TransientScottyEngine extends AbstractProcessingEngine implements ProcessingEngine, ProcessingEngineMXBean { @Override public synchronized void startup() { if (engineState != EngineState.RAW) throw new IllegalStateException(); logger.info("Engine is starting up..."); super.startup(); wfRepository.start(); timeoutManager.setEngine(this); poolManager.setEngine(this); timeoutManager.startup(); earlyResponseContainer.startup(); poolManager.startup(); engineState = EngineState.STARTED; logger.info("Engine is running"); startupBlocker.unblock(); }  void setTicketPoolManager(TicketPoolManager ticketPoolManager); void setTimeoutManager(TimeoutManager timeoutManager); void setPoolManager(ProcessorPoolManager<TransientProcessorPool> poolManager); void setEarlyResponseContainer(EarlyResponseContainer earlyResponseContainer); @Override void notify(Response<?> response, Acknowledge ack); @Override synchronized void shutdown(); @Override synchronized void startup(); @Override void registerCallbacks(Workflow<?> w, WaitMode mode, long timeoutMsec, String... correlationIds); void removeWorkflow(String id); @Override String getState(); @Override String queryObjectState(String id); @Override List<WorkflowInfo> queryWorkflowInstances(); @Override WorkflowInfo queryWorkflowInstance(String id); @Override int getNumberOfWorkflowInstances(); @Override void addWaitHook(String wfInstanceId, WaitHook waitHook); @Override List<ProcessorPoolMXBean> getProcessorPools(); @Override EngineType getEngineType(); @Override List<WorkflowInfo> queryActiveWorkflowInstances(final String className, final int max); @Override WorkflowInfo queryActiveWorkflowInstance(final String id); @Override List<String> getWorkflowInstanceStates(); @Override List<WorkflowInfo> queryWorkflowInstances(final WorkflowInstanceFilter filter); @Override long countWorkflowInstances(final WorkflowInstanceFilter filter); void incErrorWFCounter();  }
@Test public void testStartup() throws Exception { TransientEngineFactory factory = new TransientEngineFactory() { @Override protected File getWorkflowSourceDirectory() { return new File("./src/test/workflow"); } }; TransientScottyEngine engine = factory.create(); try { org.junit.Assert.assertEquals("STARTED", engine.getState()); engine.run("test.HelloWorldWorkflow", null); } finally { engine.shutdown(); } }