Package org.testng

Class SuiteRunner

    • Constructor Detail

      • SuiteRunner

        public SuiteRunner​(org.testng.internal.IConfiguration configuration,
                           XmlSuite suite,
                           java.lang.String outputDir,
                           ITestRunnerFactory runnerFactory,
                           java.util.Comparator<ITestNGMethod> comparator)
      • SuiteRunner

        public SuiteRunner​(org.testng.internal.IConfiguration configuration,
                           XmlSuite suite,
                           java.lang.String outputDir,
                           ITestRunnerFactory runnerFactory,
                           boolean useDefaultListeners,
                           java.util.Comparator<ITestNGMethod> comparator)
    • Method Detail

      • getXmlSuite

        public XmlSuite getXmlSuite()
        Specified by:
        getXmlSuite in interface ISuite
        Returns:
        The representation of the current XML suite file.
      • getName

        public java.lang.String getName()
        Specified by:
        getName in interface ISuite
        Returns:
        the name of this suite.
      • setReportResults

        public void setReportResults​(boolean reportResults)
      • getParallel

        public java.lang.String getParallel()
        Specified by:
        getParallel in interface ISuite
        Returns:
        true if the tests must be run in parallel.
      • getParentModule

        public java.lang.String getParentModule()
        Specified by:
        getParentModule in interface ISuite
      • getGuiceStage

        public java.lang.String getGuiceStage()
        Specified by:
        getGuiceStage in interface ISuite
      • getParentInjector

        public com.google.inject.Injector getParentInjector()
        Specified by:
        getParentInjector in interface ISuite
      • setParentInjector

        public void setParentInjector​(com.google.inject.Injector injector)
        Specified by:
        setParentInjector in interface ISuite
      • run

        public void run()
        Description copied from interface: ISuite
        Triggers the start of running tests included in the suite.
        Specified by:
        run in interface ISuite
      • getReporters

        public java.util.List<IReporter> getReporters()
      • getDataProviderListeners

        public java.util.Collection<IDataProviderListener> getDataProviderListeners()
      • addListener

        protected void addListener​(ISuiteListener reporter)
        Parameters:
        reporter - The ISuiteListener interested in reporting the result of the current suite.
      • getOutputDirectory

        public java.lang.String getOutputDirectory()
        Specified by:
        getOutputDirectory in interface ISuite
        Returns:
        The output directory used for the reports.
      • getResults

        public java.util.Map<java.lang.String,​ISuiteResult> getResults()
        Specified by:
        getResults in interface ISuite
        Returns:
        The results for this suite.
      • getParameter

        public java.lang.String getParameter​(java.lang.String parameterName)
        FIXME: should be removed?
        Specified by:
        getParameter in interface ISuite
        Parameters:
        parameterName - The name of the parameter
        Returns:
        The value of this parameter, or null if none was specified.
        See Also:
        ISuite.getParameter(java.lang.String)
      • getMethodsByGroups

        public java.util.Map<java.lang.String,​java.util.Collection<ITestNGMethod>> getMethodsByGroups()
        Description copied from interface: ISuite
        Retrieves the map of groups and their associated test methods.
        Specified by:
        getMethodsByGroups in interface ISuite
        Returns:
        A map where the key is the group and the value is a list of methods used by this group.
        See Also:
        ISuite.getMethodsByGroups()
      • getAnnotationFinder

        public org.testng.internal.annotations.IAnnotationFinder getAnnotationFinder()
        Returns the annotation finder for the given annotation type.
        Specified by:
        getAnnotationFinder in interface ISuite
        Returns:
        the annotation finder for the given annotation type.
      • setHost

        public void setHost​(java.lang.String host)
      • getHost

        public java.lang.String getHost()
        Specified by:
        getHost in interface ISuite
        Returns:
        The host where this suite was run, or null if it was run locally. The returned string has the form: host:port
      • setSkipFailedInvocationCounts

        public void setSkipFailedInvocationCounts​(java.lang.Boolean skipFailedInvocationCounts)
      • getAttribute

        public java.lang.Object getAttribute​(java.lang.String name)
        Specified by:
        getAttribute in interface IAttributes
        Parameters:
        name - The name of the attribute to return
        Returns:
        The attribute
      • setAttribute

        public void setAttribute​(java.lang.String name,
                                 java.lang.Object value)
        Description copied from interface: IAttributes
        Set a custom attribute.
        Specified by:
        setAttribute in interface IAttributes
        Parameters:
        name - The attribute name
        value - The attribute value
      • getAttributeNames

        public java.util.Set<java.lang.String> getAttributeNames()
        Specified by:
        getAttributeNames in interface IAttributes
        Returns:
        all the attributes names.
      • removeAttribute

        public java.lang.Object removeAttribute​(java.lang.String name)
        Description copied from interface: IAttributes
        Remove the attribute
        Specified by:
        removeAttribute in interface IAttributes
        Parameters:
        name - The attribute name
        Returns:
        the attribute value if found, null otherwise
      • getAllInvokedMethods

        public java.util.List<IInvokedMethod> getAllInvokedMethods()
        Specified by:
        getAllInvokedMethods in interface ISuite
        Returns:
        a list of all the methods that were invoked in this suite.
      • getAllMethods

        public java.util.List<ITestNGMethod> getAllMethods()
        Specified by:
        getAllMethods in interface ISuite
        Returns:
        the total number of methods found in this suite. The presence of factories or data providers might cause the actual number of test methods run be bigger than this list.