use of com.adaptris.core.NullMessageProducer in project interlok by adaptris.
the class ExampleChannelCase method configureWorkflow.
protected Workflow configureWorkflow(WorkflowImp impl) throws CoreException {
impl.setUniqueId(UUID.randomUUID().toString());
AdaptrisMessageConsumer consumer = new NullMessageConsumer();
impl.setConsumer(consumer);
impl.setProducer(new NullMessageProducer());
impl.setServiceCollection(createServiceCollection());
return impl;
}
use of com.adaptris.core.NullMessageProducer in project interlok by adaptris.
the class SharedConnectionConfigurationCheckerTest method createAdapterConfig.
private static String createAdapterConfig(AdaptrisConnection sharedComponent, AdaptrisConnection consumeConnection, AdaptrisConnection produceConnection, AdaptrisConnection serviceConnection) throws Exception {
Adapter adapter = new Adapter();
if (sharedComponent != null) {
adapter.getSharedComponents().addConnection(sharedComponent);
}
Channel channel = new Channel();
if (consumeConnection != null) {
channel.setConsumeConnection(consumeConnection);
}
if (produceConnection != null) {
channel.setProduceConnection(produceConnection);
}
if (serviceConnection != null) {
StandardWorkflow standardWorkflow = new StandardWorkflow();
StandaloneProducer sp = new StandaloneProducer(serviceConnection, new NullMessageProducer());
standardWorkflow.getServiceCollection().add(sp);
channel.getWorkflowList().add(standardWorkflow);
}
adapter.getChannelList().add(channel);
return DefaultMarshaller.getDefaultMarshaller().marshal(adapter);
}
use of com.adaptris.core.NullMessageProducer in project interlok by adaptris.
the class BasicMessageSplitterServiceTest method testInit.
@Test
public void testInit() throws Exception {
BasicMessageSplitterService service = new BasicMessageSplitterService();
try {
service.init();
fail();
} catch (CoreException expected) {
}
service.setConnection(new NullConnection());
service.setSplitter(new LineCountSplitter());
service.setProducer(new NullMessageProducer());
service.init();
}
use of com.adaptris.core.NullMessageProducer in project interlok by adaptris.
the class SplitterCase method createBasic.
static BasicMessageSplitterService createBasic(MessageSplitter ms) {
BasicMessageSplitterService service = new BasicMessageSplitterService();
service.setConnection(new NullConnection());
service.setProducer(new NullMessageProducer());
service.setSplitter(ms);
return service;
}
use of com.adaptris.core.NullMessageProducer in project interlok by adaptris.
the class OnMessageHandlerTest method testOnMessageHandlerCommitFailsThenRollback.
@Test
public void testOnMessageHandlerCommitFailsThenRollback() throws Exception {
when(mockSession.getTransacted()).thenReturn(true);
doThrow(new JMSException("Expected")).when(mockSession).commit();
JmsTransactedWorkflow jmsTransactedWorkflow = new JmsTransactedWorkflow();
jmsTransactedWorkflow.setConsumer(new NullMessageConsumer());
jmsTransactedWorkflow.setProducer(new NullMessageProducer());
jmsTransactedWorkflow.registerChannel(mockChannel);
config.setCorrelationIdSource(mockCorrelationSourceId);
config.setMessageTranslator(mockTranslator);
config.registerAdaptrisMessageListener(jmsTransactedWorkflow);
handler = new OnMessageHandler(config);
handler.onMessage(jmsMessage);
verify(mockSession).commit();
verify(mockSession).rollback();
}
Aggregations