It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

clover is not recording classes under default package

kiran kumar Dec 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
Marek Parfianowicz Atlassian Team Dec 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).

0 votes
kiran kumar Dec 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 Dec 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.

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Published in Opsgenie

Handling Opsgenie Alerts

Hi everyone, welcome to the kb articles for Opsgenie FAQs. I'm one of the Technical Support Engineers for Opsgenie who will be providing weekly posts on FAQs from customers.   All alerts are ...

28 views 0 1
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you