vmassol 2003/11/29 11:11:31 Modified: dashboard plugin.properties project.xml dashboard/xdocs changes.xml aggregators.xml dashboard/src/plugin-test/subproject2 project.properties dashboard/src/plugin-test maven.xml project.properties dashboard/src/plugin-test/subproject1 project.properties dashboard/src/plugin-test/subproject3 project.properties Added: dashboard/src/plugin-resources/aggregators cloverloc.jelly clovertpc.jelly cserrors.jelly junitfailures.jelly junittests.jelly csall.jelly juniterrors.jelly junitpassrate.jelly cloverncloc.jelly cswarnings.jelly Removed: dashboard/src/plugin-resources/reports cloverloc.jelly clovertpc.jelly cloverncloc.jelly csall.jelly cswarnings.jelly cserrors.jelly Log: Added JUnit aggregators. Thanks to John D Taylor. John I had to change several things from your patch: - remove tabs - added missind documentation (xdoc) - added missing tests - it was not working. More specifically it would not work if the clover aggregators were used before the junit ones - the goal caused by the junit aggregators was not the correct one... (you were calling "test" whereas it's the junit-report that must be called) Please note that I had to modify both the Clover plugin and the junit-report one. So if you wish to use the junit aggregators you need to have the CVS versions of the these 2 plugins installed. Revision Changes Path 1.5 +33 -6 maven-plugins/dashboard/plugin.properties Index: plugin.properties =================================================================== RCS file: /home/cvs/maven-plugins/dashboard/plugin.properties,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- plugin.properties 24 Nov 2003 20:31:38 -0000 1.4 +++ plugin.properties 29 Nov 2003 19:11:31 -0000 1.5 @@ -40,11 +40,20 @@ # ------------------------------------------------------------ # Location of default dashboard aggregators -maven.dashboard.aggregators.dir = ${plugin.resources}/reports +maven.dashboard.aggregators.dir = ${plugin.resources}/aggregators # Comma-separated list of aggregators to use maven.dashboard.aggregators = cserrors,cswarnings,clovertpc,cloverloc,cloverncloc +# Generated dashboard data for a single project +maven.dashboard.report.single = ${maven.build.dir}/dashboard-single.xml + +# Decide whether to call goals associated with report types or not +maven.dashboard.rungoals = true + +# Default aggregators +# ------------------- + # Properties for the Checkstyle error/warning aggregator (all errors/warnings) maven.dashboard.aggregator.csall.script = ${maven.dashboard.aggregators.dir}/csall.jelly maven.dashboard.aggregator.csall.artifact = ${maven.build.dir}/checkstyle-raw-report.xml @@ -81,8 +90,26 @@ maven.dashboard.aggregator.cloverncloc.label = Clover NCLOC maven.dashboard.aggregator.cloverncloc.goal = clover -# Generated dashboard data for a single project -maven.dashboard.report.single = ${maven.build.dir}/dashboard-single.xml - -# Decide whether to call goals associated with report types or not -maven.dashboard.rungoals = true +# Properties for the JUnit Test aggregator +maven.dashboard.aggregator.junittests.script = ${maven.dashboard.aggregators.dir}/junittests.jelly +maven.dashboard.aggregator.junittests.artifact = ${maven.build.dir}/TESTS-TestSuites.xml +maven.dashboard.aggregator.junittests.label = JUnit Tests +maven.dashboard.aggregator.junittests.goal = junit-report:report + +# Properties for the JUnit Failures aggregator +maven.dashboard.aggregator.junitfailures.script = ${maven.dashboard.aggregators.dir}/junitfailures.jelly +maven.dashboard.aggregator.junitfailures.artifact = ${maven.build.dir}/TESTS-TestSuites.xml +maven.dashboard.aggregator.junitfailures.label = JUnit Failures +maven.dashboard.aggregator.junitfailures.goal = junit-report:report + +# Properties for the JUnit Errors aggregator +maven.dashboard.aggregator.juniterrors.script = ${maven.dashboard.aggregators.dir}/juniterrors.jelly +maven.dashboard.aggregator.juniterrors.artifact = ${maven.build.dir}/TESTS-TestSuites.xml +maven.dashboard.aggregator.juniterrors.label = JUnit Errors +maven.dashboard.aggregator.juniterrors.goal = junit-report:report + +# Properties for the JUnit Pass Rate aggregator +maven.dashboard.aggregator.junitpassrate.script = ${maven.dashboard.aggregators.dir}/junitpassrate.jelly +maven.dashboard.aggregator.junitpassrate.artifact = ${maven.build.dir}/TESTS-TestSuites.xml +maven.dashboard.aggregator.junitpassrate.label = JUnit Pass Rate +maven.dashboard.aggregator.junitpassrate.goal = junit-report:report 1.7 +6 -0 maven-plugins/dashboard/project.xml Index: project.xml =================================================================== RCS file: /home/cvs/maven-plugins/dashboard/project.xml,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- project.xml 20 Nov 2003 10:25:56 -0000 1.6 +++ project.xml 29 Nov 2003 19:11:31 -0000 1.7 @@ -46,6 +46,12 @@ </roles> </developer> </developers> + <contributors> + <contributor> + <name>John D Taylor</name> + <email>[EMAIL PROTECTED]</email> + </contributor> + </contributors> <dependencies/> <reports> <report>maven-changes-plugin</report> 1.1 maven-plugins/dashboard/src/plugin-resources/aggregators/cloverloc.jelly Index: cloverloc.jelly =================================================================== <?xml version="1.0"?> <!-- ======================================================================== Clover aggregator. Extracts total line of code (LOC) from Clover raw file. ======================================================================== --> <j:jelly xmlns:j="jelly:core" xmlns:x="jelly:xml" xmlns:u="jelly:util"> <!-- Extract LOC --> <u:file var="artifactAsFile" name="${maven.dashboard.aggregator.cloverloc.artifact}"/> <j:choose> <j:when test="${artifactAsFile.exists()}"> <x:parse var="doc" xml="${artifactAsFile}"/> <x:expr select="string($doc/coverage/project/metrics/@loc)"/> </j:when> <j:otherwise> <j:expr value="-"/> </j:otherwise> </j:choose> </j:jelly> 1.1 maven-plugins/dashboard/src/plugin-resources/aggregators/clovertpc.jelly Index: clovertpc.jelly =================================================================== <?xml version="1.0"?> <!-- ======================================================================== Clover aggregator. Extracts total coverage percentage from Clover raw file. ======================================================================== --> <j:jelly xmlns:j="jelly:core" xmlns:x="jelly:xml" xmlns:u="jelly:util"> <!-- Extract total coverage percentage --> <u:file var="artifactAsFile" name="${maven.dashboard.aggregator.clovertpc.artifact}"/> <j:choose> <j:when test="${artifactAsFile.exists()}"> <x:parse var="doc" xml="${artifactAsFile}"/> <x:set var="coveredelements" select="string($doc/coverage/project/metrics/@coveredelements)"/> <x:set var="elements" select="string($doc/coverage/project/metrics/@elements)"/> <j:useBean var="tpc" class="org.apache.maven.dashboard.aggregator.clover.CloverTPC"/> <j:expr value="${tpc.computeTPC(elements, coveredelements)}"/> </j:when> <j:otherwise> <j:expr value="-"/> </j:otherwise> </j:choose> </j:jelly> 1.1 maven-plugins/dashboard/src/plugin-resources/aggregators/cserrors.jelly Index: cserrors.jelly =================================================================== <?xml version="1.0"?> <!-- ======================================================================== Checkstyle error aggregator. Extracts error count from Checkstyle raw XML file (does not count warnings). ======================================================================== --> <j:jelly xmlns:j="jelly:core" xmlns:x="jelly:xml" xmlns:u="jelly:util"> <u:file var="artifactAsFile" name="${maven.dashboard.aggregator.cserrors.artifact}"/> <j:choose> <j:when test="${artifactAsFile.exists()}"> <x:parse var="doc" xml="${artifactAsFile}"/> <x:expr select="count($doc//[EMAIL PROTECTED] = 'error'])"/> </j:when> <j:otherwise> <j:expr value="-"/> </j:otherwise> </j:choose> </j:jelly> 1.1 maven-plugins/dashboard/src/plugin-resources/aggregators/junitfailures.jelly Index: junitfailures.jelly =================================================================== <?xml version="1.0"?> <!-- ======================================================================== JUnit aggregator. Extracts failures count from junit report ======================================================================== --> <j:jelly xmlns:j="jelly:core" xmlns:x="jelly:xml" xmlns:u="jelly:util"> <u:file var="artifactAsFile" name="${maven.dashboard.aggregator.junittests.artifact}"/> <j:choose> <j:when test="${artifactAsFile.exists()}"> <x:parse var="doc" xml="${artifactAsFile}"/> <x:expr select="sum($doc/testsuites/testsuite/@failures)"/> </j:when> <j:otherwise> <j:expr value="-"/> </j:otherwise> </j:choose> </j:jelly> 1.1 maven-plugins/dashboard/src/plugin-resources/aggregators/junittests.jelly Index: junittests.jelly =================================================================== <?xml version="1.0"?> <!-- ======================================================================== JUnit aggregator. Extracts number of junit tests from JUnit test report ======================================================================== --> <j:jelly xmlns:j="jelly:core" xmlns:x="jelly:xml" xmlns:u="jelly:util"> <u:file var="artifactAsFile" name="${maven.dashboard.aggregator.junittests.artifact}"/> <j:choose> <j:when test="${artifactAsFile.exists()}"> <x:parse var="doc" xml="${artifactAsFile}"/> <x:expr select="sum($doc/testsuites/testsuite/@tests)"/> </j:when> <j:otherwise> <j:expr value="-"/> </j:otherwise> </j:choose> </j:jelly> 1.1 maven-plugins/dashboard/src/plugin-resources/aggregators/csall.jelly Index: csall.jelly =================================================================== <?xml version="1.0"?> <!-- ======================================================================== Checkstyle aggregator. Extracts error count from Checkstyle raw XML file. ======================================================================== --> <j:jelly xmlns:j="jelly:core" xmlns:x="jelly:xml" xmlns:u="jelly:util"> <u:file var="artifactAsFile" name="${maven.dashboard.aggregator.csall.artifact}"/> <j:choose> <j:when test="${artifactAsFile.exists()}"> <x:parse var="doc" xml="${artifactAsFile}"/> <x:expr select="count($doc//error)"/> </j:when> <j:otherwise> <j:expr value="-"/> </j:otherwise> </j:choose> </j:jelly> 1.1 maven-plugins/dashboard/src/plugin-resources/aggregators/juniterrors.jelly Index: juniterrors.jelly =================================================================== <?xml version="1.0"?> <!-- ======================================================================== JUnit aggregator. Extracts errors count from junit report ======================================================================== --> <j:jelly xmlns:j="jelly:core" xmlns:x="jelly:xml" xmlns:u="jelly:util"> <u:file var="artifactAsFile" name="${maven.dashboard.aggregator.junittests.artifact}"/> <j:choose> <j:when test="${artifactAsFile.exists()}"> <x:parse var="doc" xml="${artifactAsFile}"/> <x:expr select="sum($doc/testsuites/testsuite/@errors)"/> </j:when> <j:otherwise> <j:expr value="-"/> </j:otherwise> </j:choose> </j:jelly> 1.1 maven-plugins/dashboard/src/plugin-resources/aggregators/junitpassrate.jelly Index: junitpassrate.jelly =================================================================== <?xml version="1.0"?> <!-- ======================================================================== JUnit aggregator. Calculates pass rate from junit report ======================================================================== --> <j:jelly xmlns:j="jelly:core" xmlns:x="jelly:xml" xmlns:u="jelly:util"> <u:file var="artifactAsFile" name="${maven.dashboard.aggregator.junittests.artifact}"/> <j:choose> <j:when test="${artifactAsFile.exists()}"> <x:parse var="doc" xml="${artifactAsFile}"/> <x:expr select="floor(100 - 100 * (sum($doc/testsuites/testsuite/@failures) + sum($doc/testsuites/testsuite/@errors)) div sum($doc/testsuites/testsuite/@tests))"/> % </j:when> <j:otherwise> <j:expr value="-"/> </j:otherwise> </j:choose> </j:jelly> 1.1 maven-plugins/dashboard/src/plugin-resources/aggregators/cloverncloc.jelly Index: cloverncloc.jelly =================================================================== <?xml version="1.0"?> <!-- ======================================================================== Clover aggregator. Extracts total non-commented lines of code (NCLOC) from Clover raw file. ======================================================================== --> <j:jelly xmlns:j="jelly:core" xmlns:x="jelly:xml" xmlns:u="jelly:util"> <!-- Extract NCLOC --> <u:file var="artifactAsFile" name="${maven.dashboard.aggregator.cloverncloc.artifact}"/> <j:choose> <j:when test="${artifactAsFile.exists()}"> <x:parse var="doc" xml="${artifactAsFile}"/> <x:expr select="string($doc/coverage/project/metrics/@ncloc)"/> </j:when> <j:otherwise> <j:expr value="-"/> </j:otherwise> </j:choose> </j:jelly> 1.1 maven-plugins/dashboard/src/plugin-resources/aggregators/cswarnings.jelly Index: cswarnings.jelly =================================================================== <?xml version="1.0"?> <!-- ======================================================================== Checkstyle error aggregator. Extracts warning count from Checkstyle raw XML file (does not count errors). ======================================================================== --> <j:jelly xmlns:j="jelly:core" xmlns:x="jelly:xml" xmlns:u="jelly:util"> <u:file var="artifactAsFile" name="${maven.dashboard.aggregator.cserrors.artifact}"/> <j:choose> <j:when test="${artifactAsFile.exists()}"> <x:parse var="doc" xml="${artifactAsFile}"/> <x:expr select="count($doc//[EMAIL PROTECTED] = 'warning'])"/> </j:when> <j:otherwise> <j:expr value="-"/> </j:otherwise> </j:choose> </j:jelly> 1.10 +3 -0 maven-plugins/dashboard/xdocs/changes.xml Index: changes.xml =================================================================== RCS file: /home/cvs/maven-plugins/dashboard/xdocs/changes.xml,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- changes.xml 26 Nov 2003 15:00:10 -0000 1.9 +++ changes.xml 29 Nov 2003 19:11:31 -0000 1.10 @@ -8,6 +8,9 @@ <body> <release version="1.2" date="in CVS"> + <action dev="vmassol" due-to="John D Taylor"> + Added JUnit aggregators. + </action> <action dev="vmassol" type="add"> Added tutorial on how to create custom aggregators. </action> 1.4 +28 -0 maven-plugins/dashboard/xdocs/aggregators.xml Index: aggregators.xml =================================================================== RCS file: /home/cvs/maven-plugins/dashboard/xdocs/aggregators.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- aggregators.xml 20 Nov 2003 10:20:58 -0000 1.3 +++ aggregators.xml 29 Nov 2003 19:11:31 -0000 1.4 @@ -62,6 +62,34 @@ Computes total Non-Commented Line Of Code (NCLOC) using Clover. </td> </tr> + <tr> + <td>junittests</td> + <td>JUnit</td> + <td> + Number of JUnit tests. + </td> + </tr> + <tr> + <td>juniterrors</td> + <td>JUnit</td> + <td> + Number of JUnit errors. + </td> + </tr> + <tr> + <td>junitfailures</td> + <td>JUnit</td> + <td> + Number of JUnit failures. + </td> + </tr> + <tr> + <td>junitpassrate</td> + <td>JUnit</td> + <td> + Percentage of JUnit tests that have passed. + </td> + </tr> </table> </section> </body> 1.2 +2 -0 maven-plugins/dashboard/src/plugin-test/subproject2/project.properties Index: project.properties =================================================================== RCS file: /home/cvs/maven-plugins/dashboard/src/plugin-test/subproject2/project.properties,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- project.properties 17 Nov 2003 21:36:59 -0000 1.1 +++ project.properties 29 Nov 2003 19:11:31 -0000 1.2 @@ -4,3 +4,5 @@ maven.xdoc.date=left maven.xdoc.version=${pom.currentVersion} maven.checkstyle.header.file = ${basedir}/../LICENSE.txt + +maven.dashboard.aggregators = csall,cserrors,cswarnings,clovertpc,cloverloc,cloverncloc,junittests,junitpassrate,junitfailures,juniterrors 1.4 +0 -1 maven-plugins/dashboard/src/plugin-test/maven.xml Index: maven.xml =================================================================== RCS file: /home/cvs/maven-plugins/dashboard/src/plugin-test/maven.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- maven.xml 24 Nov 2003 20:31:38 -0000 1.3 +++ maven.xml 29 Nov 2003 19:11:31 -0000 1.4 @@ -35,5 +35,4 @@ <assert:assertEquals expected="4" value="${count.intValue().toString()}"/> </goal> - </project> 1.2 +0 -2 maven-plugins/dashboard/src/plugin-test/project.properties Index: project.properties =================================================================== RCS file: /home/cvs/maven-plugins/dashboard/src/plugin-test/project.properties,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- project.properties 17 Nov 2003 21:36:58 -0000 1.1 +++ project.properties 29 Nov 2003 19:11:31 -0000 1.2 @@ -5,6 +5,4 @@ maven.xdoc.version=${pom.currentVersion} maven.checkstyle.header.file = ${basedir}/LICENSE.txt -maven.dashboard.aggregators = csall,cserrors,cswarnings,clovertpc,cloverloc,cloverncloc - offline=true 1.2 +2 -0 maven-plugins/dashboard/src/plugin-test/subproject1/project.properties Index: project.properties =================================================================== RCS file: /home/cvs/maven-plugins/dashboard/src/plugin-test/subproject1/project.properties,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- project.properties 17 Nov 2003 21:36:59 -0000 1.1 +++ project.properties 29 Nov 2003 19:11:31 -0000 1.2 @@ -4,3 +4,5 @@ maven.xdoc.date=left maven.xdoc.version=${pom.currentVersion} maven.checkstyle.header.file = ${basedir}/../LICENSE.txt + +maven.dashboard.aggregators = csall,cserrors,cswarnings,clovertpc,cloverloc,cloverncloc,junittests,junitpassrate,junitfailures,juniterrors 1.2 +2 -0 maven-plugins/dashboard/src/plugin-test/subproject3/project.properties Index: project.properties =================================================================== RCS file: /home/cvs/maven-plugins/dashboard/src/plugin-test/subproject3/project.properties,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- project.properties 17 Nov 2003 21:36:59 -0000 1.1 +++ project.properties 29 Nov 2003 19:11:31 -0000 1.2 @@ -4,3 +4,5 @@ maven.xdoc.date=left maven.xdoc.version=${pom.currentVersion} maven.checkstyle.header.file = ${basedir}/../LICENSE.txt + +maven.dashboard.aggregators = csall,cserrors,cswarnings,clovertpc,cloverloc,cloverncloc,junittests,junitpassrate,junitfailures,juniterrors
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]