Loading test-runner/src/android/test/TestPrinter.java +6 −22 Original line number Original line Diff line number Diff line Loading @@ -21,7 +21,6 @@ import junit.framework.Test; import junit.framework.TestListener; import junit.framework.TestListener; import java.util.HashSet; import java.util.HashSet; import java.util.List; import java.util.Set; import java.util.Set; /** /** Loading @@ -34,52 +33,37 @@ import java.util.Set; * {@hide} Not needed for 1.0 SDK. * {@hide} Not needed for 1.0 SDK. */ */ @Deprecated @Deprecated public class TestPrinter implements TestRunner.Listener, TestListener { class TestPrinter implements TestListener { private String mTag; private String mTag; private boolean mOnlyFailures; private boolean mOnlyFailures; private Set<String> mFailedTests = new HashSet<String>(); private Set<String> mFailedTests = new HashSet<String>(); public TestPrinter(String tag, boolean onlyFailures) { TestPrinter(String tag, boolean onlyFailures) { mTag = tag; mTag = tag; mOnlyFailures = onlyFailures; mOnlyFailures = onlyFailures; } } public void started(String className) { private void started(String className) { if (!mOnlyFailures) { if (!mOnlyFailures) { Log.i(mTag, "started: " + className); Log.i(mTag, "started: " + className); } } } } public void finished(String className) { private void finished(String className) { if (!mOnlyFailures) { if (!mOnlyFailures) { Log.i(mTag, "finished: " + className); Log.i(mTag, "finished: " + className); } } } } public void performance(String className, private void passed(String className) { long itemTimeNS, int iterations, List<TestRunner.IntermediateTime> 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 passed(String className) { if (!mOnlyFailures) { if (!mOnlyFailures) { Log.i(mTag, "passed: " + className); Log.i(mTag, "passed: " + className); } } } } public void failed(String className, Throwable exception) { private void failed(String className, Throwable exception) { Log.i(mTag, "failed: " + className); Log.i(mTag, "failed: " + className); Log.i(mTag, "----- begin exception -----"); Log.i(mTag, "----- begin exception -----"); Log.i(mTag, "", exception); Log.i(mTag, "", exception); Loading Loading
test-runner/src/android/test/TestPrinter.java +6 −22 Original line number Original line Diff line number Diff line Loading @@ -21,7 +21,6 @@ import junit.framework.Test; import junit.framework.TestListener; import junit.framework.TestListener; import java.util.HashSet; import java.util.HashSet; import java.util.List; import java.util.Set; import java.util.Set; /** /** Loading @@ -34,52 +33,37 @@ import java.util.Set; * {@hide} Not needed for 1.0 SDK. * {@hide} Not needed for 1.0 SDK. */ */ @Deprecated @Deprecated public class TestPrinter implements TestRunner.Listener, TestListener { class TestPrinter implements TestListener { private String mTag; private String mTag; private boolean mOnlyFailures; private boolean mOnlyFailures; private Set<String> mFailedTests = new HashSet<String>(); private Set<String> mFailedTests = new HashSet<String>(); public TestPrinter(String tag, boolean onlyFailures) { TestPrinter(String tag, boolean onlyFailures) { mTag = tag; mTag = tag; mOnlyFailures = onlyFailures; mOnlyFailures = onlyFailures; } } public void started(String className) { private void started(String className) { if (!mOnlyFailures) { if (!mOnlyFailures) { Log.i(mTag, "started: " + className); Log.i(mTag, "started: " + className); } } } } public void finished(String className) { private void finished(String className) { if (!mOnlyFailures) { if (!mOnlyFailures) { Log.i(mTag, "finished: " + className); Log.i(mTag, "finished: " + className); } } } } public void performance(String className, private void passed(String className) { long itemTimeNS, int iterations, List<TestRunner.IntermediateTime> 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 passed(String className) { if (!mOnlyFailures) { if (!mOnlyFailures) { Log.i(mTag, "passed: " + className); Log.i(mTag, "passed: " + className); } } } } public void failed(String className, Throwable exception) { private void failed(String className, Throwable exception) { Log.i(mTag, "failed: " + className); Log.i(mTag, "failed: " + className); Log.i(mTag, "----- begin exception -----"); Log.i(mTag, "----- begin exception -----"); Log.i(mTag, "", exception); Log.i(mTag, "", exception); Loading