public abstract class TestRunner
extends java.lang.Object
If a test suite does not wish tom use the default test runner,
it should provide its own implementation of this class. The primary
method which should be implemented is runTests(java.util.Iterator)
.
Constructor and Description |
---|
TestRunner() |
Modifier and Type | Method and Description |
---|---|
BackupPolicy |
getBackupPolicy()
Get the backup policy to be used when creating the test result files
generated by this test runner.
|
int |
getConcurrency()
Get the concurrency to be used when running the tests, if applicable.
|
TestEnvironment |
getEnvironment()
Get the test environment to be used to execute the tests that will
be run by this test runner.
|
java.lang.String[] |
getExcludedTestCases(TestDescription td)
Get the names of the test cases to be excluded when running a specific test.
|
ExcludeList |
getExcludeList()
Get the exclude list to be used to identify the test cases to be
excluded when running tests.
|
TestSuite |
getTestSuite()
Get the test suite containing the tests to be run by this test runner.
|
WorkDirectory |
getWorkDirectory()
Get the work directory to be used to store the test results generated
by this test runner.
|
protected void |
notifyFinishedTest(TestResult tr)
This method must be called when each test is finished, to notify any
registered observers.
|
protected void |
notifyStartingTest(TestResult tr)
This method must be called as each test is started, to notify any
registered observers.
|
protected abstract boolean |
runTests(java.util.Iterator testIter)
Run the tests obtained from an iterator.
|
public WorkDirectory getWorkDirectory()
public TestSuite getTestSuite()
public BackupPolicy getBackupPolicy()
TestResult.writeResults(WorkDirectory, BackupPolicy)
public TestEnvironment getEnvironment()
getEnvironment()
public ExcludeList getExcludeList()
getExcludedTestCases(com.sun.javatest.TestDescription)
public java.lang.String[] getExcludedTestCases(TestDescription td)
td
- the test for which the excluded test cases should be obtainedpublic int getConcurrency()
getConcurrency()
protected abstract boolean runTests(java.util.Iterator testIter) throws java.lang.InterruptedException
notifyStartingTest(com.sun.javatest.TestResult)
.
When the test completes (however it completes) the implementation of
this method must call notifyFinishedTest(com.sun.javatest.TestResult)
.testIter
- the iterator to be used to obtain the tests to be runjava.lang.InterruptedException
- if the test run was interruptedprotected void notifyStartingTest(TestResult tr)
tr
- the TestResult object for the test that has been startedHarness.Observer
protected void notifyFinishedTest(TestResult tr)
tr
- the TestResult object for the test that has been startedHarness.Observer
Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved.