|
ScalaTest 0.9.2
|
|
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 JUnit3Suites 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, includes : scala.collection.immutable.Set[java.lang.String], excludes : 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, fail, fail, fail, fail, assert, assert, assert, assert, convertToEqualizer, intercept, intercept, expect, expect |
| 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, includes : scala.collection.immutable.Set[java.lang.String], excludes : 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 reportedincludes - Contains the names of groups to run. This class ignores this parameter.excludes - 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 Suites could be put to be executed by another entity, such as concurrently by a pool of threads. If None, nested Suites will be executed sequentially.
Currently, this class ignores this parameter.NullPointerException - if any passed parameter is null.|
ScalaTest 0.9.2
|
|