reportDirectory.mkdirs();
Logger.info( "Generating XML report in " + reportDirectory.getAbsolutePath() );
//Adding a listener for the running test
TestXmlRingingListener testXmlRingingListener = new TestXmlRingingListener( reportDirectory );
jUnitCore.addListener( testXmlRingingListener );
try {
Class clazz = Class.forName( className );
testXmlRingingListener.startFile( clazz );
jUnitCore.run( clazz );
testXmlRingingListener.closeFile();
} catch ( ClassNotFoundException e ) {
throw new ServletException( e );
}
//Setting the response
response.setStatus( testXmlRingingListener.getStatusCode() );
}