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

0 votes

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.

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

0 votes

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 Join to answer
Community showcase
Teodora [Botron]
Published Thursday in Marketplace Apps

Jira Inferno: The Nine Circles of Jira Administration Hell

If you spend enough time as a Jira admin - whether you are managing a single, mid-sized instance, a large enterprise one or juggling multiple instances at once - you will eventually find yourself in ...

247 views 0 11
Read article

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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot