Package com.sun.javatest
Interface Harness.Observer
-
- Enclosing class:
- Harness
public static interface Harness.Observer
This interface provides a means for Harness to report on events that might be of interest as it executes.
-
-
Method Summary
All Methods Instance Methods Default Methods Deprecated Methods Modifier and Type Method Description default void
error(java.lang.String msg)
The given error occurred.default void
finishedTest(TestResult tr)
The harness has finished running the given test.default void
finishedTesting()
Deprecated.it is recommended to overridefinishedTesting(TestResultTable.TreeIterator)
insteaddefault void
finishedTesting(TestResultTable.TreeIterator treeIterator)
An enhanced new version offinishedTesting
method that allows to evaluate givenTestResultTable.TreeIterator
instance and get any extra info about the finished test run.default void
finishedTestRun(boolean allOK)
The test run has been completed, either because the user requested that the harness stop, the harness decided to terminate the test run, or all requested tests have been run.default void
notifyOfTheFinalStats(java.util.Map<TestFilter,java.util.List<TestDescription>> filterStats, int... stats)
Is called when final test run stats are available for evaluation.default void
startingTest(TestResult tr)
The harness is about to run the given test.default void
startingTestRun(Parameters params)
The harness is beginning to execute tests.default void
stoppingTestRun()
The harness is about to stop a test run, before it has finished executing all the specified tests.
-
-
-
Method Detail
-
startingTestRun
default void startingTestRun(Parameters params)
The harness is beginning to execute tests. Default implementation does nothing.- Parameters:
params
- the parameters for the test run
-
startingTest
default void startingTest(TestResult tr)
The harness is about to run the given test. Default implementation does nothing.- Parameters:
tr
- The test result which is going to receive the data from the current execution of that test.
-
finishedTest
default void finishedTest(TestResult tr)
The harness has finished running the given test. This message is sent without respect to the resulting test's completion status (pass, fail, etc...). Default implementation does nothing.- Parameters:
tr
- The result object containing the results from the execution which was just completed.
-
stoppingTestRun
default void stoppingTestRun()
The harness is about to stop a test run, before it has finished executing all the specified tests. The method is not notified if the test run completes normally, after executing all the specified tests. Default implementation does nothing.
-
finishedTesting
default void finishedTesting()
Deprecated.it is recommended to overridefinishedTesting(TestResultTable.TreeIterator)
insteadThe harness has finished running tests and is doing other activities (writing the report, updating caches, etc...). This message will be broadcast both when error conditions terminate the run or when a test completes normally. It may provide a reasonable opportunity for a client to clean up any resources that were used during the test run, before a new run is started. Default implementation does nothing.
-
finishedTesting
default void finishedTesting(TestResultTable.TreeIterator treeIterator)
An enhanced new version offinishedTesting
method that allows to evaluate givenTestResultTable.TreeIterator
instance and get any extra info about the finished test run. Both versions of this method would be called after test run is finished. Default implementation does nothing.
-
finishedTestRun
default void finishedTestRun(boolean allOK)
The test run has been completed, either because the user requested that the harness stop, the harness decided to terminate the test run, or all requested tests have been run. The harness is now ready to perform another test run. Note that since the actions of other observers are undefined, a new test run may have already been started by the time this method is called for any specific observer. Default implementation does nothing.- Parameters:
allOK
- True if all tests passed, false otherwise.
-
error
default void error(java.lang.String msg)
The given error occurred. Default implementation does nothing.- Parameters:
msg
- A description of the error event.
-
notifyOfTheFinalStats
default void notifyOfTheFinalStats(java.util.Map<TestFilter,java.util.List<TestDescription>> filterStats, int... stats)
Is called when final test run stats are available for evaluation.- Parameters:
filterStats
- the final statistics about happened test filteringstats
- status type is the number of element, value is the number or tests with that type of status
-
-