Package org.eclipse.jdt.junit.model
Interface ITestElement
-
- All Known Subinterfaces:
ITestCaseElement,ITestElementContainer,ITestRunSession,ITestSuiteElement
public interface ITestElementCommon protocol for test elements. This set consists ofITestCaseElement,ITestSuiteElementandITestRunSessionThis 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
Nested Classes Modifier and Type Interface Description static classITestElement.FailureTraceA failure trace of a test.static classITestElement.ProgressStateRunning states of a test.static classITestElement.ResultResult states of a test.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description doublegetElapsedTimeInSeconds()Returns the estimated total time elapsed in seconds while executing this test element.ITestElement.FailureTracegetFailureTrace()Returns the failure trace of this test element ornullif the test has not resulted in an error or failure.ITestElementContainergetParentContainer()Returns the parent test element container ornullif the test element is the test run session.ITestElement.ProgressStategetProgressState()Returns the progress state of this test element.ITestElement.ResultgetTestResult(boolean includeChildren)Returns the result of the test element.ITestRunSessiongetTestRunSession()Returns the test run session.
-
-
-
Method Detail
-
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
ITestElement.Result getTestResult(boolean includeChildren)
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.FAILUREorITestElement.Result.IGNORED. Clients should also prepare for other, new values.
-
getFailureTrace
ITestElement.FailureTrace getFailureTrace()
Returns the failure trace of this test element ornullif 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 ornullif 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.COMPLETEDtest elements.- Returns:
- total execution time for the test element in seconds, or
Double.NaNif the state of the element is notITestElement.ProgressState.COMPLETED - Since:
- 3.4
-
-