static SessionReplyStatus releaseToGateway( final FixLibrary library, final Session session, final TestSystem testSystem) { final Reply<SessionReplyStatus> reply = testSystem.awaitReply( library.releaseToGateway(session, DEFAULT_REPLY_TIMEOUT_IN_MS)); return reply.resultIfPresent(); }
@Test public void shouldEnableLibraryConnectionsOneAfterAnother() { for (int i = 0; i < 20; i++) { DebugLogger.log(LogTag.FIX_TEST, "Iteration: " + i); acceptingLibrary = testSystem.add(newAcceptingLibrary(acceptingHandler)); while (!acceptingLibrary.isConnected()) { testSystem.poll(); Thread.yield(); } acquireAcceptingSession(); final Reply<SessionReplyStatus> reply = testSystem.awaitReply(acceptingLibrary.releaseToGateway( acceptingSession, DEFAULT_REPLY_TIMEOUT_IN_MS)); assertEquals(SessionReplyStatus.OK, reply.resultIfPresent()); acceptingLibrary.close(); } }