jmathlib.tools.junit.runner
Class BaseTestRunner

java.lang.Object
  extended by jmathlib.tools.junit.runner.BaseTestRunner
All Implemented Interfaces:
TestListener
Direct Known Subclasses:
TestRunner, TestRunner

public abstract class BaseTestRunner
extends java.lang.Object
implements TestListener

Base class for all test runners. This class was born live on stage in Sardinia during XP2000.


Field Summary
(package private) static boolean fgFilterStack
           
(package private) static int fgMaxMessageLength
           
(package private)  boolean fLoading
           
(package private) static java.util.Properties fPreferences
           
static java.lang.String SUITE_METHODNAME
           
 
Constructor Summary
BaseTestRunner()
           
 
Method Summary
protected  void clearStatus()
          Clears the status message.
 java.lang.String elapsedTimeAsString(long runTime)
          Returns the formatted string of the elapsed time.
 java.lang.String extractClassName(java.lang.String className)
          Extract the class name from a String in VA/Java style
(package private) static boolean filterLine(java.lang.String line)
           
static java.lang.String filterStack(java.lang.String stack)
          Filters stack frames from internal JUnit classes
static java.lang.String getFilteredTrace(java.lang.Throwable t)
          Returns a filtered stack trace
 TestSuiteLoader getLoader()
          Returns the loader to be used.
static java.lang.String getPreference(java.lang.String key)
           
static int getPreference(java.lang.String key, int dflt)
           
private static java.io.File getPreferencesFile()
           
 Test getTest(java.lang.String suiteClassName)
          Returns the Test corresponding to the given suite.
static boolean inVAJava()
           
protected  java.lang.Class loadSuiteClass(java.lang.String suiteClassName)
          Returns the loaded Class for a suite name.
protected  java.lang.String processArguments(java.lang.String[] args)
          Processes the command line arguments and returns the name of the suite class to run or null
private static void readPreferences()
           
protected abstract  void runFailed(java.lang.String message)
          Override to define how to handle a failed loading of a test suite.
 void setLoading(boolean enable)
          Sets the loading behaviour of the test runner
static java.lang.String truncate(java.lang.String s)
          Truncates a String to the maximum length.
protected  boolean useReloadingTestSuiteLoader()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface jmathlib.tools.junit.framework.TestListener
addError, addFailure, endTest, startTest
 

Field Detail

SUITE_METHODNAME

public static final java.lang.String SUITE_METHODNAME
See Also:
Constant Field Values

fPreferences

static java.util.Properties fPreferences

fgMaxMessageLength

static int fgMaxMessageLength

fgFilterStack

static boolean fgFilterStack

fLoading

boolean fLoading
Constructor Detail

BaseTestRunner

public BaseTestRunner()
Method Detail

getTest

public Test getTest(java.lang.String suiteClassName)
Returns the Test corresponding to the given suite. This is a template method, subclasses override runFailed(), clearStatus().


elapsedTimeAsString

public java.lang.String elapsedTimeAsString(long runTime)
Returns the formatted string of the elapsed time.


processArguments

protected java.lang.String processArguments(java.lang.String[] args)
Processes the command line arguments and returns the name of the suite class to run or null


setLoading

public void setLoading(boolean enable)
Sets the loading behaviour of the test runner


extractClassName

public java.lang.String extractClassName(java.lang.String className)
Extract the class name from a String in VA/Java style


truncate

public static java.lang.String truncate(java.lang.String s)
Truncates a String to the maximum length.


runFailed

protected abstract void runFailed(java.lang.String message)
Override to define how to handle a failed loading of a test suite.


loadSuiteClass

protected java.lang.Class loadSuiteClass(java.lang.String suiteClassName)
                                  throws java.lang.ClassNotFoundException
Returns the loaded Class for a suite name.

Throws:
java.lang.ClassNotFoundException

clearStatus

protected void clearStatus()
Clears the status message.


getLoader

public TestSuiteLoader getLoader()
Returns the loader to be used.


useReloadingTestSuiteLoader

protected boolean useReloadingTestSuiteLoader()

getPreferencesFile

private static java.io.File getPreferencesFile()

readPreferences

private static void readPreferences()

getPreference

public static java.lang.String getPreference(java.lang.String key)

getPreference

public static int getPreference(java.lang.String key,
                                int dflt)

inVAJava

public static boolean inVAJava()

getFilteredTrace

public static java.lang.String getFilteredTrace(java.lang.Throwable t)
Returns a filtered stack trace


filterStack

public static java.lang.String filterStack(java.lang.String stack)
Filters stack frames from internal JUnit classes


filterLine

static boolean filterLine(java.lang.String line)

FOOTER

BOTTOM