scala.testing

SUnit

object SUnit extends AnyRef

Unit testing methods in the spirit of JUnit framework.

Use these classes like this:

import scala.testing.SUnitimport 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 (tf <- r.failures()) { println(tf.toString()) }

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

linear super types: AnyRef, Any
source: SUnit.scala
    deprecated:
  1. "SUnit will be removed in 2.8.0. There are several free and sophisticated testing\012".+("frameworks for Scala available, examples are "ScalaTest", "ScalaCheck" or "Specs".")

Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Hide All
  2. Show all
  1. SUnit
  2. AnyRef
  3. Any
Visibility
  1. Public
  2. All
Impl.
  1. Concrete
  2. Abstract

Type Members

  1. trait Assert extends AnyRef

    this class defines useful assert methods

  2. case class AssertFailed (msg: String, stackTrace: Boolean) extends RuntimeException with Product

    an AssertFailed is thrown for a failed assertion

  3. trait Test extends AnyRef

    a Test can be run with its result being collected

  4. class TestCase extends Test with Assert

    The class TestCase defines the fixture to run multiple tests.

  5. trait TestConsoleMain extends AnyRef

    Convenience trait, mix it in a TestMain object and implement "suite" to get this code.

  6. class TestFailure extends AnyRef

    The class TestFailure collects a failed test together with the thrown exception.

  7. class TestResult extends AnyRef

    a TestResult collects the result of executing a test case

  8. class TestSuite extends Test

    The class TestSuite runs a composite of test cases.