ScalaTest 0.9.5
|
|
org/scalatest/junit/JUnit3Suite.scala
]
trait
JUnit3Suite
extends
junit.framework.TestCase with
SuiteassertEquals
, etc.).
You create tests by defining methods that start with test
, and can create fixtures with methods
named setUp
and tearDown
. For example:
import org.scalatest.junit.JUnit3Suite import scala.collection.mutable.ListBuffer class TwoSuite extends JUnit3Suite { var sb: StringBuilder = _ var lb: ListBuffer[String] = _ override def setUp() { sb = new StringBuilder("ScalaTest is ") lb = new ListBuffer[String] } def testEasy() { sb.append("easy!") assert(sb.toString === "ScalaTest is easy!") assert(lb.isEmpty) lb += "sweet" } def testFun() { sb.append("fun!") assert(sb.toString === "ScalaTest is fun!") assert(lb.isEmpty) } }
To execute JUnit3Suite
s with ScalaTest's Runner
, you must include JUnit3's jar file on the class path or runpath.
This version of JUnit3Suite
was tested with JUnit version 3.8.1.
Method Summary | |
override def
|
execute
(testName : scala.Option[java.lang.String], reporter : Reporter, stopper : Stopper, groupsToInclude : scala.collection.immutable.Set[java.lang.String], groupsToExclude : scala.collection.immutable.Set[java.lang.String], properties : scala.collection.immutable.Map[java.lang.String, Any], distributor : scala.Option[Distributor]) : Unit
Execute this
JUnit3Suite . |
Methods inherited from Suite | |
nestedSuites, execute, execute, groups, testNames, runTest, runTests, runNestedSuites, suiteName, expectedTestCount |
Methods inherited from Assertions | |
assert, assert, assert, assert, convertToEqualizer, intercept, intercept, intercept, expect, expect, fail, fail, fail, fail |
Methods inherited from AnyRef | |
getClass, hashCode, equals, clone, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized |
Methods inherited from Any | |
==, !=, isInstanceOf, asInstanceOf |
Method Details |
override
def
execute(testName : scala.Option[java.lang.String], reporter : Reporter, stopper : Stopper, groupsToInclude : scala.collection.immutable.Set[java.lang.String], groupsToExclude : scala.collection.immutable.Set[java.lang.String], properties : scala.collection.immutable.Map[java.lang.String, Any], distributor : scala.Option[Distributor]) : Unit
JUnit3Suite
.testName -
an optional name of one test to execute. If None
, all tests will be executed. I.e., None
acts like a wildcard that means execute all tests in this JUnit3Suite
.reporter -
the Reporter
to which results will be reportedgroupsToInclude -
Contains the names of groups to run. This class ignores this parameter.groupsToExclude -
Tests in groups in this Set will not be executed. This class ignores this parameter.stopper -
the Stopper
may be used to request an early termination of a suite of tests. Currently, this class ignores this parameter.properties -
a Map
of properties that can be used by the executing Suite
of tests. This class does not use this parameter.distributor -
an optional Distributor
, into which nested Suite
s could be put to be executed by another entity, such as concurrently by a pool of threads. If None
, nested Suite
s will be executed sequentially.
Currently, this class ignores this parameter.NullPointerException -
if any passed parameter is null
.
ScalaTest 0.9.5
|
|