use of org.apache.camel.impl.DefaultCamelContext in project camel by apache.
the class PutAttributesCommandTest method setUp.
@Before
public void setUp() {
sdbClient = new AmazonSDBClientMock();
configuration = new SdbConfiguration();
configuration.setDomainName("DOMAIN1");
exchange = new DefaultExchange(new DefaultCamelContext());
command = new PutAttributesCommand(sdbClient, configuration, exchange);
}
use of org.apache.camel.impl.DefaultCamelContext in project camel by apache.
the class EndpointTest method setUp.
@Before
public void setUp() throws Exception {
context = new DefaultCamelContext();
context.disableJMX();
context.start();
}
use of org.apache.camel.impl.DefaultCamelContext in project camel by apache.
the class BodyAndHeaderConvertTest method setUp.
@Override
protected void setUp() throws Exception {
super.setUp();
exchange = new DefaultExchange(new DefaultCamelContext());
exchange.setProperty("foo", 1234);
Message message = exchange.getIn();
message.setBody("<hello>world!</hello>");
message.setHeader("bar", 567);
message.addAttachmentObject("att", new DefaultAttachment(new URLDataSource(new URL("http://camel.apache.org/message.html"))));
}
use of org.apache.camel.impl.DefaultCamelContext in project camel by apache.
the class ConverterTest method testMandatoryConvertTo.
public void testMandatoryConvertTo() {
CamelContext camel = new DefaultCamelContext();
Exchange e = new DefaultExchange(camel);
try {
converter.mandatoryConvertTo(InputStream.class, e);
fail("Expect exception here");
} catch (Exception ex) {
assertTrue("Expect to get a NoTypeConversionAvailableException here", ex instanceof NoTypeConversionAvailableException);
}
}
use of org.apache.camel.impl.DefaultCamelContext in project camel by apache.
the class ConverterTest method testInstanceMethodConversionWithExchange.
public void testInstanceMethodConversionWithExchange() throws Exception {
String[] values = new String[] { "5", "bar" };
CamelContext camel = new DefaultCamelContext();
Exchange e = new DefaultExchange(camel);
e.setProperty("prefix", "foo-");
MyBean bean = converter.convertTo(MyBean.class, e, values);
assertEquals("converted using exchange", 5, bean.getFoo(), 5);
assertEquals("converted using exchange", "foo-bar", bean.getBar());
}
Aggregations