Coverage for JUnit Plugin tests?

35 views
Skip to first unread message

Stephan Druskat

unread,
Dec 14, 2015, 9:59:43 AM12/14/15
to JaCoCo and EclEmma Users
Dear Group,

I'm wondering about the following issue I've run into. I've a group of JUnit Plugin tests for my Eclipse RCP application. From within Eclipse, I run them via a Run Configuration with option "Run all tests from selected project...". When I run them, they work just fine (and all are passing).

However, when I select the same Run Config via Run > Coverage, one of the test fails with a NoClassDefFoundError. I get the same when trying to run the test in question via plain JUnit.

Is there a way to get Coverage for a set of JUnit Plugin tests?

Thanks!
Stephan

Marc R. Hoffmann

unread,
Dec 18, 2015, 4:59:52 AM12/18/15
to jac...@googlegroups.com
Hi Stephan,

can you please provide the full stack trace?

Thanks,
-marc

Stephan Druskat

unread,
Dec 18, 2015, 5:18:21 AM12/18/15
to JaCoCo and EclEmma Users
Hi Marc,

Thanks for getting back to me. Unfortunately I have since deleted the test in question (and re-implemented as an SWTBot test). So I cannot reproduce the error. I'm new to TDD, so I might have just implemented something wrong.

However, I get another strange side-effect now, namely that VisualVM starts, whenever I run the run configuration for the JUnit Plugin Tests?!? All is fine when I just run the run configuration for my product though, so I guess I'll just use that in the future.

Nevertheless I have a two simple questions that perhaps you or someone else could answer quickly?
  1. Am I supposed to run Coverage... on Test or on Eclipse Application run configurations?
  2. Does EclEmma take SWTBot (or RCPTT) tests into account or just "plain" unit tests?

Many thanks indeed! A great tool overall!

Marc R. Hoffmann

unread,
Dec 23, 2015, 6:07:13 AM12/23/15
to jac...@googlegroups.com
Hi Stephan,

the interference with VisualVM is a known issue which will be fixed in an upcoming release:
https://github.com/jacoco/eclemma/issues/112
The only workaround fir now is to uninstall the VisualVM plugin.

Yes, SWT Bot tests are supported, please see documentation for a full list of supported launch types:
http://eclemma.org/userdoc/launching.html
Regards,
-marc
Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages