Search in sources :

Example 11 with CustomURLClassLoader

use of CustomCLs.CustomURLClassLoader in project openj9 by eclipse.

the class Verifier method executeTest.

public boolean executeTest(String classpath, String[] classesToVerify, String[] results) {
    System.out.println("\nCreating Verifier.....");
    URLClassPathCreator vfPathCreator = new URLClassPathCreator(classpath);
    URL[] vfPath;
    vfPath = vfPathCreator.createURLClassPath();
    CustomURLClassLoader verifier = new CustomURLClassLoader(vfPath, this.getClass().getClassLoader());
    System.out.println("\nRunning Verifier.....");
    boolean result = true;
    for (int cIndex = 0; cIndex < classesToVerify.length; cIndex++) {
        String className = classesToVerify[cIndex];
        if (className != null) {
            String expectedResult = results[cIndex];
            String testResult = String.valueOf(verifier.isClassInSharedCache(className));
            if (!(expectedResult.equals(testResult))) {
                System.out.println("\nFailure testing class: " + className + " result: " + testResult + " expecting: " + expectedResult);
                result = false;
            }
        }
    }
    return result;
}
Also used : CustomURLClassLoader(CustomCLs.CustomURLClassLoader) URL(java.net.URL)

Aggregations

CustomURLClassLoader (CustomCLs.CustomURLClassLoader)11 URLClassPathCreator (Utilities.URLClassPathCreator)9 URL (java.net.URL)8 CustomURLLoader (CustomCLs.CustomURLLoader)5 HelperAlreadyDefinedException (com.ibm.oti.shared.HelperAlreadyDefinedException)3 SharedClassHelperFactory (com.ibm.oti.shared.SharedClassHelperFactory)3 SharedClassURLClasspathHelper (com.ibm.oti.shared.SharedClassURLClasspathHelper)3 Method (java.lang.reflect.Method)3 CustomTokenClassLoader (CustomCLs.CustomTokenClassLoader)1 CannotSetClasspathException (com.ibm.oti.shared.CannotSetClasspathException)1