Permalink
Browse files

maven site / reports

  • Loading branch information...
1 parent aaf908b commit 92d1c03d31cf76b7e17836e74333f70841e31877 @shane-k-j committed May 11, 2012
@@ -0,0 +1,3 @@
+<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
+ <public publicId="-//JACOCO//DTD Report 1.0//EN" uri="./report.dtd" />
+</catalog>
@@ -0,0 +1,170 @@
+<?xml version="1.0"?>
+
+<!-- Converts Jacoco XML to old Emma XML as good as it is possible
+ - Author: Markus Schlegel, pulinco engineering switzerland
+ - Version 0.1, 23.Jan.2012
+ -->
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <xsl:template match="/report">
+ <report>
+ <stats>
+ <packages>
+ <xsl:attribute name="value">
+ <xsl:value-of select="count(//package)"/>
+ </xsl:attribute>
+ </packages>
+ <classes>
+ <xsl:attribute name="value">
+ <xsl:value-of select="counter[@type='CLASS']/@covered + counter[@type='CLASS']/@missed"/>
+ </xsl:attribute>
+ </classes>
+ <methods>
+ <xsl:attribute name="value">
+ <xsl:value-of select="counter[@type='METHOD']/@covered + counter[@type='METHOD']/@missed"/>
+ </xsl:attribute>
+ </methods>
+ <srcfiles>
+ <xsl:attribute name="value">
+ <xsl:value-of select="count(//sourcefile)"/>
+ </xsl:attribute>
+ </srcfiles>
+ <srclines>
+ <xsl:attribute name="value">
+ <xsl:value-of select="counter[@type='LINE']/@covered + counter[@type='LINE']/@missed"/>
+ </xsl:attribute>
+ </srclines>
+ </stats>
+ <data>
+ <all name="all classes">
+ <xsl:for-each select="counter">
+ <xsl:call-template name="counter"/>
+ </xsl:for-each>
+ <xsl:for-each select="group/package">
+ <package>
+ <xsl:attribute name="name">
+ <xsl:value-of select="replace(@name, '/', '.')"/>
+ </xsl:attribute>
+ <xsl:for-each select="counter">
+ <xsl:call-template name="counter"/>
+ </xsl:for-each>
+ <xsl:for-each select="sourcefile">
+ <srcfile>
+ <xsl:attribute name="name">
+ <xsl:value-of select="replace(@name, '/', '.')"/>
+ </xsl:attribute>
+ <xsl:for-each select="counter">
+ <xsl:call-template name="counter"/>
+ </xsl:for-each>
+ <xsl:variable name="clsName" select="concat(../@name, '/', substring-before(@name, '.java') ) "/>
+ <!-- xsl:value-of select="$clsName"/ -->
+ <xsl:for-each select="../class[starts-with(@name,$clsName)]">
+ <class>
+ <xsl:attribute name="name">
+ <xsl:value-of select="substring(substring-after(@name, ../@name), 2)"/>
+ </xsl:attribute>
+ <xsl:for-each select="counter">
+ <xsl:call-template name="counter"/>
+ </xsl:for-each>
+ <xsl:for-each select="method">
+ <xsl:variable name="arguments">
+ <xsl:value-of select="replace(substring-before(@desc, ')'), ';', ', ')"/>)</xsl:variable>
+ <xsl:variable name="mReturn">
+ <xsl:choose>
+ <xsl:when test="ends-with(@desc, ')V')">: void</xsl:when>
+ <xsl:otherwise>: <xsl:value-of select="substring-after(@desc, ')')"/></xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <method>
+ <xsl:attribute name="name">
+ <xsl:value-of select="concat(@name, ' ', $arguments, replace($mReturn, ';', ''))"/>
+ </xsl:attribute>
+ <xsl:for-each select="counter">
+ <xsl:call-template name="counter"/>
+ </xsl:for-each>
+ </method>
+ </xsl:for-each>
+ </class>
+ </xsl:for-each>
+ </srcfile>
+ </xsl:for-each>
+ </package>
+ </xsl:for-each>
+ </all>
+ </data>
+ </report>
+ </xsl:template>
+
+ <xsl:template name="counter">
+ <xsl:variable name="emmaType">
+ <xsl:choose>
+ <xsl:when test="@type='CLASS'">class, %</xsl:when>
+ <xsl:when test="@type='METHOD'">method, %</xsl:when>
+ <xsl:when test="@type='COMPLEXITY'">block, %</xsl:when>
+ <xsl:when test="@type='LINE'">line, %</xsl:when>
+ <xsl:otherwise>unknown</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
+ <xsl:if test="$emmaType != 'unknown'">
+ <coverage>
+ <xsl:attribute name="type">
+ <xsl:value-of select="$emmaType"/>
+ </xsl:attribute>
+ <xsl:variable name="total" select="@missed + @covered"/>
+ <xsl:attribute name="value">
+ <xsl:value-of select="ceiling((1 div $total) * @covered * 100)"/>% (<xsl:value-of select="@covered"/>/<xsl:value-of select="$total"/>)</xsl:attribute>
+ </coverage>
+ </xsl:if>
+ </xsl:template>
+</xsl:stylesheet><!-- Stylus Studio meta-information - (c) 2004-2008. Progress Software Corporation. All rights reserved.
+
+<metaInformation>
+ <scenarios>
+ <scenario default="no" name="Scenario1" userelativepaths="yes" externalpreview="no" url="coverage.xml" htmlbaseurl="" outputurl="" processortype="saxon8" useresolver="no" profilemode="0" profiledepth="" profilelength="" urlprofilexml=""
+ commandline="" additionalpath="" additionalclasspath="" postprocessortype="none" postprocesscommandline="" postprocessadditionalpath="" postprocessgeneratedext="" validateoutput="no" validator="internal" customvalidator="">
+ <advancedProp name="sInitialMode" value=""/>
+ <advancedProp name="bXsltOneIsOkay" value="true"/>
+ <advancedProp name="bSchemaAware" value="false"/>
+ <advancedProp name="bXml11" value="false"/>
+ <advancedProp name="iValidation" value="0"/>
+ <advancedProp name="bExtensions" value="true"/>
+ <advancedProp name="iWhitespace" value="0"/>
+ <advancedProp name="sInitialTemplate" value=""/>
+ <advancedProp name="bTinyTree" value="true"/>
+ <advancedProp name="bWarnings" value="true"/>
+ <advancedProp name="bUseDTD" value="false"/>
+ <advancedProp name="iErrorHandling" value="fatal"/>
+ </scenario>
+ <scenario default="yes" name="Scenario2" userelativepaths="yes" externalpreview="no" url="coverageOrig.xml" htmlbaseurl="" outputurl="" processortype="saxon8" useresolver="no" profilemode="0" profiledepth="" profilelength="" urlprofilexml=""
+ commandline="" additionalpath="" additionalclasspath="" postprocessortype="none" postprocesscommandline="" postprocessadditionalpath="" postprocessgeneratedext="" validateoutput="no" validator="internal" customvalidator="">
+ <advancedProp name="sInitialMode" value=""/>
+ <advancedProp name="bXsltOneIsOkay" value="true"/>
+ <advancedProp name="bSchemaAware" value="false"/>
+ <advancedProp name="bXml11" value="false"/>
+ <advancedProp name="iValidation" value="0"/>
+ <advancedProp name="bExtensions" value="true"/>
+ <advancedProp name="iWhitespace" value="0"/>
+ <advancedProp name="sInitialTemplate" value=""/>
+ <advancedProp name="bTinyTree" value="true"/>
+ <advancedProp name="bWarnings" value="true"/>
+ <advancedProp name="bUseDTD" value="false"/>
+ <advancedProp name="iErrorHandling" value="fatal"/>
+ </scenario>
+ </scenarios>
+ <MapperMetaTag>
+ <MapperInfo srcSchemaPathIsRelative="yes" srcSchemaInterpretAsXML="no" destSchemaPath="emma.xsd" destSchemaRoot="report" destSchemaPathIsRelative="yes" destSchemaInterpretAsXML="no">
+ <SourceSchema srcSchemaPath="coverage.xml" srcSchemaRoot="report" AssociatedInstance="" loaderFunction="document" loaderFunctionUsesURI="no"/>
+ </MapperInfo>
+ <MapperBlockPosition>
+ <template match="/">
+ <block path="report/data/all/xsl:for-each" x="317" y="224"/>
+ <block path="report/data/all/xsl:for-each/package/xsl:for-each" x="317" y="278"/>
+ <block path="report/data/all/xsl:for-each/package/xsl:for-each/srcfile/xsl:for-each" x="317" y="332"/>
+ <block path="report/data/all/xsl:for-each/package/xsl:for-each/srcfile/xsl:for-each/class/xsl:for-each" x="317" y="386"/>
+ </template>
+ </MapperBlockPosition>
+ <TemplateContext></TemplateContext>
+ <MapperFilter side="source"></MapperFilter>
+ </MapperMetaTag>
+</metaInformation>
+-->
@@ -0,0 +1,84 @@
+<!--
+ Copyright (c) 2009, 2012 Mountainminds GmbH & Co. KG and Contributors
+ All rights reserved. This program and the accompanying materials
+ are made available under the terms of the Eclipse Public License v1.0
+ which accompanies this distribution, and is available at
+ http://www.eclipse.org/legal/epl-v10.html
+
+ Contributors:
+ Brock Janiczak - initial API and implementation
+ Marc R. Hoffmann - generalized report structure, line info, documentation
+
+ $Id: $
+-->
+
+<!-- This DTD describes the JaCoCo XML report format. It is identified by the
+ following identifiers:
+
+ PUBID = "-//JACOCO//DTD Report 1.0//EN"
+ SYSTEM = "report.dtd"
+-->
+
+<!-- report root node -->
+<!ELEMENT report (sessioninfo*, (group* | package*), counter*)>
+ <!ATTLIST report name CDATA #REQUIRED>
+
+<!-- information about a session which contributed execution data -->
+<!ELEMENT sessioninfo EMPTY>
+ <!-- session id -->
+ <!ATTLIST sessioninfo id CDATA #REQUIRED>
+ <!-- start time stamp -->
+ <!ATTLIST sessioninfo start CDATA #REQUIRED>
+ <!-- dump time stamp -->
+ <!ATTLIST sessioninfo dump CDATA #REQUIRED>
+
+<!-- representation of a group -->
+<!ELEMENT group ((group* | package*), counter*)>
+ <!-- group name -->
+ <!ATTLIST group name CDATA #REQUIRED>
+
+<!-- representation of a package -->
+<!ELEMENT package ((class | sourcefile)*, counter*)>
+ <!-- package name in VM notation -->
+ <!ATTLIST package name CDATA #REQUIRED>
+
+<!-- representation of a class -->
+<!ELEMENT class (method*, counter*)>
+ <!-- fully qualified VM name -->
+ <!ATTLIST class name CDATA #REQUIRED>
+
+<!-- representation of a method -->
+<!ELEMENT method (counter*)>
+ <!-- method name -->
+ <!ATTLIST method name CDATA #REQUIRED>
+ <!-- method parameter description -->
+ <!ATTLIST method desc CDATA #REQUIRED>
+ <!-- first source line number of this method -->
+ <!ATTLIST method line CDATA #IMPLIED>
+
+<!-- representation of a source file -->
+<!ELEMENT sourcefile (line*, counter*)>
+ <!-- local source file name -->
+ <!ATTLIST sourcefile name CDATA #REQUIRED>
+
+<!-- representation of a source line -->
+<!ELEMENT line EMPTY>
+ <!-- line number -->
+ <!ATTLIST line nr CDATA #REQUIRED>
+ <!-- number of missed instructions -->
+ <!ATTLIST line mi CDATA #IMPLIED>
+ <!-- number of covered instructions -->
+ <!ATTLIST line ci CDATA #IMPLIED>
+ <!-- number of missed branches -->
+ <!ATTLIST line mb CDATA #IMPLIED>
+ <!-- number of covered branches -->
+ <!ATTLIST line cb CDATA #IMPLIED>
+
+<!-- coverage data counter for different metrics -->
+<!ELEMENT counter EMPTY>
+ <!-- metric type -->
+ <!ATTLIST counter type (INSTRUCTION|BRANCH|LINE|COMPLEXITY|METHOD|CLASS) #REQUIRED>
+ <!-- number of missed items -->
+ <!ATTLIST counter missed CDATA #REQUIRED>
+ <!-- number of covered items -->
+ <!ATTLIST counter covered CDATA #REQUIRED>

0 comments on commit 92d1c03

Please sign in to comment.