public class MultiTest extends java.lang.Object implements Test
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( )
Modifier and Type | Class and Description |
---|---|
static class |
MultiTest.SetupException
This exception is thrown when a problem occurs initializing the test.
|
Modifier and Type | Field and Description |
---|---|
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 and Description |
---|
MultiTest() |
Modifier and Type | Method and Description |
---|---|
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.
|
protected java.io.PrintWriter ref
protected java.io.PrintWriter log
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 methodjava.lang.reflect.InvocationTargetException
- if the specified method threw an exception when
it was invoked.Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved.