org.scalatest

trait Distributor

[source: org/scalatest/Distributor.scala]

trait Distributor
extends AnyRef

A object that facilitates concurrent and/or distributed execution of Suites. An optional Distributor is passed to the execute method of Suite. If a Distributor is indeed passed, trait Suite's implementation of execute will populate that Distributor with its nested Suites (by passing them to the Distributor's put method) rather than executing the nested Suites directly. It is then up to another party or parties to execute those Suites.

If you have a set of nested Suites that must be executed sequentially, you can override runNestedSuites and call this trait's implementation, passing in None for the Distributor. For example:

 override protected def runNestedSuites(reporter: Reporter, stopper: Stopper,
     includes: Set[String], excludes: Set[String], properties: Map[String, Any],
     distributor: Option[Distributor]) {

   // Execute nested suites sequentially
   super.runNestedSuites(reporter, stopper, includes, excludes, properties, None)
 }
 

Implementations of this trait must be thread safe.

Author
Bill Venners
Method Summary
abstract def put (suite : Suite) : Unit
Puts a Suite into the Distributor.
Methods inherited from AnyRef
getClass, hashCode, equals, clone, toString, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized
Methods inherited from Any
==, !=, isInstanceOf, asInstanceOf
Method Details
abstract def put(suite : Suite) : Unit
Puts a Suite into the Distributor.
Parameters
suite - the Suite to put into the Distributor.
Throws
NullPointerException - if suite is null.


Copyright (C) 2001-2009 Artima, Inc. All rights reserved.