final TranscriptExceptionTracer exceptions = TranscriptExceptionTracer.create (transcript, exceptionsQueue);
final BasicThreadingContext threading = BasicThreadingContext.create (this, exceptions, exceptions.catcher);
Assert.assertTrue (threading.initialize (KvTest.defaultPollTimeout));
final String serverIdentity = UUID.randomUUID ().toString ();
final String clientIdentity = UUID.randomUUID ().toString ();
final ZeroMqChannel serverChannel = ZeroMqChannel.create (serverIdentity, threading, exceptions);
serverChannel.register (KvSession.Server);
serverChannel.accept (KvTest.defaultServerEndpoint);
final ZeroMqChannel clientChannel = ZeroMqChannel.create (clientIdentity, threading, exceptions);
clientChannel.register (KvSession.Client);
clientChannel.connect (KvTest.defaultServerEndpoint);
final KvServer server = new KvServer (exceptions, KvTest.defaultPollTimeout);
server.initialize (serverChannel);
final KvClient client_1 = new KvClient ();
Assert.assertEquals (Boolean.TRUE, Threading.awaitOrCatch (client_1.initialize (clientChannel, serverIdentity), KvTest.defaultPollTimeout));
Assert.assertEquals (Boolean.TRUE, Threading.awaitOrCatch (client_1.put ("a", "1"), KvTest.defaultPollTimeout));
Assert.assertEquals (Boolean.TRUE, Threading.awaitOrCatch (client_1.put ("b", "2"), KvTest.defaultPollTimeout));
final KvClient client_2 = new KvClient ();
Assert.assertEquals (Boolean.TRUE, Threading.awaitOrCatch (client_2.initialize (clientChannel, serverIdentity), KvTest.defaultPollTimeout));
Assert.assertEquals ("1", Threading.awaitOrCatch (client_2.get ("a"), KvTest.defaultPollTimeout));
Assert.assertEquals ("2", Threading.awaitOrCatch (client_2.get ("b"), KvTest.defaultPollTimeout));
Assert.assertTrue (serverChannel.terminate (KvTest.defaultPollTimeout));
Assert.assertTrue (clientChannel.terminate (KvTest.defaultPollTimeout));
Assert.assertTrue (threading.destroy (KvTest.defaultPollTimeout));
Assert.assertNull (exceptionsQueue.queue.poll ());
}