/*
* Instantiate method filter if any.
*/
String methodFilterGlob = Strings.emptyToNull(System.getProperty(SysGlobals.SYSPROP_TESTMETHOD()));
Filter methodFilter = Filter.ALL;
if (methodFilterGlob != null) {
methodFilter = new MethodGlobFilter(methodFilterGlob);
}
/*
* Important. Run each class separately so that we get separate
* {@link RunListener} callbacks for the top extracted description.
*/
debug(debug, "Entering main suite loop.");
try {
while (classNames.hasNext()) {
final String clName = classNames.next();
debug(debug, "Instantiating: " + clName);
Class<?> clazz = instantiate(clName);
if (clazz == null)
continue;
Request request = Request.aClass(clazz);
try {
Runner runner = request.getRunner();
methodFilter.apply(runner);
fNotifier.fireTestRunStarted(runner.getDescription());
debug(debug, "Runner.run(" + clName + ")");
runner.run(fNotifier);
debug(debug, "Runner.done(" + clName + ")");