Android APIs
public abstract class

BaseTestRunner

extends Object
implements TestListener
java.lang.Object
   ↳ junit.runner.BaseTestRunner
Known Direct Subclasses

Class Overview

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

Summary

Constants
String SUITE_METHODNAME
Public Constructors
BaseTestRunner()
Public Methods
synchronized void addError(Test test, Throwable t)
An error occurred.
synchronized void addFailure(Test test, AssertionFailedError t)
A failure occurred.
String elapsedTimeAsString(long runTime)
Returns the formatted string of the elapsed time.
synchronized 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(Throwable t)
Returns a filtered stack trace
static String getFilteredTrace(String stack)
Filters stack frames from internal JUnit classes
TestSuiteLoader getLoader()
This method was deprecated in API level 16. not present in JUnit4.10
static int getPreference(String key, int dflt)
static String getPreference(String key)
Test getTest(String suiteClassName)
Returns the Test corresponding to the given suite.
static boolean inVAJava()
This method was deprecated in API level 16. not present in JUnit4.10
static void savePreferences()
void setLoading(boolean enable)
Sets the loading behaviour of the test runner
void setPreference(String key, String value)
synchronized void startTest(Test test)
A test started.
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.
Protected Methods
void clearStatus()
Clears the status message.
static Properties getPreferences()
Class<?> loadSuiteClass(String suiteClassName)
Returns the loaded Class for a suite name.
String processArguments(String[] args)
Processes the command line arguments and returns the name of the suite class to run or null
abstract void runFailed(String message)
Override to define how to handle a failed loading of a test suite.
static void setPreferences(Properties preferences)
static boolean showStackRaw()
boolean useReloadingTestSuiteLoader()
[Expand]
Inherited Methods
From class java.lang.Object
From interface junit.framework.TestListener

Constants

public static final String SUITE_METHODNAME

Added in API level 1

Constant Value: "suite"

Public Constructors

public BaseTestRunner ()

Added in API level 1

Public Methods

public synchronized void addError (Test test, Throwable t)

Added in API level 1

An error occurred.

public synchronized void addFailure (Test test, AssertionFailedError t)

Added in API level 1

A failure occurred.

public String elapsedTimeAsString (long runTime)

Added in API level 1

Returns the formatted string of the elapsed time.

public synchronized void endTest (Test test)

Added in API level 1

A test ended.

public String extractClassName (String className)

Added in API level 1

Extract the class name from a String in VA/Java style

public static String getFilteredTrace (Throwable t)

Added in API level 1

Returns a filtered stack trace

public static String getFilteredTrace (String stack)

Added in API level 1

Filters stack frames from internal JUnit classes

public TestSuiteLoader getLoader ()

Added in API level 1

This method was deprecated in API level 16.
not present in JUnit4.10

Returns the loader to be used.

public static int getPreference (String key, int dflt)

Added in API level 1

public static String getPreference (String key)

Added in API level 1

public Test getTest (String suiteClassName)

Added in API level 1

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

public static boolean inVAJava ()

Added in API level 1

This method was deprecated in API level 16.
not present in JUnit4.10

public static void savePreferences ()

Added in API level 1

Throws
IOException

public void setLoading (boolean enable)

Added in API level 1

Sets the loading behaviour of the test runner

public void setPreference (String key, String value)

Added in API level 1

public synchronized void startTest (Test test)

Added in API level 1

A test started.

public abstract void testEnded (String testName)

Added in API level 1

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

Added in API level 1

public abstract void testStarted (String testName)

Added in API level 1

public static String truncate (String s)

Added in API level 1

Truncates a String to the maximum length.

Protected Methods

protected void clearStatus ()

Added in API level 1

Clears the status message.

protected static Properties getPreferences ()

Added in API level 1

protected Class<?> loadSuiteClass (String suiteClassName)

Added in API level 1

Returns the loaded Class for a suite name.

protected String processArguments (String[] args)

Added in API level 1

Processes the command line arguments and returns the name of the suite class to run or null

protected abstract void runFailed (String message)

Added in API level 1

Override to define how to handle a failed loading of a test suite.

protected static void setPreferences (Properties preferences)

Added in API level 1

protected static boolean showStackRaw ()

Added in API level 1

protected boolean useReloadingTestSuiteLoader ()

Added in API level 1