@Test public void testSingleChildFailing() throws Throwable { ServiceParent parent = startService(new MockService("1", true, 100)); waitForParentToStop(parent); assert parent.getFailureCause() != null; }
@Test public void testSingleChildFailing() throws Throwable { ServiceParent parent = startService(new MockService("1", true, 100)); waitForParentToStop(parent); assert parent.getFailureCause() != null; }
@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()); }
@Test public void testFailInStartNext() throws Throwable { MockService one = new MockService("one", false, 100); MockService two = new MockService("two", true, 0); MockService three = new MockService("3", false, 0); ServiceParent parent = startService(one, two, three); waitForParentToStop(parent); assertStopped(one); assertStopped(two); Throwable failureCause = two.getFailureCause(); assertNotNull(failureCause); Throwable parentFailureCause = parent.getFailureCause(); assertNotNull(parentFailureCause); assertEquals(parentFailureCause, failureCause); assertInState(three, Service.STATE.NOTINITED); }
@Test public void testFailInStartNext() throws Throwable { MockService one = new MockService("one", false, 100); MockService two = new MockService("two", true, 0); MockService three = new MockService("3", false, 0); ServiceParent parent = startService(one, two, three); waitForParentToStop(parent); assertStopped(one); assertStopped(two); Throwable failureCause = two.getFailureCause(); assertNotNull(failureCause); Throwable parentFailureCause = parent.getFailureCause(); assertNotNull(parentFailureCause); assertEquals(parentFailureCause, failureCause); assertInState(three, Service.STATE.NOTINITED); }