trait Runner extends AnyRef
Represents one run of a suite of tests.
The run represented by a Runner
has a lifecycle. The run
begins when the Runner
is instantiated by the framework and
returned to the client during a Framework.runner
invocation.
The run continues until the client invokes done
on the
Runner
. Before invoking done
, the client can
invoke the tasks
method as many times at it wants, but once
done
has been invoked, the Runner
enters "spent"
mode. Any subsequent invocations of tasks
will be met with an
IllegalStateException
.
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's done
method is invoked, nothing may be
invoked on the workers nor on the controller. Workers can be
de-commissioned before the controller terminates.
- Alphabetic
- By Inheritance
- Runner
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Abstract Value Members
-
abstract
def
args: Array[String]
Returns the arguments that were used to create this
Runner
.Returns the arguments that were used to create this
Runner
.- returns
an array of argument that is used to create this Runner.
-
abstract
def
deserializeTask(task: String, deserializer: (String) ⇒ TaskDef): Task
Scala.js specific: Deserialize a task that has been serialized by
serializeTask
of another or thisRunner
.Scala.js specific: Deserialize a task that has been serialized by
serializeTask
of another or thisRunner
.The resulting task must associate with this runner.
-
abstract
def
done(): String
Indicates the client is done with this
Runner
instance.Indicates the client is done with this
Runner
instance.After invoking the
done
method on aRunner
instance, the client should no longer invoke thetask
methods on that instance. (If the client does invoketask
afterdone
, it will be rewarded with anIllegalStateException
.)Similarly, after returning from
done
, the test framework should no longer write any messages to theLogger
, nor fire any more events to theEventHandler
, passed toFramework.runner
. If the test framework has not completed writing log messages or firing events when the client invokesdone
, the framework should not return fromdone
until it is finished sending messages and events, and may block the thread that invokeddone
until it is actually done.In short, by invoking
done
, the client indicates it is done invoking thetask
methods for this run. By returning fromdone
, the test framework indicates it is done writing log messages and firing events for this run.If the client invokes
done
more than once on the sameRunner
instance, the test framework should on subsequent invocations should throwIllegalStateException
.The test framework may send a summary (i.e., a message giving total tests succeeded, failed, and so on) to the user via a log message. If so, it should return the summary from
done
. If not, it should return an empty string. The client may use the return value ofdone
to decide whether to display its own summary message.The test framework may return a multi-lines string (i.e., a message giving total tests succeeded, failed and so on) to the client.
In Scala.js, the client must not call this method before all execute methods of all Tasks have called their completion continuation. Otherwise, the Framework should throw an IllegalStateException (since it cannot block).
Further, if this is the controller, the client must not call this method before all
done
methods of all workers have returned (otherwise, anIllegalStateException
is thrown). If this is a worker, the returned string is ignored.- returns
a possibly multi-line summary string, or the empty string if no summary is provided
-
abstract
def
receiveMessage(msg: String): Option[String]
Scala.js specific: Invoked on the controller
Runner
when a worker sends a message (through the channel provided by the client).Scala.js specific: Invoked on the controller
Runner
when a worker sends a message (through the channel provided by the client).The controller may send a message back to the sending worker by returning the message in a
Some
.Invoked on a worker
Runner
when the controller responds to a message (sent by the worker via the supplied closure inslaveRunner
, akaworkerRunner
; see the Scaladoc ofsbt.testing.Framework
about the name.). The return value of the call is ignored in this case. -
abstract
def
remoteArgs(): Array[String]
Remote args that will be passed to
Runner
in a sub-process as remoteArgs.Remote args that will be passed to
Runner
in a sub-process as remoteArgs.- returns
an array of strings that will be passed to
Runner
in a sub-process asremoteArgs
.
-
abstract
def
serializeTask(task: Task, serializer: (TaskDef) ⇒ String): String
Scala.js specific: Serialize a task created by
tasks
or returned fromexecute
.Scala.js specific: Serialize a task created by
tasks
or returned fromexecute
.The resulting string will be passed to the
deserializeTask
method of another runner. After calling this method, the passed task is invalid and should dissociate from this runner. -
abstract
def
tasks(taskDefs: Array[TaskDef]): Array[Task]
Returns an array of tasks that when executed will run tests and suites determined by the passed
TaskDef
s.Returns an array of tasks that when executed will run tests and suites determined by the passed
TaskDef
s.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 passed
TaskDef
s.This
tasks
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
.- taskDefs
the
TaskDef
s for requested tasks- returns
an array of
Task
s
- Exceptions thrown
java.lang.IllegalStateException
if invoked afterdone
has been invoked.
Concrete Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()