org.testng
Class TestNGCommandLineArgs

java.lang.Object
  extended by org.testng.TestNGCommandLineArgs

public final class TestNGCommandLineArgs
extends Object

TestNG/RemoteTestNG command line arguments parser.

Author:
Cedric Beust, Alexandru Popescu

Field Summary
static String ANNOTATIONS_COMMAND_OPT
          The default annotations option (useful in TestNG 15 only).
static String CONFIG_FAILURE_POLICY
           
static String DATA_PROVIDER_THREAD_COUNT
           
static String EXCLUDED_GROUPS_COMMAND_OPT
           
static String GROUPS_COMMAND_OPT
           
static String HOST_COMMAND_OPT
           
static String JUNIT_DEF_OPT
           
static String LISTENER_COMMAND_OPT
           
static String LOG
          The logging level option.
static String MASTER_OPT
           
static String METHOD_SELECTOR_OPT
          Value is a Map
static String OBJECT_FACTORY_COMMAND_OPT
           
static String OUTDIR_COMMAND_OPT
          The test report output directory option.
static String PARALLEL_MODE
           
static String PORT_COMMAND_OPT
           
static String REPORTER
          Used to pass a reporter configuration in the form -reporter :option=value[,option=value]
static String REPORTERS_LIST
          Used as map key for the complete list of report listeners provided with the above argument
static String SHOW_TESTNG_STACK_FRAMES
           
static String SKIP_FAILED_INVOCATION_COUNT_OPT
           
static String SLAVE_OPT
           
static String SRC_COMMAND_OPT
          The source directory option (when using JavaDoc type annotations).
static String SUITE_DEF_OPT
           
static String SUITE_NAME_OPT
           
static String TARGET_COMMAND_OPT
          Deprecated. replaced by DEFAULT_ANNOTATIONS_COMMAND_OPT.
static String TEST_CLASSPATH
           
static String TEST_NAME_OPT
           
static String TEST_NAMES_COMMAND_OPT
          List of test names
static String TESTCLASS_COMMAND_OPT
          The list of test classes option.
static String TESTJAR_COMMAND_OPT
           
static String TESTRUNNER_FACTORY_COMMAND_OPT
           
static String THREAD_COUNT
           
static String USE_DEFAULT_LISTENERS
           
 
Method Summary
static Map parseCommandLine(String[] originalArgv)
          Parses the command line options and returns a map from option string to parsed values.
static List<String> readFile(String fileName)
          Reads the file specified by filename and returns the file content as a string.
static void usage()
          Prints the usage message to System.out.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SHOW_TESTNG_STACK_FRAMES

public static final String SHOW_TESTNG_STACK_FRAMES
See Also:
Constant Field Values

TEST_CLASSPATH

public static final String TEST_CLASSPATH
See Also:
Constant Field Values

PORT_COMMAND_OPT

public static final String PORT_COMMAND_OPT
See Also:
Constant Field Values

HOST_COMMAND_OPT

public static final String HOST_COMMAND_OPT
See Also:
Constant Field Values

LOG

public static final String LOG
The logging level option.

See Also:
Constant Field Values

TARGET_COMMAND_OPT

public static final String TARGET_COMMAND_OPT
Deprecated. replaced by DEFAULT_ANNOTATIONS_COMMAND_OPT.
See Also:
Constant Field Values

ANNOTATIONS_COMMAND_OPT

public static final String ANNOTATIONS_COMMAND_OPT
The default annotations option (useful in TestNG 15 only).

See Also:
Constant Field Values

OUTDIR_COMMAND_OPT

public static final String OUTDIR_COMMAND_OPT
The test report output directory option.

See Also:
Constant Field Values

EXCLUDED_GROUPS_COMMAND_OPT

public static final String EXCLUDED_GROUPS_COMMAND_OPT
See Also:
Constant Field Values

GROUPS_COMMAND_OPT

public static final String GROUPS_COMMAND_OPT
See Also:
Constant Field Values

JUNIT_DEF_OPT

public static final String JUNIT_DEF_OPT
See Also:
Constant Field Values

LISTENER_COMMAND_OPT

public static final String LISTENER_COMMAND_OPT
See Also:
Constant Field Values

METHOD_SELECTOR_OPT

public static final String METHOD_SELECTOR_OPT
Value is a Map

See Also:
Constant Field Values

MASTER_OPT

public static final String MASTER_OPT
See Also:
Constant Field Values

OBJECT_FACTORY_COMMAND_OPT

public static final String OBJECT_FACTORY_COMMAND_OPT
See Also:
Constant Field Values

REPORTER

public static final String REPORTER
Used to pass a reporter configuration in the form -reporter :option=value[,option=value]

See Also:
Constant Field Values

REPORTERS_LIST

public static final String REPORTERS_LIST
Used as map key for the complete list of report listeners provided with the above argument

See Also:
Constant Field Values

PARALLEL_MODE

public static final String PARALLEL_MODE
See Also:
Constant Field Values

SKIP_FAILED_INVOCATION_COUNT_OPT

public static final String SKIP_FAILED_INVOCATION_COUNT_OPT
See Also:
Constant Field Values

SLAVE_OPT

public static final String SLAVE_OPT
See Also:
Constant Field Values

SRC_COMMAND_OPT

public static final String SRC_COMMAND_OPT
The source directory option (when using JavaDoc type annotations).

See Also:
Constant Field Values

SUITE_NAME_OPT

public static final String SUITE_NAME_OPT
See Also:
Constant Field Values

TESTCLASS_COMMAND_OPT

public static final String TESTCLASS_COMMAND_OPT
The list of test classes option.

See Also:
Constant Field Values

TEST_NAMES_COMMAND_OPT

public static final String TEST_NAMES_COMMAND_OPT
List of test names

See Also:
Constant Field Values

TESTJAR_COMMAND_OPT

public static final String TESTJAR_COMMAND_OPT
See Also:
Constant Field Values

TEST_NAME_OPT

public static final String TEST_NAME_OPT
See Also:
Constant Field Values

TESTRUNNER_FACTORY_COMMAND_OPT

public static final String TESTRUNNER_FACTORY_COMMAND_OPT
See Also:
Constant Field Values

THREAD_COUNT

public static final String THREAD_COUNT
See Also:
Constant Field Values

DATA_PROVIDER_THREAD_COUNT

public static final String DATA_PROVIDER_THREAD_COUNT
See Also:
Constant Field Values

USE_DEFAULT_LISTENERS

public static final String USE_DEFAULT_LISTENERS
See Also:
Constant Field Values

SUITE_DEF_OPT

public static final String SUITE_DEF_OPT
See Also:
Constant Field Values

CONFIG_FAILURE_POLICY

public static final String CONFIG_FAILURE_POLICY
See Also:
Constant Field Values
Method Detail

parseCommandLine

public static Map parseCommandLine(String[] originalArgv)
Parses the command line options and returns a map from option string to parsed values. For example, if argv contains {..., "-sourcedir", "src/main", "-target", ...} then the map would contain an entry in which the key would be the "-sourcedir" String and the value would be the "src/main" String.

Parameters:
originalArgv - the command line options.
Returns:
the parsed parameters as a map from option string to parsed values.

readFile

public static List<String> readFile(String fileName)
Reads the file specified by filename and returns the file content as a string. End of lines are replaced by a space

Parameters:
fileName - the command line filename
Returns:
the file content as a string.

usage

public static void usage()
Prints the usage message to System.out. This message describes all the command line options.



Copyright © 2010. All Rights Reserved.