clover is not recording classes under default package

kiran kumar December 17, 2014

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 votes
kiran kumar December 18, 2014

 

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

 

Marek Parfianowicz
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 18, 2014

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.

0 votes
Marek Parfianowicz
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 18, 2014

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

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events