use of com.adaptris.core.StandardWorkflow in project interlok by adaptris.
the class FailedMessageRetrierCase method createWorkflow.
protected StandardWorkflow createWorkflow(String uniqueId) throws Exception {
AdaptrisMessageConsumer consumer = new MockMessageConsumer();
AdaptrisMessageProducer producer = new MockMessageProducer();
StandardWorkflow workflow = new StandardWorkflow();
workflow.setUniqueId(uniqueId);
workflow.setConsumer(consumer);
workflow.setProducer(producer);
Channel channel = new MockChannel();
channel.setUniqueId(null);
channel.getWorkflowList().add(workflow);
channel.prepare();
return workflow;
}
use of com.adaptris.core.StandardWorkflow in project interlok by adaptris.
the class FsConsumerCase method testFsMonitor.
@Test
public void testFsMonitor() throws Exception {
String subdir = new GuidGenerator().safeUUID();
FsConsumerImpl fs = createConsumer(subdir);
fs.setUniqueId(getName());
Adapter adapter = new Adapter();
adapter.setUniqueId(getName());
Channel channel = new Channel();
channel.setUniqueId(getName());
StandardWorkflow wf = new StandardWorkflow();
wf.setUniqueId(getName());
wf.setConsumer(fs);
channel.getWorkflowList().add(wf);
adapter.getChannelList().add(channel);
AdapterManager am = new AdapterManager(adapter);
try {
am.registerMBean();
am.requestInit();
String objectNameString = String.format("com.adaptris:type=ConsumerMonitor,adapter=%s,channel=%s,workflow=%s,id=%s", getName(), getName(), getName(), getName());
MBeanServer mBeanServer = JmxHelper.findMBeanServer();
FsConsumerMonitorMBean mbean = JMX.newMBeanProxy(mBeanServer, ObjectName.getInstance(objectNameString), FsConsumerMonitorMBean.class);
assertEquals(0, mbean.messagesRemaining());
} finally {
am.requestClose();
am.unregisterMBean();
}
}
use of com.adaptris.core.StandardWorkflow in project interlok by adaptris.
the class JmsConnectionErrorHandlerTest method createWorkflow.
private Workflow createWorkflow(EmbeddedActiveMq mq, String destination) throws Exception {
StandardWorkflow wf = new StandardWorkflow();
PasConsumer consumer = new PasConsumer().withTopic(destination);
wf.setProducer(new MockMessageProducer());
wf.setConsumer(consumer);
return wf;
}
use of com.adaptris.core.StandardWorkflow in project interlok by adaptris.
the class BasicActiveMqConsumerTest method testTopic_ProduceWhenConsumerStopped.
@Test
public void testTopic_ProduceWhenConsumerStopped() throws Exception {
PasConsumer consumer = new PasConsumer().withTopic(getName());
consumer.setAcknowledgeMode("AUTO_ACKNOWLEDGE");
StandardWorkflow workflow = new StandardWorkflow();
MockMessageProducer producer = new MockMessageProducer();
workflow.setConsumer(consumer);
workflow.setProducer(producer);
Channel channel = createChannel(activeMqBroker.getJmsConnection(createVendorImpl()), workflow);
try {
StandaloneProducer standaloneProducer = new StandaloneProducer(activeMqBroker.getJmsConnection(createVendorImpl()), new PasProducer().withTopic(getName()));
channel.requestStart();
workflow.requestStop();
start(standaloneProducer);
AdaptrisMessage msg = createMessage(null);
standaloneProducer.produce(msg);
Thread.sleep(250);
assertEquals(0, producer.messageCount());
stop(standaloneProducer);
} finally {
channel.requestClose();
}
}
use of com.adaptris.core.StandardWorkflow in project interlok by adaptris.
the class ActiveMqPasPollingConsumerTest method create.
private static PasPollingConsumer create() {
PasPollingConsumer consumer = new PasPollingConsumer().withTopic("destination");
consumer.setVendorImplementation(new BasicActiveMqImplementation());
consumer.registerAdaptrisMessageListener(new StandardWorkflow());
return consumer;
}
Aggregations