junit.runner
Class BaseTestRunner

java.lang.Object
  extended by junit.runner.BaseTestRunner

public abstract class BaseTestRunner
extends Object

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


Field Summary
static String SUITE_METHODNAME
           
 
Constructor Summary
BaseTestRunner()
           
 
Method Summary
 void addError(Test test, Throwable t)
           
 void addFailure(Test test, AssertionFailedError t)
           
 String elapsedTimeAsString(long runTime)
          Returns the formatted string of the elapsed time.
 void endTest(Test test)
           
 String extractClassName(String className)
          Extract the class name from a String in VA/Java style
static String getFilteredTrace(String stack)
          Filters stack frames from internal JUnit classes
static String getFilteredTrace(Throwable t)
          Returns a filtered stack trace
 TestSuiteLoader getLoader()
          Returns the loader to be used.
static String getPreference(String key)
           
static int getPreference(String key, int dflt)
           
 Test getTest(String suiteClassName)
          Returns the Test corresponding to the given suite.
static boolean inVAJava()
           
static void savePreferences()
           
 void setLoading(boolean enable)
          Sets the loading behaviour of the test runner
 void setPreference(String key, String value)
           
 void startTest(Test test)
           
abstract  void testEnded(String testName)
           
abstract  void testFailed(int status, Test test, Throwable t)
           
abstract  void testStarted(String testName)
           
static String truncate(String s)
          Truncates a String to the maximum length.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SUITE_METHODNAME

public static final String SUITE_METHODNAME
See Also:
Constant Field Values
Constructor Detail

BaseTestRunner

public BaseTestRunner()
Method Detail

startTest

public void startTest(Test test)

savePreferences

public static void savePreferences()
                            throws IOException
Throws:
IOException

setPreference

public void setPreference(String key,
                          String value)

endTest

public void endTest(Test test)

addError

public void addError(Test test,
                     Throwable t)

addFailure

public void addFailure(Test test,
                       AssertionFailedError t)

testStarted

public abstract void testStarted(String testName)

testEnded

public abstract void testEnded(String testName)

testFailed

public abstract void testFailed(int status,
                                Test test,
                                Throwable t)

getTest

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


elapsedTimeAsString

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


setLoading

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


extractClassName

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


truncate

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


getLoader

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


getPreference

public static String getPreference(String key)

getPreference

public static int getPreference(String key,
                                int dflt)

inVAJava

public static boolean inVAJava()

getFilteredTrace

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


getFilteredTrace

public static String getFilteredTrace(String stack)
Filters stack frames from internal JUnit classes