// [TODO] Remove this hack when it becomes possible to pass data to the enrichers
ResourceCallbackHandlerAssociation.setCallbackHandler(this);
// Get the TestRunner
ClassLoader serviceClassLoader = getTestClassLoader().getServiceClassLoader();
TestRunner runner = TestRunners.getTestRunner(serviceClassLoader);
Class<?> testClass = getTestClassLoader().loadTestClass(className);
ClassLoader oldThreadContextCL = SecurityActions.getThreadContextClassLoader();
try
{
DynamicServiceLoader.setClassLoaderAssociation(serviceClassLoader);
SecurityActions.setThreadContextClassLoader(SecurityActions.getClassLoader(testClass));
testResult = runner.execute(testClass, methodName);
}
finally
{
SecurityActions.setThreadContextClassLoader(oldThreadContextCL);
DynamicServiceLoader.setClassLoaderAssociation(null);