# Print output for @column tags ?>
Developers

- Design
- Develop
- Distribute

Developer Console

## Most visited

## Recently visited

## Results for

Summary: Constants | Ctors | Methods | Protected Methods | Inherited Methods

# BaseTestRunner

`public abstract class BaseTestRunner`
`extends Object` `implements TestListener`

java.lang.Object
↳ | junit.runner.BaseTestRunner

Known direct subclasses AndroidTestRunner
AndroidTestRunner | This class is deprecated. Use AndroidJUnitRunner instead. New tests should be written using the Android Testing Support Library.

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
`void` | `addError(Test test, Throwable t)` An error occurred.
`void` | `addFailure(Test test, AssertionFailedError t)` A failure occurred.
`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 t)` Returns a filtered stack trace
`TestSuiteLoader` | `getLoader()` This method is deprecated. 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 is deprecated. 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)`
`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()`

### Inherited methods
From class `java.lang.Object`
`Object` | `clone()` Creates and returns a copy of this object.
`boolean` | `equals(Object obj)` Indicates whether some other object is "equal to" this one.
`void` | `finalize()` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
`final Class<?>` | `getClass()` Returns the runtime class of this `Object`.
`int` | `hashCode()` Returns a hash code value for the object.
`final void` | `notify()` Wakes up a single thread that is waiting on this object's monitor.
`final void` | `notifyAll()` Wakes up all threads that are waiting on this object's monitor.
`String` | `toString()` Returns a string representation of the object.
`final void` | `wait(long timeout, int nanos)` Causes the current thread to wait until another thread invokes the `notify()` method or the `notifyAll()` method for this object, or some other thread interrupts the current thread, or a certain amount of real time has elapsed.
`final void` | `wait(long timeout)` Causes the current thread to wait until either another thread invokes the `notify()` method or the `notifyAll()` method for this object, or a specified amount of time has elapsed.
`final void` | `wait()` Causes the current thread to wait until another thread invokes the `notify()` method or the `notifyAll()` method for this object.
From interface `junit.framework.TestListener`
`abstract void` | `addError(Test test, Throwable t)` An error occurred.
`abstract void` | `addFailure(Test test, AssertionFailedError t)` A failure occurred.
`abstract void` | `endTest(Test test)` A test ended.
`abstract void` | `startTest(Test test)` A test started.

## Constants

### SUITE_METHODNAME

    public static final String SUITE_METHODNAME

Constant Value: "suite"

## Public constructors

### BaseTestRunner

    public BaseTestRunner ()

## Public methods

### addError

    public void addError (Test test,
                    Throwable t)

An error occurred.

Parameters
`test` | `Test`
`t` | `Throwable`

### addFailure

    public void addFailure (Test test,
                    AssertionFailedError t)

A failure occurred.

Parameters
`test` | `Test`
`t` | `AssertionFailedError`

### elapsedTimeAsString

    public String elapsedTimeAsString (long runTime)

Returns the formatted string of the elapsed time.

Parameters
`runTime` | `long`

Returns
`String` |

### endTest

    public void endTest (Test test)

A test ended.

Parameters
`test` | `Test`

### extractClassName

    public String extractClassName (String className)

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

Parameters
`className` | `String`

Returns
`String` |

### getFilteredTrace

    public static String getFilteredTrace (String stack)

Filters stack frames from internal JUnit classes

Parameters
`stack` | `String`

Returns
`String` |

### getFilteredTrace

    public static String getFilteredTrace (Throwable t)

Returns a filtered stack trace

Parameters
`t` | `Throwable`

Returns
`String` |

### getLoader

    public TestSuiteLoader getLoader ()

This method is deprecated.
not present in JUnit4.10

Returns the loader to be used.

Returns
`TestSuiteLoader` |

### getPreference

    public static int getPreference (String key,
                    int dflt)

Parameters
`key` | `String`
`dflt` | `int`

Returns
`int` |

### getPreference

    public static String getPreference (String key)

Parameters
`key` | `String`

Returns
`String` |

### getTest

    public Test getTest (String suiteClassName)

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

Parameters
`suiteClassName` | `String`

Returns
`Test` |

### inVAJava

    public static boolean inVAJava ()

This method is deprecated.
not present in JUnit4.10

Returns
`boolean` |

### savePreferences

    public static void savePreferences ()

Throws
`IOException` |

### setLoading

    public void setLoading (boolean enable)

Sets the loading behaviour of the test runner

Parameters
`enable` | `boolean`

### setPreference

    public void setPreference (String key,
                    String value)

Parameters
`key` | `String`
`value` | `String`

### startTest

    public void startTest (Test test)

A test started.

Parameters
`test` | `Test`

### testEnded

    public abstract void testEnded (String testName)

Parameters
`testName` | `String`

### testFailed

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

Parameters
`status` | `int`
`test` | `Test`
`t` | `Throwable`

### testStarted

    public abstract void testStarted (String testName)

Parameters
`testName` | `String`

### truncate

    public static String truncate (String s)

Truncates a String to the maximum length.

Parameters
`s` | `String`

Returns
`String` |

## Protected methods

### clearStatus

    protected void clearStatus ()

Clears the status message.

### getPreferences

    protected static Properties getPreferences ()

Returns
`Properties` |

### loadSuiteClass

    protected Class<?> loadSuiteClass (String suiteClassName)

Returns the loaded Class for a suite name.

Parameters
`suiteClassName` | `String`

Returns
`Class<?>` |

Throws
`ClassNotFoundException` |

### processArguments

    protected String processArguments (String[] args)

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

Parameters
`args` | `String`

Returns
`String` |

### runFailed

    protected abstract void runFailed (String message)

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

Parameters
`message` | `String`

### setPreferences

    protected static void setPreferences (Properties preferences)

Parameters
`preferences` | `Properties`

### showStackRaw

    protected static boolean showStackRaw ()

Returns
`boolean` |

### useReloadingTestSuiteLoader

    protected boolean useReloadingTestSuiteLoader ()

Returns
`boolean` |

Full name *
Email address *
Company / developer name
One of your Play Store app URLs *
Which best describes your business:*
Apps
Games
Apps & Games
*
*