|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.javatest.lib.MultiTest
public class MultiTest
Base class for tests with multiple sub test cases. This base class implements the standard com.sun.javatest.Test features so that you can provide the additional test cases without concern about the boilerplate needed to execute individual test case methods.
You must add individual test case methods to your derived test class to create a useful test class. Each test case method must take no arguments. If you need to pass an argument into a test method, you should design a wrapper test case to calculate the argument values and then call the test method with the correct arguments. The test case methods must implement this interface:
public Status methodName( )
Test
,
TestCases
Nested Class Summary | |
---|---|
static class |
MultiTest.SetupException
This exception is thrown when a problem occurs initializing the test. |
Field Summary | |
---|---|
protected java.io.PrintWriter |
log
Output to be logged to result file. |
protected java.io.PrintWriter |
ref
Output to be logged to result file. |
Constructor Summary | |
---|---|
MultiTest()
|
Method Summary | |
---|---|
protected void |
decodeAllArgs(java.lang.String[] args)
Parses the arguments passed to the test. |
protected int |
decodeArg(java.lang.String[] args,
int index)
Decode the next argument in the argument array. |
protected void |
init()
A setup method called after argument decoding is complete, and before the test cases are executed. |
protected Status |
init(java.lang.String[] args)
Deprecated. Use decodeArg(String) and init() instead. |
protected Status |
invokeTestCase(java.lang.reflect.Method m)
Default way to invoke a specified test case. |
Status |
run(java.lang.String[] argv,
java.io.PrintStream log,
java.io.PrintStream ref)
Run the test cases contained in this object This method is a convenience wrapper around the primary run method which takes PrintWriters: this variant takes PrintStreams and wraps them into PrintWriters. |
Status |
run(java.lang.String[] args,
java.io.PrintWriter log,
java.io.PrintWriter ref)
Run the test cases contained in this object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.io.PrintWriter ref
protected java.io.PrintWriter log
Constructor Detail |
---|
public MultiTest()
Method Detail |
---|
public Status run(java.lang.String[] args, java.io.PrintWriter log, java.io.PrintWriter ref)
run
in interface Test
args
- Execute arguments passed in from either the
command line or the execution harness.log
- Output stream for general messages from the tests.ref
- Output stream for reference output from the tests.
decodeAllArgs(java.lang.String[])
,
init(java.lang.String[])
public final Status run(java.lang.String[] argv, java.io.PrintStream log, java.io.PrintStream ref)
argv
- Execute arguments passed in from either the
command line or the execution harness.log
- Output stream for general messages from the tests.ref
- Output stream for reference output from the tests.
decodeAllArgs(java.lang.String[])
,
init(java.lang.String[])
protected Status init(java.lang.String[] args)
decodeArg(String)
and init()
instead.
decodeAllArgs
, and then init()
will be called.
args
- The arguments for the test, passed to decodeArgs
.
decodeAllArgs(java.lang.String[])
,
decodeArg(java.lang.String[], int)
,
init()
protected void init() throws MultiTest.SetupException
MultiTest.SetupException
- if processing should not continue.
This may be due to some inconsistency in the arguments,
or if it is determined the test should not execute for
some reason.protected final void decodeAllArgs(java.lang.String[] args) throws MultiTest.SetupException
decodeArg
for successive arguments in the
argument array.
args
- arguments passed to the test.
MultiTest.SetupException
- raised when an invalid parameter is passed,
or another error occurred.decodeArg(java.lang.String[], int)
protected int decodeArg(java.lang.String[] args, int index) throws MultiTest.SetupException
super.decodeArg(args, index)
to give supertypes a change
to decode the argument as well.
args
- The array containing all the argumentsindex
- The position of the next argument to be decoded.
MultiTest.SetupException
- is there is a problem decoding the
argument.protected Status invokeTestCase(java.lang.reflect.Method m) throws java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException
m
- The method to be invoked.
java.lang.IllegalAccessException
- if there was a problem accessing the specified method
java.lang.reflect.InvocationTargetException
- if the specified method threw an exception when
it was invoked.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |