use of com.adaptris.core.http.jetty.EmbeddedJettyHelper 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.EmbeddedJettyHelper 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();
}
}
Aggregations