String directoryName = (String) GlobalCommandState.getInstance().getValue(
CommandStateConstants.DIRECTORY_NAME);
ClassLoader parent = null;
RuntimeModule runtimeModule = null;
try {
if (directoryName != null && !InteractiveCommandUtils.isRootProject(directoryName)) {
runtimeModule = Impala.getRuntimeModule(directoryName);
}
else {
runtimeModule = Impala.getRootRuntimeModule();
}
}
catch (NoServiceException e) {
//we're not terribly interested in this situation - simply means that the module context has not been loaded
}
if (runtimeModule != null) {
parent = runtimeModule.getClassLoader();
} else {
parent = ClassUtils.getDefaultClassLoader();
}
c = Class.forName(testClassName, false, parent);