jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • Maven 1.x Clover Plugin
  • MPCLOVER-9

How to execute single Class by using Clover?

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: New Feature New Feature
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: 1.6
  • Labels:
    None

Description

Hi,

While generation of Clover report, I found that it generates report
for all Test classes i.e. given in project.xml file.

<include>*/Test.java</include>

To generate the report of single Test class, I need to modify above
statement as follows.
e.g. <include>*/TestManualSim.java</include>

So each time, it needs to modify project.xml for report generation.
So to avoid change in project.xml file, following changes need to be
done in maven-clover-plugin. Following is my suggestion.

<!--If there is no tescase argument, generate report for all
Testcases -->
<j:if test="${empty(testcase) == 'true'}">
<attainGoal name="test:test"/>
</j:if>
<!--If there is tescase argument, generate report for that
particular
testcase -->
<j:if test="${empty(testcase) == 'false'}">
<attainGoal name="test:single"/>
</j:if>

So it takes dynamically testclass name as command argument for report
generation.
e.g. maven -Dmaven.junit.fork=yes -Dtestcase=MyTest
clover:swing-report

Thanks & Regards,
Shohara

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Vincent Massol added a comment - 16/Jul/04 8:16 AM

Hi Shohara,

I'd like to know what's your use case for this. Why do you need to run Clover only on a single class?

Is the instrumentation that you wish to run on a single class or the report only?

Thanks

Show
Vincent Massol added a comment - 16/Jul/04 8:16 AM Hi Shohara, I'd like to know what's your use case for this. Why do you need to run Clover only on a single class? Is the instrumentation that you wish to run on a single class or the report only? Thanks
Hide
Permalink
Shohara Farad Shaikh added a comment - 16/Jul/04 11:02 AM

Hello Vincent,

I would like to run clover on single class. Purpose behind it, I'm writing a test class and after finishing my testcase, I want to check the coverage of Test class. So developer can confirm his test cases immediately after finishing.

Second thing, it is fast to run a clover on single class.

Regards,

shohara

Show
Shohara Farad Shaikh added a comment - 16/Jul/04 11:02 AM Hello Vincent, I would like to run clover on single class. Purpose behind it, I'm writing a test class and after finishing my testcase, I want to check the coverage of Test class. So developer can confirm his test cases immediately after finishing. Second thing, it is fast to run a clover on single class. Regards, shohara
Hide
Permalink
Vincent Massol added a comment - 16/Jul/04 2:39 PM

Done even though I don't believe this is the best way to achieve your use case. I highly suggest you use your IDE Clover plugin which will a much much faster way to check how much your code is tested by your unit tests. For example, for JBuilder (which I know you're using), see http://www.cenqua.com/clover/doc/jbuilder/index.html

Show
Vincent Massol added a comment - 16/Jul/04 2:39 PM Done even though I don't believe this is the best way to achieve your use case. I highly suggest you use your IDE Clover plugin which will a much much faster way to check how much your code is tested by your unit tests. For example, for JBuilder (which I know you're using), see http://www.cenqua.com/clover/doc/jbuilder/index.html

People

  • Assignee:
    Vincent Massol
    Reporter:
    Shohara Farad Shaikh
Vote (0)
Watch (0)

Dates

  • Created:
    08/Oct/03 6:21 AM
    Updated:
    16/Jul/04 2:39 PM
    Resolved:
    16/Jul/04 2:39 PM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.