jmunit.framework.cldc11
Class TestResult

java.lang.Object
  extended by jmunit.framework.cldc11.TestResult

public class TestResult
extends java.lang.Object

The TestResult class collects test results and relays them to TestListeners.

Since:
JMUnit 1.1.
Author:
C.A. Meijer

Constructor Summary
TestResult()
          The constructor.
 
Method Summary
 void addError(java.lang.Class testClass, java.lang.String test, java.lang.Throwable t)
          An error or failure occurred.
 void addListener(TestListener listener)
          Registers a TestListener
 void clear()
          Clears the results of all the tests.
 void endTest(java.lang.Class testClass, java.lang.String test)
          A test ended.
 void removeListeners()
          Unregisters all TestListeners
 void startTest(java.lang.Class testClass, java.lang.String test)
          A test started.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TestResult

public TestResult()
The constructor.

Method Detail

addListener

public void addListener(TestListener listener)
Registers a TestListener

Parameters:
listener - The listener.
Since:
JMUnit 1.1.

removeListeners

public void removeListeners()
Unregisters all TestListeners

Since:
JMUnit 1.1.

addError

public void addError(java.lang.Class testClass,
                     java.lang.String test,
                     java.lang.Throwable t)
An error or failure occurred. Note that, unlike JUnit, the TestResult's API doesn't distinguish between failures and errors. Kent Beck has written that he's not sure that the distinction between errors and failures is worthwhile since it complicates the interface. We still draw the distinction for TestListeners though.

Parameters:
testClass - the Class associated with the test.
test - The test.
t - The error.
Since:
JMUnit 1.1.

endTest

public void endTest(java.lang.Class testClass,
                    java.lang.String test)
A test ended.

Parameters:
testClass - the Class associated with the test.
test - The test.
Since:
JMUnit 1.1.

startTest

public void startTest(java.lang.Class testClass,
                      java.lang.String test)
A test started.

Parameters:
testClass - the Class associated with the test.
test - The test.
Since:
JMUnit 1.1.

clear

public void clear()
Clears the results of all the tests.

Since:
JMUnit 1.1.