From 5e4b3fd5f270775cf3c4226ff732e62845933a8e Mon Sep 17 00:00:00 2001 From: vmassol Date: Sun, 13 Mar 2005 17:10:08 +0000 Subject: [PATCH] MPDASHBOARD-17: Prevent failure in due to a division by zero when there is a unit test source directory defined but no tests are executed. git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@157343 13f79535-47bb-0310-9956-ffa450edef68 --- .../aggregators/junitpassrate.jelly | 20 ++++-- .../dashboard/test/subproject1/Sample.java | 64 ++++-------------- .../test/subproject1/TestSample.java | 64 ++++-------------- .../dashboard/test/subproject2/Sample.java | 66 ++++--------------- .../dashboard/test/subproject2/Dummy.java | 31 +++++++++ .../src/plugin-test/subproject3/project.xml | 10 +++ dashboard/xdocs/changes.xml | 5 ++ 7 files changed, 97 insertions(+), 163 deletions(-) create mode 100644 dashboard/src/plugin-test/subproject2/src/test/org/apache/maven/dashboard/test/subproject2/Dummy.java diff --git a/dashboard/src/plugin-resources/aggregators/junitpassrate.jelly b/dashboard/src/plugin-resources/aggregators/junitpassrate.jelly index 552b6286..d7524acc 100644 --- a/dashboard/src/plugin-resources/aggregators/junitpassrate.jelly +++ b/dashboard/src/plugin-resources/aggregators/junitpassrate.jelly @@ -1,7 +1,8 @@ + - - + - - - % + + + + + + % + + + + + diff --git a/dashboard/src/plugin-test/subproject1/src/java/org/apache/maven/dashboard/test/subproject1/Sample.java b/dashboard/src/plugin-test/subproject1/src/java/org/apache/maven/dashboard/test/subproject1/Sample.java index 3ecf02c2..64466d8e 100644 --- a/dashboard/src/plugin-test/subproject1/src/java/org/apache/maven/dashboard/test/subproject1/Sample.java +++ b/dashboard/src/plugin-test/subproject1/src/java/org/apache/maven/dashboard/test/subproject1/Sample.java @@ -1,60 +1,20 @@ -package org.apache.maven.dashboard.test.subproject1; - /* ==================================================================== - * The Apache Software License, Version 1.1 + * Copyright 2001-2005 The Apache Software Foundation. * - * Copyright (c) 2001 The Apache Software Foundation. All rights - * reserved. + * 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 * - * 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 apache@apache.org. - * - * 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/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 @@ package org.apache.maven.dashboard.test.subproject1; * * @author Vincent Massol * - * @version $Id: Sample.java,v 1.3 2004/11/26 08:33:00 vmassol Exp $ + * @version $Id$ */ public class Sample { diff --git a/dashboard/src/plugin-test/subproject1/src/test/org/apache/maven/dashboard/test/subproject1/TestSample.java b/dashboard/src/plugin-test/subproject1/src/test/org/apache/maven/dashboard/test/subproject1/TestSample.java index 3d8db863..2da99937 100644 --- a/dashboard/src/plugin-test/subproject1/src/test/org/apache/maven/dashboard/test/subproject1/TestSample.java +++ b/dashboard/src/plugin-test/subproject1/src/test/org/apache/maven/dashboard/test/subproject1/TestSample.java @@ -1,60 +1,20 @@ -package org.apache.maven.dashboard.test.subproject1; - /* ==================================================================== - * The Apache Software License, Version 1.1 + * Copyright 2001-2005 The Apache Software Foundation. * - * Copyright (c) 2001 The Apache Software Foundation. All rights - * reserved. + * 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 * - * 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 apache@apache.org. - * - * 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/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 @@ import junit.framework.TestCase; * * @author Vincent Massol * - * @version $Id: TestSample.java,v 1.1 2003/11/17 21:37:00 vmassol Exp $ + * @version $Id$ */ public class TestSample extends TestCase { diff --git a/dashboard/src/plugin-test/subproject2/src/java/org/apache/maven/dashboard/test/subproject2/Sample.java b/dashboard/src/plugin-test/subproject2/src/java/org/apache/maven/dashboard/test/subproject2/Sample.java index f8e82eb2..54b14140 100644 --- a/dashboard/src/plugin-test/subproject2/src/java/org/apache/maven/dashboard/test/subproject2/Sample.java +++ b/dashboard/src/plugin-test/subproject2/src/java/org/apache/maven/dashboard/test/subproject2/Sample.java @@ -1,67 +1,27 @@ -package org.apache.maven.dashboard.test.subproject2; - /* ==================================================================== - * The Apache Software License, Version 1.1 + * Copyright 2001-2005 The Apache Software Foundation. * - * Copyright (c) 2001-2004 The Apache Software Foundation. All rights - * reserved. + * 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 * - * 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 apache@apache.org. - * - * 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/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 Vincent Massol * - * @version $Id: Sample.java,v 1.2 2004/11/05 15:30:11 vmassol Exp $ + * @version $Id$ */ public class Sample { diff --git a/dashboard/src/plugin-test/subproject2/src/test/org/apache/maven/dashboard/test/subproject2/Dummy.java b/dashboard/src/plugin-test/subproject2/src/test/org/apache/maven/dashboard/test/subproject2/Dummy.java new file mode 100644 index 00000000..c829710e --- /dev/null +++ b/dashboard/src/plugin-test/subproject2/src/test/org/apache/maven/dashboard/test/subproject2/Dummy.java @@ -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 Vincent Massol + * + * @version $Id$ + */ +public class Dummy +{ +} \ No newline at end of file diff --git a/dashboard/src/plugin-test/subproject3/project.xml b/dashboard/src/plugin-test/subproject3/project.xml index 0db3a70b..298720dc 100644 --- a/dashboard/src/plugin-test/subproject3/project.xml +++ b/dashboard/src/plugin-test/subproject3/project.xml @@ -21,4 +21,14 @@ ${basedir}/../common/project.xml test-maven-dashboard-plugin-subproject3 Maven Dashboard plugin test - Subproject3 + + maven-changes-plugin + maven-tasklist-plugin + maven-linkcheck-plugin + maven-javadoc-plugin + maven-jxr-plugin + maven-jdepend-plugin + maven-checkstyle-plugin + maven-junit-report-plugin + diff --git a/dashboard/xdocs/changes.xml b/dashboard/xdocs/changes.xml index 70a0df8a..969d2c41 100644 --- a/dashboard/xdocs/changes.xml +++ b/dashboard/xdocs/changes.xml @@ -25,6 +25,11 @@ + + Prevent failure in due to a division + by zero when there is a unit test source directory defined but no tests + are executed. + Added links to reports for all aggregators.