{
classesRoot = testCompiler.getClassesRoot(testRoot);
}
catch (IOException ex)
{
throw new CommandOperationException("Error creating directory for compiled tests.", ex);
}
if (classesRoot.exists())
{
FileUtils.deleteQuietly(classesRoot);
}
List<File> testContainerDirs = new IntegrationTestFinder().findTestContainerDirs(brjs, testRoot, ignoreWorkbenches(args));
if (testContainerDirs.size() < 1)
{
throw new CommandOperationException("No tests found.");
}
logger.println("Found tests in " + testContainerDirs.size() + " location(s).");
List<File> classDirs = testCompiler.compileTestDirs(brjs, testContainerDirs);
List<Class<?>> testClasses = testCompiler.loadClasses(classDirs);
Result testResult = null;
try {
File runnerConf = TestRunnerConfLocator.getTestRunnerConf();
testResult = new IntegrationTestRunner().runTests(runnerConf, testClasses);
}
catch (Exception ex)
{
throw new CommandOperationException(ex);
}
printTestReport(testResult);
if (testResult.getFailures().size() > 0)
{
throw new CommandOperationException("There were failing tests.");
}
return 0;
}