I am trying to use the Clover-for-Android plugin in Eclipse for my Test setup. I followed the instructions on:
Running the App Project on the device works, code coverage can be viewed after manually using the app. When I run the TestProject with "Run as Android JUnit Test" the tests fail with:
at java.lang.reflect.Method.invokeNative(Native Method)
The App-Project is set in the BuildPath of the Test-Project and it is exported. The files are successfully created in the data folder on the device. I have no idea what to do to solve this issue.
Do you have any ideas? Feel free to ask for more information about my setup. I don't know what else is worth sharing right here.
Thanks in advance,
I found a bug - it's reported in CLOV-1194. As a workaround, disable per-test instrumentation:
I should add, that I found out that some tests run successfully. They also use the MainApp's code and I can't really find a big difference to those methods that fail. The Errors in the different tests do not originate from the same line of my code but it's always the same line of the clover code that throws the exception. As seen above.
1) Does this exception occur every time you run your tests?
2) Does it happen also when tests are launched first time after a full rebuild (full workspace clean + removal of clover database + removal of coverage files)?
3) How large is your project (number of statements)?
Clover for Android is using a coverage recorder with a dynamically resizable buffer with an initial capacity of 1 million elements (statements + branches + methods). I suspect that your project has exceeded initial buffer size. It can happen also when actual code base is smaller, because every time class is recompiled it adds new data to clover.db database. So the point 2) should help.
thanks for your answers. I'll answer your 3 questions:
1) Yes it does occur every time. Some tests run through, most don't.
2) Yes it happens everytime. I did clean up everything several times, did a full rebuild and still it fails.
3) It has only 1,207(App) + 443(Tests) statements according to the clover coverage explorer. The project is really small, I can't imagine that its size could be a problem..
So I just tried removing the clover databases again, removing the coverage files, rebuilding everything, and running the tests again. No luck. It still fails with the stack trace above.
Thanks again for your help!
Could you try the following workaround:
This will disable per-test coverage so exception should disappear. (Unfortunately Test Contributions and Test Run Explorer will be empty).
Hi all Lets make this Friday fun really fun and post one (or more) of your best jokes! The joke can be about an Atlassian product, or just a really fun joke you want to share! I’m not the best j...
Connect with like-minded Atlassian users at free events near you!Find a group
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG
We're bringing product updates and pro tips on teamwork to ten cities around the world.Save your spot