Author: vmassol Date: Sun Mar 13 09:10:08 2005 New Revision: 157343 URL: http://svn.apache.org/viewcvs?view=rev&rev=157343 Log: MPDASHBOARD-17: Prevent failure in <code><junitpassrate.jelly/code> due to a division by zero when there is a unit test source directory defined but no tests are executed.
Added: maven/maven-1/plugins/trunk/dashboard/src/plugin-test/subproject2/src/test/ maven/maven-1/plugins/trunk/dashboard/src/plugin-test/subproject2/src/test/org/ maven/maven-1/plugins/trunk/dashboard/src/plugin-test/subproject2/src/test/org/apache/ maven/maven-1/plugins/trunk/dashboard/src/plugin-test/subproject2/src/test/org/apache/maven/ maven/maven-1/plugins/trunk/dashboard/src/plugin-test/subproject2/src/test/org/apache/maven/dashboard/ maven/maven-1/plugins/trunk/dashboard/src/plugin-test/subproject2/src/test/org/apache/maven/dashboard/test/ maven/maven-1/plugins/trunk/dashboard/src/plugin-test/subproject2/src/test/org/apache/maven/dashboard/test/subproject2/ maven/maven-1/plugins/trunk/dashboard/src/plugin-test/subproject2/src/test/org/apache/maven/dashboard/test/subproject2/Dummy.java (with props) Modified: maven/maven-1/plugins/trunk/dashboard/src/plugin-resources/aggregators/junitpassrate.jelly maven/maven-1/plugins/trunk/dashboard/src/plugin-test/subproject1/src/java/org/apache/maven/dashboard/test/subproject1/Sample.java maven/maven-1/plugins/trunk/dashboard/src/plugin-test/subproject1/src/test/org/apache/maven/dashboard/test/subproject1/TestSample.java maven/maven-1/plugins/trunk/dashboard/src/plugin-test/subproject2/src/java/org/apache/maven/dashboard/test/subproject2/Sample.java maven/maven-1/plugins/trunk/dashboard/src/plugin-test/subproject3/project.xml maven/maven-1/plugins/trunk/dashboard/xdocs/changes.xml Modified: maven/maven-1/plugins/trunk/dashboard/src/plugin-resources/aggregators/junitpassrate.jelly URL: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/dashboard/src/plugin-resources/aggregators/junitpassrate.jelly?view=diff&r1=157342&r2=157343 ============================================================================== --- maven/maven-1/plugins/trunk/dashboard/src/plugin-resources/aggregators/junitpassrate.jelly (original) +++ maven/maven-1/plugins/trunk/dashboard/src/plugin-resources/aggregators/junitpassrate.jelly Sun Mar 13 09:10:08 2005 @@ -1,7 +1,8 @@ <?xml version="1.0"?> + <!-- /* - * Copyright 2001-2004 The Apache Software Foundation. + * Copyright 2001-2005 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,20 +18,27 @@ */ --> - <!-- ======================================================================== JUnit aggregator. Calculates pass rate from junit report ======================================================================== --> -<j:jelly xmlns:j="jelly:core" xmlns:x="jelly:xml" xmlns:u="jelly:util"> +<j:jelly xmlns:j="jelly:core" xmlns:a="jelly:ant" 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:choose> + <x:set var="nbTests" select="sum($doc/testsuites/testsuite/@tests)"/> + <j:when test="${nbTests != 0}"> + <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:when> <j:otherwise> <j:expr value="-"/> Modified: maven/maven-1/plugins/trunk/dashboard/src/plugin-test/subproject1/src/java/org/apache/maven/dashboard/test/subproject1/Sample.java URL: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/dashboard/src/plugin-test/subproject1/src/java/org/apache/maven/dashboard/test/subproject1/Sample.java?view=diff&r1=157342&r2=157343 ============================================================================== --- maven/maven-1/plugins/trunk/dashboard/src/plugin-test/subproject1/src/java/org/apache/maven/dashboard/test/subproject1/Sample.java (original) +++ maven/maven-1/plugins/trunk/dashboard/src/plugin-test/subproject1/src/java/org/apache/maven/dashboard/test/subproject1/Sample.java Sun Mar 13 09:10:08 2005 @@ -1,60 +1,20 @@ -package org.apache.maven.dashboard.test.subproject1; - /* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2001 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" and - * "Apache Maven" must not be used to endorse or promote products - * derived from this software without prior written permission. For - * written permission, please contact [EMAIL PROTECTED] - * - * 5. Products derived from this software may not be called "Apache", - * "Apache Maven", nor may "Apache" appear in their name, without - * prior written permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * <http://www.apache.org/>. + * Copyright 2001-2005 The Apache Software Foundation. * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. * ==================================================================== */ +package org.apache.maven.dashboard.test.subproject1; /** * Example voluntarily generating checsktyle errors. @@ -62,7 +22,7 @@ * * @author <a href="mailto:[EMAIL PROTECTED]">Vincent Massol</a> * - * @version $Id: Sample.java,v 1.3 2004/11/26 08:33:00 vmassol Exp $ + * @version $Id$ */ public class Sample { Modified: maven/maven-1/plugins/trunk/dashboard/src/plugin-test/subproject1/src/test/org/apache/maven/dashboard/test/subproject1/TestSample.java URL: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/dashboard/src/plugin-test/subproject1/src/test/org/apache/maven/dashboard/test/subproject1/TestSample.java?view=diff&r1=157342&r2=157343 ============================================================================== --- maven/maven-1/plugins/trunk/dashboard/src/plugin-test/subproject1/src/test/org/apache/maven/dashboard/test/subproject1/TestSample.java (original) +++ maven/maven-1/plugins/trunk/dashboard/src/plugin-test/subproject1/src/test/org/apache/maven/dashboard/test/subproject1/TestSample.java Sun Mar 13 09:10:08 2005 @@ -1,60 +1,20 @@ -package org.apache.maven.dashboard.test.subproject1; - /* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2001 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" and - * "Apache Maven" must not be used to endorse or promote products - * derived from this software without prior written permission. For - * written permission, please contact [EMAIL PROTECTED] - * - * 5. Products derived from this software may not be called "Apache", - * "Apache Maven", nor may "Apache" appear in their name, without - * prior written permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * <http://www.apache.org/>. + * Copyright 2001-2005 The Apache Software Foundation. * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. * ==================================================================== */ +package org.apache.maven.dashboard.test.subproject1; import junit.framework.TestCase; @@ -63,7 +23,7 @@ * * @author <a href="mailto:[EMAIL PROTECTED]">Vincent Massol</a> * - * @version $Id: TestSample.java,v 1.1 2003/11/17 21:37:00 vmassol Exp $ + * @version $Id$ */ public class TestSample extends TestCase { Modified: maven/maven-1/plugins/trunk/dashboard/src/plugin-test/subproject2/src/java/org/apache/maven/dashboard/test/subproject2/Sample.java URL: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/dashboard/src/plugin-test/subproject2/src/java/org/apache/maven/dashboard/test/subproject2/Sample.java?view=diff&r1=157342&r2=157343 ============================================================================== --- maven/maven-1/plugins/trunk/dashboard/src/plugin-test/subproject2/src/java/org/apache/maven/dashboard/test/subproject2/Sample.java (original) +++ maven/maven-1/plugins/trunk/dashboard/src/plugin-test/subproject2/src/java/org/apache/maven/dashboard/test/subproject2/Sample.java Sun Mar 13 09:10:08 2005 @@ -1,67 +1,27 @@ -package org.apache.maven.dashboard.test.subproject2; - /* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2001-2004 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" and - * "Apache Maven" must not be used to endorse or promote products - * derived from this software without prior written permission. For - * written permission, please contact [EMAIL PROTECTED] - * - * 5. Products derived from this software may not be called "Apache", - * "Apache Maven", nor may "Apache" appear in their name, without - * prior written permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * <http://www.apache.org/>. + * Copyright 2001-2005 The Apache Software Foundation. * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. * ==================================================================== */ +package org.apache.maven.dashboard.test.subproject2; /** - * Example voluntarily generating checsktyle errors. + * Example voluntarily generating checkstyle errors. * * @author <a href="mailto:[EMAIL PROTECTED]">Vincent Massol</a> * - * @version $Id: Sample.java,v 1.2 2004/11/05 15:30:11 vmassol Exp $ + * @version $Id$ */ public class Sample { Added: maven/maven-1/plugins/trunk/dashboard/src/plugin-test/subproject2/src/test/org/apache/maven/dashboard/test/subproject2/Dummy.java URL: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/dashboard/src/plugin-test/subproject2/src/test/org/apache/maven/dashboard/test/subproject2/Dummy.java?view=auto&rev=157343 ============================================================================== --- maven/maven-1/plugins/trunk/dashboard/src/plugin-test/subproject2/src/test/org/apache/maven/dashboard/test/subproject2/Dummy.java (added) +++ maven/maven-1/plugins/trunk/dashboard/src/plugin-test/subproject2/src/test/org/apache/maven/dashboard/test/subproject2/Dummy.java Sun Mar 13 09:10:08 2005 @@ -0,0 +1,31 @@ +/* ==================================================================== + * Copyright 2001-2005 The Apache Software Foundation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ==================================================================== + */ +package org.apache.maven.dashboard.test.subproject2; + +/** + * Dummy test simply there to ensure the directory is not empty. + * This is to verify the use case where the user has a test directory but + * no tests are run. The aggregators using unit tests should handle this + * gracefully. + * + * @author <a href="mailto:[EMAIL PROTECTED]">Vincent Massol</a> + * + * @version $Id$ + */ +public class Dummy +{ +} \ No newline at end of file Propchange: maven/maven-1/plugins/trunk/dashboard/src/plugin-test/subproject2/src/test/org/apache/maven/dashboard/test/subproject2/Dummy.java ------------------------------------------------------------------------------ svn:keywords = Id Modified: maven/maven-1/plugins/trunk/dashboard/src/plugin-test/subproject3/project.xml URL: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/dashboard/src/plugin-test/subproject3/project.xml?view=diff&r1=157342&r2=157343 ============================================================================== --- maven/maven-1/plugins/trunk/dashboard/src/plugin-test/subproject3/project.xml (original) +++ maven/maven-1/plugins/trunk/dashboard/src/plugin-test/subproject3/project.xml Sun Mar 13 09:10:08 2005 @@ -21,4 +21,14 @@ <extend>${basedir}/../common/project.xml</extend> <id>test-maven-dashboard-plugin-subproject3</id> <name>Maven Dashboard plugin test - Subproject3</name> + <reports> + <report>maven-changes-plugin</report> + <report>maven-tasklist-plugin</report> + <report>maven-linkcheck-plugin</report> + <report>maven-javadoc-plugin</report> + <report>maven-jxr-plugin</report> + <report>maven-jdepend-plugin</report> + <report>maven-checkstyle-plugin</report> + <report>maven-junit-report-plugin</report> + </reports> </project> Modified: maven/maven-1/plugins/trunk/dashboard/xdocs/changes.xml URL: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/dashboard/xdocs/changes.xml?view=diff&r1=157342&r2=157343 ============================================================================== --- maven/maven-1/plugins/trunk/dashboard/xdocs/changes.xml (original) +++ maven/maven-1/plugins/trunk/dashboard/xdocs/changes.xml Sun Mar 13 09:10:08 2005 @@ -25,6 +25,11 @@ </properties> <body> <release version="1.8-SNAPSHOT" date="in SVN"> + <action dev="vmassol" type="fix" issue="MPDASHBOARD-17" due-to="Philippe Kernevez"> + Prevent failure in <code><junitpassrate.jelly/code> due to a division + by zero when there is a unit test source directory defined but no tests + are executed. + </action> </release> <release version="1.7" date="2005-03-05"> <action dev="vmassol" type="add" issue="MPDASHBOARD-9" due-to="Philippe Kernevez">Added links to reports for all aggregators.</action> --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]