Assert.assertEquals(0, server.getRemotingService().getConnections().size());
}
public void testCloseSeveralSessionOnGC() throws Exception
{
ClientSessionFactoryImpl sf = createInVMFactory();
ClientSession session1 = sf.createSession(false, true, true);
ClientSession session2 = sf.createSession(false, true, true);
ClientSession session3 = sf.createSession(false, true, true);
Assert.assertEquals(1, server.getRemotingService().getConnections().size());
WeakReference<ClientSession> ref1 = new WeakReference<ClientSession>(session1);
WeakReference<ClientSession> ref2 = new WeakReference<ClientSession>(session2);
WeakReference<ClientSession> ref3 = new WeakReference<ClientSession>(session3);
session1 = null;
session2 = null;
session3 = null;
UnitTestCase.checkWeakReferences(ref1, ref2, ref3);
Assert.assertEquals(0, sf.numSessions());
Assert.assertEquals(0, sf.numConnections());
Assert.assertEquals(0, server.getRemotingService().getConnections().size());
}