use of com.adaptris.core.fs.FsProducer in project interlok by adaptris.
the class RetryMessageErrorHandlerTest method createForExamples.
@Override
protected RetryMessageErrorHandler createForExamples() {
RetryMessageErrorHandler meh = new RetryMessageErrorHandler();
FsProducer producer = new FsProducer();
producer.setBaseDirectoryUrl("/path/to/bad-directory");
producer.setEncoder(new MimeEncoder(false, null, null));
meh.setProcessingExceptionService(new ServiceList(new ArrayList(Arrays.asList(new Service[] { new StandaloneProducer(producer) }))));
return meh;
}
use of com.adaptris.core.fs.FsProducer in project interlok by adaptris.
the class SharedComponentListTest method createAdapter.
private Adapter createAdapter() throws CoreException, PasswordException {
Adapter adapter = new Adapter();
adapter.setUniqueId("upbeat_liskov");
JmsConnection jmsConnection = createPtpConnection("jms-connection");
adapter.getSharedComponents().addConnection(jmsConnection);
ServiceList serviceList = new ServiceList();
serviceList.setUniqueId("shared-service-list");
serviceList.add(new LogMessageService("log-message-service"));
adapter.getSharedComponents().addService(serviceList);
StandardWorkflow wf1 = new StandardWorkflow();
wf1.setUniqueId("reverent-edison");
wf1.setConsumer(new FsConsumer().withBaseDirectoryUrl("in-directory"));
wf1.setProducer(new FsProducer().withBaseDirectoryUrl("out-directory"));
wf1.getServiceCollection().add(new SharedService("shared-service-list"));
StandardWorkflow wf = new StandardWorkflow();
wf.setUniqueId("pedantic_brown");
wf.setConsumer(new JmsConsumer().withEndpoint("jms:queue:SampleQueue1"));
wf.setProducer(new NullMessageProducer());
wf.getServiceCollection().add(new StandaloneProducer(new SharedConnection("jms-connection"), new JmsProducer().withEndpoint("jms:topic:MyTopicName")));
Channel channel = new Channel();
channel.setUniqueId("quirky_shannon");
channel.setConsumeConnection(new SharedConnection("jms-connection"));
channel.getWorkflowList().add(wf);
channel.getWorkflowList().add(wf1);
adapter.getChannelList().add(channel);
return adapter;
}
use of com.adaptris.core.fs.FsProducer in project interlok by adaptris.
the class JmsTransactedWorkflowTest method retrieveObjectForSampleConfig.
@Override
protected Object retrieveObjectForSampleConfig() {
Channel c = new Channel();
try {
c.setUniqueId(UUID.randomUUID().toString());
c.setConsumeConnection(configure(new JmsConnection()));
JmsTransactedWorkflow workflow = createWorkflow("Sample_Queue_1");
workflow.setUniqueId(UUID.randomUUID().toString());
workflow.setWaitPeriodAfterRollback(new TimeInterval(30L, TimeUnit.SECONDS.name()));
workflow.getServiceCollection().addService(new WaitService());
workflow.getServiceCollection().addService(new ThrowExceptionService(new ConfiguredException("Fail")));
workflow.setProducer(new FsProducer().withBaseDirectoryUrl("file:////path/to/directory"));
c.getWorkflowList().add(workflow);
} catch (CoreException e) {
throw new RuntimeException(e);
}
return c;
}
use of com.adaptris.core.fs.FsProducer in project interlok by adaptris.
the class StandaloneProducerTest method testCreateQualifier.
@Test
public void testCreateQualifier() throws Exception {
FsProducer mp = new FsProducer();
mp.setUniqueId("abc");
StandaloneProducer service = new StandaloneProducer(mp);
assertEquals("abc", service.createQualifier());
assertEquals(service.getProducer().createQualifier(), service.createQualifier());
mp.setUniqueId("");
service.setUniqueId(StandaloneProducer.class.getSimpleName());
assertEquals(StandaloneProducer.class.getSimpleName(), service.createQualifier());
assertNotSame(service.getProducer().createQualifier(), service.createQualifier());
}
use of com.adaptris.core.fs.FsProducer in project interlok by adaptris.
the class StandardProcessingExceptionHandlerTest method createForExamples.
@Override
protected StandardProcessingExceptionHandler createForExamples() {
StandardProcessingExceptionHandler meh = new StandardProcessingExceptionHandler();
FsProducer producer = new FsProducer().withBaseDirectoryUrl("/path/to/bad-directory");
producer.setEncoder(new MimeEncoder(false, null, null));
meh.setProcessingExceptionService(new ServiceList(Arrays.asList(new Service[] { new StandaloneProducer(producer) })));
return meh;
}
Aggregations