public TestRunner(IConfiguration configuration, ISuite suite, XmlTest test, boolean skipFailedInvocationCounts, Collection<IInvokedMethodListener> invokedMethodListeners, List<IClassListener> classListeners, Comparator<ITestNGMethod> comparator) { this.comparator = comparator; this.m_dataProviderListeners = Collections.emptyMap(); init(configuration, suite, test, suite.getOutputDirectory(), suite.getAnnotationFinder(), skipFailedInvocationCounts, invokedMethodListeners, classListeners); }
/** * This constructor is used by testng-remote, any changes related to it please contact with testng-team. */ public TestRunner(IConfiguration configuration, ISuite suite, XmlTest test, boolean skipFailedInvocationCounts, Collection<IInvokedMethodListener> invokedMethodListeners, List<IClassListener> classListeners) { this.comparator = Systematiser.getComparator(); this.m_dataProviderListeners = Collections.emptyMap(); init(configuration, suite, test, suite.getOutputDirectory(), suite.getAnnotationFinder(), skipFailedInvocationCounts, invokedMethodListeners, classListeners); }
public TestRunner( IConfiguration configuration, ISuite suite, XmlTest test, boolean skipFailedInvocationCounts, Collection<IInvokedMethodListener> invokedMethodListeners, List<IClassListener> classListeners, Comparator<ITestNGMethod> comparator) { this.comparator = comparator; this.m_dataProviderListeners = Collections.emptyMap(); init( configuration, suite, test, suite.getOutputDirectory(), suite.getAnnotationFinder(), skipFailedInvocationCounts, invokedMethodListeners, classListeners); }
/** * This constructor is used by testng-remote, any changes related to it please contact with * testng-team. */ public TestRunner( IConfiguration configuration, ISuite suite, XmlTest test, boolean skipFailedInvocationCounts, Collection<IInvokedMethodListener> invokedMethodListeners, List<IClassListener> classListeners) { this.comparator = Systematiser.getComparator(); this.m_dataProviderListeners = Collections.emptyMap(); init( configuration, suite, test, suite.getOutputDirectory(), suite.getAnnotationFinder(), skipFailedInvocationCounts, invokedMethodListeners, classListeners); }
@Override public TestRunner newTestRunner(ISuite suite, XmlTest test, List<IInvokedMethodListener> listeners) { IConfiguration configuration = TestNG.getDefault().getConfiguration(); String outputDirectory = suite.getOutputDirectory(); IAnnotationFinder annotationFinder = configuration.getAnnotationFinder(); Boolean skipFailedInvocationCounts = suite.getXmlSuite().skipFailedInvocationCounts(); return new DruidTestRunner( configuration, suite, test, outputDirectory, annotationFinder, skipFailedInvocationCounts, listeners ); }
protected void generateFailureSuite(XmlSuite xmlSuite, ISuite suite, String outputDir) { XmlSuite failedSuite = xmlSuite.shallowCopy(); failedSuite.setName("Failed suite [" + xmlSuite.getName() + "]"); m_xmlSuite= failedSuite; Map<String, ISuiteResult> results = suite.getResults(); for(Map.Entry<String, ISuiteResult> entry : results.entrySet()) { ISuiteResult suiteResult = entry.getValue(); ITestContext testContext = suiteResult.getTestContext(); generateXmlTest(testContext.getCurrentXmlTest(), testContext, testContext.getFailedTests().getAllResults(), testContext.getSkippedTests().getAllResults()); } if(null != failedSuite.getTests() && failedSuite.getTests().size() > 0) { Utils.writeUtf8File(outputDir, TESTNG_FAILED_XML, failedSuite.toXml()); Utils.writeUtf8File(suite.getOutputDirectory(), TESTNG_FAILED_XML, failedSuite.toXml()); } }
protected void generateFailureSuite(XmlSuite xmlSuite, ISuite suite, String outputDir) { XmlSuite failedSuite = xmlSuite.shallowCopy(); failedSuite.setName("Failed suite [" + xmlSuite.getName() + "]"); m_xmlSuite = failedSuite; Map<String, ISuiteResult> results = suite.getResults(); for (Map.Entry<String, ISuiteResult> entry : results.entrySet()) { ISuiteResult suiteResult = entry.getValue(); ITestContext testContext = suiteResult.getTestContext(); generateXmlTest( testContext.getCurrentXmlTest(), testContext, testContext.getFailedTests().getAllResults(), testContext.getSkippedTests().getAllResults()); } if (null != failedSuite.getTests() && failedSuite.getTests().size() > 0) { Utils.writeUtf8File(outputDir, TESTNG_FAILED_XML, failedSuite.toXml()); Utils.writeUtf8File(suite.getOutputDirectory(), TESTNG_FAILED_XML, failedSuite.toXml()); } }
@Override public TestRunner newTestRunner(ISuite suite, XmlTest test, Collection<IInvokedMethodListener> listeners, List<IClassListener> classListeners, Map<Class<? extends IDataProviderListener>, IDataProviderListener> dataProviderListeners) { boolean skip = skipFailedInvocationCounts; if (! skip) { skip = test.skipFailedInvocationCounts(); } TestRunner testRunner = new TestRunner(configuration, suite, test, suite.getOutputDirectory(), suite.getAnnotationFinder(), skip, listeners, classListeners, comparator, dataProviderListeners); if (useDefaultListeners) { testRunner.addListener(new TestHTMLReporter()); testRunner.addListener(new JUnitXMLReporter()); //TODO: Moved these here because maven2 has output reporters running //already, the output from these causes directories to be created with //files. This is not the desired behaviour of running tests in maven2. //Don't know what to do about this though, are people relying on these //to be added even with defaultListeners set to false? testRunner.addListener(new TextReporter(testRunner.getName(), TestRunner.getVerbose())); } for (ITestListener itl : failureGenerators) { testRunner.addTestListener(itl); } for (IConfigurationListener cl : configuration.getConfigurationListeners()) { testRunner.addConfigurationListener(cl); } return testRunner; } }
suite, test, suite.getOutputDirectory(), suite.getAnnotationFinder(), skip,
@Override public String getOutputDirectory() { return suite.getOutputDirectory(); }
startRCServer(); setSuiteOutputDir(testContext.getSuite().getOutputDirectory());
Utils.writeUtf8File(suite.getOutputDirectory().replaceAll(".Surefire suite", ""), generateFileName(suite) + ".xml", document.toXML());
@Override public void onStart(ISuite suite) { logger.entering(suite); if (!ListenerManager.executeCurrentMethod(this)) { logger.exiting(ListenerManager.THREAD_EXCLUSION_MSG); return; } if (!bInitConfig) { bInitConfig = true; File outFile = new File(suite.getOutputDirectory()); outputDirectory = outFile.getParent() + File.separator + "RuntimeReporter"; logger.info("Runtime Report : " + outputDirectory + File.separator + "index.html"); RuntimeReportResourceManager resourceMgr = new RuntimeReportResourceManager(); resourceMgr.copyResources(outFile.getParent()); } logger.exiting(); }
@Override public TestRunner newTestRunner(ISuite suite, XmlTest test, List<IInvokedMethodListener> listeners) { IConfiguration configuration = TestNG.getDefault().getConfiguration(); String outputDirectory = suite.getOutputDirectory(); IAnnotationFinder annotationFinder = configuration.getAnnotationFinder(); Boolean skipFailedInvocationCounts = suite.getXmlSuite().skipFailedInvocationCounts(); return new DruidTestRunner( configuration, suite, test, outputDirectory, annotationFinder, skipFailedInvocationCounts, listeners ); }
String base = suite.getOutputDirectory(); String suiteName = suite.getName(); String rootFolder = filterOutputDirectory(base, suiteName);