Package org.eclipse.jdt.junit.model
Interface ITestElement
- All Known Subinterfaces:
ITestCaseElement
,ITestElementContainer
,ITestRunSession
,ITestSuiteElement
public interface ITestElement
Common protocol for test elements.
This set consists of
ITestCaseElement
, ITestSuiteElement
and ITestRunSession
This interface is not intended to be implemented by clients.
- Since:
- 3.3
- Restriction:
- This interface is not intended to be implemented by clients.
- Restriction:
- This interface is not intended to be extended by clients.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic final class
A failure trace of a test.static final class
Running states of a test.static final class
Result states of a test. -
Method Summary
Modifier and TypeMethodDescriptiondouble
Returns the estimated total time elapsed in seconds while executing this test element.Returns the failure trace of this test element ornull
if the test has not resulted in an error or failure.Returns the parent test element container ornull
if the test element is the test run session.Returns the progress state of this test element.getTestResult
(boolean includeChildren) Returns the result of the test element.Returns the test run session.
-
Method Details
-
getProgressState
ITestElement.ProgressState getProgressState()Returns the progress state of this test element.ITestElement.ProgressState.NOT_STARTED
: the test has not yet startedITestElement.ProgressState.RUNNING
: the test is currently runningITestElement.ProgressState.STOPPED
: the test has stopped before being completedITestElement.ProgressState.COMPLETED
: the test (and all its children) has completed
-
getTestResult
Returns the result of the test element.ITestElement.Result.UNDEFINED
: the result is not yet evaluatedITestElement.Result.OK
: the test has succeededITestElement.Result.ERROR
: the test has returned an errorITestElement.Result.FAILURE
: the test has returned an failureITestElement.Result.IGNORED
: the test has been ignored (skipped)
- Parameters:
includeChildren
- iftrue
, the returned result is the combined result of the test and its children (if it has any). Iffalse
, only the test's result is returned.- Returns:
- returns one of
ITestElement.Result.UNDEFINED
,ITestElement.Result.OK
,ITestElement.Result.ERROR
,ITestElement.Result.FAILURE
orITestElement.Result.IGNORED
. Clients should also prepare for other, new values.
-
getFailureTrace
ITestElement.FailureTrace getFailureTrace()Returns the failure trace of this test element ornull
if the test has not resulted in an error or failure.- Returns:
- the failure trace of this test or
null
.
-
getParentContainer
ITestElementContainer getParentContainer()Returns the parent test element container ornull
if the test element is the test run session.- Returns:
- the parent test suite
-
getTestRunSession
ITestRunSession getTestRunSession()Returns the test run session.- Returns:
- the parent test run session.
-
getElapsedTimeInSeconds
double getElapsedTimeInSeconds()Returns the estimated total time elapsed in seconds while executing this test element. The total time for a test suite includes the time used for all tests in that suite. The total time for a test session includes the time used for all tests in that session.Note: The elapsed time is only valid for
ITestElement.ProgressState.COMPLETED
test elements.- Returns:
- total execution time for the test element in seconds, or
Double.NaN
if the state of the element is notITestElement.ProgressState.COMPLETED
- Since:
- 3.4
-