package testing
- Alphabetic
- Public
- All
Type Members
-
trait
AnnotatedFingerprint extends Fingerprint
Indicates that classes or modules with a specific annotation, either on at least one top level method or on the class or module itself, should be discovered as test classes.
-
trait
Event extends AnyRef
An event fired by the test framework during a run.
-
trait
EventHandler extends AnyRef
Interface implemented by clients that handle events fired by the test framework during a run.
Interface implemented by clients that handle events fired by the test framework during a run.
An event handler is passed to the test framework via the
execute
method ofTask
s. -
trait
Fingerprint extends AnyRef
A way to identify test classes and/or modules that should be discovered when the client performs discovery.
A way to identify test classes and/or modules that should be discovered when the client performs discovery.
Scala.js: Implementations may not rely on the identity of Fingerprints, since they are serialized between JS / JVM.
-
trait
Framework extends AnyRef
Interface implemented by test frameworks.
Interface implemented by test frameworks.
- Annotations
- @EnableReflectiveInstantiation()
-
trait
Logger extends AnyRef
A logger through which to provide feedback to the user about a run.
A logger through which to provide feedback to the user about a run.
The difference between the event handler and the logger is that the event handler is for events intended to be consumed by the client software whereas the logger is for messages intended to be consumed by the client *user* (i.e., a human).
Implementations of this interface must be thread-safe.
-
final
class
NestedSuiteSelector extends Selector with Serializable
Information in addition to a test class name that identifies a nested suite about which an event was fired.
-
final
class
NestedTestSelector extends Selector with Serializable
Information in addition to a test class name that identifies a test in a nested suite about which an event was fired.
-
final
class
OptionalThrowable extends Serializable
An optional
Throwable
. -
trait
Runner extends AnyRef
Represents one run of a suite of tests.
Represents one run of a suite of tests.
The run represented by a
Runner
has a lifecycle. The run begins when theRunner
is instantiated by the framework and returned to the client during aFramework.runner
invocation. The run continues until the client invokesdone
on theRunner
. Before invokingdone
, the client can invoke thetasks
method as many times at it wants, but oncedone
has been invoked, theRunner
enters "spent" mode. Any subsequent invocations oftasks
will be met with anIllegalStateException
.In Scala.js, the client may request multiple instances of
Runner
, where one of these instances is considered the controller. The workers receive a communication channel to the controller. Once the controller'sdone
method is invoked, nothing may be invoked on the workers nor on the controller. Workers can be de-commissioned before the controller terminates. -
sealed abstract
class
Selector extends AnyRef
Information in addition to a test class name that identifies the suite or test about which an event was fired.
Information in addition to a test class name that identifies the suite or test about which an event was fired.
This class has five subtypes:
SuiteSelector
- indicates an event is about an entire suite of tests whose class was reported asfullyQualifiedName
in theEvent
TestSelector
- indicates an event is about a single test directly contained in the suite whose class was reported asfullyQualifiedName
in theEvent
NestedSuiteSelector
- indicates an event is about an entire nested suite of tests whose top-level, "nesting" class was reported asfullyQualifiedName
in theEvent
NestedTestSelector
- indicates an event is about a single test contained in a nested suite whose top-level, "nesting" class was reported asfullyQualifiedName
in theEvent
TestWildcardSelector
- indicates an event is about zero to many tests directly contained in the suite whose class was reported asfullyQualifiedName
in theEvent
-
class
Status extends Enum[Status]
Represents the status of running a test.
Represents the status of running a test.
Test frameworks can decided which of these to use and what they mean, but in general, the intended meanings are:
- Success - a test succeeded
- Error - an "error" occurred during a test
- Failure - an "failure" during a test
- Skipped - a test was skipped for any reason
- Ignored - a test was ignored, i.e., temporarily disabled with the intention of fixing it later
- Canceled - a test was canceled, i.e., not able to be completed because of some unmet pre-condition, such as a database being offline that the test requires
- Pending - a test was declared as pending, i.e., with test code and/or production code as yet unimplemented
The difference between errors and failures, if any, is determined by the test frameworks. JUnit and specs2 differentiate between errors and failures. ScalaTest reports everything (both assertion failures and unexpected errors) as failures. JUnit and ScalaTest support ignored tests. ScalaTest and specs2 support a notion of pending tests. ScalaTest differentiates between ignored and canceled tests, whereas specs2 only supports skipped tests, which are implemented like ScalaTest's canceled tests. TestNG uses "skipped" to report tests that were not executed because of failures in dependencies, which is also similar to canceled tests in ScalaTest.
-
trait
SubclassFingerprint extends Fingerprint
Indicates that classes (and possibly modules) that extend a particular superclass, or mix in a particular supertrait, should be discovered as test classes.
-
final
class
SuiteSelector extends Selector with Serializable
Indicates an event was about the entire suite whose class had the fully qualified name specified as the
fullyQualifiedName
attribute the event. -
trait
Task extends AnyRef
A task to execute.
A task to execute.
The client may decide when or how to execute the task based on its tags. A task can be any job, but is primarily intended for running tests and/or supplying more tasks to the client. A framework can supply more tasks to the client in the returned an array of Tasks (which can be empty if there's no more work to do.)
-
final
class
TaskDef extends Serializable
A bundle of information used to request a
Task
from a test framework.A bundle of information used to request a
Task
from a test framework.An array of
TaskDef
is passed toRunner
'stasks
method, which returns an array ofTasks
. Each returned task, when executed, will run tests and suites determined by the test class name, fingerprints, "explicitly specified" field, and selectors of one of the passedTaskDef
s.The "Explicitly specified" field means the user supplied a complete fully qualified test name, such as with the command:
> test-only com.mycompany.myproject.WholeNameSpec
as opposed to commands like:
> test-only *WholeNameSpec
or simply:
> test
The
explicitlySpecified
field will be true for in the first case, and false in the last two cases, because only in the first case was the fully qualified test class name completely specified by the user. The test framework can use this information to decide whether to ignore an annotation requesting a class not be discovered.The
fingerprint
parameter indicates how the test suite was identified as a test suite. Thistasks
method may be called withTaskDef
s containing the same value fortestClassName
but different fingerprints. For example, if both a class and its companion object were test classes, thetasks
method could be passed an array containingTaskDef
s with the same name but with a different value forfingerprint.isModule
.A test framework may "reject" a requested task by returning no
Task
for thatTaskDef
. -
final
class
TestSelector extends Selector with Serializable
Information in addition to a test class name that identifies a test directly contained in the suite whose class had the fully qualified name specified as the
fullyQualifiedName
attribute passed to the event. -
final
class
TestWildcardSelector extends Selector with Serializable
Information that identifies zero to many tests directly contained in a test class.
Information that identifies zero to many tests directly contained in a test class.
The
testWildcard
is a simple string, i.e., not a glob or regular expression. Any test whose name includes thetestWildcard
string as a substring will be selected.
Value Members
- object Status extends Serializable