@Test public void testFailureRun() throws Throwable { WorkflowCompositeService svc = run(new WorkflowCompositeService()); ServiceTerminatingRunnable runnable = new ServiceTerminatingRunnable(svc, new SimpleRunnable(true)); // synchronous in-thread execution runnable.run(); assertStopped(svc); assertNotNull(runnable.getException()); }
@Test public void testBasicRun() throws Throwable { WorkflowCompositeService svc = run(new WorkflowCompositeService()); ServiceTerminatingRunnable runnable = new ServiceTerminatingRunnable(svc, new SimpleRunnable()); // synchronous in-thread execution runnable.run(); assertStopped(svc); }
@Test public void testFailureRun() throws Throwable { ExecutorSvc svc = run(new ExecutorSvc()); ServiceTerminatingRunnable runnable = new ServiceTerminatingRunnable(svc, new SimpleRunnable(true)); // synchronous in-thread execution svc.execute(runnable); Thread.sleep(1000); assertStopped(svc); assertNotNull(runnable.getException()); }
@Test public void testNoservice() throws Throwable { try { new ServiceTerminatingRunnable(null, new SimpleRunnable()); fail("unexpected "); } catch (IllegalArgumentException e) { // expected } }
@Test public void testBasicRun() throws Throwable { WorkflowCompositeService svc = run(new WorkflowCompositeService()); ServiceTerminatingRunnable runnable = new ServiceTerminatingRunnable(svc, new SimpleRunnable()); // synchronous in-thread execution runnable.run(); assertStopped(svc); }
@Test public void testFailureRun() throws Throwable { ExecutorSvc svc = run(new ExecutorSvc()); ServiceTerminatingRunnable runnable = new ServiceTerminatingRunnable(svc, new SimpleRunnable(true)); // synchronous in-thread execution svc.execute(runnable); Thread.sleep(1000); assertStopped(svc); assertNotNull(runnable.getException()); }
@Test public void testNoservice() throws Throwable { try { new ServiceTerminatingRunnable(null, new SimpleRunnable()); fail("unexpected "); } catch (IllegalArgumentException e) { // expected } }
@Test public void testFailureRun() throws Throwable { WorkflowCompositeService svc = run(new WorkflowCompositeService()); ServiceTerminatingRunnable runnable = new ServiceTerminatingRunnable(svc, new SimpleRunnable(true)); // synchronous in-thread execution runnable.run(); assertStopped(svc); assertNotNull(runnable.getException()); }
@Test public void testAsyncRun() throws Throwable { ExecutorSvc svc = run(new ExecutorSvc()); ServiceTerminatingRunnable runnable = new ServiceTerminatingRunnable(svc, new SimpleRunnable()); // synchronous in-thread execution svc.execute(runnable); Thread.sleep(1000); assertStopped(svc); }
@Test public void testAsyncRun() throws Throwable { ExecutorSvc svc = run(new ExecutorSvc()); ServiceTerminatingRunnable runnable = new ServiceTerminatingRunnable(svc, new SimpleRunnable()); // synchronous in-thread execution svc.execute(runnable); Thread.sleep(1000); assertStopped(svc); }