I've added a test on SessionCloseOnGCTest (testValidateLeakWithClosedSessions),
and the only reason the is passing is because I missed an assertion.
The test is creating two sessions, and closing them allright but not closing the factory.
The factory on this case will leak, since it will be referenced by the PingRunnable->ConnectionManager->ClientSessionFactory.
I have a fix for this already, by transfering the field from ClientSessionFactoryImpl to ClientSession.
Actually, closing the factory should be irrelevant.
If all sessions are closed, then the factory will close the PingRunnable anyway, so there should be no need for an explicit close() method on the factory (I was going to remove this).
Now, garbage collection will close unclosed sessions so it shouldn't be possible for a factory to cause a leak.
There are a few tests that are starting a JMSServerManager, and not closing it.
That object will start a deployer, and it will stay live for the rest of the testsuite.
There are also a few possible real leaks (not on the testsuite itself). I wlil post about it later after another run I' m doing now (it takes 90 minutes on my desktop)