Search in sources :

Example 1 with MethodCall

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);
}
Also used : MethodCall(org.jgroups.blocks.MethodCall)

Example 2 with MethodCall

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);
}
Also used : MethodCall(org.jgroups.blocks.MethodCall)

Example 3 with MethodCall

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);
}
Also used : MethodCall(org.jgroups.blocks.MethodCall)

Example 4 with MethodCall

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);
}
Also used : Method(java.lang.reflect.Method) MethodCall(org.jgroups.blocks.MethodCall)

Example 5 with MethodCall

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);
}
Also used : MethodCall(org.jgroups.blocks.MethodCall)

Aggregations

MethodCall (org.jgroups.blocks.MethodCall)31 RequestOptions (org.jgroups.blocks.RequestOptions)9 Method (java.lang.reflect.Method)6 Address (org.jgroups.Address)5 RpcDispatcher (org.jgroups.blocks.RpcDispatcher)5 Rsp (org.jgroups.util.Rsp)3 SiteMaster (org.jgroups.protocols.relay.SiteMaster)2 RspList (org.jgroups.util.RspList)2 ArrayList (java.util.ArrayList)1 Map (java.util.Map)1 JChannel (org.jgroups.JChannel)1 AdditionalJmxObjects (org.jgroups.jmx.AdditionalJmxObjects)1 RELAY2 (org.jgroups.protocols.relay.RELAY2)1 Route (org.jgroups.protocols.relay.Route)1 Protocol (org.jgroups.stack.Protocol)1 Average (org.jgroups.util.Average)1 AfterMethod (org.testng.annotations.AfterMethod)1 BeforeMethod (org.testng.annotations.BeforeMethod)1 Test (org.testng.annotations.Test)1