# Print output for @column tags ?>
Developers

- Design
- Develop
- Distribute

Developer Console

## Most visited

## Recently visited

## Results for

Summary: Fields | Ctors | Methods | Protected Methods | Inherited Methods

# TestResult

`public class TestResult`
`extends Object` ``

java.lang.Object
↳ | junit.framework.TestResult

A `TestResult` collects the results of executing a test case. It is an instance of the Collecting Parameter pattern. The test framework distinguishes between failures and errors. A failure is anticipated and checked for with assertions. Errors are unanticipated problems like an `ArrayIndexOutOfBoundsException`.

See also:

- `Test`

## Summary

### Fields
`protected Vector<TestFailure>` | `fErrors`
`protected Vector<TestFailure>` | `fFailures`
`protected Vector<TestListener>` | `fListeners`
`protected int` | `fRunTests`

### Public constructors
`TestResult()`

### Public methods
`void` | `addError(Test test, Throwable t)` Adds an error to the list of errors.
`void` | `addFailure(Test test, AssertionFailedError t)` Adds a failure to the list of failures.
`void` | `addListener(TestListener listener)` Registers a TestListener
`void` | `endTest(Test test)` Informs the result that a test was completed.
`int` | `errorCount()` Gets the number of detected errors.
`Enumeration<TestFailure>` | `errors()` Returns an Enumeration for the errors
`int` | `failureCount()` Gets the number of detected failures.
`Enumeration<TestFailure>` | `failures()` Returns an Enumeration for the failures
`void` | `removeListener(TestListener listener)` Unregisters a TestListener
`int` | `runCount()` Gets the number of run tests.
`void` | `runProtected(Test test, Protectable p)` Runs a TestCase.
`boolean` | `shouldStop()` Checks whether the test run should stop
`void` | `startTest(Test test)` Informs the result that a test will be started.
`void` | `stop()` Marks that the test run should stop.
`boolean` | `wasSuccessful()` Returns whether the entire test was successful or not.

### Protected methods
`void` | `run(TestCase test)` Runs a TestCase.

### 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.

## Fields

### fErrors

    protected Vector<TestFailure> fErrors

### fFailures

    protected Vector<TestFailure> fFailures

### fListeners

    protected Vector<TestListener> fListeners

### fRunTests

    protected int fRunTests

## Public constructors

### TestResult

    public TestResult ()

## Public methods

### addError

    public void addError (Test test,
                    Throwable t)

Adds an error to the list of errors. The passed in exception caused the error.

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

### addFailure

    public void addFailure (Test test,
                    AssertionFailedError t)

Adds a failure to the list of failures. The passed in exception caused the failure.

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

### addListener

    public void addListener (TestListener listener)

Registers a TestListener

Parameters
`listener` | `TestListener`

### endTest

    public void endTest (Test test)

Informs the result that a test was completed.

Parameters
`test` | `Test`

### errorCount

    public int errorCount ()

Gets the number of detected errors.

Returns
`int` |

### errors

    public Enumeration<TestFailure> errors ()

Returns an Enumeration for the errors

Returns
`Enumeration<TestFailure>` |

### failureCount

    public int failureCount ()

Gets the number of detected failures.

Returns
`int` |

### failures

    public Enumeration<TestFailure> failures ()

Returns an Enumeration for the failures

Returns
`Enumeration<TestFailure>` |

### removeListener

    public void removeListener (TestListener listener)

Unregisters a TestListener

Parameters
`listener` | `TestListener`

### runCount

    public int runCount ()

Gets the number of run tests.

Returns
`int` |

### runProtected

    public void runProtected (Test test,
                    Protectable p)

Runs a TestCase.

Parameters
`test` | `Test`
`p` | `Protectable`

### shouldStop

    public boolean shouldStop ()

Checks whether the test run should stop

Returns
`boolean` |

### startTest

    public void startTest (Test test)

Informs the result that a test will be started.

Parameters
`test` | `Test`

### stop

    public void stop ()

Marks that the test run should stop.

### wasSuccessful

    public boolean wasSuccessful ()

Returns whether the entire test was successful or not.

Returns
`boolean` |

## Protected methods

### run

    protected void run (TestCase test)

Runs a TestCase.

Parameters
`test` | `TestCase`

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