use of com.adaptris.core.WorkflowImp in project interlok by adaptris.
the class ExampleWorkflowCase method testRegisterObjects.
@Test
public void testRegisterObjects() throws Exception {
WorkflowImp wf = createWorkflowForGenericTests();
wf.registerChannel(new Channel());
try {
wf.registerChannel(null);
fail();
} catch (IllegalArgumentException e) {
;
}
wf.registerActiveMsgErrorHandler(new NullProcessingExceptionHandler());
try {
wf.registerActiveMsgErrorHandler(null);
fail();
} catch (IllegalArgumentException e) {
;
}
wf.registerActiveMsgErrorHandler(new NullProcessingExceptionHandler());
try {
wf.registerActiveMsgErrorHandler(null);
fail();
} catch (IllegalArgumentException e) {
;
}
wf.registerEventHandler(new DefaultEventHandler());
try {
wf.registerEventHandler(null);
fail();
} catch (IllegalArgumentException e) {
;
}
}
use of com.adaptris.core.WorkflowImp in project interlok by adaptris.
the class ExampleWorkflowCase method testSetProduceExceptionHandler.
@Test
public void testSetProduceExceptionHandler() throws Exception {
WorkflowImp wf = createWorkflowForGenericTests();
assertNull(wf.getProduceExceptionHandler());
ProduceExceptionHandler obj = new NullProduceExceptionHandler();
wf.setProduceExceptionHandler(obj);
assertEquals(obj, wf.getProduceExceptionHandler());
}
use of com.adaptris.core.WorkflowImp in project interlok by adaptris.
the class ExampleWorkflowCase method testSetInterceptors.
@Test
public void testSetInterceptors() throws Exception {
WorkflowImp wf = createWorkflowForGenericTests();
wf.setInterceptors(new ArrayList(Arrays.asList(new WorkflowInterceptor[] { new MockWorkflowInterceptor() })));
assertEquals(1, wf.getInterceptors().size());
try {
wf.addInterceptor(null);
fail();
} catch (IllegalArgumentException expected) {
}
assertEquals(1, wf.getInterceptors().size());
wf.addInterceptor(new MockWorkflowInterceptor());
assertEquals(2, wf.getInterceptors().size());
try {
wf.setInterceptors(null);
fail();
} catch (IllegalArgumentException expected) {
}
assertEquals(2, wf.getInterceptors().size());
}
use of com.adaptris.core.WorkflowImp in project interlok by adaptris.
the class BasicJettyConsumer method submitToWorkflow.
private boolean submitToWorkflow(AdaptrisMessage msg) {
boolean waitForCompletion = false;
if (retrieveAdaptrisMessageListener() instanceof WorkflowImp) {
List<WorkflowInterceptor> interceptors = ((WorkflowImp) retrieveAdaptrisMessageListener()).getInterceptors();
for (WorkflowInterceptor i : interceptors) {
if (JettyWorkflowInterceptorImpl.class.isAssignableFrom(i.getClass())) {
waitForCompletion = true;
break;
}
}
}
retrieveAdaptrisMessageListener().onAdaptrisMessage(msg);
return waitForCompletion;
}
use of com.adaptris.core.WorkflowImp in project interlok by adaptris.
the class ExampleWorkflowCase method testSetSendEvents.
@Test
public void testSetSendEvents() throws Exception {
WorkflowImp wf = createWorkflowForGenericTests();
assertNull(wf.getSendEvents());
assertTrue(wf.sendEvents());
wf.setSendEvents(Boolean.FALSE);
assertNotNull(wf.getSendEvents());
assertEquals(Boolean.FALSE, wf.getSendEvents());
assertEquals(false, wf.sendEvents());
wf.setSendEvents(null);
assertNull(wf.getSendEvents());
assertTrue(wf.sendEvents());
}
Aggregations