use of org.jgroups.blocks.MethodCall in project JGroups by belaban.
the class MethodCallTest method testTYPES.
public static void testTYPES() throws Exception {
MethodCall methodCall = new MethodCall("someMethod", new Object[] { "abc" }, new Class[] { String.class });
Target target = new Target();
Object result = methodCall.invoke(target);
Assert.assertEquals("ABC", result);
}
use of org.jgroups.blocks.MethodCall in project JGroups by belaban.
the class MethodCallTest method testTypes.
public void testTypes() throws Exception {
MethodCall mc = new MethodCall("foo", new Object[] { 35, "Bela" }, new Class[] { int.class, String.class });
Assert.assertEquals(mc.invoke(target), Boolean.TRUE);
}
use of org.jgroups.blocks.MethodCall in project JGroups by belaban.
the class MethodCallTest method testNoArgumentMethodForTYPES.
public static void testNoArgumentMethodForTYPES() throws Exception {
MethodCall methodCall = new MethodCall("noArgumentMethod", new Object[0], new Class[0]);
TargetSubclass target = new TargetSubclass();
Object result = methodCall.invoke(target);
Assert.assertEquals("noArgumentMethodResult", result);
}
use of org.jgroups.blocks.MethodCall in project JGroups by belaban.
the class MethodCallTest method testInheritanceMETHOD.
public static void testInheritanceMETHOD() throws Exception {
Method method = Target.class.getMethod("someMethod", String.class);
MethodCall methodCall = new MethodCall(method, "abc");
TargetSubclass target = new TargetSubclass();
Object result = methodCall.invoke(target);
Assert.assertEquals("ABC", result);
}
use of org.jgroups.blocks.MethodCall in project JGroups by belaban.
the class MethodCallTest method testInheritanceOLD.
public static void testInheritanceOLD() throws Exception {
MethodCall methodCall = new MethodCall("someMethod", new Object[] { "abc" }, new Class[] { String.class });
TargetSubclass target = new TargetSubclass();
Object result = methodCall.invoke(target);
Assert.assertEquals("ABC", result);
}
Aggregations