Companion object to class Canceled that provides, in addition to the extractor and factory method provided by the compiler given its companion is a case class, a second factory method that produces a Canceled outcome given a string message.
Attributes
Members list
Type members
Inherited types
The names of the product elements
The names of the product elements
Attributes
- Inherited from:
- Mirror
The name of the type
The name of the type
Attributes
- Inherited from:
- Mirror
Value members
Concrete methods
Creates a Canceled instance, with a TestCanceledException set as its exception field.
Creates a Canceled instance, with a TestCanceledException set as its exception field.
Attributes
- Returns
-
An instance of
Canceledwith aTestCanceledExceptionset as itsexceptionfield.
Creates a Canceled instance with the passed in message and cause.
Creates a Canceled instance with the passed in message and cause.
Value parameters
- cause
-
the cause for the
TestCanceledExceptionset as itsexceptionfield - message
-
the message for the
TestCanceledExceptionset as itsexceptionfield
Attributes
- Returns
-
An instance of
Canceledwith aTestCanceledExceptioncreated from passed inmessageandcauseset as itsexceptionfield.
Creates a Canceled instance with the passed in Throwable. If the passed in Throwable is a TestCanceledException, it will be set as exception field, in other case a new TestCanceledException will be created using ex as its cause
Creates a Canceled instance with the passed in Throwable. If the passed in Throwable is a TestCanceledException, it will be set as exception field, in other case a new TestCanceledException will be created using ex as its cause
Value parameters
- ex
-
the passed in
Throwable
Attributes
- Returns
-
An instance of
Canceledwithexset as itsexceptionfield ifexis aTestCanceledException, or a newly createdTestCanceledExceptionwithexset as itscauseifexis not aTestCanceledException.
Creates a Canceled outcome given a string message.
Creates a Canceled outcome given a string message.
For example, trait CancelAfterFailure uses this factory method to create a Canceled status if a cancelRemaining flag is set, which will be the case if a test failed previously while running the suite:
abstract override def withFixture(test: NoArgTest): Outcome = {
if (cancelRemaining)
Canceled("Canceled by CancelOnFailure because a test failed previously")
else
super.withFixture(test) match {
case failed: Failed =>
cancelRemaining = true
failed
case outcome => outcome
}
}
Attributes
Creates a Canceled with the passed in cause.
Creates a Canceled with the passed in cause.
Value parameters
- cause
-
the passed in cause
Attributes
- Returns
-
A
Canceledwithexceptionfield set to a newly createdTestCanceledExceptionusing the passed incause.