org.quilt.runner
Class BaseTestRunner

java.lang.Object
  |
  +--org.quilt.framework.QuiltTest
        |
        +--org.quilt.runner.Runner
              |
              +--org.quilt.runner.BaseTestRunner
All Implemented Interfaces:
java.lang.Cloneable, RunnerConst, junit.framework.TestListener

public class BaseTestRunner
extends Runner

Stand-along Quilt test runner, fully compatible with Ant's JUnit options. Accepts options from Ant via QuiltTask; can also be run from the command line using TestRunner.

See Also:
QuiltTask, QuiltTest, TestRunner

Field Summary
 
Fields inherited from interface org.quilt.runner.RunnerConst
DEFAULT_TRACE_FILTERS, ERRORS, FAILURES, SUCCESS
 
Constructor Summary
BaseTestRunner(QuiltTest test)
          Constructor used by command line test runner.
BaseTestRunner(QuiltTest test, java.lang.ClassLoader loader)
          Constructor used when not using Quilt class loader.
 
Method Summary
 void addError(junit.framework.Test test, java.lang.Throwable t)
          An unexpected error occurred.
 void addFailure(junit.framework.Test test, junit.framework.AssertionFailedError t)
          A test failure (or error) has occurred.
 void addFailure(junit.framework.Test test, java.lang.Throwable t)
          A test failure (or error) has occurred.
 void addFormatter(Formatter f)
          Add a result formatter
 void endTest(junit.framework.Test test)
          Called at end of test suite.
 int getRetCode()
          Get status code from run.
 void handleErrorFlush(java.lang.String line)
          Flush error output.
 void handleErrorOutput(java.lang.String line)
          Process an error message.
 void handleFlush(java.lang.String line)
          Flush standard output.
 void handleOutput(java.lang.String line)
          Handle a block of output.
 void run()
           
 void startTest(junit.framework.Test t)
          Called at start of test run.
 
Methods inherited from class org.quilt.runner.Runner
filterStack, getFilteredTrace
 
Methods inherited from class org.quilt.framework.QuiltTest
addFormatter, addFormattersTo, clone, errorCount, failureCount, getCheckCoverage, getCheckExcludes, getCheckExcludesArray, getCheckIncludes, getCheckIncludesArray, getErrorProperty, getFailureProperty, getFiltertrace, getFork, getFormatters, getHaltOnError, getHaltOnFailure, getIfProperty, getMockTestRun, getName, getOutfile, getProperties, getRunTime, getShowOutput, getTodir, getUnlessProperty, runCount, runMe, setCheckCoverage, setCheckExcludes, setCheckIncludes, setCounts, setErrorProperty, setFailureProperty, setFiltertrace, setFork, setHaltOnError, setHaltOnFailure, setIf, setMockTestRun, setName, setOutfile, setProperties, setRunTime, setShowOutput, setTodir, setUnless, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BaseTestRunner

public BaseTestRunner(QuiltTest test)
Constructor used by command line test runner. And so also used when Ant forks the test runner. XXX No longer true.

Parameters:
test - Data structure holding parameters for a single test suite.

BaseTestRunner

public BaseTestRunner(QuiltTest test,
                      java.lang.ClassLoader loader)
Constructor used when not using Quilt class loader. XXX Not true. Uses BaseTestRunner.retCode to signal whether construction successful or not. If the operation fails, the exception involved is passed back in BaseTestRunner.exception.

Parameters:
test - Data structure holding parameters for a single test suite.
loader - Class loader passed from parent.
Method Detail

run

public void run()
Specified by:
run in class Runner

getRetCode

public int getRetCode()
Get status code from run.

Specified by:
getRetCode in class Runner
Returns:
Status codes from RunnerConst

startTest

public void startTest(junit.framework.Test t)
Called at start of test run.

Specified by:
startTest in interface junit.framework.TestListener
Specified by:
startTest in class Runner

endTest

public void endTest(junit.framework.Test test)
Called at end of test suite.

Specified by:
endTest in interface junit.framework.TestListener
Specified by:
endTest in class Runner

addFailure

public void addFailure(junit.framework.Test test,
                       java.lang.Throwable t)
A test failure (or error) has occurred.

Specified by:
addFailure in class Runner

addFailure

public void addFailure(junit.framework.Test test,
                       junit.framework.AssertionFailedError t)
A test failure (or error) has occurred.

Specified by:
addFailure in interface junit.framework.TestListener
Specified by:
addFailure in class Runner

addError

public void addError(junit.framework.Test test,
                     java.lang.Throwable t)
An unexpected error occurred.

Specified by:
addError in interface junit.framework.TestListener
Specified by:
addError in class Runner

handleOutput

public void handleOutput(java.lang.String line)
Handle a block of output.

Specified by:
handleOutput in class Runner

handleErrorOutput

public void handleErrorOutput(java.lang.String line)
Process an error message.

Specified by:
handleErrorOutput in class Runner

handleFlush

public void handleFlush(java.lang.String line)
Flush standard output.

Specified by:
handleFlush in class Runner

handleErrorFlush

public void handleErrorFlush(java.lang.String line)
Flush error output.

Specified by:
handleErrorFlush in class Runner

addFormatter

public void addFormatter(Formatter f)
Add a result formatter

Specified by:
addFormatter in class Runner


Copyright © 2001-2003 Apache Software Foundation. All Rights Reserved.