Java - Turn off TestNG's default reporters programmatically
问题 I have an application where I need to execute my TestNG @Test annotated methods from my main method, and use ReportNG to generate reports. My main method looks like this: public static void main(String args[]) { TestNG myTestNG = new TestNG(); XmlSuite mySuite = new XmlSuite(); mySuite.setName("Sample Suite"); mySuite.addListener("org.uncommons.reportng.HTMLReporter"); mySuite.addListener("org.uncommons.reportng.JUnitXMLReporter"); XmlTest myTest = new XmlTest(mySuite); myTest.setName("Sample