ArrayList<String> excludes = getIncludesExcludes(p.getProperty("excludes"));
ClassLoader testClassLoader = getBundleClassLoader(plugin);
ClassLoader surefireClassLoader = Surefire.class.getClassLoader();
Surefire surefire = new Surefire();
List reports = new ArrayList();
reports.add(new Object[] {
"org.apache.maven.surefire.report.BriefConsoleReporter",
new Object[] {
Boolean.TRUE /*trimStackTrace*/
}
});
reports.add(new Object[] {
"org.apache.maven.surefire.report.XMLReporter",
new Object[] {
reportsDir,
Boolean.TRUE /*trimStackTrace*/
}
});
List tests = new ArrayList();
tests.add(new Object[] {
runner,
new Object[] {
testDir,
includes,
excludes
}
});
return surefire.run(reports, tests, surefireClassLoader, testClassLoader, true /*failIfNoTests*/);
}