use of com.adaptris.core.http.jetty.EmbeddedConnection in project interlok by adaptris.
the class FileInputStreamDataInputParameterTest method testExtractFromRemote.
@Test
public void testExtractFromRemote() throws Exception {
EmbeddedJettyHelper helper = new EmbeddedJettyHelper();
helper.startServer();
MockMessageProducer mockProducer = new MockMessageProducer();
Channel channel = JettyHelper.createChannel(new EmbeddedConnection(), JettyHelper.createConsumer(URL_TO_POST_TO), mockProducer);
try {
LifecycleHelper.initAndStart(channel);
FileInputStreamDataInputParameter p = new FileInputStreamDataInputParameter();
p.setUrl(helper.createProduceDestination());
AdaptrisMessage msg = AdaptrisMessageFactory.getDefaultInstance().newMessage();
assertNotNull(p.extract(msg));
} finally {
LifecycleHelper.stopAndClose(channel);
helper.stopServer();
}
}
use of com.adaptris.core.http.jetty.EmbeddedConnection in project interlok by adaptris.
the class FileDataInputParameterTest method testExtractFromRemote.
@Test
public void testExtractFromRemote() throws Exception {
EmbeddedJettyHelper helper = new EmbeddedJettyHelper();
helper.startServer();
MockMessageProducer mockProducer = new MockMessageProducer();
Channel channel = JettyHelper.createChannel(new EmbeddedConnection(), JettyHelper.createConsumer(URL_TO_POST_TO), mockProducer);
try {
LifecycleHelper.initAndStart(channel);
FileDataInputParameter p = new FileDataInputParameter();
p.setUrl(helper.createProduceDestination());
AdaptrisMessage msg = AdaptrisMessageFactory.getDefaultInstance().newMessage();
assertNotNull(p.extract(msg));
} finally {
LifecycleHelper.stopAndClose(channel);
helper.stopServer();
}
}
use of com.adaptris.core.http.jetty.EmbeddedConnection in project interlok by adaptris.
the class SharedComponentListTest method retrieveObjectForSampleConfig.
@Override
protected Object retrieveObjectForSampleConfig() {
Adapter adapter = null;
try {
adapter = createAdapter();
for (ConnectionBuilder b : ConnectionBuilder.values()) {
adapter.getSharedComponents().addConnection(b.build());
}
TransactionManager transactionManager = new DummyTransactionManager("myTransactionManager");
adapter.getSharedComponents().setTransactionManager(transactionManager);
Channel c = new Channel();
c.setProduceConnection(new SharedConnection("goofy_edison"));
c.setConsumeConnection(new EmbeddedConnection());
} catch (Exception e) {
throw new RuntimeException(e);
}
return adapter;
}
use of com.adaptris.core.http.jetty.EmbeddedConnection 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