trait JUnitSuite

trait JUnitSuite

 extends Test with ScalaObject

The strategy for running Specifications with JUnit is as follow:

-the specifications are used to create JUnit3 TestSuite and TestCase objects -however, since TestSuite is not an interface, a JUnitSuite trait is used to represent it (and the JUnitSuite uses a TestSuite internally to hold the tests) -a specification is represented as a JUnitSuite -a system under test (sus) is represented as an ExamplesTestSuite <: JUnitSuite -an example is represented as an ExampleTestCase <: TestCase Then, the JUnitSuite which implements the junit.framework.Test interface can be run using a custom JUnit4 annotation: JUnitSuiteRunner This JUnitSuite trait encapsulates a JUnit3 TestSuite to allow it being seen as a trait and not a class The suite is initialized once whenever some information is required, like getName, or countTestCases

Source: JUnit.scala(23)

Direct Known Subclasses

JUnit, ExamplesTestSuite,


getName def getName
- the name of the embedded suite
suites def suites
- the test suites of the embedded suite
testCases def testCases
- the test cases of the embedded suite
testSuite val testSuite
embedded JUnit3 TestSuite object
tests def tests
- the tests of the embedded suite (suites and test cases)


!= final def !=(arg0 : Any) Boolean Any
!= final def !=(arg0 : Object) Boolean AnyRef
== final def ==(arg0 : Object) Boolean AnyRef
== final def ==(arg0 : Any) Boolean Any
addTest def addTest(t : Test)
add a new test to the embedded suite
asInstanceOf final def asInstanceOf[T0] T0 Any
clone protected def clone Object AnyRef
countTestCases def countTestCases
- the number of tests of the embedded suite (suites and test cases)
eq final def eq(arg0 : Object) Boolean AnyRef
equals def equals(arg0 : Any) Boolean AnyRef
finalize protected def finalize Unit AnyRef
getClass final def getClass Class[Object] AnyRef
hashCode def hashCode Int AnyRef
init def init
the init method is called before any "getter" method is called [details]
Then it initializes the object if it hasn't been done before
initialize abstract def initialize
the initialize method should be provided to build the testSuite object by adding nested suites and test cases
isInstanceOf final def isInstanceOf[T0] Boolean Any
ne final def ne(arg0 : Object) Boolean AnyRef
notify final def notify Unit AnyRef
notifyAll final def notifyAll Unit AnyRef
run def run(result : TestResult)
run the embedded suite
setName def setName(n : String)
set the name of the embedded suite
synchronized final def synchronized[T0](arg0 : T0) T0 AnyRef
toString def toString String AnyRef
wait final def wait Unit AnyRef
wait final def wait(arg0 : Long) Unit AnyRef
wait final def wait(arg0 : Long, arg1 : Int) Unit AnyRef
Copyright (c) 2007-2009. All Rights Reserved.