194195196197198199200201202203
"hivemind.ThreadEventNotifier", ThreadEventNotifier.class); interceptLogging("hivemind.test.services"); n.fireThreadCleanup(); assertLoggedMessage("threadDidDiscardService() has been invoked."); } }
6667686970717273747576
h.setValue("fred"); assertEquals("fred", h.getValue()); n.fireThreadCleanup(); assertNull(h.getValue()); assertEquals( "<LoggingInterceptor for hivemind.test.services.StringHolder(hivemind.test.services.StringHolder)>",
189190191192193194195196197198
4344454647484950515253
{ ThreadEventNotifier n = new ThreadEventNotifierImpl(); Listener l = new Listener(); n.addThreadCleanupListener(l); n.fireThreadCleanup(); assertEquals(true, l._cleanup); } public void testRemove()
5960616263646566676869
n.addThreadCleanupListener(l1); n.addThreadCleanupListener(l2); n.removeThreadCleanupListener(l1); n.fireThreadCleanup(); assertEquals(false, l1._cleanup); assertEquals(true, l2._cleanup); }
7374757677787980818283
Listener l = new Listener(); n.addThreadCleanupListener(l); n.fireThreadCleanup(); assertEquals(true, l._cleanup); l._cleanup = false;
7980818283848586878889
assertEquals(true, l._cleanup); l._cleanup = false; n.fireThreadCleanup(); // Don't expect a notification, because the notifier's list is gone assertEquals(false, l._cleanup); }
108109110111112113114115116117
ThreadEventNotifier n = new ThreadEventNotifierImpl(log); n.addThreadCleanupListener(l); n.fireThreadCleanup(); verifyControls(); } }
h.setValue("fred"); assertEquals("fred", h.getValue()); n.fireThreadCleanup(); assertNull(h.getValue()); assertEquals( "<OuterProxy for hivemind.test.services.StringHolder(hivemind.test.services.StringHolder)>",