Package com.sun.ts.lib.harness
Class EETest
java.lang.Object
com.sun.ts.lib.harness.EETest
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
BaseUrlClient
,Client
,secformClient
,ServiceEETest
This abstract class must be extended by all clients of all J2EE-TS tests. All implementations of this class must
define a setup, cleanup, and runtest(method names of runtest methods must match the 'testname' tag. EETest uses
reflection to invoke these methods which in turn, run the test(s) to completion. Tests are assumed to pass, unless a
Fault is thrown.
- Author:
- Kyle Grucci
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
This exception must be thrown by all implentations of EETest to signify a test failure.static class
This exception is used only by EETest. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected PrintStream
protected int
protected PrintStream
protected String
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Status
getPropsReady
(String[] argv, Properties p) protected Properties
getTestPropsFromArgs
(String[] argv) protected Properties
initializeProperties
(String sPropertiesFile) void
prints a string to the TestUtil error stream.void
prints a string to the TestUtil error stream.void
prints a string to the TestUtil log stream.void
prints a debug string to the TestUtil log stream.void
run
(String[] argv, PrintStream log, PrintStream err) This method is only called when test are run outside of JavaTest.run
(String[] argv, PrintWriter log, PrintWriter err) This method is only called when tests are run outside of JavaTest or if the test is being run in the same VM as the harness.run
(String[] argv, Properties p) This run method is the one that actually invokes reflection to figure out and invoke the testcase methods.run
(String[] argv, Properties p, PrintWriter log, PrintWriter err) This method is only called from JavaTest to run a single testcase.protected Status
runAllTestCases
(String[] argv, Properties p, PrintWriter log, PrintWriter err) protected void
setTestStatus
(Status s, Throwable t)
-
Field Details
-
log
-
err
-
sTestCase
-
iLogDelaySeconds
protected int iLogDelaySeconds
-
-
Constructor Details
-
EETest
public EETest()
-
-
Method Details
-
getTestPropsFromArgs
-
initializeProperties
-
run
This method is only called when test are run outside of JavaTest. If a testcase name is passed within argv, then that testcase is run. Otherwise, all testcases within this implementation of EETest are run.- Parameters:
argv
- an array of arguments that a test may uselog
- Stream passed to TestUtil for standard logginerr
- Writer passed to TestUtil for error logging- Returns:
- a Javatest
Status
object (passed or failed)
-
run
This method is only called when tests are run outside of JavaTest or if the test is being run in the same VM as the harness. If a testcase name is passed within argv, then that testcase is run. Otherwise, all testcases within this implementation of EETest are run.- Parameters:
argv
- an array of arguments that a test may uselog
- Writer passed to TestUtil for standard logginerr
- Writer passed to TestUtil for error logging- Returns:
- a Javatest
Status
object (passed or failed)
-
setTestStatus
-
runAllTestCases
-
run
This method is only called from JavaTest to run a single testcase. All properties are determined from the source code tags.- Parameters:
argv
- an array of arguments that a test may usep
- properties that are used by the testcaselog
- stream passed to TestUtil for standard loggingerr
- stream passed to TestUtil for error logging- Returns:
- a Javatest Status object (passed or failed)
-
getPropsReady
-
run
This run method is the one that actually invokes reflection to figure out and invoke the testcase methods.- Parameters:
argv
- an array of arguments that a test may usep
- properties that are used by the testcase- Returns:
- a Javatest Status object (passed or failed)
-
logMsg
prints a string to the TestUtil log stream. All tests should use this method for standard logging messages- Parameters:
msg
- string to print to the log stream
-
logTrace
prints a debug string to the TestUtil log stream. All tests should use this method for verbose logging messages. Whether or not the string is printed is determined by the last call to the TestUtil setTrace method.- Parameters:
msg
- string to print to the log stream
-
logTrace
-
logErr
prints a string to the TestUtil error stream. All tests should use this method for error messages- Parameters:
msg
- string to print to the error stream
-
logErr
prints a string to the TestUtil error stream. All tests should use this method for error messages- Parameters:
msg
- string to print to the error streame
- a Throwable whose stacktrace gets printed
-