use of com.adaptris.core.stubs.StubEventHandler in project interlok by adaptris.
the class AdapterTest method testAdapterLogsEventSendException.
// Probably a redundant test, but you get a nice warm feeling from have 100%
// code coverage don't you
@Test
public void testAdapterLogsEventSendException() throws Exception {
Adapter a = createAdapter("testAdapterLogsEventSendException", new StubEventHandler() {
@Override
public void send(Event evt) throws CoreException {
if (evt instanceof AdapterCloseEvent) {
throw new CoreException();
} else if (evt instanceof AdapterStopEvent) {
throw new CoreException();
}
}
});
a.requestStart();
a.requestClose();
}
use of com.adaptris.core.stubs.StubEventHandler in project interlok by adaptris.
the class DefaultFailedMessageRetrierTest method retrieveObjectForSampleConfig.
@Override
protected Object retrieveObjectForSampleConfig() {
Adapter result = null;
try {
DefaultFailedMessageRetrier fmr = new DefaultFailedMessageRetrier();
FsConsumer consumer = new FsConsumer().withBaseDirectoryUrl("/path/to/retry-directory");
StandaloneConsumer c = new StandaloneConsumer(consumer);
fmr.setStandaloneConsumer(c);
result = new Adapter();
result.setFailedMessageRetrier(fmr);
result.setChannelList(new ChannelList());
result.setEventHandler(new StubEventHandler());
result.setUniqueId(UUID.randomUUID().toString());
} catch (Exception e) {
throw new RuntimeException(e);
}
return result;
}
use of com.adaptris.core.stubs.StubEventHandler in project interlok by adaptris.
the class ExampleErrorHandlerCase method retrieveObjectForSampleConfig.
@Override
protected Object retrieveObjectForSampleConfig() {
Adapter result = new Adapter();
result.setUniqueId("dummy-adapter");
ProcessingExceptionHandler meh = createForExamples();
result.setMessageErrorHandler(meh);
result.setEventHandler(new StubEventHandler());
result.setChannelList(new ChannelList());
return result;
}
use of com.adaptris.core.stubs.StubEventHandler in project interlok by adaptris.
the class RetryFromJettyTest method retrieveObjectForSampleConfig.
@Override
protected Object retrieveObjectForSampleConfig() {
Adapter result = null;
try {
RetryFromJetty fmr = new RetryFromJetty();
fmr.setConnection(new EmbeddedConnection());
fmr.setRetryStore(new InMemoryRetryStore());
result = new Adapter();
result.setFailedMessageRetrier(fmr);
result.setChannelList(new ChannelList());
result.setEventHandler(new StubEventHandler());
result.setUniqueId(UUID.randomUUID().toString());
} catch (Exception e) {
throw new RuntimeException(e);
}
return result;
}
Aggregations