Returns the number of tests expected to be run by JUnit when run is invoked
on this JUnitSuite.
Returns the number of tests expected to be run by JUnit when run is invoked
on this JUnitSuite.
If tagsToInclude in the passed Filter is defined, this class's
implementation of this method returns 0. Else this class's implementation of this method
returns the size of the set returned by testNames on the current instance,
less the number of tests that were annotated with org.junit.Ignore.
a Filter for test filtering
number of expected test count
Overrides to use JUnit 4 to run the test(s).
Overrides to use JUnit 4 to run the test(s).
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.
the Args for this run
a Status object that indicates when all tests and nested suites started by this method have completed, and whether or not a failure occurred.
Throws UnsupportedOperationException, because this method is unused by this
trait, given this trait's run method delegates to JUnit to run
its tests.
Throws UnsupportedOperationException, because this method is unused by this
trait, given this trait'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.
the Args for this run
always.
Throws UnsupportedOperationException, because this method is unused by this
trait, given this traits's run method delegates to JUnit to run
its tests.
Throws UnsupportedOperationException, because this method is unused by this
trait, given this traits'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.
the name of one test to run.
the Args for this run
always.
Throws UnsupportedOperationException, because this method is unused by this
trait, given this trait's run method delegates to JUnit to run
its tests.
Throws UnsupportedOperationException, because this method is unused by this
trait, given this trait'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.
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.
the Args for this run
always.
Suite style name.
Overrides to return just tests that have org.
Overrides to return just tests that have org.junit.Ignore on them, but calls it org.scalatest.Ignore. It also auto-tags suite level annotation.
Overrides to retrieve suite and test tags from annotations.
Overrides to retrieve suite and test tags from annotations.
the name of the test for which to return a TestData instance
the config map to include in the returned TestData
a TestData instance for the specified test, which includes the specified config map
Returns the set of test names that will be executed by JUnit when run is invoked
on an instance of this class, or the instance is passed directly to JUnit for running.
Returns the set of test names that will be executed by JUnit when run is invoked
on an instance of this class, or the instance is passed directly to JUnit for running.
The iterator obtained by invoking elements on this
returned Set will produce the test names in their natural order, as determined by String's
compareTo method. Nevertheless, this method is not consulted by JUnit when it
runs the tests, and JUnit may run the tests in any order.
Throws UnsupportedOperationException, because this method is unused by this
class, given this class's run method delegates to JUnit to run
its tests.
Throws 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.
the no-arg test function to run with a fixture
A suite of tests that can be run with either JUnit or ScalaTest. This class allows you to write JUnit 4 tests with ScalaTest's more concise assertion syntax as well as JUnit's assertions (
assertEquals, etc.). You create tests by defining methods that are annotated withTest, and can create fixtures with methods annotated withBeforeandAfter. For example:import org.scalatest.junit.JUnitSuite import scala.collection.mutable.ListBuffer import _root_.org.junit.Test import _root_.org.junit.Before class TwoSuite extends JUnitSuite { var sb: StringBuilder = _ var lb: ListBuffer[String] = _ @Before def initialize() { sb = new StringBuilder("ScalaTest is ") lb = new ListBuffer[String] } @Test def verifyEasy() { sb.append("easy!") assert(sb.toString === "ScalaTest is easy!") assert(lb.isEmpty) lb += "sweet" } @Test def verifyFun() { sb.append("fun!") assert(sb.toString === "ScalaTest is fun!") assert(lb.isEmpty) } }To execute
JUnitSuites with ScalaTest'sRunner, you must include JUnit's jar file on the class path or runpath. This version ofJUnitSuitewas tested with JUnit version 4.10.Instances of this class are not thread safe.