public abstract class BaseTestRunner extends java.lang.Object implements TestListener
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
SUITE_METHODNAME |
Constructor and Description |
---|
BaseTestRunner() |
Modifier and Type | Method and Description |
---|---|
void |
addError(Test test,
java.lang.Throwable t)
An error occurred.
|
void |
addFailure(Test test,
AssertionFailedError t)
A failure occurred.
|
protected void |
clearStatus()
Clears the status message.
|
java.lang.String |
elapsedTimeAsString(long runTime)
Returns the formatted string of the elapsed time.
|
void |
endTest(Test test)
A test ended.
|
java.lang.String |
extractClassName(java.lang.String className)
Extract the class name from a String in VA/Java style
|
static java.lang.String |
getFilteredTrace(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) |
protected static java.util.Properties |
getPreferences() |
Test |
getTest(java.lang.String suiteClassName)
Returns the Test corresponding to the given suite.
|
static boolean |
inMac() |
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
|
protected abstract void |
runFailed(java.lang.String message)
Override to define how to handle a failed loading of
a test suite.
|
static void |
savePreferences() |
void |
setLoading(boolean enable)
Sets the loading behaviour of the test runner
|
static void |
setPreference(java.lang.String key,
java.lang.String value) |
protected static void |
setPreferences(java.util.Properties preferences) |
protected static boolean |
showStackRaw() |
void |
startTest(Test test)
A test started.
|
abstract void |
testEnded(java.lang.String testName) |
abstract void |
testFailed(int status,
Test test,
java.lang.Throwable t) |
abstract void |
testStarted(java.lang.String testName) |
static java.lang.String |
truncate(java.lang.String s)
Truncates a String to the maximum length.
|
protected boolean |
useReloadingTestSuiteLoader() |
public static final java.lang.String SUITE_METHODNAME
public void startTest(Test test)
TestListener
startTest
in interface TestListener
protected static void setPreferences(java.util.Properties preferences)
protected static java.util.Properties getPreferences()
public static void savePreferences() throws java.io.IOException
java.io.IOException
public static void setPreference(java.lang.String key, java.lang.String value)
public void endTest(Test test)
TestListener
endTest
in interface TestListener
public void addError(Test test, java.lang.Throwable t)
TestListener
addError
in interface TestListener
public void addFailure(Test test, AssertionFailedError t)
TestListener
addFailure
in interface TestListener
public abstract void testStarted(java.lang.String testName)
public abstract void testEnded(java.lang.String testName)
public abstract void testFailed(int status, Test test, java.lang.Throwable t)
public Test getTest(java.lang.String suiteClassName)
public java.lang.String elapsedTimeAsString(long runTime)
protected java.lang.String processArguments(java.lang.String[] args)
public void setLoading(boolean enable)
public java.lang.String extractClassName(java.lang.String className)
public static java.lang.String truncate(java.lang.String s)
protected abstract void runFailed(java.lang.String message)
protected java.lang.Class loadSuiteClass(java.lang.String suiteClassName) throws java.lang.ClassNotFoundException
java.lang.ClassNotFoundException
protected void clearStatus()
public TestSuiteLoader getLoader()
protected boolean useReloadingTestSuiteLoader()
public static java.lang.String getPreference(java.lang.String key)
public static int getPreference(java.lang.String key, int dflt)
public static boolean inVAJava()
public static boolean inMac()
public static java.lang.String getFilteredTrace(java.lang.Throwable t)
public static java.lang.String getFilteredTrace(java.lang.String stack)
protected static boolean showStackRaw()