@Test
public void testSessionCreation() throws Exception {

    try (Session session1 = provider.getSession(new SessionID("FIX.4.2", "SENDER", "SENDERSUB",
            "SENDERLOC", "TARGET", "TARGETSUB", "TARGETLOC", null), null)) {
        SessionID sessionID1 = session1.getSessionID();
        assertEquals("wrong FIX version", "FIX.4.2", sessionID1.getBeginString());
        assertEquals("wrong sender", "SENDER", sessionID1.getSenderCompID());
        assertEquals("wrong senderSub", "SENDERSUB", sessionID1.getSenderSubID());
        assertEquals("wrong senderLoc", "SENDERLOC", sessionID1.getSenderLocationID());
        assertEquals("wrong target", "TARGET", sessionID1.getTargetCompID());
        assertEquals("wrong targetSub", "TARGETSUB", sessionID1.getTargetSubID());
        assertEquals("wrong targetLoc", "TARGETLOC", sessionID1.getTargetLocationID());
        assertFalse("wrong setting", session1.getResetOnLogout());
        assertFalse("wrong setting", session1.getRefreshOnLogon());
        assertFalse("wrong setting", session1.getCheckCompID());
    }
    try (Session session2 = provider.getSession(new SessionID("FIX.4.4", "S1", "T"), null)) {
        SessionID sessionID2 = session2.getSessionID();
        assertEquals("wrong FIX version", "FIX.4.4", sessionID2.getBeginString());
        assertEquals("wrong sender", "S1", sessionID2.getSenderCompID());
        assertEquals("wrong target", "T", sessionID2.getTargetCompID());
        assertTrue("wrong setting", session2.getResetOnLogout());
        assertFalse("wrong setting", session2.getRefreshOnLogon());
        assertTrue("wrong setting", session2.getCheckCompID());
    }
    try (Session session3 = provider.getSession(new SessionID("FIX.4.4", "X", "Y"), null)) {
        SessionID sessionID3 = session3.getSessionID();
        assertEquals("wrong FIX version", "FIX.4.4", sessionID3.getBeginString());
        assertEquals("wrong sender", "X", sessionID3.getSenderCompID());
        assertEquals("wrong target", "Y", sessionID3.getTargetCompID());
        assertFalse("wrong setting", session3.getResetOnLogout());
        assertTrue("wrong setting", session3.getRefreshOnLogon());
        assertTrue("wrong setting", session3.getCheckCompID());
    }
}