UTJML

edu.utep.cs.utjml.rat
Class RatTestRunner

java.lang.Object
  extended by junit.runner.BaseTestRunner
      extended by junit.textui.TestRunner
          extended by edu.utep.cs.utjml.rat.RatTestRunner
All Implemented Interfaces:
junit.framework.TestListener

public class RatTestRunner
extends junit.textui.TestRunner

A JML/JUnit test runner class. This class refines JUnit's text-based test runner class TestRunner and provides a command line based tool to run tests.

 java org.jmlspecs.jmlunit.JMLTestRunner [-wait] TestCaseClass
 
JMLTestRunner expects the name of a TestCase class as argument. If this class defines a static suite method it will be invoked and the returned test is run. Otherwise all the methods starting with "test" having no arguments are run.

When the wait command line argument is given JMLTestRunner waits until the users types RETURN.

JMLTestRunner prints a trace as the tests are executed followed by a summary at the end. In addition to the summary by TestRunner, it produces JML/JUnit specific test results such as the total number of test cases and the number of meaningful test cases.

Version:
$Revision: 1.1 $
Author:
Yoonsik Cheon

Nested Class Summary
static class RatTestRunner.JmlResultPrinter
           
 
Field Summary
protected static boolean showMeaninglessCases
          If true, then information about the cases declared meaningless is printed at the end of the JUnit run.
 
Fields inherited from class junit.textui.TestRunner
EXCEPTION_EXIT, FAILURE_EXIT, SUCCESS_EXIT
 
Fields inherited from class junit.runner.BaseTestRunner
SUITE_METHODNAME
 
Constructor Summary
RatTestRunner()
          Constructs a JMLTestRunner using System.out for all output.
RatTestRunner(PrintStream writer)
          Constructs a JMLTestRunner using the given stream for all the output.
 
Method Summary
protected  junit.framework.TestResult createTestResult()
          Creates a test result object to be used for a test run.
 junit.framework.TestResult doRun(junit.framework.Test suite, boolean wait)
          Performs test execution and print test report.
static void main(String[] args)
          Performs test execution for the user-specified testcase class.
static junit.framework.TestResult run(junit.framework.Test suite)
          Runs a single test and collects its results.
static void runAndWait(junit.framework.Test suite)
          Runs a single test and waits until the user types RETURN.
 
Methods inherited from class junit.textui.TestRunner
doRun, getLoader, pause, run, runFailed, setPrinter, start, testEnded, testFailed, testStarted
 
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

showMeaninglessCases

protected static boolean showMeaninglessCases
If true, then information about the cases declared meaningless is printed at the end of the JUnit run.

Constructor Detail

RatTestRunner

public RatTestRunner()
Constructs a JMLTestRunner using System.out for all output.


RatTestRunner

public RatTestRunner(PrintStream writer)
Constructs a JMLTestRunner using the given stream for all the output.

Method Detail

main

public static void main(String[] args)
Performs test execution for the user-specified testcase class. The name of a TestCase class must be given as an argument. If this class defines a static suite method it will be invoked and the returned test is run. Otherwise all the methods starting with "test" having no arguments are run.
 
 java org.jmlspecs.jmlunit.JMLTestRunner [-M] [-wait] TestCaseClass 
 


run

public static junit.framework.TestResult run(junit.framework.Test suite)
Runs a single test and collects its results. This method can be used to start a test run from a program, e.g.
 public static void main (String[] args) {
     org.jmlspecs.jmlunit.RatTestRunner.run(suite());
 }
 


runAndWait

public static void runAndWait(junit.framework.Test suite)
Runs a single test and waits until the user types RETURN.


doRun

public junit.framework.TestResult doRun(junit.framework.Test suite,
                                        boolean wait)
Performs test execution and print test report. This method is overridden here to produce a JML-specific summary report. The method print of the class ResultPrinter is package-visible, thus all these troubles of overriding.

Overrides:
doRun in class junit.textui.TestRunner

createTestResult

protected junit.framework.TestResult createTestResult()
Creates a test result object to be used for a test run.

Overrides:
createTestResult in class junit.textui.TestRunner

UTJML

UTJML is Copyright (C) 2004-2006 by University of Texas at El Paso and is distributed under the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This release depends on code from the JML project.