in scala.testing
object SUnit

`object` SUnit
  `extends` java.lang.Object
  `with` scala.ScalaObject

  Unit testing methods in the spirit of JUnit framework.

  Use these classes like this:

       import scala.testing.SUnit
       import SUnit._

       class MyTest(n: String) extends TestCase(n) {

         override def runTest() = n match {
           case "myTest1" => assertTrue(true)
           case "myTest2" => assertTrue("hello", false)
         }
       }

       val r = new TestResult()
       suite.run(r)
       for (val tf <- r.failures()) {
         Console.println(tf.toString())
       }

  The trait TestConsoleMain contains this code as a main method, for convenience.

Class Summary
`case` | `class` AssertFailed an AssertFailed is thrown for a failed assertion
| `class` TestCase The class `TestCase` defines the fixture to run multiple tests.
| `class` TestFailure The class `TestFailure` collects a failed test together with the thrown exception.
| `class` TestResult a TestResult collects the result of executing a test case
| `class` TestSuite The class `TestSuite` runs a composite of test cases.

Trait Summary
`abstract` | `trait` Assert this class defined useful assert methods
`abstract` | `trait` Test a Test can be run with its result being collected
`abstract` | `trait` TestConsoleMain convenience trait, mix it in a TestMain object and implement "suite" to get this code val r = new TestResult() suite.run(r) for (val tf <- r.failures()) { Console.println(tf.toString())

Constructor Summary
| `def` this

Trait Detail

`abstract trait` Assert
  `extends` java.lang.Object
  `with` scala.ScalaObject

  this class defined useful assert methods

Direct Known Subclasses:
  TestCase

Def Summary
| `def` assertEq (expected: => java.lang.Object, actual: => java.lang.Object) : scala.Unit fails if expected ne actual
| `def` assertEq (msg: java.lang.String, expected: => java.lang.Object, actual: => java.lang.Object) : scala.Unit fails if expected ne actual
| `def` assertEquals [A] (expected: A, actual: => A) : scala.Unit fails if expected != actual
| `def` assertEquals [A] (msg: java.lang.String, expected: A, actual: => A) : scala.Unit fails if expected != actual
| `def` assertFalse (actual: => scala.Boolean) : scala.Unit succeeds if actual is false
| `def` assertFalse (msg: java.lang.String, actual: => scala.Boolean) : scala.Unit succeeds if actual is false
| `def` assertNotEq (expected: => java.lang.Object, actual: => java.lang.Object) : scala.Unit fail if expected eq actual
| `def` assertNotEq (msg: java.lang.String, expected: => java.lang.Object, actual: => java.lang.Object) : scala.Unit fail if expected eq actual
| `def` assertNotNull (actual: => java.lang.Object) : scala.Unit fails if null eq actual
| `def` assertNotNull (msg: java.lang.String, actual: => java.lang.Object) : scala.Unit fails if null eq actual
| `def` assertNotSame (expected: => java.lang.Object, actual: => java.lang.Object) : scala.Unit
| `def` assertNotSame (msg: java.lang.String, expected: => java.lang.Object, actual: => java.lang.Object) : scala.Unit
| `def` assertNull (actual: => java.lang.Object) : scala.Unit fails if actual ne null
| `def` assertNull (msg: java.lang.String, actual: => java.lang.Object) : scala.Unit fails if actual ne null
| `def` assertSame (expected: => java.lang.Object, actual: => java.lang.Object) : scala.Unit
| `def` assertSame (msg: java.lang.String, expected: => java.lang.Object, actual: => java.lang.Object) : scala.Unit
| `def` assertTrue (actual: => scala.Boolean) : scala.Unit succeeds if actual == true
| `def` assertTrue (msg: java.lang.String, actual: => scala.Boolean) : scala.Unit succeeds if actual == true
| `def` fail (msg: java.lang.String) : scala.Unit throws `AssertFailed` with given message `msg`.

Def Detail

`def` assertEq (expected: => java.lang.Object, actual: => java.lang.Object): scala.Unit

  fails if expected ne actual

`def` assertEq (msg: java.lang.String, expected: => java.lang.Object, actual: => java.lang.Object): scala.Unit

  fails if expected ne actual

`def` assertEquals [A](expected: A, actual: => A): scala.Unit

  fails if expected != actual

`def` assertEquals [A](msg: java.lang.String, expected: A, actual: => A): scala.Unit

  fails if expected != actual

`def` assertFalse (actual: => scala.Boolean): scala.Unit

  succeeds if actual is false

`def` assertFalse (msg: java.lang.String, actual: => scala.Boolean): scala.Unit

  succeeds if actual is false

`def` assertNotEq (expected: => java.lang.Object, actual: => java.lang.Object): scala.Unit

  fail if expected eq actual

`def` assertNotEq (msg: java.lang.String, expected: => java.lang.Object, actual: => java.lang.Object): scala.Unit

  fail if expected eq actual

`def` assertNotNull (actual: => java.lang.Object): scala.Unit

  fails if null eq actual

`def` assertNotNull (msg: java.lang.String, actual: => java.lang.Object): scala.Unit

  fails if null eq actual

@scala.deprecated
`def` assertNotSame (expected: => java.lang.Object, actual: => java.lang.Object): scala.Unit

Deprecated:
  use assertNotEq instead

@scala.deprecated
`def` assertNotSame (msg: java.lang.String, expected: => java.lang.Object, actual: => java.lang.Object): scala.Unit

Deprecated:
  use assertNotEq instead

`def` assertNull (actual: => java.lang.Object): scala.Unit

  fails if actual ne null

`def` assertNull (msg: java.lang.String, actual: => java.lang.Object): scala.Unit

  fails if actual ne null

`def` assertSame (expected: => java.lang.Object, actual: => java.lang.Object): scala.Unit

Deprecated:
  use assertEq instead

`def` assertSame (msg: java.lang.String, expected: => java.lang.Object, actual: => java.lang.Object): scala.Unit

Deprecated:
  use assertEq instead

`def` assertTrue (actual: => scala.Boolean): scala.Unit

  succeeds if actual == true

`def` assertTrue (msg: java.lang.String, actual: => scala.Boolean): scala.Unit

  succeeds if actual == true

`def` fail (msg: java.lang.String): scala.Unit

  throws `AssertFailed` with given message `msg`.

`abstract trait` Test
  `extends` java.lang.Object
  `with` scala.ScalaObject

  a Test can be run with its result being collected

Direct Known Subclasses:
  TestCase, TestSuite

Def Summary
`abstract` | `def` run (r: SUnit.this.TestResult) : scala.Unit

Def Detail

`abstract def` run (r: SUnit.this.TestResult): scala.Unit

`abstract trait` TestConsoleMain
  `extends` java.lang.Object
  `with` scala.ScalaObject

  convenience trait, mix it in a TestMain object and implement "suite" to get this code val r = new TestResult() suite.run(r) for (val tf <- r.failures()) { Console.println(tf.toString())

Def Summary
| `def` main (args: scala.Array[java.lang.String]) : scala.Unit
`abstract` | `def` suite : SUnit.this.TestSuite

Def Detail

`def` main (args: scala.Array[java.lang.String]): scala.Unit

`abstract def` suite : SUnit.this.TestSuite

Constructor Detail

`def` this