junitx.ddtunit
Class DDTRunMonitor

java.lang.Object
  extended by junit.textui.ResultPrinter
      extended by junitx.ddtunit.DDTRunMonitor
All Implemented Interfaces:
junit.framework.TestListener, DDTTestListener

public class DDTRunMonitor
extends junit.textui.ResultPrinter
implements DDTTestListener

This class implements a simple monitor for testruns.
It is implemented as singleton so we can use it internally to protocol test progress and results.
Lateron there will be an implementaion of a TestRunner that conformes to the interface DDTTestListener

Author:
jg

Method Summary
 void addError(junit.framework.Test test, Throwable t)
          Just let the standard runner do this work - do nothing
 void addFailure(junit.framework.Test test, junit.framework.AssertionFailedError t)
          Just let the standard runner do this work - do nothing
 void addMethodTestError(junit.framework.Test test, String testName, Throwable throwable)
          Add error of executed test
 void addMethodTestFailure(junit.framework.Test test, String testName, junit.framework.AssertionFailedError assertFailed)
          Add failure of executed test
 void endMethodTest(IDDTTestCase test, String testName)
          Notify about end of method test execution
 void endTest(junit.framework.Test test)
          Just let the standard runner do this work - do nothing
static DDTRunMonitor getInstance()
          Get singleton instance of this class
 void startMethodTest(IDDTTestCase test, String testName)
          Notify about start of method test execution
 void startTest(junit.framework.Test test)
          Just let the standard runner do this work - do nothing
 
Methods inherited from class junit.textui.ResultPrinter
elapsedTimeAsString, getWriter, printDefect, printDefectHeader, printDefects, printDefectTrace, printErrors, printFailures, printFooter, printHeader
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static DDTRunMonitor getInstance()
Get singleton instance of this class

Returns:
singleton instance

addMethodTestError

public void addMethodTestError(junit.framework.Test test,
                               String testName,
                               Throwable throwable)
Add error of executed test

Specified by:
addMethodTestError in interface DDTTestListener
Parameters:
test - processed
testName - actually processed
throwable - caught during execution
See Also:
DDTTestListener.addMethodTestError(junit.framework.Test, java.lang.String, java.lang.Throwable)

addMethodTestFailure

public void addMethodTestFailure(junit.framework.Test test,
                                 String testName,
                                 junit.framework.AssertionFailedError assertFailed)
Add failure of executed test

Specified by:
addMethodTestFailure in interface DDTTestListener
Parameters:
test - processed
testName - actually processed
assertFailed - caught during execution
See Also:
DDTTestListener.addMethodTestFailure(junit.framework.Test, java.lang.String, junit.framework.AssertionFailedError)

endMethodTest

public void endMethodTest(IDDTTestCase test,
                          String testName)
Notify about end of method test execution

Specified by:
endMethodTest in interface DDTTestListener
Parameters:
test - processed
testName - actually processed
See Also:
junitx.ddtunit.DDTTestListener#endMethodTest(junitx.ddtunit.DDTTestCase, java.lang.String)

startMethodTest

public void startMethodTest(IDDTTestCase test,
                            String testName)
Notify about start of method test execution

Specified by:
startMethodTest in interface DDTTestListener
Parameters:
test - processed
testName - actually processed
See Also:
junitx.ddtunit.DDTTestListener#startMethodTest(junitx.ddtunit.DDTTestCase, java.lang.String)

addError

public void addError(junit.framework.Test test,
                     Throwable t)
Just let the standard runner do this work - do nothing

Specified by:
addError in interface junit.framework.TestListener
Overrides:
addError in class junit.textui.ResultPrinter
See Also:
TestListener.addError(junit.framework.Test, java.lang.Throwable)

addFailure

public void addFailure(junit.framework.Test test,
                       junit.framework.AssertionFailedError t)
Just let the standard runner do this work - do nothing

Specified by:
addFailure in interface junit.framework.TestListener
Overrides:
addFailure in class junit.textui.ResultPrinter
See Also:
TestListener.addFailure(junit.framework.Test, junit.framework.AssertionFailedError)

endTest

public void endTest(junit.framework.Test test)
Just let the standard runner do this work - do nothing

Specified by:
endTest in interface junit.framework.TestListener
Overrides:
endTest in class junit.textui.ResultPrinter
See Also:
TestListener.endTest(junit.framework.Test)

startTest

public void startTest(junit.framework.Test test)
Just let the standard runner do this work - do nothing

Specified by:
startTest in interface junit.framework.TestListener
Overrides:
startTest in class junit.textui.ResultPrinter
See Also:
TestListener.startTest(junit.framework.Test)


Copyright © 2004-2011. All Rights Reserved.