Package org.eclipse.unittest.model
Interface ITestRunSession
- All Superinterfaces:
ITestElement
,ITestSuiteElement
Represents a test run session.
This interface is not intended to be implemented by clients.
- 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/interfaces inherited from interface org.eclipse.unittest.model.ITestElement
ITestElement.FailureTrace, ITestElement.Result
-
Method Summary
Modifier and TypeMethodDescriptionReturns theILaunch
from which this test run session has been started, ornull
if not available.getTestElement
(String id) Returns a test element by its identifiernewTestCase
(String testId, String testName, ITestSuiteElement parent, String displayName, String data) Creates a new Test Case and adds it to the modelnewTestSuite
(String testId, String testName, Integer testCount, ITestSuiteElement parent, String displayName, String data) Creates a new Test Suite and adds it to the modelvoid
notifyTestEnded
(ITestElement test, boolean isIgnored) Notifies on an individual test ended.void
notifyTestFailed
(ITestElement test, ITestElement.Result status, boolean isAssumptionFailed, ITestElement.FailureTrace failureTrace) Notifies on an individual test failed with a stack trace.void
notifyTestSessionAborted
(Duration duration, Exception cause) Notifies on a test run aborted, abnormally.void
notifyTestSessionCompleted
(Duration duration) Notifies on a test run ended normally.void
notifyTestSessionStarted
(Integer count) Notifies on a test run started.void
Notifies on an individual test started.Methods inherited from interface org.eclipse.unittest.model.ITestElement
getData, getDisplayName, getDuration, getFailureTrace, getId, getParent, getTestName, getTestRunSession
Methods inherited from interface org.eclipse.unittest.model.ITestSuiteElement
getChildren
-
Method Details
-
getLaunch
ILaunch getLaunch()Returns theILaunch
from which this test run session has been started, ornull
if not available.- Returns:
- the
ILaunch
object instance, ornull
is not available.
-
getTestElement
Returns a test element by its identifier- Parameters:
id
- a test element identifier- Returns:
- a
ITestElement
found ornull
-
newTestCase
ITestCaseElement newTestCase(String testId, String testName, ITestSuiteElement parent, String displayName, String data) Creates a new Test Case and adds it to the model- Parameters:
testId
- a unique id for the testtestName
- the name of the testparent
- the parent, can benull
displayName
- the display name of the testdata
- runner specific data- Returns:
- the new test case element
-
newTestSuite
ITestSuiteElement newTestSuite(String testId, String testName, Integer testCount, ITestSuiteElement parent, String displayName, String data) Creates a new Test Suite and adds it to the model- Parameters:
testId
- a unique id for the testtestName
- the name of the testtestCount
- the number of tests this suite will run,null
if unknown.parent
- the parentdisplayName
- the display name of the testdata
- runner specific data- Returns:
- the new test case element
-
notifyTestSessionCompleted
Notifies on a test run ended normally. Individual test success don't matter. If the test session failed to complete for some reason, usenotifyTestSessionAborted(Duration, Exception)
.- Parameters:
duration
- the total elapsed time of the test run, can benull
.- See Also:
-
notifyTestSessionAborted
Notifies on a test run aborted, abnormally.- Parameters:
duration
- duration of the test run session until abortion, can benull
.cause
- the cause of the abortion, can be shown in log or to user, can benull
.- See Also:
-
notifyTestEnded
Notifies on an individual test ended.- Parameters:
test
- a unique Id identifying the testisIgnored
-true
indicates that the specified test was ignored, otherwise -false
-
notifyTestStarted
Notifies on an individual test started.- Parameters:
test
- the test
-
notifyTestSessionStarted
Notifies on a test run started.- Parameters:
count
- the number of individual tests that will be run,null
if unknown
-
notifyTestFailed
void notifyTestFailed(ITestElement test, ITestElement.Result status, boolean isAssumptionFailed, ITestElement.FailureTrace failureTrace) throws IllegalArgumentException Notifies on an individual test failed with a stack trace.- Parameters:
test
- the teststatus
- the outcome of the test; one ofITestElement.Result.ERROR
orITestElement.Result.FAILURE
. An exception is thrown otherwiseisAssumptionFailed
- indicates that an assumption is failedfailureTrace
- The failure trace- Throws:
IllegalArgumentException
- if status doesn't indicate ERROR or FAILURE.
-