public static synchronized ClassLoader createUserClassloader(
      String name, String classpath, ClassLoader parent, IUserContext ucxt) throws Exception {

    Log.debug("name=" + name + " cp=" + classpath + " " + ucxt + " cl=" + parent);

    Key key = new Key(name, classpath, parent, ucxt);
    ClassLoader loader = userClassLoaders.get(key);

    Log.debug(loader == null ? "New" : "Old");

    if (loader == null) {
      loader = createClassLoader(classpath, parent, ucxt);
      // TODO fix it
      userClassLoaders.put(key, loader);
    }

    return loader;
  }
 protected void addTestSuiteMethodsFromDependencies() {
   for (CompiledDependency dependency : this.getDependencies()) {
     for (IOpenMethod depMethod :
         dependency.getCompiledOpenClass().getOpenClassWithErrors().getMethods()) {
       if (depMethod instanceof TestSuiteMethod) {
         TestSuiteMethod testSuiteMethod = (TestSuiteMethod) depMethod;
         try {
           // Workaround for set dependency names in method while
           // compile
           if (testSuiteMethod.getModuleName() == null) {
             testSuiteMethod.setModuleName(dependency.getDependencyName());
           }
           TestSuiteMethod newTestSuiteMethod = createNewTestSuiteMethod(testSuiteMethod);
           addMethod(newTestSuiteMethod);
         } catch (OpenlNotCheckedException e) {
           if (Log.isDebugEnabled()) {
             Log.debug(e.getMessage(), e);
           }
           addError(e);
         }
       }
     }
   }
 }
Exemplo n.º 3
0
 /** Prints the string if printing is on. */
 public static void print(String s) {
   if (Debug.yes) {
     Log.debug(s);
   }
 }