org.testng
Class SuiteRunner

java.lang.Object  extended by org.testng.SuiteRunner
All Implemented Interfaces:
Serializable, IAttributes, IInvokedMethodListener, ISuite, ITestNGListener

public class SuiteRunner
extends Object
implements ISuite, Serializable, IInvokedMethodListener

SuiteRunner is responsible for running all the tests included in one suite. The test start is triggered by run() method.

Author:
Cedric Beust, Apr 26, 2004
See Also:
Serialized Form


Constructor Summary
 SuiteRunner(org.testng.internal.IConfiguration configuration, XmlSuite suite, String outputDir)
           
 SuiteRunner(org.testng.internal.IConfiguration configuration, XmlSuite suite, String outputDir, ITestRunnerFactory runnerFactory)
           
 SuiteRunner(org.testng.internal.IConfiguration configuration, XmlSuite suite, String outputDir, ITestRunnerFactory runnerFactory, boolean useDefaultListeners)
           
protected SuiteRunner(org.testng.internal.IConfiguration configuration, XmlSuite suite, String outputDir, ITestRunnerFactory runnerFactory, boolean useDefaultListeners, IMethodInterceptor methodInterceptor, List<IInvokedMethodListener> invokedMethodListeners, List<ITestListener> testListeners)
           
 
Method Summary
protected  voidaddListener(ISuiteListener reporter)
          Registers ISuiteListeners interested in reporting the result of the current suite.
 voidaddListener(ITestNGListener listener)
           
 voidafterInvocation(IInvokedMethod method, ITestResult testResult)
           
 voidbeforeInvocation(IInvokedMethod method, ITestResult testResult)
           
 List<IInvokedMethod>getAllInvokedMethods()
           
 List<ITestNGMethod>getAllMethods()
           
 org.testng.internal.annotations.IAnnotationFindergetAnnotationFinder()
          Returns the annotation finder for the given annotation type.
 ObjectgetAttribute(String name)
           
 Set<String>getAttributeNames()
           
 Collection<ITestNGMethod>getExcludedMethods()
           
 StringgetHost()
           
 Collection<ITestNGMethod>getInvokedMethods()
          Retrieves the list of all the methods that were invoked during this run.
 Map<String,Collection<ITestNGMethod>>getMethodsByGroups()
          Retrieves the map of groups and their associated test methods.
 StringgetName()
           
 IObjectFactorygetObjectFactory()
           
 IObjectFactory2getObjectFactory2()
           
 StringgetOutputDirectory()
           
 StringgetParallel()
           
 StringgetParameter(String parameterName)
          FIXME: should be removed?
 List<IReporter>getReporters()
           
 Map<String,ISuiteResult>getResults()
           
 SuiteRunStategetSuiteState()
          Retrieves the shared state for a suite.
 XmlSuitegetXmlSuite()
           
static voidppp(String s)
           
 ObjectremoveAttribute(String name)
          Remove the attribute
 voidrun()
          Triggers the start of running tests included in the suite.
 voidsetAttribute(String name, Object value)
          Set a custom attribute.
 voidsetHost(String host)
           
 voidsetObjectFactory(ITestObjectFactory objectFactory)
           
 voidsetReportResults(boolean reportResults)
           
 voidsetSkipFailedInvocationCounts(Boolean skipFailedInvocationCounts)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SuiteRunner

public SuiteRunner(org.testng.internal.IConfiguration configuration,                   XmlSuite suite,                   String outputDir)

SuiteRunner

public SuiteRunner(org.testng.internal.IConfiguration configuration,                   XmlSuite suite,                   String outputDir,                   ITestRunnerFactory runnerFactory)

SuiteRunner

public SuiteRunner(org.testng.internal.IConfiguration configuration,                   XmlSuite suite,                   String outputDir,                   ITestRunnerFactory runnerFactory,                   boolean useDefaultListeners)

SuiteRunner

protected SuiteRunner(org.testng.internal.IConfiguration configuration,                      XmlSuite suite,                      String outputDir,                      ITestRunnerFactory runnerFactory,                      boolean useDefaultListeners,                      IMethodInterceptor methodInterceptor,                      List<IInvokedMethodListener> invokedMethodListeners,                      List<ITestListener> testListeners)
Method Detail

getXmlSuite

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

getName

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

setObjectFactory

public void setObjectFactory(ITestObjectFactory objectFactory)

setReportResults

public void setReportResults(boolean reportResults)

getParallel

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

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 List<IReporter> getReporters()

addListener

protected void addListener(ISuiteListener reporter)
Registers ISuiteListeners interested in reporting the result of the current suite.

Parameters:
reporter -

addListener

public void addListener(ITestNGListener listener)
Specified by:
addListener in interface ISuite

getOutputDirectory

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

getResults

public Map<String,ISuiteResult> getResults()
Specified by:
getResults in interface ISuite
Returns:
The results for this suite.

getParameter

public String getParameter(String parameterName)
FIXME: should be removed?

Specified by:
getParameter in interface ISuite
Returns:
The value of this parameter, or null if none was specified.
See Also:
ISuite.getParameter(java.lang.String)

getMethodsByGroups

public Map<String,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()

getInvokedMethods

public Collection<ITestNGMethod> getInvokedMethods()
Description copied from interface: ISuite
Retrieves the list of all the methods that were invoked during this run.

Specified by:
getInvokedMethods in interface ISuite
Returns:
a collection of ITestNGMethods belonging to all tests included in the suite.
See Also:
ISuite.getInvokedMethods()

getExcludedMethods

public Collection<ITestNGMethod> getExcludedMethods()
Specified by:
getExcludedMethods in interface ISuite
Returns:
All the methods that were not included in this test run.
See Also:
ISuite.getExcludedMethods()

getObjectFactory

public IObjectFactory getObjectFactory()
Specified by:
getObjectFactory in interface ISuite
Returns:
The object factory used to create all test instances.

getObjectFactory2

public IObjectFactory2 getObjectFactory2()
Specified by:
getObjectFactory2 in interface ISuite

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.

ppp

public static void ppp(String s)

setHost

public void setHost(String host)

getHost

public 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

getSuiteState

public SuiteRunState getSuiteState()
Description copied from interface: ISuite
Retrieves the shared state for a suite.

Specified by:
getSuiteState in interface ISuite
Returns:
the share state of the current suite.
See Also:
ISuite.getSuiteState()

setSkipFailedInvocationCounts

public void setSkipFailedInvocationCounts(Boolean skipFailedInvocationCounts)

getAttribute

public Object getAttribute(String name)
Specified by:
getAttribute in interface IAttributes
Parameters:
name - The name of the attribute to return

setAttribute

public void setAttribute(String name,                         Object value)
Description copied from interface: IAttributes
Set a custom attribute.

Specified by:
setAttribute in interface IAttributes

getAttributeNames

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

removeAttribute

public Object removeAttribute(String name)
Description copied from interface: IAttributes
Remove the attribute

Specified by:
removeAttribute in interface IAttributes
Returns:
the attribute value if found, null otherwise

afterInvocation

public void afterInvocation(IInvokedMethod method,                            ITestResult testResult)
Specified by:
afterInvocation in interface IInvokedMethodListener

beforeInvocation

public void beforeInvocation(IInvokedMethod method,                             ITestResult testResult)
Specified by:
beforeInvocation in interface IInvokedMethodListener

getAllInvokedMethods

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

getAllMethods

public 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.


Copyright © 2012. All Rights Reserved.


NOTHING
NOTHING
Add the Maven Dependecy to your project: maven dependecy for com.amazonaws : aws-java-sdk : 1.3.14