Code example for AssertionFailedError

Methods: getMessage

0
        try { 
            Support_Exec.execJava(arg, path, true);
            fail("Should fail here!");
        } catch (AssertionFailedError e) {
            // class loader changes, can not load classes 
            assertTrue(-1 != e.getMessage().indexOf("NoClassDefFoundError"));
        } 
    } 
 
    /** 
     * @tests try to use a new ClassLoader 
     */ 
    public void test_new_classLoader_Exists() throws Exception { 
        String[] arg = new String[2];
        arg[0] = "-javaagent:src/test/resources/jars/org/apache/harmony/tests/instrument/new_classloader.jar";
        arg[1] = "org/apache/harmony/tests/java/lang/instrument/TestMain";
        String[] path = new String[1];
        path[0] = "src/test/resources/jars/org/apache/harmony/tests/instrument/new_classloader.jar";
        String result = Support_Exec.execJava(arg, path, true);
        assertNotNull(result);
Contextual code suggestions in your IDE  Get Codota for Java