public abstract class BaseTestRunner extends Object implements TestListener
Modifier and Type | Field and Description |
---|---|
static String |
SUITE_METHODNAME |
Constructor and Description |
---|
BaseTestRunner() |
Modifier and Type | Method and Description |
---|---|
void |
addError(Test test,
Throwable e)
An error occurred.
|
void |
addFailure(Test test,
AssertionFailedError e)
A failure occurred.
|
protected void |
clearStatus()
Clears the status message.
|
String |
elapsedTimeAsString(long runTime)
Returns the formatted string of the elapsed time.
|
void |
endTest(Test test)
A test ended.
|
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 e)
Returns a filtered stack trace
|
static String |
getPreference(String key) |
static int |
getPreference(String key,
int dflt) |
protected static Properties |
getPreferences() |
Test |
getTest(String suiteClassName)
Returns the Test corresponding to the given suite.
|
protected Class<?> |
loadSuiteClass(String suiteClassName)
Returns the loaded Class for a suite name.
|
protected String |
processArguments(String[] args)
Processes the command line arguments and
returns the name of the suite class to run or null
|
protected abstract void |
runFailed(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(String key,
String value) |
protected static void |
setPreferences(Properties preferences) |
protected static boolean |
showStackRaw() |
void |
startTest(Test test)
A test started.
|
abstract void |
testEnded(String testName) |
abstract void |
testFailed(int status,
Test test,
Throwable e) |
abstract void |
testStarted(String testName) |
static String |
truncate(String s)
Truncates a String to the maximum length.
|
protected boolean |
useReloadingTestSuiteLoader() |
public static final String SUITE_METHODNAME
public void startTest(Test test)
TestListener
startTest
in interface TestListener
protected static void setPreferences(Properties preferences)
protected static Properties getPreferences()
public static void savePreferences() throws IOException
IOException
public void endTest(Test test)
TestListener
endTest
in interface TestListener
public void addError(Test test, Throwable e)
TestListener
addError
in interface TestListener
public void addFailure(Test test, AssertionFailedError e)
TestListener
addFailure
in interface TestListener
public abstract void testStarted(String testName)
public abstract void testEnded(String testName)
public Test getTest(String suiteClassName)
public String elapsedTimeAsString(long runTime)
protected String processArguments(String[] args)
public void setLoading(boolean enable)
public String extractClassName(String className)
protected abstract void runFailed(String message)
protected Class<?> loadSuiteClass(String suiteClassName) throws ClassNotFoundException
ClassNotFoundException
protected void clearStatus()
protected boolean useReloadingTestSuiteLoader()
public static int getPreference(String key, int dflt)
public static String getFilteredTrace(String stack)
protected static boolean showStackRaw()
Copyright © 2002–2019 JUnit. All rights reserved.