The command line parameters are:
outputdir: specify the output directory
class_name: specifies one or several class names
jar_name: specifies the jar containing the tests
src1;src2: ; separated list of source directories (used only when
javadoc annotations are used)
Please consult documentation for more details.
FIXME: should support more than simple paths for suite xmls
usage()
| Modifier and Type | Field and Description |
|---|---|
| public static final String | DEFAULT_COMMAND_LINE_SUITE_NAME
The default name for a suite launched from the command line |
| public static final String | DEFAULT_COMMAND_LINE_TEST_NAME
The default name for a test launched from the command line |
| private static final ITestObjectFactory | |
| public static final String | DEFAULT_OUTPUTDIR
The default name of the result's output directory (keep public, used by Eclipse). |
| private static final String | |
| public static final Integer | |
| private ExitCode | |
| private final ExitCodeListener | |
| private boolean | |
| private static final Logger | LOGGER
This class' log4testng Logger. |
| private final Map | |
| private boolean | |
| private IAnnotationTransformer | |
| private final Map | |
| private List | |
| private List | |
| private Class | |
| private XmlSuite. | |
| private IConfigurable | |
| private IConfiguration | |
| private final Map | |
| private final Map | |
| private Integer | |
| private final IAnnotationTransformer | |
| private String | |
| private String | |
| protected long | |
| private String[] | |
| private final Map | |
| private boolean | |
| private boolean | |
| private Boolean | |
| private IHookable | |
| private boolean | |
| private String[] | |
| private static TestNG | |
| private final Map | |
| private boolean | |
| private String | |
| private static JCommander | |
| private final List | |
| private final Map | |
| private final List | |
| private ITestObjectFactory | |
| private String | |
| private XmlSuite. | |
| private Boolean | |
| private boolean | |
| private final Map | |
| private final Set | |
| private URLClassLoader | |
| private Boolean | |
| protected long | |
| private List | |
| private final Map | |
| protected List | |
| private Integer | |
| private final Map | |
| private List | m_testNames
The list of test names to run from the given suite |
| private ITestRunnerFactory | |
| private int | |
| protected boolean | |
| private Integer | m_verbose
If m_verbose gets set, it will override the verbose setting in testng.xml |
| private String | m_xmlPathInJar
The path of the testng.xml file inside the jar file |
| private final Map |
| Access | Constructor and Description |
|---|---|
| public | |
| public | TestNG(boolean
Whether or not any default reports should be added to tests. useDefaultListeners)Used by maven2 to have 0 output of any kind come out of testng. |
| Modifier and Type | Method and Description |
|---|---|
| public void | addClassLoader(final ClassLoader
The class loader to add loader)Add a class loader to the searchable loaders. |
| public void | |
| public void | |
| private void | |
| public void | |
| public void | |
| private void | |
| private void | |
| private void | |
| private void | |
| public void | |
| protected void | configure(CommandLineArgs
The command line parameters cla)Configure the TestNG instance based on the command line parameters. |
| public void | |
| private List | |
| private List | Returns: a list of XmlSuite objects that represent the list of classes and methods passed in parameter.a string with the form "com.example.Foo.f1,com.example.Bar.f2" commandLineMethods)
|
| private SuiteRunner | |
| private void | createSuiteRunners(SuiteRunnerMap
Map with XMLSuite as key and it's respective SuiteRunner as value. This
is updated as part of this method call suiteRunnerMap, XmlSuite Xml Suite (and its children) for which xmlSuite)SuiteRunners are createdCreates the |
| private static void | |
| pack-priv static void | |
| private void | |
| public IAnnotationTransformer | |
| public XmlSuite. | |
| protected IConfiguration | |
| public static TestNG | |
| public String | |
| public String | |
| protected long | |
| public ListenerComparator | |
| public String | |
| private OverrideProcessor | |
| public boolean | |
| public Set | |
| public List | |
| protected long | |
| public int | |
| public List | |
| public Integer | |
| public List | |
| private int | Returns: the verbose level, checking in order: the verbose level on the suite, the verbose level on the TestNG object, or 1.
|
| public boolean | |
| public boolean | Returns: true if at least one test failed within success percentage.
|
| public boolean | |
| private void | |
| private void | |
| private void | |
| private static void | initializeCommandLineSuitesGroups(XmlSuite s, boolean hasIncludedGroups, String[] m_includedGroups, boolean hasExcludedGroups, String[] m_excludedGroups)
|
| private void | |
| private void | |
| private void | |
| public void | |
| public void | |
| public boolean | |
| public boolean | |
| public static void | |
| private static <E> void | |
| private static <E> void | |
| private IReporter | |
| private static int | |
| private Collection | |
| private void | |
| private void | populateSuiteGraph(IDynamicGraph<ISuite>
dynamic graph representing the reverse hierarchy of SuiteRunners suiteGraph, SuiteRunnerMap Map with XMLSuite as key and its respective SuiteRunner as value suiteRunnerMap, XmlSuite XML Suite xmlSuite)Populates the dynamic graph with the reverse hierarchy of suites. |
| public static TestNG | Returns: The TestNG instanceThe param arguments argv, ITestListener The listener listener)Note this method is not part of the public API and is meant for internal usage only. |
| private Collection | |
| private void | |
| public void | |
| public void | |
| private void | |
| private void | |
| protected List | |
| public List | Returns: The locally run suitesThis needs to be public for maven2, for now..At least until an alternative mechanism is found. |
| private void | runSuitesSequentially(XmlSuite
XML Suite to be executed xmlSuite, SuiteRunnerMap Maps suiteRunnerMap, int XmlSuites to respective ISuiteverbose level verbose, String default suite name defaultSuiteName)Recursively runs suites. |
| private void | sanityCheck()
Before suites are executed, do a sanity check to ensure all required conditions are met. |
| private void | |
| public void | |
| public void | setConfigFailurePolicy(XmlSuite.
the configuration failure policy failurePolicySets the policy for whether or not to ever invoke a configuration method again after it has failed once. |
| private void | |
| public void | |
| public void | |
| public void | |
| public void | setExcludedGroups(String
A list of group names separated by a comma. groups)Define which groups will be excluded from this run. |
| public void | |
| public void | |
| public void | |
| public void | |
| private void | |
| private void | |
| public void | |
| public void | setListenerClasses(List<Class<? extends ITestNGListener>>
A list of classes, which must be either ISuiteListener, ITestListener or
IReporter classes)Define which listeners to user for this run. |
| public void | |
| public void | |
| public void | setListenersToSkipFromBeingWiredInViaServiceLoaders(String...
- An array of fully qualified class names that should be skipped from being
wired in via service loaders. listeners)
|
| public void | |
| public void | |
| public void | |
| public void | setOutputDirectory(final String
The directory. outputdir)Sets the output directory where the reports will be created. |
| public void | setParallel(String
Define whether this run will be run in parallel mode. parallel)
Deprecated
Use #setParallel(XmlSuite.ParallelMode) instead
|
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | setSourcePath(String
The path path)
Deprecated
This method is invoked by Maven's Surefire, only remove it once Surefire has been modified to
no longer call it.
|
| public void | |
| public void | setTestClasses(Class<T>[]
An array of classes that contain TestNG annotations. classes)Set the test classes to be run by this TestNG object. |
| public void | |
| public void | |
| protected void | |
| private void | |
| public void | setTestSuites(List<String>
A list of paths to one more XML files defining the tests. For example:
suites)
TestNG tng = new TestNG();
List<String> suites = Lists.newArrayList();
suites.add("c:/tests/testng1.xml");
suites.add("c:/tests/testng2.xml");
tng.setTestSuites(suites);
tng.run();
Set the suites file names to be run by this TestNG object. |
| public void | |
| public void | setUseDefaultListeners(boolean
If true before run(), the default listeners will not be used.
useDefaultListeners)
|
| public void | setVerbose(int
the verbosity level (0 to 10 where 10 is most detailed) Actually, this is a lie:
you can specify -1 and this will put TestNG in debug mode (no longer slicing off stack
traces and all). verbose)Sets the level of verbosity. |
| public void | |
| public void | setXmlSuites(List<XmlSuite>
- The list of suites)XmlSuite objects.Specifies the XmlSuite objects to run. |
| public void | |
| public void | |
| private String[] | splitMethod(String m)
Given a string com.example.Foo.f1, return an array where [0] is the class and [1] is the method. |
| public void | toggleFailureIfAllTestsWereSkipped(boolean
- Whether TestNG should enable/disable failing when all the tests
were skipped and nothing was run (Mostly when a test is powered by a data provider and when
the data provider itself fails causing all tests to skip). failIfAllTestsSkipped)
|
| private static void | |
| public boolean | |
| protected static void | validateCommandLineParameters(CommandLineArgs
The command line to check args)Double check that the command line parameters are valid. |