Packages

o

org.scalatest

FailedStatus

object FailedStatus extends Status with Serializable

Singleton status that represents an already completed run with at least one failed test or aborted suite.

Note: the difference between this FailedStatus object and the similarly named Failed class is that a Failed instance indicates one test failed, whereas this FailedStatus object indicates either one or more tests failed and/or one or more suites aborted during a run. Both are used as the result type of Suite lifecycle methods, but Failed is a possible result of withFixture, whereas FailedStatus is a possible result of run, runNestedSuites, runTests, or runTest. In short, Failed is always just about one test, whereas FailedStatus could be about something larger: multiple tests or an entire suite.

Source
Status.scala
Linear Supertypes
Serializable, Status, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. FailedStatus
  2. Serializable
  3. Status
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  6. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  7. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  8. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  9. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  10. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  11. def isCompleted(): Boolean

    Always returns true.

    Always returns true.

    returns

    true

    Definition Classes
    FailedStatusStatus
  12. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  13. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  14. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  15. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  16. def succeeds(): Boolean

    Always returns false.

    Always returns false.

    returns

    true

    Definition Classes
    FailedStatusStatus
  17. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  18. final def thenRun(f: => Status): Status

    Registers a Status-producing by-name function to execute after this Status completes, returning a Status that mirrors the Status returned by the by-name.

    Registers a Status-producing by-name function to execute after this Status completes, returning a Status that mirrors the Status returned by the by-name.

    The Status returned by this method will complete when the status produced by the Status produced by the passed-by name completes. The returned Status will complete with the same succeeds and unreportedException values. But unlike the Status produced by the by-name, the returned Status will be available immediately.

    If the by-name function passed to this method completes abruptly with a non-run-aborting exception, that exception will be caught and installed as the unreportedException on the Status returned by this method. The Status returned by this method will then complete. The thread that attempted to evaluate the by-name function will be allowed to continue (i.e., the non-run-aborting exception will not be rethrown on that thread).

    If the by-name function passed to this method completes abruptly with a run-aborting exception, such as StackOverflowError, that exception will be caught and a new java.util.concurrent.ExecutionException that contains the run-aborting exception as its cause will be installed as the unreportedException on the Status returned by this method. The Status returned by this method will then complete. The original run-aborting exception will then be rethrown on the thread that attempted to evaluate the by-name function.

    If an unreported exception is installed on this Status, the passed by-name function will still be executed.

    Internally, ScalaTest uses this method in async styles to ensure that by default, each subsequent test in an async-style suite begins execution only after the previous test has completed. This method is not used if ParallelTestExection is mixed into an async style. Instead, tests are allowed to begin execution concurrently.

    returns

    a Status that represents the status of executing the by-name function passed to this method.

    Definition Classes
    Status
  19. final def toFuture: Future[Boolean]

    Converts this Status to a Future[Boolean] where Success(true) means no tests failed and suites aborted, Success(false), means at least one test failed or one suite aborted and any thrown exception was was reported to the Reporter via a ScalaTest event, Failure(unreportedException) means an exception, unreportedException, was thrown that was not reported to the Reporter via a ScalaTest event.

    Converts this Status to a Future[Boolean] where Success(true) means no tests failed and suites aborted, Success(false), means at least one test failed or one suite aborted and any thrown exception was was reported to the Reporter via a ScalaTest event, Failure(unreportedException) means an exception, unreportedException, was thrown that was not reported to the Reporter via a ScalaTest event.

    returns

    a Future[Boolean] representing this Status.

    Definition Classes
    Status
  20. def toString(): String
    Definition Classes
    AnyRef → Any
  21. def unreportedException: Option[Throwable]

    An exception that was thrown during the activity represented by this Status that was not reported via a ScalaTest event fired to the Reporter.

    An exception that was thrown during the activity represented by this Status that was not reported via a ScalaTest event fired to the Reporter.

    When a test executes, "non-run-aborting" thrown exceptions are reported by events fired to the reporter. A TestPendingException is reported via a TestPending event. A TestCanceledException is reported via a TestCanceled event. Any other non-run-aborting exceptions, including TestFailedException will be reported via a TestFailed event.

    Run-aborting exceptions indicate critical problems, such as OutOfMemoryError, that instead of being reported via a test completion event should instead cause the entire suite to abort. In synchronous testing styles, this exception will be allowed to just propagate up the call stack. But in async styles, the thread or threads executing the test will often be taken from the async suite's execution context. Instead of propagating these run-aborting exceptions up the call stack, they will be installed as an "unreported exception" in the test's Status. They are "unreported" because no test completion event will be fired to report them. For more explanation and a list of run-aborting exception types, see Treatment of java.lang.Errors.

    Another way for an unreported exception to occur is if an exception of any type is thrown outside of the body of an actual test. For example, traits BeforeAndAfter, BeforeAndAfterEach, and BeforeAndAfterEachTestData execute code before and after tests. Traits BeforeAndAfterAll and BeforeAndAfterAllConfigMap execute code before and after all tests and nested suites of a suite. If any "before" or "after" code completes abruptly with an exception (of any type, not just run-aborting types) on a thread taken from an async suite's execution context, this exception will installed as an unreportedException of the relevant Status.

    In addition, ScalaTest Suite exposes four "run" lifecycle methods--run, runNestedSuites, runTests, and runTest--that users can override to customize the framework. If a "run" lifecycle methods completes abruptly with an exception, that exception occurs outside the context of a test body. As a result, such exceptions will be installed as an unreportedException of the relevant Status.

    The toFuture method on Status returns a Future[Boolean]. If the Future succeeds with the Boolean value of true, that indicates no tests failed and no suites aborted during the activity represented by this Status. If a test failed or suite aborted, and that event was reported by a fired ScalaTest Event, the Future will succeed with the value false. If an unreported exception has been installed on the Status, however, the Future will fail with that exception.

    returns

    a optional unreported Throwable

    Definition Classes
    Status
  22. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  23. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  24. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  25. def waitUntilCompleted(): Unit

    Always returns immediately.

    Always returns immediately.

    Definition Classes
    FailedStatusStatus
  26. def whenCompleted(f: (Try[Boolean]) => Unit): Unit

    Executes the passed function immediately on the calling thread.

    Executes the passed function immediately on the calling thread.

    Definition Classes
    FailedStatusStatus
  27. final def withAfterEffect(f: => Unit): Status

    Registers a by-name function (producing an optional exception) to execute after this Status completes.

    Registers a by-name function (producing an optional exception) to execute after this Status completes.

    If the by-name function passed to this method completes abruptly with a non-run-aborting exception, that exception will be caught and installed as the unreportedException on the Status returned by this method. The Status returned by this method will then complete. The thread that attempted to evaluate the by-name function will be allowed to continue (i.e., the non-run-aborting exception will not be rethrown on that thread).

    If the by-name function passed to this method completes abruptly with a run-aborting exception, such as StackOverflowError, that exception will be caught and a new java.util.concurrent.ExecutionException that contains the run-aborting exception as its cause will be installed as the unreportedException on the Status returned by this method. The Status returned by this method will then complete. The original run-aborting exception will then be rethrown on the thread that attempted to evaluate the by-name function.

    If an unreported exception is installed on this Status, the passed by-name function will not be executed. Instead, the same unreported exception will be installed on the Status returned by this method.

    Internally, ScalaTest uses this method in traits BeforeAndAfter, BeforeAndAfterEach, and BeforeAndAfterEachTestData to ensure "after" code is executed after the relevant test has completed, and in traits BeforeAndAfterAll and BeforeAndAfterAllConfigMap to ensure "after" code is executed after the relevant tests and nested suites have completed.

    f

    A by-name function to invoke after this Status has completed.

    returns

    a Status that represents this Status, modified by any exception thrown by the passed by-name function.

    Definition Classes
    Status

Inherited from Serializable

Inherited from Status

Inherited from AnyRef

Inherited from Any

Ungrouped