trait Status extends AnyRef
The result status of running a test or a suite.
This trait is the return type of the "run" lifecycle methods of trait Suite: run, runNestedSuites,
runTests, and runTest. It can be used to determine whether a test or suite has completed, and if completed,
whether it succeeded or failed. The main use case for this trait in ScalaTest is to enable BeforeAndAfterAll's afterAll
method to wait until all relevant tests and nested suites have completed before performing the "after all" code, even if those tests are
nested suites are run in parallel.
- Source
- Status.scala
- Alphabetic
- By Inheritance
- Status
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Abstract Value Members
-
abstract
def
isCompleted: Boolean
Non-blocking call that indicates whether the all the tests or nested suites fired off by the run method that returned the
Statushave completed.Non-blocking call that indicates whether the all the tests or nested suites fired off by the run method that returned the
Statushave completed. Because this is non-blocking, you can use this to poll the completion status.- returns
trueif the test or suite run is already completed,falseotherwise.
-
abstract
def
succeeds(): Boolean
Blocking call that waits until completion, then returns returns
trueif no tests failed and no suites aborted, else returnsfalse.Blocking call that waits until completion, then returns returns
trueif no tests failed and no suites aborted, else returnsfalse.This only reports
falseif there was a failed test or aborted suite in the context of the "run" lifecycle method it was returned from. For example, if you callsucceedson the returnStatusofrunTest, it returns (after that test has completed)trueif the test whose name was passed torunTestsucceeded,falseif that test failed (or the suite aborts). If you callsucceedson the return value ofrunTests, by contrast, it returns (after the suite's tests have completed)trueonly if all tests in the suite succeeded. If any test in the suite fails (or the whole suite aborts), thesucceedscall will returnfalse. TheStatusreturned fromrunNestedSuiteswill return true only if all tests in all nested suites (and their nested suites, etc.) fired off by thatrunNestedSuitescall succeed and no suites abort. Simlarly, theStatusreturned fromrunwill return true only if all tests in all nested suites (and their nested suites, etc.) fired off by thatruncall succeed and no suites abort.- returns
trueif no tests failed and no suites aborted,falseotherwise
-
abstract
def
waitUntilCompleted(): Unit
Blocking call that returns only after the underlying test or suite is completed.
-
abstract
def
whenCompleted(f: (Boolean) ⇒ Unit): Unit
Registers the passed function to be executed when this status completes.
Registers the passed function to be executed when this status completes.
You may register multiple functions, which on completion will be executed in an undefined order.
Concrete Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )