diff --git a/artio-system-tests/src/test/java/uk/co/real_logic/artio/system_tests/MessageBasedAcceptorSystemTest.java b/artio-system-tests/src/test/java/uk/co/real_logic/artio/system_tests/MessageBasedAcceptorSystemTest.java index a7654bd684..a56413918a 100644 --- a/artio-system-tests/src/test/java/uk/co/real_logic/artio/system_tests/MessageBasedAcceptorSystemTest.java +++ b/artio-system-tests/src/test/java/uk/co/real_logic/artio/system_tests/MessageBasedAcceptorSystemTest.java @@ -23,11 +23,12 @@ import uk.co.real_logic.artio.builder.*; import uk.co.real_logic.artio.decoder.*; import uk.co.real_logic.artio.engine.SessionInfo; -import uk.co.real_logic.artio.engine.framer.LibraryInfo; import uk.co.real_logic.artio.library.FixLibrary; -import uk.co.real_logic.artio.messages.*; +import uk.co.real_logic.artio.messages.DisconnectReason; +import uk.co.real_logic.artio.messages.InitialAcceptedSessionOwner; +import uk.co.real_logic.artio.messages.SessionReplyStatus; +import uk.co.real_logic.artio.messages.ThrottleConfigurationStatus; import uk.co.real_logic.artio.session.Session; -import uk.co.real_logic.artio.session.SessionWriter; import uk.co.real_logic.artio.util.MutableAsciiBuffer; import java.io.IOException; @@ -54,7 +55,8 @@ import static uk.co.real_logic.artio.messages.InitialAcceptedSessionOwner.ENGINE; import static uk.co.real_logic.artio.messages.InitialAcceptedSessionOwner.SOLE_LIBRARY; import static uk.co.real_logic.artio.messages.ThrottleConfigurationStatus.OK; -import static uk.co.real_logic.artio.system_tests.AbstractGatewayToGatewaySystemTest.*; +import static uk.co.real_logic.artio.system_tests.AbstractGatewayToGatewaySystemTest.LONG_TEST_TIMEOUT_IN_MS; +import static uk.co.real_logic.artio.system_tests.AbstractGatewayToGatewaySystemTest.TEST_TIMEOUT_IN_MS; import static uk.co.real_logic.artio.system_tests.FixConnection.BUFFER_SIZE; import static uk.co.real_logic.artio.system_tests.MessageBasedInitiatorSystemTest.assertConnectionDisconnects; import static uk.co.real_logic.artio.system_tests.SystemTestUtil.*; @@ -607,70 +609,6 @@ public void shouldSupportLogonBasedSequenceNumberResetWithMessagesSentBeforeLogo }); } - @Test(timeout = TEST_TIMEOUT_IN_MS) - public void shouldSupportFollowerSessionLogonWithoutSequenceResetOnDisconnectBeforeLibraryLogonResponse() - throws IOException - { - setup(false, true); - setupLibrary(); - - final List noSessionContext = engine.allSessions(); - assertEquals(0, noSessionContext.size()); - - final SessionWriter sessionWriter = createFollowerSession( - TEST_TIMEOUT_IN_MS, testSystem, library, INITIATOR_ID, ACCEPTOR_ID); - final SessionReplyStatus requestSessionReply = requestSession(library, sessionWriter.id(), testSystem); - assertEquals(SessionReplyStatus.OK, requestSessionReply); - - try (FixConnection connection = FixConnection.initiate(port)) - { - connection.logon(true); - Timing.assertEventuallyTrue("Library did not transition session to connected", - () -> - { - library.poll(1); - final List sessions = library.sessions(); - return sessions.size() == 1 && sessions.get(0).state() == SessionState.CONNECTED; - } - ); - } - - Timing.assertEventuallyTrue("Fix connection was not disconnected", - () -> - { - final Reply> libraryReply = engine.libraries(); - while (!libraryReply.hasCompleted()) - { - sleep(500); - } - - final List allLibraryInfo = libraryReply.resultIfPresent(); - for (final LibraryInfo libraryInfo : allLibraryInfo) { - if (libraryInfo.libraryId() == libraryId) { - return libraryInfo.sessions().isEmpty(); - } - } - return false; - } - ); - - Timing.assertEventuallyTrue("Library did not transition session to active", - () -> - { - library.poll(1); - final List sessions = library.sessions(); - return sessions.size() == 1 && sessions.get(0).state() == SessionState.ACTIVE; - } - ); - - assertEngineSubscriptionCaughtUpToLibraryPublication( - testSystem, mediaDriver.mediaDriver().aeronDirectoryName(), engine, library); - - final List sessionContextAfterLogonNoSenderEndpoint = engine.allSessions(); - assertEquals(1, sessionContextAfterLogonNoSenderEndpoint.size()); - assertEquals(0, sessionContextAfterLogonNoSenderEndpoint.get(0).sequenceIndex()); - } - @Test(timeout = TEST_TIMEOUT_IN_MS) public void shouldHandleOnlineResetFollowedByDisconnectAndRestart() throws IOException {