@Test public void testNestedComposite() throws Throwable { MockService one = new MockService("one", false, 100); MockService two = new MockService("two", false, 100); ServiceParent parent = buildService(one, two); ServiceParent outer = startService(parent); assertTrue(outer.waitForServiceToStop(1000)); assertStopped(one); assertStopped(two); }
@Test public void testNestedComposite() throws Throwable { MockService one = new MockService("one", false, 100); MockService two = new MockService("two", false, 100); ServiceParent parent = buildService(one, two); ServiceParent outer = startService(parent); assertTrue(outer.waitForServiceToStop(1000)); assertStopped(one); assertStopped(two); }
@Test public void testCallableChild() throws Throwable { MockService one = new MockService("one", false, 100); CallableHandler handler = new CallableHandler("hello"); WorkflowCallbackService<String> ens = new WorkflowCallbackService<String>("handler", handler, 100, true); MockService two = new MockService("two", false, 100); ServiceParent parent = startService(one, ens, two); waitForParentToStop(parent); assertStopped(one); assertStopped(ens); assertStopped(two); assertTrue(handler.notified); String s = ens.getScheduledFuture().get(); assertEquals("hello", s); }
@Test public void testCallableChild() throws Throwable { MockService one = new MockService("one", false, 100); CallableHandler handler = new CallableHandler("hello"); WorkflowCallbackService<String> ens = new WorkflowCallbackService<String>("handler", handler, 100, true); MockService two = new MockService("two", false, 100); ServiceParent parent = startService(one, ens, two); waitForParentToStop(parent); assertStopped(one); assertStopped(ens); assertStopped(two); assertTrue(handler.notified); String s = ens.getScheduledFuture().get(); assertEquals("hello", s); }