clover for eclipse, no test contributions

I installed the trial version of Clover some days ago, according to the directions in the installation guide. Then I marked my project as a clover-enabled project. Whenever I run some simple test from my src/test/java directory (it's an imported maven project) I hope to see the test included in the test contributions view, but it doesn't happen. No matter what I try: the 4 clover views (Coverage explorer, Test run explorer, test contributions, clover dashboard) remain empty. Is it related to my project using aspectj (I read somewhere clover and aspectj don't go along well), or am i missing something simple?

3 answers

1 accepted

This widget could not be displayed.

Clover does not support AspectJ (unless you have AspectJ and Java source files fully separated, i.e. no AspectJ annotations in Java).

How did you import your Maven project into Eclipse? How do you run build and tests? Using Maven command or using Eclipse builder? Please note that Clover requires that "Java builder" is used (you can check it in project's properties).

Do you keep application and test code in the same project?

Hi Marek,

Thanks for your response!

1) Clover does not support AspectJ: that's a showstopper for my evaluation, as we shouldn't have to change our architecture to be able to run a coverage tool

2) How did you import your Maven project into Eclipse?

Did a 'mvn clean install' on a command line, and used 'import maven project' from the file menu in eclipse

3) How do you run build and tests? Using Maven command or using Eclipse builder? Please note that Clover requires that "Java builder" is used (you can check it in project's properties).

I see 3 builders: Aspectj builder, Maven Project Builder and Clover No-java builder

4) Do you keep application and test code in the same project?

We have a separate test project containing the integration and system tests. To evaluate clover I started by using some small unit tests included in the same project, but even those didn't produce anything

> Aspectj builder, Maven Project Builder and Clover No-java builder

This is a reason why you don't see Clover stuff. Your project is incompatible with Clover I'm afraid.

The only thing you could do is to instrument sources 'manually' (using CloverInstr or <clover-instr/> for instance) and next import such instrumented sources into Eclipse. It's similar as presented on the diagram for Instrumenting+RCP+Application.

This widget could not be displayed.

Please could you provide more detailed steps to resolving this situation using the manual instrumentation approach?

Hi Michael,

As described in the "Instrumenting+RCP+Application" manual, the trick is to run <clover-instr/> in order to produce an instrumented version of Java sources and to put them into another workspace, keeping the original directory structure as well all non-java files you'd normally need (resources for example).

As Clover instrumentation in based on the source code and not on the byte code (as Cobertura or Emma does, for instance), such instrumented sources should be "transparent" for AspectJ (because they look just like the normal source code, but a just more complex).

Thanks to this, you shall be able to compile such instrumented sources using AspectJ. As soon as such instrumented code will be executed, Clover's coverage recorders should start recording code coverage.

Please let me know at which point exactly from this manual you got stuck.

Cheers
Marek

This widget could not be displayed.

Update: 

Clover (unofficially) supports the AspectJ language now. Try the new Clover AspectJ Compiler tool:

https://confluence.atlassian.com/display/CLOVER/Clover+AspectJ+Compiler

 

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Wednesday in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

207 views 3 0
Join discussion

Atlassian User Groups

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!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you