remove now invalid tests

Since we are removing the finalize cleanup these tests are now invalid
This commit is contained in:
Clebert Suconic 2016-01-11 19:41:21 -05:00
parent 945963ed07
commit d9ac06a907
1 changed files with 0 additions and 48 deletions

View File

@ -176,52 +176,4 @@ public class SessionCloseOnGCTest extends ActiveMQTestBase {
locator = null;
ActiveMQTestBase.checkWeakReferences(fref);
}
@Test
public void testCloseOneSessionOnGC() throws Exception {
ClientSessionFactoryImpl sf = (ClientSessionFactoryImpl) locator.createSessionFactory();
{
ClientSession session = sf.createSession(false, true, true);
Assert.assertEquals(1, server.getRemotingService().getConnections().size());
}
for (int i = 0; i < 1000 && sf.numSessions() != 0; i++) {
forceGC();
}
Assert.assertEquals(0, sf.numSessions());
Assert.assertEquals(1, sf.numConnections());
Assert.assertEquals(1, server.getRemotingService().getConnections().size());
}
@Test
public void testCloseSeveralSessionOnGC() throws Exception {
ClientSessionFactoryImpl sf = (ClientSessionFactoryImpl) locator.createSessionFactory();
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<>(session1);
WeakReference<ClientSession> ref2 = new WeakReference<>(session2);
WeakReference<ClientSession> ref3 = new WeakReference<>(session3);
session1 = null;
session2 = null;
session3 = null;
ActiveMQTestBase.checkWeakReferences(ref1, ref2, ref3);
for (int i = 0; i < 1000 && sf.numSessions() != 0; i++) {
forceGC();
}
Assert.assertEquals("# sessions", 0, sf.numSessions());
Assert.assertEquals("# connections", 1, sf.numConnections());
Assert.assertEquals("# connections in remoting service", 1, server.getRemotingService().getConnections().size());
}
}