public abstract class TestRunListener extends Object
JUnitCore.addTestRunListener(TestRunListener)
or as a contribution to the org.eclipse.jdt.junit.testRunListeners
extension point.
The latter approach has the advantage that the contributing plug-in is automatically loaded when a test run starts.
A test run starts with the call to sessionLaunched(ITestRunSession)
and
sessionStarted(ITestRunSession)
, followed by calls to
testCaseStarted(ITestCaseElement)
and testCaseFinished(ITestCaseElement)
for all test cases contained in the tree.
A test run session is ended with the call to sessionFinished(ITestRunSession)
. After that
call, no references must be kept to the session or any of the test cases or suites.
Constructor and Description |
---|
TestRunListener() |
Modifier and Type | Method and Description |
---|---|
void |
sessionFinished(ITestRunSession session)
A test run session has finished.
|
void |
sessionLaunched(ITestRunSession session)
A test run session has been launched.
|
void |
sessionStarted(ITestRunSession session)
A test run session has started.
|
void |
testCaseFinished(ITestCaseElement testCaseElement)
A test case has ended.
|
void |
testCaseStarted(ITestCaseElement testCaseElement)
A test case has started.
|
public void sessionLaunched(ITestRunSession session)
Important: The implementor of this method must not keep a reference to the session element
after sessionFinished(ITestRunSession)
has finished.
session
- the session that has just been launchedpublic void sessionStarted(ITestRunSession session)
Important: The implementor of this method must not keep a reference to the session element
after sessionFinished(ITestRunSession)
has finished.
session
- the session that has just started.public void sessionFinished(ITestRunSession session)
Important: The implementor of this method must not keep the session element when the method is finished.
session
- the testpublic void testCaseStarted(ITestCaseElement testCaseElement)
Important: The implementor of this method must not keep a reference to the test case element
after sessionFinished(ITestRunSession)
has finished.
testCaseElement
- the test that has started to runpublic void testCaseFinished(ITestCaseElement testCaseElement)
Important: The implementor of this method must not keep a reference to the test case element
after sessionFinished(ITestRunSession)
has finished.
testCaseElement
- the test that has finished running
Copyright (c) 2000, 2015 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.