TestPrinterpublic class TestPrinter extends Object implements TestRunner.Listener, TestListenerPrints the test progress to stdout. Android includes a default
implementation and calls these methods to print out test progress; you
probably will not need to create or extend this class or call its methods manually.
See the full {@link android.test} package description for information about
getting test results.
{@hide} Not needed for 1.0 SDK. |
Fields Summary |
---|
private String | mTag | private boolean | mOnlyFailures | private Set | mFailedTests |
Constructors Summary |
---|
public TestPrinter(String tag, boolean onlyFailures)
mTag = tag;
mOnlyFailures = onlyFailures;
|
Methods Summary |
---|
public void | addError(junit.framework.Test test, java.lang.Throwable t)
failed(test, t);
| public void | addFailure(junit.framework.Test test, junit.framework.AssertionFailedError t)
failed(test, t);
| public void | endTest(junit.framework.Test test)
finished(test.toString());
if (!mFailedTests.contains(test.toString())) {
passed(test.toString());
}
mFailedTests.remove(test.toString());
| public void | failed(java.lang.String className, java.lang.Throwable exception)
Log.i(mTag, "failed: " + className);
Log.i(mTag, "----- begin exception -----");
Log.i(mTag, "", exception);
Log.i(mTag, "----- end exception -----");
| private void | failed(junit.framework.Test test, java.lang.Throwable t)
mFailedTests.add(test.toString());
failed(test.toString(), t);
| public void | finished(java.lang.String className)
if (!mOnlyFailures) {
Log.i(mTag, "finished: " + className);
}
| public void | passed(java.lang.String className)
if (!mOnlyFailures) {
Log.i(mTag, "passed: " + className);
}
| public void | performance(java.lang.String className, long itemTimeNS, int iterations, java.util.List intermediates)
Log.i(mTag, "perf: " + className + " = " + itemTimeNS + "ns/op (done "
+ iterations + " times)");
if (intermediates != null && intermediates.size() > 0) {
int N = intermediates.size();
for (int i = 0; i < N; i++) {
TestRunner.IntermediateTime time = intermediates.get(i);
Log.i(mTag, " intermediate: " + time.name + " = "
+ time.timeInNS + "ns");
}
}
| public void | startTest(junit.framework.Test test)
started(test.toString());
| public void | started(java.lang.String className)
if (!mOnlyFailures) {
Log.i(mTag, "started: " + className);
}
|
|