Package org.jgroups.blocks

Examples of org.jgroups.blocks.MethodCall


    }


    public void testWithNull() {
        try {
            MethodCall mc=new MethodCall("foobar", null, (Class[])null);
            System.out.println("mc: " + mc);
            mc.invoke(target);
        }
        catch(Throwable t) {
            assert false : t.toString();
        }
    }
View Full Code Here


    }


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

    }


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

    }


    public void testOldWithNull3() {
        try {
            MethodCall mc=new MethodCall("foobar", null, (Class[])null);
            mc.invoke(target);
        }
        catch(Throwable t) {
            assert false : t.toString();
        }
    }
View Full Code Here

    }


    public void testOldWithNull4() {
        try {
            MethodCall mc=new MethodCall("foobar", new Object[0], (Class[])null);
            mc.invoke(target);
        }
        catch(Throwable t) {
            assert false : t.toString();
        }
    }
View Full Code Here

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

        }
    }


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

    }



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

        }
    }


    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

            assert false : t.toString();
        }
    }

    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

TOP

Related Classes of org.jgroups.blocks.MethodCall

Copyright © 2018 www.massapicom. 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.