Search in sources :

Example 1 with SocketBasedConnector

use of com.thecoderscorner.menu.remote.socket.SocketBasedConnector in project tcMenu by davetcc.

the class MenuServerSocketIntegrationTest method setUp.

@BeforeEach
void setUp() throws IOException {
    var executor = Executors.newScheduledThreadPool(4);
    var tree = DomainFixtures.fullEspAmplifierTestTree();
    var authenticator = new PreDefinedAuthenticator("4321", List.of(new AuthenticationToken("integration-client", localUuid.toString())));
    serverConnection = new SocketServerConnectionManager(protocol, executor, 9876, Clock.systemDefaultZone());
    menuServer = new MenuManagerServer(executor, tree, "integration-test", serverUuid, authenticator, Clock.systemDefaultZone());
    menuServer.addConnectionManager(serverConnection);
    clientConnector = new SocketBasedConnector(new LocalIdentifier(localUuid, "integration-client"), executor, Clock.systemDefaultZone(), protocol, "localhost", 9876, ConnectMode.FULLY_AUTHENTICATED);
    clientController = new RemoteMenuController(clientConnector, new MenuTree());
    treePopulatedLatch = new CountDownLatch(1);
    correlationLatch = new CountDownLatch(1);
    itemUpdatedLatch = new CountDownLatch(1);
}
Also used : MenuTree(com.thecoderscorner.menu.domain.state.MenuTree) AuthenticationToken(com.thecoderscorner.menu.auth.PreDefinedAuthenticator.AuthenticationToken) MenuManagerServer(com.thecoderscorner.menu.mgr.MenuManagerServer) PreDefinedAuthenticator(com.thecoderscorner.menu.auth.PreDefinedAuthenticator) CountDownLatch(java.util.concurrent.CountDownLatch) SocketServerConnectionManager(com.thecoderscorner.menu.remote.mgrclient.SocketServerConnectionManager) SocketBasedConnector(com.thecoderscorner.menu.remote.socket.SocketBasedConnector) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

PreDefinedAuthenticator (com.thecoderscorner.menu.auth.PreDefinedAuthenticator)1 AuthenticationToken (com.thecoderscorner.menu.auth.PreDefinedAuthenticator.AuthenticationToken)1 MenuTree (com.thecoderscorner.menu.domain.state.MenuTree)1 MenuManagerServer (com.thecoderscorner.menu.mgr.MenuManagerServer)1 SocketServerConnectionManager (com.thecoderscorner.menu.remote.mgrclient.SocketServerConnectionManager)1 SocketBasedConnector (com.thecoderscorner.menu.remote.socket.SocketBasedConnector)1 CountDownLatch (java.util.concurrent.CountDownLatch)1 BeforeEach (org.junit.jupiter.api.BeforeEach)1