Search in sources :

Example 91 with DefaultCamelContext

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);
}
Also used : DefaultExchange(org.apache.camel.impl.DefaultExchange) DefaultCamelContext(org.apache.camel.impl.DefaultCamelContext) Before(org.junit.Before)

Example 92 with DefaultCamelContext

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();
}
Also used : DefaultCamelContext(org.apache.camel.impl.DefaultCamelContext) Before(org.junit.Before)

Example 93 with DefaultCamelContext

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"))));
}
Also used : DefaultExchange(org.apache.camel.impl.DefaultExchange) URLDataSource(javax.activation.URLDataSource) DefaultAttachment(org.apache.camel.impl.DefaultAttachment) DefaultCamelContext(org.apache.camel.impl.DefaultCamelContext) URL(java.net.URL)

Example 94 with DefaultCamelContext

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);
    }
}
Also used : DefaultCamelContext(org.apache.camel.impl.DefaultCamelContext) CamelContext(org.apache.camel.CamelContext) Exchange(org.apache.camel.Exchange) DefaultExchange(org.apache.camel.impl.DefaultExchange) DefaultExchange(org.apache.camel.impl.DefaultExchange) NoTypeConversionAvailableException(org.apache.camel.NoTypeConversionAvailableException) DefaultCamelContext(org.apache.camel.impl.DefaultCamelContext) NoTypeConversionAvailableException(org.apache.camel.NoTypeConversionAvailableException) TypeConversionException(org.apache.camel.TypeConversionException)

Example 95 with DefaultCamelContext

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());
}
Also used : DefaultCamelContext(org.apache.camel.impl.DefaultCamelContext) CamelContext(org.apache.camel.CamelContext) Exchange(org.apache.camel.Exchange) DefaultExchange(org.apache.camel.impl.DefaultExchange) DefaultExchange(org.apache.camel.impl.DefaultExchange) DefaultCamelContext(org.apache.camel.impl.DefaultCamelContext)

Aggregations

DefaultCamelContext (org.apache.camel.impl.DefaultCamelContext)474 CamelContext (org.apache.camel.CamelContext)206 Test (org.junit.Test)183 DefaultExchange (org.apache.camel.impl.DefaultExchange)128 RouteBuilder (org.apache.camel.builder.RouteBuilder)101 Exchange (org.apache.camel.Exchange)91 Before (org.junit.Before)70 SimpleRegistry (org.apache.camel.impl.SimpleRegistry)61 RegisteredDelivery (org.jsmpp.bean.RegisteredDelivery)39 MockEndpoint (org.apache.camel.component.mock.MockEndpoint)38 ESMClass (org.jsmpp.bean.ESMClass)30 ProducerTemplate (org.apache.camel.ProducerTemplate)27 CountDownLatch (java.util.concurrent.CountDownLatch)15 Endpoint (org.apache.camel.Endpoint)13 FailedToCreateRouteException (org.apache.camel.FailedToCreateRouteException)13 Processor (org.apache.camel.Processor)12 RouteStartupOrder (org.apache.camel.spi.RouteStartupOrder)12 Address (org.jsmpp.bean.Address)11 SubmitMultiResult (org.jsmpp.bean.SubmitMultiResult)11 Date (java.util.Date)10