/*
 Copyright (C) 2015 - 2019 Electronic Arts Inc.  All rights reserved.
 This file is part of the Orbit Project <https://www.orbit.cloud>.
 See license in LICENSE.
 */

package orbit.client;

import kotlinx.coroutines.future.FutureKt;
import orbit.server.OrbitServer;
import orbit.shared.proto.Messages;
import org.junit.jupiter.api.Test;

class BasicTest {

    @Test
    void basicConnectionTest() {
        final OrbitServer server = new OrbitServer();
        FutureKt.asCompletableFuture(server.start()).join();

        final OrbitClientConfig config = new OrbitClientConfig();
        final OrbitClient client = new OrbitClient(config);
        client.start().join();

//        client.getConnectionHandler().sendMessage(Messages.Message.newBuilder().setInvocationRequest(
//                Messages.InvocationRequest.newBuilder().setValue("HELLO")
//        ).build());

       // client.stop();

       //FutureKt.asCompletableFuture(server.stop()).join();

        try {
            Thread.currentThread().join();
        }catch(Throwable t) {

        }
    }
}

@@ -670,18 +670,16 @@
 oin();%0A%0A
-//
         
@@ -772,18 +772,16 @@
 equest(%0A
-//
         
@@ -846,18 +846,16 @@
 HELLO%22)%0A
-//
         
@@ -874,18 +874,16 @@
 %0A       
-//
  client.
@@ -898,18 +898,17 @@
 %0A       
-//
+ 
 FutureKt
@@ -954,107 +954,8 @@
 n();
-%0A%0A        try %7B%0A            Thread.currentThread().join();%0A        %7Dcatch(Throwable t) %7B%0A%0A        %7D
 %0A   

Fix broken client test