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
executemethod ofTasks. -
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
- @JSExportDescendentClasses()
-
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.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
Runnerhas a lifecycle. The run begins when theRunneris instantiated by the framework and returned to the client during aFramework.runnerinvocation. The run continues until the client invokesdoneon theRunner. Before invokingdone, the client can invoke thetasksmethod as many times at it wants, but oncedonehas been invoked, theRunnerenters "spent" mode. Any subsequent invocations oftaskswill be met with anIllegalStateException.In Scala.js, the client may request multiple instances of
Runner, where one of these instances is considered the master. The slaves receive a communication channel to the master. Once the master'sdonemethod is invoked, nothing may be invoked on the slaves or the master. Slaves can be de-comissioned before the master 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 asfullyQualifiedNamein theEventTestSelector- indicates an event is about a single test directly contained in the suite whose class was reported asfullyQualifiedNamein theEventNestedSuiteSelector- indicates an event is about an entire nested suite of tests whose top-level, "nesting" class was reported asfullyQualifiedNamein theEventNestedTestSelector- indicates an event is about a single test contained in a nested suite whose top-level, "nesting" class was reported asfullyQualifiedNamein theEventTestWildcardSelector- indicates an event is about zero to many tests directly contained in the suite whose class was reported asfullyQualifiedNamein 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
fullyQualifiedNameattribute the event.Indicates an event was about the entire suite whose class had the fully qualified name specified as the
fullyQualifiedNameattribute 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
Taskfrom a test framework.A bundle of information used to request a
Taskfrom a test framework.An array of
TaskDefis passed toRunner'stasksmethod, 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 passedTaskDefs.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
explicitlySpecifiedfield 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
fingerprintparameter indicates how the test suite was identified as a test suite. Thistasksmethod may be called withTaskDefs containing the same value fortestClassNamebut different fingerprints. For example, if both a class and its companion object were test classes, thetasksmethod could be passed an array containingTaskDefs with the same name but with a different value forfingerprint.isModule.A test framework may "reject" a requested task by returning no
Taskfor 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
fullyQualifiedNameattribute passed to the event.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
fullyQualifiedNameattribute 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
testWildcardis a simple string, i.e., not a glob or regular expression. Any test whose name includes thetestWildcardstring as a substring will be selected.
Value Members
- object Status extends Serializable