| Method from junit.framework.TestResult Detail: |
public synchronized void addError(Test test,
Throwable t) {
fErrors.add(new TestFailure(test, t));
for (TestListener each : cloneListeners())
each.addError(test, t);
}
Adds an error to the list of errors. The passed in exception
caused the error. |
public synchronized void addFailure(Test test,
AssertionFailedError t) {
fFailures.add(new TestFailure(test, t));
for (TestListener each : cloneListeners())
each.addFailure(test, t);
}
Adds a failure to the list of failures. The passed in exception
caused the failure. |
public synchronized void addListener(TestListener listener) {
fListeners.add(listener);
}
|
public void endTest(Test test) {
for (TestListener each : cloneListeners())
each.endTest(test);
}
Informs the result that a test was completed. |
public synchronized int errorCount() {
return fErrors.size();
}
Gets the number of detected errors. |
public synchronized Enumeration<TestFailure> errors() {
return Collections.enumeration(fErrors);
}
Returns an Enumeration for the errors |
public synchronized int failureCount() {
return fFailures.size();
}
Gets the number of detected failures. |
public synchronized Enumeration<TestFailure> failures() {
return Collections.enumeration(fFailures);
}
Returns an Enumeration for the failures |
public synchronized void removeListener(TestListener listener) {
fListeners.remove(listener);
}
Unregisters a TestListener |
protected void run(TestCase test) {
startTest(test);
Protectable p= new Protectable() {
public void protect() throws Throwable {
test.runBare();
}
};
runProtected(test, p);
endTest(test);
}
|
public synchronized int runCount() {
return fRunTests;
}
Gets the number of run tests. |
public void runProtected(Test test,
Protectable p) {
try {
p.protect();
}
catch (AssertionFailedError e) {
addFailure(test, e);
}
catch (ThreadDeath e) { // don't catch ThreadDeath by accident
throw e;
}
catch (Throwable e) {
addError(test, e);
}
}
|
public synchronized boolean shouldStop() {
return fStop;
}
Checks whether the test run should stop |
public void startTest(Test test) {
final int count= test.countTestCases();
synchronized(this) {
fRunTests+= count;
}
for (TestListener each : cloneListeners())
each.startTest(test);
}
Informs the result that a test will be started. |
public synchronized void stop() {
fStop= true;
}
Marks that the test run should stop. |
public synchronized boolean wasSuccessful() {
return failureCount() == 0 && errorCount() == 0;
}
Returns whether the entire test was successful or not. |