Android JUnit has no output in Eclipse JUnit view
I followed the online directions for building HelloAndroid and HelloAndroidTest in Eclipse. The test runs, the logcat shows the correct results going to stdout, but the JUnit testrunner window in Eclipse开发者_StackOverflow社区 is silent - nothing.
I am running the test on a Nexus One with Android 2.2 installed via OTA. I've been unable to find any mention of this problem.
I'm wondering if the plumbing is broken in this latest release, or if running on a phone is not supported in terms of the JUnit view. I'll try the emulator and see if that makes a difference.
Thanks.
Check LogCat to find out the problem.
I had the same problem, Console output showed Test Successful, but JUnit didn't load any test cases and showed nothing. After I checked the LogCat and found there was a class not load runtime error, which was caused by the test class coding error. After I fixed the test class and AndroidManifest.xml, it worked fine and JUnit loaded and showed correctly.
I see a similar problem at times (I'm using a custom Android ROM, FYI).
My solution thus far has been to kill the JUnit test process and restart it. While not a perfect solution, it means that I sometimes get to see JUnit output properly, which is better than never at all.
精彩评论