UTF-X, Unit Testing Framework - Xslt

utfx.runner
Class TestRunner

java.lang.Object
  extended by junit.runner.BaseTestRunner
      extended by utfx.runner.TestRunner
All Implemented Interfaces:
junit.framework.TestListener

public class TestRunner
extends junit.runner.BaseTestRunner

UTF-X TestRunner. This code is based on the original junit.textui.TestRunner class written by Kent Beck and Erich Gamma. FIXME rewrite me please

Copyright © 2004-2005 University of Southern Queensland and others.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License v2 as published by the Free Software Foundation.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

$Source: /cvs/utf-x/framework/src/java/utfx/runner/TestRunner.java,v $

Version:
$Revision: 1.2.2.5 $ $Date: 2006/08/23 08:28:39 $ $Name: release_0_0_8_alpha $
Author:
Kent Beck (original author), Erich Gamma (original author), Jacek Radajewski

Field Summary
private  ConfigurationManager cm
           
static int EXCEPTION_EXIT
           
static int FAILURE_EXIT
           
private  org.apache.log4j.Logger log
          logger
(package private)  ResultPrinterFactory rpf
          result printer factory
static int SUCCESS_EXIT
           
 
Fields inherited from class junit.runner.BaseTestRunner
SUITE_METHODNAME
 
Constructor Summary
TestRunner()
          Construct a new UTF-X test runner object.
 
Method Summary
protected  junit.framework.TestResult createTestResult()
           
private  void displayReport()
          Attempt to open the report in a browser.
 junit.framework.TestResult doRun(junit.framework.Test suite, ResultPrinterFactory rpf)
          This is where we run the tests.
private  void generateReport(java.io.InputStream xmlIs)
           
 junit.runner.TestSuiteLoader getLoader()
          Always use the StandardTestSuiteLoader.
static void main(java.lang.String[] args)
          Main method
static junit.framework.TestResult run(junit.framework.Test test, ResultPrinterFactory rpf)
          Runs a single test and collects its results.
protected  void runFailed(java.lang.String message)
           
private  void runSuite(junit.framework.TestSuite suite, junit.framework.TestResult result, ResultPrinter[] rp)
          Run a test suite
private  void runTest(junit.framework.Test test, junit.framework.TestResult result, ResultPrinter[] rp)
          Run a test of unspecified type (class)
private  void runTestCase(junit.framework.TestCase testCase, junit.framework.TestResult result)
          Run an individual test case.
protected  junit.framework.TestResult start(java.lang.String[] args)
          Starts a test run.
 void testEnded(java.lang.String testName)
           
 void testFailed(int status, junit.framework.Test test, java.lang.Throwable t)
           
 void testStarted(java.lang.String testName)
           
 
Methods inherited from class junit.runner.BaseTestRunner
addError, addFailure, clearStatus, elapsedTimeAsString, endTest, extractClassName, getFilteredTrace, getFilteredTrace, getPreference, getPreference, getPreferences, getTest, inVAJava, loadSuiteClass, processArguments, savePreferences, setLoading, setPreference, setPreferences, showStackRaw, startTest, truncate, useReloadingTestSuiteLoader
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

rpf

ResultPrinterFactory rpf
result printer factory


log

private org.apache.log4j.Logger log
logger


cm

private ConfigurationManager cm

SUCCESS_EXIT

public static final int SUCCESS_EXIT
See Also:
Constant Field Values

FAILURE_EXIT

public static final int FAILURE_EXIT
See Also:
Constant Field Values

EXCEPTION_EXIT

public static final int EXCEPTION_EXIT
See Also:
Constant Field Values
Constructor Detail

TestRunner

public TestRunner()
Construct a new UTF-X test runner object.

Method Detail

run

public static junit.framework.TestResult run(junit.framework.Test test,
                                             ResultPrinterFactory rpf)
Runs a single test and collects its results. This method can be used to start a test run from your program.


getLoader

public junit.runner.TestSuiteLoader getLoader()
Always use the StandardTestSuiteLoader. Overridden from BaseTestRunner.

Overrides:
getLoader in class junit.runner.BaseTestRunner

testFailed

public void testFailed(int status,
                       junit.framework.Test test,
                       java.lang.Throwable t)
Specified by:
testFailed in class junit.runner.BaseTestRunner

testStarted

public void testStarted(java.lang.String testName)
Specified by:
testStarted in class junit.runner.BaseTestRunner

testEnded

public void testEnded(java.lang.String testName)
Specified by:
testEnded in class junit.runner.BaseTestRunner

createTestResult

protected junit.framework.TestResult createTestResult()

doRun

public junit.framework.TestResult doRun(junit.framework.Test suite,
                                        ResultPrinterFactory rpf)
This is where we run the tests.

Parameters:
suite - suite of tests to run

generateReport

private void generateReport(java.io.InputStream xmlIs)
                     throws java.lang.Exception
Throws:
java.lang.Exception

displayReport

private void displayReport()
Attempt to open the report in a browser.


runTestCase

private void runTestCase(junit.framework.TestCase testCase,
                         junit.framework.TestResult result)
Run an individual test case.


runTest

private void runTest(junit.framework.Test test,
                     junit.framework.TestResult result,
                     ResultPrinter[] rp)
Run a test of unspecified type (class)


runSuite

private void runSuite(junit.framework.TestSuite suite,
                      junit.framework.TestResult result,
                      ResultPrinter[] rp)
Run a test suite


start

protected junit.framework.TestResult start(java.lang.String[] args)
                                    throws java.lang.Exception
Starts a test run. This is top level method called on an instance of this class. Analyzes the command line arguments and runs the given test suite.

Parameters:
args - array of comman line argument; same as the arguments passed to main().
Returns:
result of the regression test.
Throws:
java.lang.Exception

runFailed

protected void runFailed(java.lang.String message)
Specified by:
runFailed in class junit.runner.BaseTestRunner

main

public static void main(java.lang.String[] args)
Main method


UTF-X, Unit Testing Framework - Xslt