6566676869707172737475
h.setValue("fred"); assertEquals("fred", h.getValue()); n.fireThreadCleanup(); assertNull(h.getValue()); assertEquals( "<ThreadedProxy for hivemind.test.services.StringHolder(hivemind.test.services.StringHolder)>",
196197198199200201202203204205
"hivemind.ThreadEventNotifier", ThreadEventNotifier.class); interceptLogging("hivemind.test.services"); n.fireThreadCleanup(); assertLoggedMessage("threadDidDiscardService() has been invoked."); } }
44454647484950515253
ThreadEventNotifier n = (ThreadEventNotifier) r.getService( HiveMind.THREAD_EVENT_NOTIFIER_SERVICE, ThreadEventNotifier.class); n.fireThreadCleanup(); assertEquals("funky monkey", s.getValue()); } }
7273747576777879808182
h.setValue("fred"); assertEquals("fred", h.getValue()); n.fireThreadCleanup(); assertNull(h.getValue()); assertEquals( "<OuterProxy for hivemind.test.services.StringHolder(hivemind.test.services.StringHolder)>",
210211212213214215216217218219
7172737475767778798081
s.put("biff", "bamf"); assertEquals("bamf", s.get("biff")); notifier.fireThreadCleanup(); assertNull(s.get("biff")); } private class TestRunner implements Runnable
136137138139140141142143144145
if (_testRunnerFailure != null) throw _testRunnerFailure; assertEquals(local.get("session"), "Main Session"); notifier.fireThreadCleanup(); assertNull(local.get("session")); } }
6061626364656667686970
{ ThreadEventNotifier n = new ThreadEventNotifierImpl(); Listener l = new Listener(); n.addThreadCleanupListener(l); n.fireThreadCleanup(); assertEquals(true, l._cleanup); } public void testRemove()
7677787980818283848586
n.addThreadCleanupListener(l1); n.addThreadCleanupListener(l2); n.removeThreadCleanupListener(l1); n.fireThreadCleanup(); assertEquals(false, l1._cleanup); assertEquals(true, l2._cleanup); }
949596979899100101102103104
n.addThreadCleanupListener(l1); n.addThreadCleanupListener(l2); n.addThreadCleanupListener(l3); n.fireThreadCleanup(); assertEquals(true, l1._cleanup); assertEquals(true, l2._cleanup); assertEquals(true, l3._cleanup);