ScalaTest 1.1
|
|
class
JUnitWrapperSuite(junitClassName : java.lang.String, loader : java.lang.ClassLoader)
extends
SuiteA wrapper to allow JUnit tests to be run by the ScalaTest runner.
Instances of this trait are not thread safe.
Method Summary | |
override def
|
expectedTestCount
(filter : Filter) : Int
The total number of tests that are expected to run when this
Suite 's run method is invoked. |
def
|
getRequest : org.junit.runner.Request |
override def
|
run
(testName : scala.Option[java.lang.String], report : Reporter, stopper : Stopper, filter : Filter, config : scala.collection.immutable.Map[java.lang.String, Any], distributor : scala.Option[Distributor], tracker : Tracker) : Unit
Runs this suite of tests.
|
protected override final def
|
runNestedSuites
(reporter : Reporter, stopper : Stopper, filter : Filter, configMap : scala.collection.immutable.Map[java.lang.String, Any], distributor : scala.Option[Distributor], tracker : Tracker) : Unit
Throws
UnsupportedOperationException , because this method is unused by this
class, given this class's run method delegates to JUnit to run
its tests. |
protected override final def
|
runTest
(testName : java.lang.String, reporter : Reporter, stopper : Stopper, configMap : scala.collection.immutable.Map[java.lang.String, Any], tracker : Tracker) : Unit
Throws
UnsupportedOperationException , because this method is unused by this
class, given this class's run method delegates to JUnit to run
its tests. |
protected override final def
|
runTests
(testName : scala.Option[java.lang.String], reporter : Reporter, stopper : Stopper, filter : Filter, configMap : scala.collection.immutable.Map[java.lang.String, Any], distributor : scala.Option[Distributor], tracker : Tracker) : Unit
Throws
UnsupportedOperationException , because this method is unused by this
class, given this class's run method delegates to JUnit to run
its tests. |
protected override final def
|
withFixture
(test : NoArgTest) : Unit
Throws
UnsupportedOperationException , because this method is unused by this
class, given this class's run method delegates to JUnit to run
its tests. |
Methods inherited from Suite | |
nestedSuites, execute, execute, execute, execute, tags, groups, testNames, suiteName, pending, pendingUntilFixed |
Methods inherited from Assertions | |
assert, assert, assert, assert, convertToEqualizer, intercept, expect, expect, fail, fail, fail, fail |
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 |
override
def
run(testName : scala.Option[java.lang.String], report : Reporter, stopper : Stopper, filter : Filter, config : scala.collection.immutable.Map[java.lang.String, Any], distributor : scala.Option[Distributor], tracker : Tracker) : Unit
If testName
is None
, this trait's implementation of this method
calls these two methods on this object in this order:
runNestedSuites(report, stopper, tagsToInclude, tagsToExclude, configMap, distributor)
runTests(testName, report, stopper, tagsToInclude, tagsToExclude, configMap)
If testName
is defined, then this trait's implementation of this method
calls runTests
, but does not call runNestedSuites
. This behavior
is part of the contract of this method. Subclasses that override run
must take
care not to call runNestedSuites
if testName
is defined. (The
OneInstancePerTest
trait depends on this behavior, for example.)
Subclasses and subtraits that override this run
method can implement them without
invoking either the runTests
or runNestedSuites
methods, which
are invoked by this trait's implementation of this method. It is recommended, but not required,
that subclasses and subtraits that override run
in a way that does not
invoke runNestedSuites
also override runNestedSuites
and make it
final. Similarly it is recommended, but not required,
that subclasses and subtraits that override run
in a way that does not
invoke runTests
also override runTests
(and runTest
,
which this trait's implementation of runTests
calls) and make it
final. The implementation of these final methods can either invoke the superclass implementation
of the method, or throw an UnsupportedOperationException
if appropriate. The
reason for this recommendation is that ScalaTest includes several traits that override
these methods to allow behavior to be mixed into a Suite
. For example, trait
BeforeAndAfterEach
overrides runTests
s. In a Suite
subclass that no longer invokes runTests
from run
, the
BeforeAndAfterEach
trait is not applicable. Mixing it in would have no effect.
By making runTests
final in such a Suite
subtrait, you make
the attempt to mix BeforeAndAfterEach
into a subclass of your subtrait
a compiler error. (It would fail to compile with a complaint that BeforeAndAfterEach
is trying to override runTests
, which is a final method in your trait.)
testName -
an optional name of one test to run. If None
, all relevant tests should be run. I.e., None
acts like a wildcard that means run all relevant tests in this Suite
.reporter -
the Reporter
to which results will be reportedstopper -
the Stopper
that will be consulted to determine whether to stop execution early.filter -
a Filter
with which to filter tests based on their tagsconfigMap -
a Map
of key-value pairs that can be used by the executing Suite
of tests.distributor -
an optional Distributor
, into which to put nested Suite
s to be run by another entity, such as concurrently by a pool of threads. If None
, nested Suite
s will be run sequentially.tracker -
a Tracker
tracking Ordinal
s being fired by the current thread.NullPointerException -
if any passed parameter is null
.IllegalArgumentException -
if testName
is defined, but no test with the specified test name exists in this Suite
Suite
's run
method is invoked.
This trait's implementation of this method returns the sum of:
testNames
List
, minus the number of tests marked as ignored
expectedTestCount
on every nested Suite
contained in
nestedSuites
filter -
a Filter
with which to filter tests to count based on their tags
def
getRequest : org.junit.runner.Request
UnsupportedOperationException
, because this method is unused by this
class, given this class's run
method delegates to JUnit to run
its tests.
The main purpose of this method implementation is to render a compiler error an attempt
to mix in a trait that overrides withFixture
. Because this
trait does not actually use withFixture
, the attempt to mix
in behavior would very likely not work.
test -
the no-arg test function to run with a fixtureprotected override final
def
runNestedSuites(reporter : Reporter, stopper : Stopper, filter : Filter, configMap : scala.collection.immutable.Map[java.lang.String, Any], distributor : scala.Option[Distributor], tracker : Tracker) : Unit
UnsupportedOperationException
, because this method is unused by this
class, given this class's run
method delegates to JUnit to run
its tests.
The main purpose of this method implementation is to render a compiler error an attempt
to mix in a trait that overrides runNestedSuites
. Because this
trait does not actually use runNestedSuites
, the attempt to mix
in behavior would very likely not work.
reporter -
the Reporter
to which results will be reportedstopper -
the Stopper
that will be consulted to determine whether to stop execution early.filter -
a Filter
with which to filter tests based on their tagsconfigMap -
a Map
of key-value pairs that can be used by the executing Suite
of tests.distributor -
an optional Distributor
, into which to put nested Suite
s to be run by another entity, such as concurrently by a pool of threads. If None
, nested Suite
s will be run sequentially.tracker -
a Tracker
tracking Ordinal
s being fired by the current thread.UnsupportedOperationException -
always.protected override final
def
runTests(testName : scala.Option[java.lang.String], reporter : Reporter, stopper : Stopper, filter : Filter, configMap : scala.collection.immutable.Map[java.lang.String, Any], distributor : scala.Option[Distributor], tracker : Tracker) : Unit
UnsupportedOperationException
, because this method is unused by this
class, given this class's run
method delegates to JUnit to run
its tests.
The main purpose of this method implementation is to render a compiler error an attempt
to mix in a trait that overrides runTests
. Because this
trait does not actually use runTests
, the attempt to mix
in behavior would very likely not work.
testName -
an optional name of one test to run. If None
, all relevant tests should be run. I.e., None
acts like a wildcard that means run all relevant tests in this Suite
.reporter -
the Reporter
to which results will be reportedstopper -
the Stopper
that will be consulted to determine whether to stop execution early.filter -
a Filter
with which to filter tests based on their tagsconfigMap -
a Map
of key-value pairs that can be used by the executing Suite
of tests.distributor -
an optional Distributor
, into which to put nested Suite
s to be run by another entity, such as concurrently by a pool of threads. If None
, nested Suite
s will be run sequentially.tracker -
a Tracker
tracking Ordinal
s being fired by the current thread.UnsupportedOperationException -
always.protected override final
def
runTest(testName : java.lang.String, reporter : Reporter, stopper : Stopper, configMap : scala.collection.immutable.Map[java.lang.String, Any], tracker : Tracker) : Unit
UnsupportedOperationException
, because this method is unused by this
class, given this class's run
method delegates to JUnit to run
its tests.
The main purpose of this method implementation is to render a compiler error an attempt
to mix in a trait that overrides runTest
. Because this
trait does not actually use runTest
, the attempt to mix
in behavior would very likely not work.
testName -
the name of one test to run.reporter -
the Reporter
to which results will be reportedstopper -
the Stopper
that will be consulted to determine whether to stop execution early.configMap -
a Map
of key-value pairs that can be used by the executing Suite
of tests.tracker -
a Tracker
tracking Ordinal
s being fired by the current thread.UnsupportedOperationException -
always.
ScalaTest 1.1
|
|