Closed ginatrapani closed 11 years ago
It's working for me. Maybe you need to Refresh the project and do a clean build?
Tried that, no dice. They used to pass on a Gingerbread simulator and fail on Jellybean, but now they fail everywhere. My dev machine is a bit old and slow, and I remember that this was a timing issue, so maybe that's it.
Maybe. The test results pane in eclipse should tell you how long each test took. Are any of them longer than 5 seconds?
That stack trace looks strange. It should be like "expected: 1 but was : 0". For some reason the values aren't being printed.
Yes, they all take more than 5 seconds except testPushToRemote, that's 1.527 seconds.
I think GitHub ate the markup, should have been:
junit.framework.AssertionFailedError: Should have called pullToRemote once expected:<1> but was:<0> at com.todotxt.todotxttouch.test.TodoApplicationTest.testPushToRemote(TodoApplicationTest.java:120) 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)
OK, I can reproduce this in the emulator (gingerbread) and it doesn't seem to be a timing issue. I don't know why it works on my phone and not the emulator, but it seems to be an issue with threading. The pushToRemote call is made on the same thread as the test code, so there is no way for it to complete asynchronously in the middle of the test.
I tried to call pushToRemote in a new thread, but got an error. I'll try to see if there is a way to do it that works.
All the testPushToRemote tests are failing, here's the trace from one such failure:
junit.framework.AssertionFailedError: Should have called pullToRemote once expected:<1> but was:<0> at com.todotxt.todotxttouch.test.TodoApplicationTest.testPushToRemote(TodoApplicationTest.java:120) 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)