I'm writing some tests for an Android 2.3.3 project, using the Android JUnit Test runner, and I'm seeing some weird results in the failure traces on assertions. Here's a simple example:
import junit.framework.TestCase;
public class TU_Test extends TestCase {
public void testStuff() {
assertEquals("aft", "af");
}
}
The assertion obviously fails, and here's the trace copied from Eclipse:
junit.framework.ComparisonFailure: expected:<...t> but was:<...>
at com.redprairie.test.TU_Test.testStuff(TU_Test.java:33)
at java.lang.reflect.Method.invokeNative(Native Method)
at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:169)
at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:154)
at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:529)
at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1448)
The displayed expected + actual are not very helpful... it seems to display the difference / missing characters between the two, but it would be much more helpful if I could see the full values of each. I'm normally (using JUnit 4 + not using the Android Test Runner) able to double click the failure trace in Eclipse and see a diff of the two results. Is there any way to achieve this using the Android Test Runner and it's JUnit 3 style tests? It's kind of a pain in the ass to always set breakpoints.
Thanks!