main
method of a specified test
runner class.
The test invoker will execute a test case by passing it to the specified main(String[])
method as an
argument. The called method may locate the test class by using the thread
context classloader (which is set by the BasicJavaTestingInvoker superclass).
The test invoker should be configured using the parameters specified with the PARAMETER_*
constants in
the class.
The actual arguments for the main
method call for a test case is constructed by taking the
"PrefixArguments"
, <test-case-class-name>
, and
"SuffixArguments"
parameters as values.
public static final String | PARAMETER_PREFIX_ARGUMENTS = "PrefixArguments" Parameter specifying a list of arguments that should be prepended before the test class name when the
main method is called. |
public static final String | PARAMETER_SUFFIX_ARGUMENTS = "SuffixArguments" Parameter specifying a list of arguments that should be appended after the test class name when the
main method is called. |
public static final String | PARAMETER_TEST_RUNNER_CLASS = "TestRunnerClass" Required parameter specifying the name of the test runner class. |
public | Creates a new testing invoker. |
protected final Method | Gets the test method. |
protected final Class< | Gets the class of the test runner. |
public void | initTestRunner( Initializes the test runner. |
protected void | runTest( Executes the test with the given parameters. |
From: BasicJavaTestingInvoker |
From: Object |
main
method is called.
The parameter should have a format of <param>[,<param>]*
. The intermediate commas
(,
) can be escaped using a backslash (\
).
main
method is called.
The parameter should have a format of <param>[,<param>]*
. The intermediate commas
(,
) can be escaped using a backslash (\
).
The class is loaded from the test runner class loader.
This method is called for each test case, and has a single parameter with the type of String[]
.
This class contains the test method.
This method is called first as part of the initialization.
The method should perform the operations that required in order to locate the test runner that will execute the tests. This can be done in an implementation dependent way.
In common implementations, the method will attempt to load a class that will be called with the test classes as
its input in the JavaTestingInvoker.invokeTest(
One example for this may be that is to find the entry point of the testing framework that contains a
main
method. That main
method is caleld for each test in
invokeTest.
this
testing invoker.The method should succeed if and only if the test case is considered successful, and throw InvocationTargetException if the test case failed.
You can load the test class with the name TestInvocationParameters.getTestClassName() from the BasicJavaTestingInvoker.getTestClassLoader().