org.exolab.jmscts.core
Class JUnitTestRunner

java.lang.Object
  |
  +--junit.runner.BaseTestRunner
        |
        +--org.exolab.jmscts.core.JUnitTestRunner
All Implemented Interfaces:
junit.framework.TestListener

public class JUnitTestRunner
extends junit.runner.BaseTestRunner

JUnit test runner which logs a trace as the tests are executed, followed by a summary at the end.

Version:
$Revision: 1.3 $ $Date: 2004/01/31 13:44:24 $
Author:
Tim Anderson

Fields inherited from class junit.runner.BaseTestRunner
SUITE_METHODNAME
 
Constructor Summary
JUnitTestRunner()
          Constructs a JUnitTestRunner
 
Method Summary
 void addError(junit.framework.Test test, java.lang.Throwable error)
          Logs a test error
 void addFailure(junit.framework.Test test, junit.framework.AssertionFailedError error)
          Logs a test failure
protected  junit.framework.TestResult createTestResult()
          Creates the TestResult to be used for the test run.
 junit.framework.TestResult doRun(junit.framework.Test suite)
          Run a test suite
 junit.runner.TestSuiteLoader getLoader()
          Always use the StandardTestSuiteLoader.
 void log(junit.framework.TestResult result)
          Logs the result of the test
 void logErrors(junit.framework.TestResult result)
          Logs any errors
 void logFailures(junit.framework.TestResult result)
          Log any failures
 void logHeader(junit.framework.TestResult result)
          Logs the header of the report
static void run(java.lang.Class testClass)
          Runs a suite extracted from a TestCase subclass.
static void run(junit.framework.Test suite)
          Runs a suite
protected  void runFailed(java.lang.String message)
          Notifies of overall test failure, and exits
 void startTest(junit.framework.Test test)
          Logs the start of a test
 void testEnded(java.lang.String testName)
          Notifies the end of a test
 void testFailed(int status, junit.framework.Test test, java.lang.Throwable error)
          Notifies the failure of a test
 void testStarted(java.lang.String testName)
          Notifies the start of a test
 
Methods inherited from class junit.runner.BaseTestRunner
clearStatus, elapsedTimeAsString, endTest, extractClassName, getFilteredTrace, getFilteredTrace, getPreference, getPreference, getPreferences, getTest, inVAJava, loadSuiteClass, processArguments, savePreferences, setLoading, setPreference, setPreferences, showStackRaw, truncate, useReloadingTestSuiteLoader
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JUnitTestRunner

public JUnitTestRunner()
Constructs a JUnitTestRunner
Method Detail

getLoader

public junit.runner.TestSuiteLoader getLoader()
Always use the StandardTestSuiteLoader. Overridden from BaseTestRunner.
Overrides:
getLoader in class junit.runner.BaseTestRunner
Returns:
a new StandardTestSuiteLoader

testStarted

public void testStarted(java.lang.String testName)
Notifies the start of a test
Overrides:
testStarted in class junit.runner.BaseTestRunner
Parameters:
testName - the name of the test

testEnded

public void testEnded(java.lang.String testName)
Notifies the end of a test
Overrides:
testEnded in class junit.runner.BaseTestRunner
Parameters:
testName - the name of the test

testFailed

public void testFailed(int status,
                       junit.framework.Test test,
                       java.lang.Throwable error)
Notifies the failure of a test
Overrides:
testFailed in class junit.runner.BaseTestRunner
Parameters:
status - the status
test - the test
error - the error

doRun

public junit.framework.TestResult doRun(junit.framework.Test suite)
Run a test suite
Parameters:
suite - the suite to run
Returns:
the result of the run

startTest

public void startTest(junit.framework.Test test)
Logs the start of a test
Overrides:
startTest in class junit.runner.BaseTestRunner
Parameters:
test - the test

addError

public void addError(junit.framework.Test test,
                     java.lang.Throwable error)
Logs a test error
Overrides:
addError in class junit.runner.BaseTestRunner
Parameters:
test - the test
error - the error

addFailure

public void addFailure(junit.framework.Test test,
                       junit.framework.AssertionFailedError error)
Logs a test failure
Overrides:
addFailure in class junit.runner.BaseTestRunner
Parameters:
test - the test
error - the error

log

public void log(junit.framework.TestResult result)
Logs the result of the test
Parameters:
result - the test result

logErrors

public void logErrors(junit.framework.TestResult result)
Logs any errors
Parameters:
result - the test result

logFailures

public void logFailures(junit.framework.TestResult result)
Log any failures
Parameters:
result - the test result

logHeader

public void logHeader(junit.framework.TestResult result)
Logs the header of the report
Parameters:
result - the test result

run

public static void run(java.lang.Class testClass)
Runs a suite extracted from a TestCase subclass.
Parameters:
testClass - the class of the test case

run

public static void run(junit.framework.Test suite)
Runs a suite
Parameters:
suite - the suite to run

createTestResult

protected junit.framework.TestResult createTestResult()
Creates the TestResult to be used for the test run.
Returns:
a new TestResult

runFailed

protected void runFailed(java.lang.String message)
Notifies of overall test failure, and exits
Overrides:
runFailed in class junit.runner.BaseTestRunner
Parameters:
message - the failure message


Copyright © 2001-2004 JMS CTS Team. All Rights Reserved.