Package org.jgroups.blocks

Examples of org.jgroups.blocks.MethodCall.invoke()


    public void testTypesWithNullArgument() {
        MethodCall mc;
        mc=new MethodCall("bar", new Object[]{new String[]{"one", "two", "three"}, null},
                          new Class[]{String[].class, String.class});
        try {
            mc.invoke(target);
        }
        catch(Throwable t) {
            assert false : t.toString();
        }
    }
View Full Code Here


    public void testTypesWithNullArgument2() throws Throwable {
        MethodCall mc;
        mc=new MethodCall("bar", new Object[]{new String[]{"one", "two", "three"}, new Object[]{}},
                          new Class[]{String[].class, String.class});
        try {
            mc.invoke(target);
            assert false: "we should not get here as there should be an argument mismatch exception";
        }
        catch(IllegalArgumentException ex) {
            System.out.println("caught IllegalArgumentException - as expected");
        }
View Full Code Here

    public void testTypesWithNullArgument3() {
        MethodCall mc;
        mc=new MethodCall("foobar", new Object[]{}, new Class[]{});
        try {
            mc.invoke(target);
        }
        catch(IllegalArgumentException ex) {
            assert true : "this was expected";
        }
        catch(Throwable t) {
View Full Code Here

    public void testTypesWithNullArgument4() {
        MethodCall mc;
        mc=new MethodCall("foobar", null, (Class[])null);
        try {
            mc.invoke(target);
        }
        catch(IllegalArgumentException ex) {
            assert true : "this was expected";
        }
        catch(Throwable t) {
View Full Code Here

    public void testTypesWithNullArgument5() {
        MethodCall mc;
        mc=new MethodCall("foobar", new Object[0], new Class[0]);
        try {
            mc.invoke(target);
        }
        catch(IllegalArgumentException ex) {
            assert true : "this was expected";
        }
        catch(Throwable t) {
View Full Code Here

    public void testSignature() {
        MethodCall mc;
        mc=new MethodCall("foo", new Object[]{new Integer(35), "Bela"},
                          new String[]{int.class.getName(), String.class.getName()});
        try {
            Assert.assertEquals(mc.invoke(target), Boolean.TRUE);
        }
        catch(Throwable t) {
            assert false : t.toString();
        }
    }
View Full Code Here


    public static void testOLD() throws Throwable {
        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);
    }


    public static void testInheritanceOLD() throws Throwable {
View Full Code Here


    public static void testInheritanceOLD() throws Throwable {
        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);
    }


    public static void testMETHOD() throws Throwable {
View Full Code Here

        Method method = Target.class.getMethod("someMethod", new Class[] { String.class });
        MethodCall methodCall = new MethodCall(method, new Object[] {"abc"});

        Target target = new Target();
        Object result = methodCall.invoke(target);
        Assert.assertEquals("ABC", result);
    }


    public static void testInheritanceMETHOD() throws Throwable {
View Full Code Here

        Method method = Target.class.getMethod("someMethod", new Class[] { String.class });
        MethodCall methodCall = new MethodCall(method, new Object[] {"abc"});

        TargetSubclass target = new TargetSubclass();
        Object result = methodCall.invoke(target);
        Assert.assertEquals("ABC", result);
    }


    public static void testTYPES() throws Throwable {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.