if (!suiteFiles.isEmpty()) {
testNg.setTestSuites(GFileUtils.toPaths(suiteFiles));
Object rootId = idGenerator.generateId();
TestDescriptorInternal rootSuite = new DefaultTestSuiteDescriptor(rootId, options.getDefaultTestName());
TestResultProcessor decorator = new AttachParentTestResultProcessor(processor);
decorator.started(rootSuite, new TestStartEvent(System.currentTimeMillis()));
testNg.addListener((Object) adaptListener(new TestNGTestResultProcessorAdapter(decorator, idGenerator)));
try {
testNg.run();
} finally {
decorator.completed(rootId, new TestCompleteEvent(System.currentTimeMillis()));
}
} else {
testNg.setTestClasses(testClasses.toArray(new Class[testClasses.size()]));
testNg.addListener((Object) adaptListener(new TestNGTestResultProcessorAdapter(processor, idGenerator)));
testNg.run();