Search in sources :

Example 36 with DefaultExchange

use of org.apache.camel.impl.DefaultExchange in project camel by apache.

the class BeanExcludedMethodTest method testExcludedMethod.

public void testExcludedMethod() throws Exception {
    BeanInfo info = new BeanInfo(context, MyDummyBean.class);
    Exchange exchange = new DefaultExchange(context);
    MyDummyBean pojo = new MyDummyBean();
    MethodInvocation mi = info.createInvocation(pojo, exchange);
    assertNull("Should not be possible to find a suitable method", mi);
}
Also used : DefaultExchange(org.apache.camel.impl.DefaultExchange) Exchange(org.apache.camel.Exchange) DefaultExchange(org.apache.camel.impl.DefaultExchange)

Example 37 with DefaultExchange

use of org.apache.camel.impl.DefaultExchange in project camel by apache.

the class BeanExcludedMethodTest method testNotExcludedMethod.

public void testNotExcludedMethod() throws Exception {
    BeanInfo info = new BeanInfo(context, MyOtherDummyBean.class);
    Exchange exchange = new DefaultExchange(context);
    MyOtherDummyBean pojo = new MyOtherDummyBean();
    MethodInvocation mi = info.createInvocation(pojo, exchange);
    assertNotNull(mi);
    assertEquals("hello", mi.getMethod().getName());
}
Also used : DefaultExchange(org.apache.camel.impl.DefaultExchange) Exchange(org.apache.camel.Exchange) DefaultExchange(org.apache.camel.impl.DefaultExchange)

Example 38 with DefaultExchange

use of org.apache.camel.impl.DefaultExchange in project camel by apache.

the class BeanHandlerMethodTest method testHandleAmbigious.

public void testHandleAmbigious() throws Exception {
    BeanInfo info = new BeanInfo(context, MyReallyDummyBean.class);
    Exchange exchange = new DefaultExchange(context);
    MyReallyDummyBean pojo = new MyReallyDummyBean();
    try {
        info.createInvocation(pojo, exchange);
        fail("Should throw exception");
    } catch (AmbiguousMethodCallException e) {
        assertEquals(2, e.getMethods().size());
    }
}
Also used : DefaultExchange(org.apache.camel.impl.DefaultExchange) Exchange(org.apache.camel.Exchange) DefaultExchange(org.apache.camel.impl.DefaultExchange)

Example 39 with DefaultExchange

use of org.apache.camel.impl.DefaultExchange in project camel by apache.

the class BeanHandlerMethodTest method testNoHandlerAmbigious.

public void testNoHandlerAmbigious() throws Exception {
    BeanInfo info = new BeanInfo(context, MyNoHandlerBean.class);
    Exchange exchange = new DefaultExchange(context);
    MyNoHandlerBean pojo = new MyNoHandlerBean();
    try {
        info.createInvocation(pojo, exchange);
        fail("Should throw exception");
    } catch (AmbiguousMethodCallException e) {
        assertEquals(3, e.getMethods().size());
    }
}
Also used : DefaultExchange(org.apache.camel.impl.DefaultExchange) Exchange(org.apache.camel.Exchange) DefaultExchange(org.apache.camel.impl.DefaultExchange)

Example 40 with DefaultExchange

use of org.apache.camel.impl.DefaultExchange in project camel by apache.

the class BeanHandlerMethodTest method testHandleMethod.

public void testHandleMethod() throws Exception {
    BeanInfo info = new BeanInfo(context, MyDummyBean.class);
    Exchange exchange = new DefaultExchange(context);
    MyDummyBean pojo = new MyDummyBean();
    MethodInvocation mi = info.createInvocation(pojo, exchange);
    assertNotNull(mi);
    assertEquals("hello", mi.getMethod().getName());
}
Also used : DefaultExchange(org.apache.camel.impl.DefaultExchange) Exchange(org.apache.camel.Exchange) DefaultExchange(org.apache.camel.impl.DefaultExchange)

Aggregations

DefaultExchange (org.apache.camel.impl.DefaultExchange)473 Exchange (org.apache.camel.Exchange)381 Test (org.junit.Test)254 DefaultCamelContext (org.apache.camel.impl.DefaultCamelContext)127 CamelContext (org.apache.camel.CamelContext)54 RegisteredDelivery (org.jsmpp.bean.RegisteredDelivery)39 HashMap (java.util.HashMap)33 Message (org.apache.camel.Message)32 Before (org.junit.Before)32 Tx (org.nhindirect.common.tx.model.Tx)31 ESMClass (org.jsmpp.bean.ESMClass)30 Processor (org.apache.camel.Processor)22 MockEndpoint (org.apache.camel.component.mock.MockEndpoint)22 Expression (org.apache.camel.Expression)21 File (java.io.File)20 DefaultMessage (org.apache.camel.impl.DefaultMessage)20 ArrayList (java.util.ArrayList)18 ByteArrayInputStream (java.io.ByteArrayInputStream)17 URL (java.net.URL)16 Date (java.util.Date)16