use of org.jgroups.blocks.MethodCall in project JGroups by belaban.
the class MethodCallTest method testOLD.
public static void testOLD() 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 testInheritanceTYPES.
public static void testInheritanceTYPES() 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);
}
use of org.jgroups.blocks.MethodCall in project JGroups by belaban.
the class MethodCallTest method testInheritanceSIGNATURE.
public static void testInheritanceSIGNATURE() 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);
}
use of org.jgroups.blocks.MethodCall in project JGroups by belaban.
the class MethodCallTest method testMethod.
public void testMethod() throws Exception {
Method m = TargetClass.class.getMethod("foo", int.class, String.class);
MethodCall mc = new MethodCall(m, 22, "Bela");
Assert.assertEquals(mc.invoke(target), Boolean.TRUE);
}
use of org.jgroups.blocks.MethodCall in project JGroups by belaban.
the class MethodCallTest method testOverriddenForTYPES.
/**
* This tests whether overriden methods are correctly identified and invoked.
*/
public static void testOverriddenForTYPES() throws Exception {
MethodCall methodCall = new MethodCall("overriddenMethod", new Object[] { "abc" }, new Class[] { String.class });
TargetSubclass target = new TargetSubclass();
Object result = methodCall.invoke(target);
Assert.assertEquals("TargetSubclassABC", result);
}
Aggregations