clover for eclipse, no test contributions

Erik Vande Velde February 27, 2013

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
Answer accepted
Marek Parfianowicz
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 28, 2013

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?

Erik Vande Velde February 28, 2013

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

Marek Parfianowicz
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 28, 2013

> 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.

Marek Parfianowicz
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 28, 2013

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.

0 votes
Marek Parfianowicz
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 8, 2016

Update: 

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

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

 

0 votes
michaelwiles October 27, 2013

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

Marek Parfianowicz
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 27, 2013

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

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events