Code example for AssertionFailedError

Methods: getMessage

0
        try { 
            Support_Exec.execJava(arg, path, true);
            fail("Should fail here!");
        } catch (AssertionFailedError e) {
            // expected 
            assertTrue(-1 != e.getMessage().indexOf("Failed")
                    || -1 != e.getMessage().indexOf("error"));
            assertTrue(-1 != e.getMessage().indexOf("Premain-Class"));
            assertTrue(-1 != e.getMessage().indexOf("attribute"));
        } 
    } 
 
    /** 
     * @tests test if attributes of "Can-Redefine-Classes" and "Boot-Class-Path" 
     *        is null 
     */ 
    public void test_Property_other_null() throws Exception { 
        String[] arg = new String[2];
        arg[0] = "-javaagent:src/test/resources/jars/org/apache/harmony/tests/instrument/Property_other_null.jar";
        arg[1] = "org/apache/harmony/tests/java/lang/instrument/TestMain";