clover is not recording classes under default package

Hi,

i am able to instrument and compile code by configuring clover in ANT build.xml file.

When i run my application manually after deploying the ear file  in Jboss 6, clover is able record and able to generate report for all the classes under any packages  but not for the classes under the default package(i.e. classes without any package).

 

Below is my clover settings in build.xml

 

<property name="clover.jar" location="C:/clover-ant-4.0.2/lib/clover.jar"/>
<taskdef resource="cloverlib.xml" classpath="${clover.jar}"/>
<target name="kewill-clover-clean" >
<echo>clover-clean</echo>
<clover-clean/> 
</target>
<target name="kewill-with-clover" >
<echo>with.clover</echo>
<clover-setup flushpolicy="interval" flushinterval="5000">
</clover-setup>
</target>
<target name="kewill-clover-report-html" depends="kewill-with-clover">
<clover-html-report outdir="clover_html"/>
</target>

<target name="kewill-clover-report-pdf" depends="kewill-with-clover">
<clover-pdf-report outfile="clover_coverage.pdf"/>
</target>

 package structure looks as below:

package.bmp

please suggest ,how to configure clover to record classes in base package

2 answers

0 vote

Could you please check whether:

1) Classes from a default package have been instrumented by Clover?

Run your build with debug logging (ant -d) and look for a message like

[clover] Processed '<path to your source file>' to '<temporary directory>\<source file>'

 

2) Classes from a default package have been included in an HTML report?

Run your build with debug logging (ant -d) and look for a message like

[clover-report] Rendering <source file> with renderer com.atlassian.clover.reporters.html.source.java.JavaSourceRenderer

 

3) Classes from a default package contain any executable code?

I'm asking about it because, by default, Clover does not show empty entities in a report (such as: interfaces with no default methods, enums with no methods, classes containing constants only etc).

 

Hi Marek,

thanks for your quick response.

I ran the ant build and the clover-report target using (-d ) option.

point 2 got failed,

1) Classes from a default package have been instrumented by Clover?

Yes, the classes are getting instrumented

i ran the ANT using -d option as you said the message is looking as below 

[clover] Processed 'D:\MCT\web-src\PhraseDyIO.java' to 'C:\DOCUME~1\user\LOCALS~1\Temp\clover8424359559670296414.tmp\PhraseDyIO.java'

2) Classes from a default package have been included in an HTML report?

Run your build with debug logging (ant -d) and look for a message like

[clover-report] Rendering <source file> with renderer com.cenqua.clover.reporters.html.source.java.JavaSourceRenderer

No, i am not able to find anything like that with above class in the debug log.

and also checked in the "clover_html" folder , there is a folder generated with "default-pkg",

which consists of html's and javascript files in which one html file is containing a class name which is under web-src folder

 temp.bmp

 3) Classes from a default package contain any executable code?

these classes are not interfaces , they are servlet classes extends httpservlet.

conatins normal methods

like :- 

public class PhraseDyIO extends HttpServlet{
dopost(){

}
}

 

 please suggest what's going wrong with remaining classes .

thanks

Kiran kumar

 

ad 1) OK ad 2) What Clover version do you use? How did you look for these messages? I'm asking, because in my example is pasted a log message from Clover 3.x, in which the JavaSourceRenderer is in com.cenqua.clover... package. In Clover 4.x the class is located in com.atlassian.clover... package. ad 3) So it's OK. May I ask you to create a ticket at http://support.atlassian.com and attach the entire build log (with 'ant -d') as well as the build.xml file? I'd love to investigate it further.

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted yesterday in Confluence

Calling all marketing teams who use Confluence - we want to hear from you!

Hi Community! me again 🙂 If you’re a marketing team using Confluence, we want to hear your story! How did you start using Confluence? What are your use cases? What have been some of the benefits?...

51 views 2 2
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