use of org.apache.camel.impl.DefaultCamelContext in project camel by apache.
the class UnitOfWorkProducerTest method createCamelContext.
@Override
protected CamelContext createCamelContext() throws Exception {
DefaultCamelContext context = new DefaultCamelContext(createRegistry());
context.getManagementStrategy().addEventNotifier(new EventNotifierSupport() {
public void notify(EventObject event) throws Exception {
events.add(event);
}
public boolean isEnabled(EventObject event) {
return event instanceof ExchangeCompletedEvent;
}
@Override
protected void doStart() throws Exception {
}
@Override
protected void doStop() throws Exception {
}
});
return context;
}
use of org.apache.camel.impl.DefaultCamelContext in project camel by apache.
the class AbstractDistributedTest method setUp.
public void setUp() throws Exception {
super.setUp();
context.setUseMDCLogging(true);
context2 = new DefaultCamelContext();
context2.setUseMDCLogging(true);
template2 = context2.createProducerTemplate();
ServiceHelper.startServices(template2, context2);
// add routes after CamelContext has been started
context2.addRoutes(createRouteBuilder2());
}
use of org.apache.camel.impl.DefaultCamelContext in project camel by apache.
the class UnmarshalProcessorTest method testDataFormatReturnsSameExchange.
public void testDataFormatReturnsSameExchange() throws Exception {
Exchange exchange = createExchangeWithBody(new DefaultCamelContext(), "body");
Processor processor = new UnmarshalProcessor(new MyDataFormat(exchange));
processor.process(exchange);
assertEquals("UnmarshalProcessor did not copy OUT from IN message", "body", exchange.getOut().getBody());
}
use of org.apache.camel.impl.DefaultCamelContext in project camel by apache.
the class UnmarshalProcessorTest method testDataFormatReturnsAnotherExchange.
public void testDataFormatReturnsAnotherExchange() throws Exception {
CamelContext context = new DefaultCamelContext();
Exchange exchange = createExchangeWithBody(context, "body");
Exchange exchange2 = createExchangeWithBody(context, "body2");
Processor processor = new UnmarshalProcessor(new MyDataFormat(exchange2));
processor.process(exchange);
Exception e = exchange.getException();
assertNotNull(e);
assertEquals("The returned exchange " + exchange2 + " is not the same as " + exchange + " provided to the DataFormat", e.getMessage());
}
use of org.apache.camel.impl.DefaultCamelContext in project camel by apache.
the class HttpHeaderFilterStrategyTest method setUp.
@Before
public void setUp() {
filter = new HttpHeaderFilterStrategy();
exchange = new DefaultExchange(new DefaultCamelContext());
}
Aggregations