You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by bu...@apache.org on 2003/01/28 16:15:49 UTC
DO NOT REPLY [Bug 16495] New: -
Include the contents of the methods in the JProbe coverage report
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16495>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND
INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16495
Include the contents of the methods in the JProbe coverage report
Summary: Include the contents of the methods in the JProbe
coverage report
Product: Ant
Version: 1.5.1
Platform: All
OS/Version: All
Status: NEW
Severity: Enhancement
Priority: Other
Component: Optional Tasks
AssignedTo: ant-dev@jakarta.apache.org
ReportedBy: sigurd@knippenberg.com
Currently the JProbe coverage report does not include the contents of the
methods and how many times each line is executed. When you run a detailed report
in JProbe you get this information.
Locally I modified the coverage-frames.xsl file to include this information (I
also added links for the classes in the package page).
Below you can see the diff result between my version and the version that came
with Ant 1.5.1.
I tested this with JProbe 4.0, not with JProbe 3.0 which is currently supported
by Ant. I don't have access to JProbe 3.0, so I cannot test this.
I would like to request for someone to add this functionality, either by using
my changes, or by making the changes himself/herself.
Thanks,
Sigurd
Index: coverage-frames.xsl
===================================================================
RCS file: /opt/cvsroot/bml/test/unit/jprobe/coverage-frames.xsl,v
retrieving revision 1.2
retrieving revision 1.1
diff -b -r1.2 -r1.1
328,333d327
< <xsl:for-each select="method">
< <xsl:variable name="filename"><xsl:call-template
name="method.filename"><xsl:with-param name="class.name"
select="../@name"/><xsl:with-param name="method.name"
select="@name"/></xsl:call-template></xsl:variable>
< <redirect:write file="{$output.dir}/{$package.dir}/{$filename}">
< <xsl:apply-templates select="." mode="method.details"/>
< </redirect:write>
< </xsl:for-each>
416c410
< <xsl:apply-templates select="." mode="stats.nolink"/>
---
> <xsl:apply-templates select="." mode="stats"/>
479,487d472
< <xsl:template match="method" mode="stats.nolink">
< <tr>
< <xsl:call-template name="alternate-row"/>
< <td><xsl:value-of select="@name"/></td>
< <td>
< <xsl:value-of select="format-number(cov.data/@hit_lines div
cov.data/@total_lines,'0.0%')"/>
< </td>
< </tr>
< </xsl:template>
491c476
< <td><a><xsl:attribute name="href"><xsl:call-template
name="method.filename"><xsl:with-param name="class.name"
select="../@name"/><xsl:with-param name="method.name"
select="@name"/></xsl:call-template></xsl:attribute><xsl:value-of
select="@name"/></a></td>
---
> <td><xsl:value-of select="@name"/></td>
505,522c490
< <xsl:template match="class" mode="stats.nolink">
< <tr>
< <xsl:call-template name="alternate-row"/>
< <td><xsl:value-of select="@name"/></td>
< <td><xsl:value-of select="format-number(cov.data/@hit_methods div
cov.data/@total_methods,'0.0%')"/></td>
< <td><xsl:value-of select="format-number(cov.data/@hit_lines div
cov.data/@total_lines,'0.0%')"/></td>
< </tr>
< </xsl:template>
< <xsl:template match="class" mode="stats">
< <tr>
< <xsl:call-template name="alternate-row"/>
< <td><a><xsl:attribute name="href"><xsl:value-of select="concat(@name,
'.html')"/></xsl:attribute><xsl:value-of select="@name"/></a></td>
< <td><xsl:value-of select="format-number(cov.data/@hit_methods div
cov.data/@total_methods,'0.0%')"/></td>
< <td><xsl:value-of select="format-number(cov.data/@hit_lines div
cov.data/@total_lines,'0.0%')"/></td>
< </tr>
< </xsl:template>
<
< <xsl:template match="package" mode="stats">
---
> <xsl:template match="package|class" mode="stats">
563,616d530
< <xsl:template name="method.filename">
< <xsl:param name="class.name"/>
< <xsl:param name="method.name"/>
< <xsl:value-of select="concat(translate($class.name, '<>().',
'_____'), '_', translate($method.name, '<>().', '_____'), '.html')"/>
< </xsl:template>
<
< <!-- details of a method -->
< <xsl:template match="method" mode="method.details">
< <xsl:variable name="package.name" select="(ancestor::package)[last()]/@name"/>
< <xsl:variable name="class.name" select="(ancestor::class)[last()]/@name"/>
< <HTML>
< <HEAD>
< <xsl:call-template name="create.stylesheet.link">
< <xsl:with-param name="package.name" select="$package.name"/>
< </xsl:call-template>
< </HEAD>
< <BODY>
< <xsl:call-template name="pageHeader"/>
< <H3>Method <xsl:if test="not($package.name = '')"><xsl:value-of
select="$package.name"/>.</xsl:if><xsl:value-of
select="$class.name"/>.<xsl:value-of select="@name"/></H3>
<
< <!-- class summary -->
< <table class="log" cellpadding="5" cellspacing="2" width="100%">
< <xsl:apply-templates select="." mode="stats.header"/>
< <xsl:apply-templates select="." mode="stats.nolink"/>
< </table>
<
< <!-- details of methods -->
< <H3>Methods</H3>
< <table class="log" cellpadding="5" cellspacing="2" width="100%">
< <xsl:apply-templates select="line[1]" mode="stats.header"/>
< <xsl:apply-templates select="line" mode="stats"/>
< </table>
< <xsl:call-template name="pageFooter"/>
< </BODY>
< </HTML>
<
< </xsl:template>
<
< <xsl:template match="line" mode="stats.header">
< <tr>
< <th width="10%" nowrap="nowrap">Line</th>
< <th width="10%" nowrap="nowrap">Calls</th>
< <th width="90%" nowrap="nowrap">Statement</th>
< </tr>
< </xsl:template>
< <xsl:template match="line" mode="stats">
< <tr>
< <xsl:call-template name="alternate-row"/>
< <td nowrap="nowrap"><xsl:value-of select="@number"/></td>
< <td nowrap="nowrap"><xsl:value-of select="cov.data/@calls"/></td>
< <td nowrap="nowrap"><xsl:value-of select="."/></td>
< </tr>
< </xsl:template>
<
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>