com.netriser.xmltestsuite
Class TestMonitor

java.lang.Object
  |
  +--junit.framework.Assert
        |
        +--com.netriser.xmltestsuite.TestResource
              |
              +--com.netriser.xmltestsuite.TestMonitor
All Implemented Interfaces:
junit.framework.TestListener, TestResourceInterface

public class TestMonitor
extends TestResource
implements junit.framework.TestListener

This resouce is a Test listener. Its used to provide a more readable output then the junit test runner. It illustrates how to monitor tests, and could be easily adapted to preform other actions.


Constructor Summary
TestMonitor()
           
 
Method Summary
 void addError(junit.framework.Test test, java.lang.Throwable t)
           
 void addFailure(junit.framework.Test test, junit.framework.AssertionFailedError t)
           
 void endTest(junit.framework.Test test)
           
 void setUp()
          Setup the resource before the tests are run
 void startTest(junit.framework.Test test)
           
 void tearDown()
          Tidy up the resource after the tests are run
 void useTestResult(junit.framework.TestResult resultCollector)
          Called when testing starts ie by Main::RunTest Provides opportunity to calll TestResult::addListener addListener requires class to implement TestListener interface
 
Methods inherited from class com.netriser.xmltestsuite.TestResource
debug, getDebugMode, getVerboseMode, setDebug, setVerbose, verbose
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TestMonitor

public TestMonitor()
Method Detail

useTestResult

public void useTestResult(junit.framework.TestResult resultCollector)
Description copied from interface: TestResourceInterface
Called when testing starts ie by Main::RunTest Provides opportunity to calll TestResult::addListener addListener requires class to implement TestListener interface

Specified by:
useTestResult in interface TestResourceInterface
Overrides:
useTestResult in class TestResource
See Also:
TestResourceInterface.useTestResult(TestResult)

setUp

public void setUp()
Description copied from class: TestResource
Setup the resource before the tests are run

Specified by:
setUp in interface TestResourceInterface
Specified by:
setUp in class TestResource
See Also:
TestResourceInterface.setUp()

tearDown

public void tearDown()
Description copied from class: TestResource
Tidy up the resource after the tests are run

Specified by:
tearDown in interface TestResourceInterface
Specified by:
tearDown in class TestResource
See Also:
TestResourceInterface.tearDown()

addError

public void addError(junit.framework.Test test,
                     java.lang.Throwable t)
Specified by:
addError in interface junit.framework.TestListener

addFailure

public void addFailure(junit.framework.Test test,
                       junit.framework.AssertionFailedError t)
Specified by:
addFailure in interface junit.framework.TestListener

startTest

public void startTest(junit.framework.Test test)
Specified by:
startTest in interface junit.framework.TestListener

endTest

public void endTest(junit.framework.Test test)
Specified by:
endTest in interface junit.framework.TestListener