use of org.apache.camel.impl.DefaultExchange in project camel by apache.
the class SimpleWithPropertiesTest method testProperty.
/**
* A property from the property component in a expression
* is processed when the expression is evaluated with exchange
* See https://issues.apache.org/jira/browse/CAMEL-4843
* Now camel doesn't support the properties expression of {{test}}
*/
@Test
public void testProperty() throws Exception {
System.setProperty("test", "testValue");
PropertiesComponent pc = new PropertiesComponent();
CamelContext context = new DefaultCamelContext();
context.addComponent("properties", pc);
// try to setup the property
Exchange exchange = new DefaultExchange(context);
String result = SimpleBuilder.simple("${properties:test}").evaluate(exchange, String.class);
Assert.assertEquals("testValue", result);
System.clearProperty("test");
}
use of org.apache.camel.impl.DefaultExchange in project camel by apache.
the class DefaultTraceEventMessageTest method testDefaultTraceEventMessageBody.
public void testDefaultTraceEventMessageBody() throws Exception {
Exchange exchange = new DefaultExchange(context);
exchange.getIn().setBody(new File("target/test"));
DefaultTraceEventMessage em = new DefaultTraceEventMessage(new Date(), null, exchange);
assertEquals("Get a wrong body string", "[Body is file based: target" + File.separator + "test]", em.getBody());
exchange.getIn().setBody(new ByteArrayInputStream("target/test".getBytes()));
em = new DefaultTraceEventMessage(new Date(), null, exchange);
assertEquals("Get a wrong body string", "[Body is instance of java.io.InputStream]", em.getBody());
}
use of org.apache.camel.impl.DefaultExchange in project camel by apache.
the class HttpHeaderFilterStrategyTest method setUp.
@Before
public void setUp() {
filter = new HttpHeaderFilterStrategy();
exchange = new DefaultExchange(new DefaultCamelContext());
}
use of org.apache.camel.impl.DefaultExchange in project camel by apache.
the class SelectCommandTest method setUp.
@Before
public void setUp() {
sdbClient = new AmazonSDBClientMock();
configuration = new SdbConfiguration();
configuration.setDomainName("DOMAIN1");
configuration.setConsistentRead(Boolean.TRUE);
exchange = new DefaultExchange(new DefaultCamelContext());
command = new SelectCommand(sdbClient, configuration, exchange);
}
use of org.apache.camel.impl.DefaultExchange in project camel by apache.
the class BatchPutAttributesCommandTest method setUp.
@Before
public void setUp() {
sdbClient = new AmazonSDBClientMock();
configuration = new SdbConfiguration();
configuration.setDomainName("DOMAIN1");
exchange = new DefaultExchange(new DefaultCamelContext());
command = new BatchPutAttributesCommand(sdbClient, configuration, exchange);
}
Aggregations