trait
Reporter extends AnyRef
Abstract Value Members
-
abstract
def
apply(event: Event): Unit
Concrete Value Members
-
final
def
!=(arg0: AnyRef): Boolean
-
final
def
!=(arg0: Any): Boolean
-
final
def
##(): Int
-
final
def
==(arg0: AnyRef): Boolean
-
final
def
==(arg0: Any): Boolean
-
final
def
asInstanceOf[T0]: T0
-
def
clone(): AnyRef
-
final
def
eq(arg0: AnyRef): Boolean
-
def
equals(arg0: Any): Boolean
-
def
finalize(): Unit
-
final
def
getClass(): Class[_]
-
def
hashCode(): Int
-
final
def
isInstanceOf[T0]: Boolean
-
final
def
ne(arg0: AnyRef): Boolean
-
final
def
notify(): Unit
-
final
def
notifyAll(): Unit
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
-
def
toString(): String
-
final
def
wait(): Unit
-
final
def
wait(arg0: Long, arg1: Int): Unit
-
final
def
wait(arg0: Long): Unit
Inherited from AnyRef
Inherited from Any
Trait whose instances collect the results of a running suite of tests and presents those results in some way to the user. Instances of this trait can be called "report functions" or "reporters."
Reporters receive test results via thirteen events. Each event is fired to pass a particular kind of information to the reporter. The events are:
RunStarting
TestStarting
TestSucceeded
TestFailed
TestIgnored
TestPending
SuiteStarting
SuiteCompleted
SuiteAborted
InfoProvided
RunStopped
RunAborted
RunCompleted
Reporters may be implemented such that they only present some of the reported events to the user. For example, you could define a reporter class that doesn nothing in response to
SuiteStarting
events. Such a class would always ignoreSuiteStarting
events.The term test as used in the
TestStarting
,TestSucceeded
, andTestFailed
event names is defined abstractly to enable a wide range of test implementations. TraitSuite
firesTestStarting
to indicate it is about to invoke one of its test methods,TestSucceeded
to indicate a test method returned normally, andTestFailed
to indicate a test method completed abruptly with an exception. Although the execution of aSuite
's test methods will likely be a common event reported via theTestStarting
,TestSucceeded
, andTestFailed
methods, because of the abstract definition of “test” used by the the event classes, these events are not limited to this use. Information about any conceptual test may be reported via theTestStarting
,TestSucceeded
, andTestFailed
events.Likewise, the term suite as used in the
SuiteStarting
,SuiteAborted
, andSuiteCompleted
event names is defined abstractly to enable a wide range of suite implementations. ObjectRunner
firesSuiteStarting
to indicate it is about to invokerun
on aSuite
,SuiteCompleted
to indicate aSuite
'srun
method returned normally, andSuiteAborted
to indicate aSuite
'srun
method completed abruptly with an exception. Similarly, classSuite
firesSuiteStarting
to indicate it is about to invokerun
on a nestedSuite
,SuiteCompleted
to indicate a nestedSuite
'srun
method returned normally, andSuiteAborted
to indicate a nestedSuite
'srun
method completed abruptly with an exception. Although the execution of aSuite
'srun
method will likely be a common event reported via theSuiteStarting
,SuiteAborted
, andSuiteCompleted
events, because of the abstract definition of "suite" used by the event classes, these events are not limited to this use. Information about any conceptual suite may be reported via theSuiteStarting
,SuiteAborted
, andSuiteCompleted
events.Extensibility
You can create classes that extend
Reporter
to report test results in custom ways, and to report custom information passed as an event "payload." For more information on the latter use case, see the Extensibility section of theEvent
documentation.Reporter
classes can handle events in any manner, including doing nothing.