@Test public void testFailingSequence() throws Throwable { MockService one = new MockService("one", true, 100); MockService two = new MockService("two", false, 100); WorkflowSequenceService parent = (WorkflowSequenceService) startService(one, two); waitForParentToStop(parent); assertStopped(one); assertInState(two, Service.STATE.NOTINITED); assertEquals(one, parent.getPreviousService()); }
@Test public void testFailingSequence() throws Throwable { MockService one = new MockService("one", true, 100); MockService two = new MockService("two", false, 100); WorkflowSequenceService parent = (WorkflowSequenceService) startService(one, two); waitForParentToStop(parent); assertStopped(one); assertInState(two, Service.STATE.NOTINITED); assertEquals(one, parent.getPreviousService()); }
@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); }