org.testng.IReporter Java Examples
The following examples show how to use
org.testng.IReporter.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: TestNGRunner.java From buck with Apache License 2.0 | 5 votes |
@Override public void run() throws Throwable { for (String className : testClassNames) { Class<?> testClass = Class.forName(className); List<TestResult> results; if (!mightBeATestClass(testClass)) { results = Collections.emptyList(); } else { results = new ArrayList<>(); TestNG testng = new TestNG(); testng.setUseDefaultListeners(false); testng.addListener(new FilteringAnnotationTransformer(results)); testng.setTestClasses(new Class<?>[] {testClass}); testng.addListener(new TestListener(results)); // use default TestNG reporters ... testng.addListener(new SuiteHTMLReporter()); testng.addListener((IReporter) new FailedReporter()); testng.addListener(new XMLReporter()); testng.addListener(new EmailableReporter()); // ... except this replaces JUnitReportReporter ... testng.addListener(new JUnitReportReporterWithMethodParameters()); // ... and we can't access TestNG verbosity, so we remove VerboseReporter testng.run(); } writeResult(className, results); } }