Package java.beans

Examples of java.beans.Statement.execute()


     */
    public void testExecute_ExceptionalConstructor() throws Exception {
        Statement t = new Statement(MockObject.class, "new", new Object[] {
                null, null });
        try {
            t.execute();
            fail("Should throw NullPointerException!");
        } catch (NullPointerException ex) {
            // expected
        }
        MockObject.assertCalled("new4", new Object[] { null, null });
View Full Code Here


    public void testExecute_NonExistingConstructor() throws Exception {
        Statement t = new Statement(MockObject.class, "new", new Object[] {
                null, null, null, null });

        try {
            t.execute();
            fail("Should throw NoSuchMethodException!");
        } catch (NoSuchMethodException ex) {
            // expected
        }
    }
View Full Code Here

     * constructors, the method name "new" and valid arguments.
     */
    public void testExecute_OverloadedConstructors() throws Exception {
        Object[] arguments = new Object[] { new Object() };
        Statement t = new Statement(MockObject.class, "new", arguments);
        t.execute();
        MockObject.assertCalled("new2", arguments);

        arguments = new Object[] { "test" };
        t = new Statement(MockObject.class, "new", arguments);
        t.execute();
View Full Code Here

        t.execute();
        MockObject.assertCalled("new2", arguments);

        arguments = new Object[] { "test" };
        t = new Statement(MockObject.class, "new", arguments);
        t.execute();
        //FIXME: the following 2 commented assert cannot pass neither in RI nor in Harmony (HARMONY-4392),
        // waiting for dev-list approval to fix Harmony implementation following spec       
//         MockObject.assertCalled("new3", arguments);

        Object[] arguments2 = new Object[] { new Integer(1) };
View Full Code Here

        // waiting for dev-list approval to fix Harmony implementation following spec       
//         MockObject.assertCalled("new3", arguments);

        Object[] arguments2 = new Object[] { new Integer(1) };
        t = new Statement(MockObject.class, "new", arguments2);
        t.execute();
//        MockObject.assertCalled("new1-2", arguments2);
    }
   
    /*
     * Test the method execute() with the Class object, a static method name and
View Full Code Here

     * valid arguments.
     */
    public void testExecute_NormalStaticMethodViaClass() throws Exception {
        Object[] arguments = new Object[] { new Object() };
        Statement t = new Statement(MockObject.class, "staticMethod", arguments);
        t.execute();
        MockObject.assertCalled("staticMethod", arguments);
    }

    /*
     * Test the method execute() with an object, a static method name and valid
View Full Code Here

     */
    public void testExecute_NormalStaticMethodViaObject() throws Exception {
        MockObject mo = new MockObject(false);
        Object[] arguments = new Object[] { new Object() };
        Statement t = new Statement(mo, "staticMethod", arguments);
        t.execute();
        MockObject.assertCalled("staticMethod", arguments);
    }

    /*
     * Test the method execute() with a Class object of a normal class that has
View Full Code Here

     * name "forName" and valid argument "string".
     */
    public void testExecute_AmbiguousStaticMethod() throws Exception {
        Object[] arguments = new String[] { "test" };
        Statement t = new Statement(MockObject.class, "forName", arguments);
        t.execute();
        MockObject.assertCalled("forName", arguments);

        t = new Statement(String.class, "forName",
                new Object[] { "java.lang.String" });
        t.execute();
View Full Code Here

        t.execute();
        MockObject.assertCalled("forName", arguments);

        t = new Statement(String.class, "forName",
                new Object[] { "java.lang.String" });
        t.execute();
    }

    /*
     * Test the method execute() with the special method Class.forName().
     */
 
View Full Code Here

     * Test the method execute() with the special method Class.forName().
     */
    public void testExecute_ClassForName() throws Exception {
        Object[] arguments = new String[] { Statement.class.getName() };
        Statement t = new Statement(Class.class, "forName", arguments);
        t.execute();

        t = new Statement(String.class, "forName",
                new Object[] { "java.lang.String" });
        t.execute();
    }
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.