@Test public void testTwoChildren() throws Throwable { MockService one = new MockService("one", false, 100); MockService two = new MockService("two", false, 100); ServiceParent parent = startService(one, two); waitForParentToStop(parent); assertStopped(one); assertStopped(two); }
@Test public void testTwoChildren() throws Throwable { MockService one = new MockService("one", false, 100); MockService two = new MockService("two", false, 100); ServiceParent parent = startService(one, two); waitForParentToStop(parent); 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 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); }
@Test public void testFailingComposite() throws Throwable { MockService one = new MockService("one", true, 10); MockService two = new MockService("two", false, 1000); ServiceParent parent = startService(one, two); waitForParentToStop(parent); assertStopped(one); assertStopped(two); assertNotNull(one.getFailureCause()); assertNotNull(parent.getFailureCause()); assertEquals(one.getFailureCause(), parent.getFailureCause()); }
@Test public void testFailingComposite() throws Throwable { MockService one = new MockService("one", true, 10); MockService two = new MockService("two", false, 1000); ServiceParent parent = startService(one, two); waitForParentToStop(parent); assertStopped(one); assertStopped(two); assertNotNull(one.getFailureCause()); assertNotNull(parent.getFailureCause()); assertEquals(one.getFailureCause(), parent.getFailureCause()); }