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);
}
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());
}
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());
}
}
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());
}
}
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());
}
Aggregations