@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 testSequence() 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); assert ((WorkflowSequenceService) parent).getPreviousService().equals(two); }
@Test public void testSequenceInSequence() 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); waitForParentToStop(parent); assertStopped(one); assertStopped(two); }
@Test public void testSingleChild() throws Throwable { Service parent = startService(new MockService()); parent.stop(); }
@Test public void testSingleSequence() throws Throwable { ServiceParent parent = startService(new MockService()); parent.stop(); }
@Test public void testVarargsConstructor() throws Throwable { MockService one = new MockService("one", false, 100); MockService two = new MockService("two", false, 100); ServiceParent parent = new WorkflowSequenceService("test", one, two); parent.init(new Configuration()); parent.start(); waitForParentToStop(parent); assertStopped(one); assertStopped(two); }
@Test public void testSingleChild() throws Throwable { Service parent = startService(new MockService()); parent.stop(); }
@Test public void testSingleSequence() throws Throwable { ServiceParent parent = startService(new MockService()); parent.stop(); }
@Test public void testVarargsConstructor() throws Throwable { MockService one = new MockService("one", false, 100); MockService two = new MockService("two", false, 100); ServiceParent parent = new WorkflowSequenceService("test", one, two); parent.init(new Configuration()); parent.start(); waitForParentToStop(parent); assertStopped(one); assertStopped(two); }
@Test public void testSingleChildTerminating() throws Throwable { ServiceParent parent = startService(new MockService("1", false, 100)); waitForParentToStop(parent); }
@Test public void testSingleChildTerminating() throws Throwable { ServiceParent parent = startService(new MockService("1", false, 100)); waitForParentToStop(parent); }
@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 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 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()); }