}
public void testThreadCleanup() throws Throwable
{
ThreadEventNotifier notifier = new ThreadEventNotifierImpl();
ThreadLocalStorageImpl local = new ThreadLocalStorageImpl();
local.setNotifier(notifier);
local.put("session", "Main Session");
TestRunner tr = new TestRunner(local, notifier);
TestThreadGroup tg = new TestThreadGroup("Test Thread Group");
new Thread(tg, tr).start();
while (!_testRunnerCompleted)
Thread.yield();
if (_testRunnerFailure != null)
throw _testRunnerFailure;
assertEquals(local.get("session"), "Main Session");
notifier.fireThreadCleanup();
assertNull(local.get("session"));
}