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
Canceled
with aTestCanceledException
set as itsexception
field.
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
TestCanceledException
set as itsexception
field - message
-
the message for the
TestCanceledException
set as itsexception
field
Attributes
- Returns
-
An instance of
Canceled
with aTestCanceledException
created from passed inmessage
andcause
set as itsexception
field.
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
Canceled
withex
set as itsexception
field ifex
is aTestCanceledException
, or a newly createdTestCanceledException
withex
set as itscause
ifex
is 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
Canceled
withexception
field set to a newly createdTestCanceledException
using the passed incause
.