[hg] main/contrib: apisupport.tc.cobertura moved to contrib

  • From: Milos Kleint < >
  • To:
  • Subject: [hg] main/contrib: apisupport.tc.cobertura moved to contrib
  • Date: Fri, 23 Nov 2012 03:26:34 -0800

changeset bf236c501b20 in main/contrib ((none))
details: http://hg.netbeans.org/main/contrib/rev/bf236c501b20
description:
        apisupport.tc.cobertura moved to contrib

diffstat:

 apisupport.tc.cobertura/arch.xml                                             
              |  228 +++++++++
 apisupport.tc.cobertura/build.xml                                            
              |    5 +
 apisupport.tc.cobertura/external/asm-3.0-license.txt                         
              |   42 +
 apisupport.tc.cobertura/external/asm-tree-3.0-license.txt                    
              |   42 +
 apisupport.tc.cobertura/external/binaries-list                               
              |    5 +
 apisupport.tc.cobertura/external/cobertura-1.9.3-license.txt                 
              |   34 +
 apisupport.tc.cobertura/external/jakarta-oro-2.0.8-license.txt               
              |   67 ++
 apisupport.tc.cobertura/external/log4j-1.2.9-license.txt                     
              |   61 ++
 apisupport.tc.cobertura/manifest.mf                                          
              |    5 +
 apisupport.tc.cobertura/nbproject/project.properties                         
              |   12 +
 apisupport.tc.cobertura/nbproject/project.xml                                
              |   18 +
 apisupport.tc.cobertura/release/testcoverage-suite.xml                       
              |   80 +++
 apisupport.tc.cobertura/release/testcoverage.xml                             
              |  229 ++++++++++
 
apisupport.tc.cobertura/src/org/netbeans/modules/apisupport/tc/cobertura/Bundle.properties
 |    7 +
 14 files changed, 835 insertions(+), 0 deletions(-)

diffs (905 lines):

diff --git a/apisupport.tc.cobertura/arch.xml 
b/apisupport.tc.cobertura/arch.xml
new file mode 100644
--- /dev/null
+++ b/apisupport.tc.cobertura/arch.xml
@@ -0,0 +1,228 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+
+Copyright 1997-2010 Oracle and/or its affiliates. All rights reserved.
+
+Oracle and Java are registered trademarks of Oracle and/or its affiliates.
+Other names may be trademarks of their respective owners.
+
+
+The contents of this file are subject to the terms of either the GNU
+General Public License Version 2 only ("GPL") or the Common
+Development and Distribution License("CDDL") (collectively, the
+"License"). You may not use this file except in compliance with the
+License. You can obtain a copy of the License at
+http://www.netbeans.org/cddl-gplv2.html
+or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
+specific language governing permissions and limitations under the
+License.  When distributing the software, include this License Header
+Notice in each file and include the License file at
+nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
+particular file as subject to the "Classpath" exception as provided
+by Oracle in the GPL Version 2 section of the License file that
+accompanied this code. If applicable, add the following below the
+License Header, with the fields enclosed by brackets [] replaced by
+your own identifying information:
+"Portions Copyrighted [year] [name of copyright owner]"
+
+Contributor(s):
+
+The Original Software is NetBeans. The Initial Developer of the Original
+Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
+Microsystems, Inc. All Rights Reserved.
+
+If you wish your version of this file to be governed by only the CDDL
+or only the GPL Version 2, indicate your decision by adding
+"[Contributor] elects to include this software in this distribution
+under the [CDDL or GPL Version 2] license." If you do not indicate a
+single choice of license, a recipient has the option to distribute
+your version of this file under either the CDDL, the GPL Version 2 or
+to extend the choice of license to its licensees as provided above.
+However, if you add GPL Version 2 code and therefore, elected the GPL
+Version 2 license, then the option applies only if the new code is
+made subject to such option by the copyright holder.
+-->
+<!DOCTYPE api-answers PUBLIC "-//NetBeans//DTD Arch Answers//EN" 
"../nbbuild/antsrc/org/netbeans/nbbuild/Arch.dtd" [
+  <!ENTITY api-questions SYSTEM 
"../nbbuild/antsrc/org/netbeans/nbbuild/Arch-api-questions.xml">
+]>
+
+<api-answers
+  question-version="1.26"
+  
author=" "
+>
+
+  &api-questions;
+
+
+<!--
+        <question id="arch-overall" when="init">
+            Describe the overall architecture.
+            <hint>
+            What will be API for
+            <a 
href="http://openide.netbeans.org/tutorial/api-design.html#design.apiandspi";>
+                clients and what support API</a>? 
+            What parts will be pluggable?
+            How will plug-ins be registered? Please use <code>&lt;api 
type="export"/&gt;</code>
+            to describe your general APIs.
+            If possible please provide 
+            simple diagrams. 
+            </hint>
+        </question>
+-->
+ <answer id="arch-overall">
+  <p>
+   Cobertura Module Test Coverage provides Ant scripts to measure test 
coverage
+   of NetBeans Module and Suite projects. It needs Module Build Harness to 
run.
+  </p>
+ </answer>
+
+
+
+<!--
+        <question id="arch-time" when="init">
+            What are the time estimates of the work?
+            <hint>
+            Please express your estimates of how long the design, 
implementation,
+            stabilization are likely to last. How many people will be needed 
to
+            implement this and what is the expected milestone by which the 
work should be 
+            ready?
+            </hint>
+        </question>
+-->
+ <answer id="arch-time">
+  <p>
+   NetBeans 6.8.
+  </p>
+ </answer>
+
+
+<!--
+        <question id="dep-nb" when="init">
+            What other NetBeans projects and modules does this one depend on?
+            <hint>
+            If you want, describe such projects as imported APIs using
+            the <code>&lt;api name="identification" type="import or export" 
category="stable" url="where is the description" /&gt;</code>
+            </hint>
+        </question>
+-->
+ <answer id="dep-nb">
+  <defaultanswer generate='here' />
+ </answer>
+
+
+
+<!--
+        <question id="dep-non-nb" when="init">
+            What other projects outside NetBeans does this one depend on?
+            
+            <hint>
+            Some non-NetBeans projects are packaged as NetBeans modules
+            (see <a href="http://libs.netbeans.org/";>libraries</a>) and
+            it is preferred to use this approach when more modules may
+            depend on such third-party library.
+            </hint>
+        </question>
+-->
+ <answer id="dep-non-nb">
+  <p>
+   Cobertura 1.9, http://cobertura.sourceforge.net.
+  </p>
+ </answer>
+
+<!--
+        <question id="deploy-jar" when="impl">
+            Do you deploy just module JAR file(s) or other files as well?
+            <hint>
+            Usually a module consist of one JAR file (perhaps with Class-Path
+            extensions) and also a configuration file that enables it. If you
+            have any other files, use
+            &lt;api group="java.io.File" name="yourname" type="export" 
category="friend"&gt;...&lt;/api&gt;
+            to define the location, name and stability of your files (of 
course
+            changing "yourname" and "friend" to suit your needs).
+            
+            If it uses more than one JAR, describe where they are located, 
how
+            they refer to each other. 
+            If it consist of module JAR(s) and other files, please describe
+            what is their purpose, why other files are necessary. Please 
+            make sure that installation/uninstallation leaves the system 
+            in state as it was before installation.
+            </hint>
+        </question>
+-->
+ <answer id="deploy-jar">
+  <p>
+   Deploys Ant scripts testcoverage.xml and testcoverage-suite.xml
+   into harness cluster, cobertura.jar and its libraries.
+  </p>
+ </answer>
+
+
+
+<!--
+        <question id="deploy-nbm" when="impl">
+            Can you deploy an NBM via the Update Center?
+            <hint>
+            If not why?
+            </hint>
+        </question>
+-->
+ <answer id="deploy-nbm">
+  <p>
+   Yes.
+  </p>
+ </answer>
+
+
+<!--
+        <question id="exec-process" when="impl">
+            Do you execute an external process from your module? How do you 
ensure
+            that the result is the same on different platforms? Do you parse 
output?
+            Do you depend on result code?
+            <hint>
+            If you feed an input, parse the output please declare that as an 
API.
+            </hint>
+        </question>
+-->
+ <answer id="exec-process">
+  <p>
+   Yes, Cobertura is run in separate processes due to GPL license it uses.
+  </p>
+ </answer>
+
+
+
+<!--
+        <question id="exec-property" when="impl">
+            Is execution of your code influenced by any environment or
+            Java system (<code>System.getProperty</code>) property?
+            
+            <hint>
+            If there is a property that can change the behavior of your 
+            code, somebody will likely use it. You should describe what it 
does 
+            and the <a 
href="http://openide.netbeans.org/tutorial/api-design.html#life";>stability 
category</a>
+            of this API. You may use
+            <pre>
+                &lt;api type="export" group="property" name="id" 
category="private" url="http://..."&gt;
+                    description of the property, where it is used, what it 
influence, etc.
+                &lt;/api&gt;            
+            </pre>
+            </hint>
+        </question>
+-->
+ <answer id="exec-property">
+  <p>
+   There is a bug which prevents Cobertura tasks to run on different JVM 
than Ant.
+   When running on NB.org module project (part of NetBeans sources) it is 
+   advisable to use:
+       <pre>
+       nbjdk.home.defaulted=true
+       permit.jdk6.builds=true
+       </pre>
+       which ensures that tests are run within the same JVM (as of NB 6.8).
+  </p>
+ </answer>
+
+
+
+</api-answers>
diff --git a/apisupport.tc.cobertura/build.xml 
b/apisupport.tc.cobertura/build.xml
new file mode 100644
--- /dev/null
+++ b/apisupport.tc.cobertura/build.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project basedir="." default="netbeans" 
name="contrib/apisupport.tc.cobertura">
+    <description>Builds, tests, and runs the project 
org.netbeans.modules.apisupport.tc.cobertura</description>
+    <import file="../../nbbuild/templates/projectized.xml"/>
+</project>
diff --git a/apisupport.tc.cobertura/external/asm-3.0-license.txt 
b/apisupport.tc.cobertura/external/asm-3.0-license.txt
new file mode 100644
--- /dev/null
+++ b/apisupport.tc.cobertura/external/asm-3.0-license.txt
@@ -0,0 +1,42 @@
+Name: ASM
+Version: 3.0
+Description: Library for bytecode manipulation
+License: BSD
+OSR: 10906
+Origin: http://download.forge.objectweb.org/asm/asm-3.0-bin.zip
+Files: asm-3.0.jar
+Comment: See issue 145107, 178037
+
+Use of is ASM 3.0 is governed by the terms of the license below:
+
+[TEXT OF THE LICENSE]
+Copyright (c) 2000-2005 INRIA, France Telecom
+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. Neither the name of the copyright holders nor the names of its
+   contributors may be used to endorse or promote products derived from
+   this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS 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 COPYRIGHT OWNER OR 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.
+
diff --git a/apisupport.tc.cobertura/external/asm-tree-3.0-license.txt 
b/apisupport.tc.cobertura/external/asm-tree-3.0-license.txt
new file mode 100644
--- /dev/null
+++ b/apisupport.tc.cobertura/external/asm-tree-3.0-license.txt
@@ -0,0 +1,42 @@
+Name: ASM
+Version: 3.0
+Description: Library for bytecode manipulation
+License: BSD
+OSR: 10906
+Origin: http://download.forge.objectweb.org/asm/asm-3.0-bin.zip
+Files: asm-tree-3.0.jar
+Comment: See issue 145107, 178037
+
+Use of is ASM 3.0 is governed by the terms of the license below:
+
+[TEXT OF THE LICENSE]
+Copyright (c) 2000-2005 INRIA, France Telecom
+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. Neither the name of the copyright holders nor the names of its
+   contributors may be used to endorse or promote products derived from
+   this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS 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 COPYRIGHT OWNER OR 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.
+
diff --git a/apisupport.tc.cobertura/external/binaries-list 
b/apisupport.tc.cobertura/external/binaries-list
new file mode 100644
--- /dev/null
+++ b/apisupport.tc.cobertura/external/binaries-list
@@ -0,0 +1,5 @@
+7864BDF46B61AE956070B17B06BE6C4B7258A81F cobertura-1.9.3.jar
+D1616C03F056291A2314510DEA75739B15B4D415 asm-3.0.jar
+6FFF655717D1E1871DECFE9F8E46A531E8DF3A31 asm-tree-3.0.jar
+5592374F834645C4AE250F4C9FBB314C9369D698 jakarta-oro-2.0.8.jar
+55856D711AB8B88F8C7B04FD85FF1643FFBFDE7C log4j-1.2.9.jar
diff --git a/apisupport.tc.cobertura/external/cobertura-1.9.3-license.txt 
b/apisupport.tc.cobertura/external/cobertura-1.9.3-license.txt
new file mode 100644
--- /dev/null
+++ b/apisupport.tc.cobertura/external/cobertura-1.9.3-license.txt
@@ -0,0 +1,34 @@
+Name: Cobertura
+Version: 1.9.3
+Description: Library for measuring and reporting code coverage of tests.
+License: cobertura
+OSR: 10710
+Origin: 
http://prdownloads.sourceforge.net/cobertura/cobertura-1.9-bin.zip?download
+Files: cobertura-1.9.3.jar
+Source: 
http://prdownloads.sourceforge.net/cobertura/cobertura-1.9-src.zip?download
+Comment: See issue 145107, 178037
+
+Use of Cobertura 1.9.x is governed by the terms of the license below:
+
+[TEXT OF THE LICENSE]
+
+LICENSE
+
+Cobertura is free software.  Most of it is licensed under the GNU
+GPL, and you can redistribute it and/or modify it under the terms
+of the GNU General Public License as published by the Free Software
+Foundation; either version 2 of the License, or (at your option)
+any later version.  Please review the file COPYING included in this
+distribution for further details.
+
+Parts of Cobertura are licensed under the Apache Software License,
+Version 1.1.
+
+WARRANTY
+
+Cobertura is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+
diff --git a/apisupport.tc.cobertura/external/jakarta-oro-2.0.8-license.txt 
b/apisupport.tc.cobertura/external/jakarta-oro-2.0.8-license.txt
new file mode 100644
--- /dev/null
+++ b/apisupport.tc.cobertura/external/jakarta-oro-2.0.8-license.txt
@@ -0,0 +1,67 @@
+Name: Jakarta Oro
+Version: 2.0.8
+Description: Library for handling regular expressions
+License: Apache-1.1
+OSR: 7796
+Origin: http://jakarta.apache.org/site/downloads/downloads_oro.cgi
+Files: jakarta-oro-2.0.8.jar
+Source: 
http://mirrors.isc.org/pub/apache/jakarta/oro/source/jakarta-oro-2.0.8.zip
+Comment: See Issue #145107
+
+Use of Jakarta Oro version 2.0.8 is governed by the terms of the license 
below:
+
+[TEXT OF THE LICENSE]
+
+/* ====================================================================
+ * The Apache Software License, Version 1.1
+ *
+ * Copyright (c) 2000-2002 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", "Jakarta-Oro" 
+ *    must not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written
+ *    permission, please contact 
.
+ *
+ * 5. Products derived from this software may not be called "Apache" 
+ *    or "Jakarta-Oro", nor may "Apache" or "Jakarta-Oro" 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/>.
+ */
diff --git a/apisupport.tc.cobertura/external/log4j-1.2.9-license.txt 
b/apisupport.tc.cobertura/external/log4j-1.2.9-license.txt
new file mode 100644
--- /dev/null
+++ b/apisupport.tc.cobertura/external/log4j-1.2.9-license.txt
@@ -0,0 +1,61 @@
+Name: Log4J
+Version: 1.2.9
+Description: Library for logging in Java
+License: Apache-1.1
+OSR:   5415
+Origin: 
http://archive.apache.org/dist/logging/log4j/1.2.9/logging-log4j-1.2.9.zip
+Files: log4j-1.2.9.jar
+Comment: See issue #145107
+
+Use of Log4J version 1.2.9 is governed by the terms of the license below:
+
+[TEXT OF THE LICENSE]
+
+/*
+ * 
============================================================================
+ *                   The Apache Software License, Version 1.1
+ * 
============================================================================
+ * 
+ *    Copyright (C) 1999 The Apache Software Foundation. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without 
modifica-
+ * tion, 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 "log4j" and  "Apache Software Foundation"  must not be used 
to
+ *    endorse  or promote  products derived  from this  software without  
prior
+ *    written permission. For written permission, please contact
+ *    
.
+ * 
+ * 5. Products  derived from this software may not  be called "Apache", 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 
(INCLU-
+ * DING, 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/>.
+ *
+ */
diff --git a/apisupport.tc.cobertura/manifest.mf 
b/apisupport.tc.cobertura/manifest.mf
new file mode 100644
--- /dev/null
+++ b/apisupport.tc.cobertura/manifest.mf
@@ -0,0 +1,5 @@
+Manifest-Version: 1.0
+OpenIDE-Module: org.netbeans.modules.apisupport.tc.cobertura
+OpenIDE-Module-Localizing-Bundle: 
org/netbeans/modules/apisupport/tc/cobertura/Bundle.properties
+OpenIDE-Module-Specification-Version: 1.5
+
diff --git a/apisupport.tc.cobertura/nbproject/project.properties 
b/apisupport.tc.cobertura/nbproject/project.properties
new file mode 100644
--- /dev/null
+++ b/apisupport.tc.cobertura/nbproject/project.properties
@@ -0,0 +1,12 @@
+javac.source=1.6
+javac.compilerargs=-Xlint -Xlint:-serial
+
+javadoc.arch=${basedir}/arch.xml
+nbm.module.author=Jesse Glick 
< >
+
+# test coverage external libs
+release.external/cobertura-1.9.3.jar=testcoverage/cobertura/cobertura-1.9.3.jar
+release.external/asm-3.0.jar=testcoverage/cobertura/lib/asm-3.0.jar
+release.external/asm-tree-3.0.jar=testcoverage/cobertura/lib/asm-tree-3.0.jar
+release.external/jakarta-oro-2.0.8.jar=testcoverage/cobertura/lib/jakarta-oro-2.0.8.jar
+release.external/log4j-1.2.9.jar=testcoverage/cobertura/lib/log4j-1.2.9.jar
diff --git a/apisupport.tc.cobertura/nbproject/project.xml 
b/apisupport.tc.cobertura/nbproject/project.xml
new file mode 100644
--- /dev/null
+++ b/apisupport.tc.cobertura/nbproject/project.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://www.netbeans.org/ns/project/1";>
+    <type>org.netbeans.modules.apisupport.project</type>
+    <configuration>
+        <data xmlns="http://www.netbeans.org/ns/nb-module-project/3";>
+            
<code-name-base>org.netbeans.modules.apisupport.tc.cobertura</code-name-base>
+            <module-dependencies>
+                <dependency>
+                    
<code-name-base>org.netbeans.modules.apisupport.harness</code-name-base>
+                    <run-dependency>
+                        <specification-version>1.18</specification-version>
+                    </run-dependency>
+                </dependency>
+            </module-dependencies>
+            <public-packages/>
+        </data>
+    </configuration>
+</project>
diff --git a/apisupport.tc.cobertura/release/testcoverage-suite.xml 
b/apisupport.tc.cobertura/release/testcoverage-suite.xml
new file mode 100644
--- /dev/null
+++ b/apisupport.tc.cobertura/release/testcoverage-suite.xml
@@ -0,0 +1,80 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="testcoverage-suite">
+
+<!--
+  Test coverage measurement for apisupport suite projects.
+
+  At present, this only measure coverage for unit tests.  Functional
+  tests, performance tests and other types of tests are not considered.
+
+  NOTE: Implemented using Cobertura, follows general contract described in 
harness README.
+-->
+    <property name="testcoverage.suite.present" value="true"/>
+    <property name="cobertura.dir" 
value="${harness.dir}/testcoverage/cobertura"/>
+
+    <path id="cobertura.classpath">
+        <fileset dir="${cobertura.dir}">
+            <include name="cobertura-1.9.3.jar" />
+            <include name="lib/**/*.jar" />
+        </fileset>
+    </path>
+
+    <taskdef classpathref="cobertura.classpath" resource="tasks.properties"/>
+
+    <target name="cobertura-init">
+        <property name="cobertura.datafiles.merge.dir" 
value="${basedir}/build/test/cobertura-datafiles"/>
+        <property name="cobertura.report.sources.dir" 
value="${basedir}/build/test/sources-for-report"/>
+        <property name="testcoverage.report.dir" 
value="build/test/cobertura-report"/>
+        <property name="cobertura.datafile" 
value="build/test/global-cobertura.ser"/>        
+    </target>
+
+    <target name="merge-coverage-reports" depends="-init,cobertura-init">
+        <!-- Creates a report by merging data collected from tests 
previously run on modules -->
+
+        <mkdir dir="build/test"/>
+        <delete file="${cobertura.datafile}" failonerror="false"/>
+        <delete dir="${testcoverage.report.dir}" failonerror="false"/>
+
+        <delete dir="${cobertura.datafiles.merge.dir}" quiet="true" />
+        <mkdir dir="${cobertura.datafiles.merge.dir}" />
+
+        <delete dir="${cobertura.report.sources.dir}" quiet="true" />
+        <mkdir dir="${cobertura.report.sources.dir}" />
+
+        <!-- have each module copy its .ser file to the suite for merging -->
+        <subant target="-copy-cobertura-datafile" 
buildpath="${modules.sorted}" inheritrefs="false" inheritall="false">
+            <property name="suite.merge.dir" 
value="${cobertura.datafiles.merge.dir}"/>
+        </subant>
+
+        <cobertura-merge datafile="${cobertura.datafile}">
+            <fileset dir="${cobertura.datafiles.merge.dir}">
+                <include name="**/*" />
+            </fileset>
+        </cobertura-merge>
+
+        <!-- have each module copy its sources to the suite for reporting -->
+        <subant target="-copy-source-folder" buildpath="${modules.sorted}" 
inheritrefs="false" inheritall="false">
+            <property name="suite.sources.dir" 
value="${cobertura.report.sources.dir}"/>
+        </subant>
+
+        <cobertura-report datafile="${cobertura.datafile}" 
destdir="${testcoverage.report.dir}" format="html">
+            <fileset dir="${cobertura.report.sources.dir}">
+                <include name="**/*.java" />
+            </fileset>
+        </cobertura-report> 
+        <cobertura-report datafile="${cobertura.datafile}" 
destdir="${testcoverage.report.dir}" format="xml">
+            <fileset dir="${cobertura.report.sources.dir}">
+                <include name="**/*.java" />
+            </fileset>
+        </cobertura-report> 
+    </target>
+
+    <target name="generate-all-coverage-reports" depends="-init">
+        <subant target="coverage-report" buildpath="${modules.sorted}" 
inheritrefs="false" inheritall="false"/>
+    </target>
+    
+    <target name="coverage-report" 
depends="generate-all-coverage-reports,merge-coverage-reports"
+        description="Generates test coverage report for entire suite">
+    </target>
+    
+</project>
diff --git a/apisupport.tc.cobertura/release/testcoverage.xml 
b/apisupport.tc.cobertura/release/testcoverage.xml
new file mode 100644
--- /dev/null
+++ b/apisupport.tc.cobertura/release/testcoverage.xml
@@ -0,0 +1,229 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="testcoverage">
+
+<!--
+  Test coverage measurement for apisupport module projects.
+
+  Unit and functional tests supported.
+
+  Implemented using Cobertura, follows general contract described in harness 
README.
+-->
+    <property name="testcoverage.present" value="true"/>
+    <condition property="cobertura.dir" 
value="${harness.dir}/testcoverage/cobertura" 
else="${netbeans.dest.dir}/harness/testcoverage/cobertura">
+        <isset property="harness.dir"/>
+    </condition>
+    <path id="cobertura.classpath">
+        <fileset dir="${cobertura.dir}">
+            <include name="cobertura-1.9.3.jar" />
+            <include name="lib/**/*.jar" />
+        </fileset>
+    </path>
+
+    <taskdef classpathref="cobertura.classpath" resource="tasks.properties"/>
+
+    <macrodef name="cobertura-init">
+        <attribute name="test.type"/>
+        <sequential>
+            <property name="build.test.cobertura.classes.dir" 
value="build/cobertura-instrumented-classes"/>
+            <property name="testcoverage.@{test.type}.report.dir" 
value="${basedir}/build/test/@{test.type}/cobertura-report"/>
+            <property name="cobertura.@{test.type}.datafile" 
value="${basedir}/build/test/@{test.type}/cobertura.ser"/>
+            <property name="continue.after.failing.tests" value="true" />
+            <property name="testcoverage.@{test.type}.backup.dir" 
value="${basedir}/build/test/@{test.type}/modulebackup" />
+
+            <path id="cobertura.test.cp">
+                <pathelement location="${build.test.cobertura.classes.dir}" 
/>
+                <pathelement location="${cobertura.dir}/cobertura-1.9.3.jar" 
/>
+                <pathelement location="${test.@{test.type}.lib.cp}"/>
+                <path refid="test.@{test.type}.run.cp"/>
+                <pathelement location="build/classes" />
+            </path>
+        </sequential>
+    </macrodef>
+
+    <target name="cobertura-init" depends="build-init,init,test-init">
+        <cobertura-init test.type="unit" />
+    </target>
+
+    <target name="cobertura-check-environment">
+        <condition property="nbjdk.active.print" value="${nbjdk.active}" 
else="UNSET">
+            <isset property="nbjdk.active"/>
+        </condition>
+        <condition property="nbjdk.home.print" value="${nbjdk.home}" 
else="UNSET">
+            <isset property="nbjdk.home"/>
+        </condition>
+        <condition property="nbjdk.home.defaulted.print" value="YES" 
else="NO">
+            <isset property="nbjdk.home.defaulted"/>
+        </condition>
+        <fail if="nbjdk.valid">
+Test coverage tasks can be currently run only with default java platform, 
that is
+with property nbjdk.active unset or set to 'default' and with property 
nbjdk.home
+unset.
+
+For NB.org module, specify properties:
+nbjdk.home.defaulted=true
+permit.jdk6.builds=true
+when running the target.
+
+Current java platform setup is:
+  nbjdk.active:         ${nbjdk.active.print}
+  nbjdk.home:           ${nbjdk.home.print}
+  nbjdk.home defaulted: ${nbjdk.home.defaulted.print}
+        </fail>
+    </target>
+
+    <macrodef name="coverage-report">
+        <attribute name="test.type" />
+        <sequential>
+            <property name="coverage.report.format" value="html" />
+            <delete dir="${testcoverage.@{test.type}.report.dir}" 
failonerror="false"/>
+            <cobertura-report format="${coverage.report.format}" 
datafile="${cobertura.@{test.type}.datafile}" srcdir="${src.dir}" 
destdir="${testcoverage.@{test.type}.report.dir}"/>
+        </sequential>
+    </macrodef>
+
+    <target name="-copy-cobertura-datafile" depends="cobertura-init">
+        <!-- rename using code-name-base so the files will be unique in the 
suite -->
+        <copy file="${cobertura.unit.datafile}" 
tofile="${suite.merge.dir}/${code.name.base.dashes}.ser" failonerror="false" 
/>
+    </target>
+
+
+    <target name="-copy-source-folder" depends="cobertura-init">
+        <!--
+            note that this does not inherently handle if there are multiple 
source
+            folders; it might be possible to handle this by overriding in the
+            module's build.xml.
+        -->
+        <property name="cobertura.src.dir" value="${suite.sources.dir}" />
+        <mkdir dir="${cobertura.src.dir}" />
+        <copy todir="${cobertura.src.dir}/">
+            <fileset dir="${src.dir}" includes="**/*.java"/>
+        </copy>
+    </target>
+
+    <target name="cobertura-instrument" depends="cobertura-init, test-build, 
cobertura-check-environment">
+        <delete dir="${build.test.cobertura.classes.dir}" 
failonerror="false"/>
+        <delete file="${cobertura.unit.datafile}" failonerror="false"/>
+        <cobertura-instrument todir="${build.test.cobertura.classes.dir}" 
datafile="${cobertura.unit.datafile}">
+            <fileset dir="${build.classes.dir}" includes="**/*.class" 
excludes="${test.coverage.exclude.files}"/>
+        </cobertura-instrument>
+    </target>
+
+    <target name="test-with-cobertura" 
depends="cobertura-init,init,test-init,netbeans,test-build">
+        <pathconvert pathsep="${line.separator} " 
property="echo.cobertura.test.cp" refid="cobertura.test.cp"/>
+        <mkdir dir="${build.test.unit.results.dir}"/>
+
+        <junit showoutput="true" fork="true" failureproperty="tests.failed" 
errorproperty="tests.failed" filtertrace="${test.filter.trace}" 
tempdir="${build.test.unit.results.dir}" timeout="${test.timeout}">
+            <batchtest todir="${build.test.unit.results.dir}">
+                <fileset dir="${build.test.unit.classes.dir}" 
erroronmissingdir="false">
+                    <include name="**/*Test.class"/>
+                </fileset>
+
+            </batchtest>
+            <!--
+               This somewhat duplicates the normal JUnit testing target, but 
the
+               cobertura.test.cp  must come first in the testing classpath 
for
+               coverage to work properly and there is no other good way to 
inject it.
+            -->
+            <classpath refid="cobertura.test.cp"/>
+            <syspropertyset refid="test.unit.properties"/>
+            <jvmarg line="${test.run.args}"/>
+            <sysproperty key="net.sourceforge.cobertura.datafile" 
file="${cobertura.unit.datafile}" />
+            <formatter type="brief" usefile="false"/>
+            <formatter type="xml"/>
+        </junit>
+        <fail if="tests.failed" unless="continue.after.failing.tests">Some 
tests failed; see details above.</fail>
+    </target>
+
+    <target name="test-coverage" depends="cobertura-init, 
cobertura-instrument, test-with-cobertura"/>
+
+    <target name="coverage-report" depends="netbeans, test-coverage" 
description="Creates unit test coverage report for this module">
+      <coverage-report test.type="unit" />
+    </target>
+
+     <!-- Support for functional tests
+     Those tasks in some ways duplicate those above, but the code coverage 
setting for qa-functional
+     tests is different from unit tests.
+     -->
+
+     <target name="cobertura-init-qa-functional" 
depends="build-init,init,test-init,cobertura-check-environment">
+        <cobertura-init test.type="qa-functional" />
+        <delete file="${cobertura.qa-functional.datafile}" 
failonerror="false"/>
+        <delete dir="${testcoverage.qa-functional.backup.dir}" 
failonerror="false" />
+        <mkdir dir="${testcoverage.qa-functional.backup.dir}" />
+     </target>
+
+    <!-- In case test.coverage.qa-functional.coveredmodules property is not 
set backup and instrument
+        just the module we're running code coverage from -->
+    <target name="cobertura-instrument-default" 
unless="test.coverage.qa-functional.coveredmodules">
+        <echo message="Instrumenting module jar." />
+        <copy file="${cluster}/${module.jar}" 
todir="${testcoverage.qa-functional.backup.dir}/modules" />
+        <cobertura-instrument datafile="${cobertura.qa-functional.datafile}" 
>
+            <fileset dir="${cluster}" includes="${module.jar}" />
+        </cobertura-instrument>
+    </target>
+
+    <target name="cobertura-instrument-specified" 
if="test.coverage.qa-functional.coveredmodules">
+        <echo message="Instrumenting specified files: 
${test.coverage.qa-functional.coveredmodules}" />
+        <copy todir="${testcoverage.qa-functional.backup.dir}" 
verbose="true">
+            <fileset dir="${netbeans.dest.dir}" 
includes="${test.coverage.qa-functional.coveredmodules}" />
+        </copy>
+        <cobertura-instrument datafile="${cobertura.qa-functional.datafile}">
+            <fileset dir="${netbeans.dest.dir}" 
includes="${test.coverage.qa-functional.coveredmodules}" />
+        </cobertura-instrument>
+    </target>
+
+    <target name="testcoverage-restore-default" 
unless="test.coverage.qa-functional.coveredmodules">
+        <delete file="${cluster}/${module.jar}" />
+        <copy file="${testcoverage.qa-functional.backup.dir}/${module.jar}" 
todir="${cluster}" />
+    </target>
+
+    <target name="testcoverage-restore-specified" 
if="test.coverage.qa-functional.coveredmodules">
+        <delete verbose="true">
+            <fileset dir="${netbeans.dest.dir}" 
includes="${test.coverage.qa-functional.coveredmodules}" />
+        </delete>
+        <copy todir="${netbeans.dest.dir}" verbose="true" >
+            <fileset dir="${testcoverage.qa-functional.backup.dir}" 
includes="${test.coverage.qa-functional.coveredmodules}" />
+        </copy>
+    </target>
+
+    <target name="cobertura-instrument-qa-functional" 
depends="cobertura-init-qa-functional, test-build, 
cobertura-instrument-default,cobertura-instrument-specified"/>
+    <target name="test-coverage-restore" 
depends="cobertura-init-qa-functional, test-build, 
testcoverage-restore-default,testcoverage-restore-specified" />
+
+    <target name="test-with-cobertura-qa-functional" 
depends="cobertura-init-qa-functional,init,test-init,netbeans,test-build">
+        <pathconvert pathsep="${line.separator} " 
property="echo.cobertura.test.cp" refid="cobertura.test.cp"/>
+        <mkdir dir="${build.test.qa-functional.results.dir}"/>
+        <property name="code.coverage.classpath" value="${cobertura.dir}" />
+        <propertyset id="test.qa-functional.coverage.properties">
+            <propertyset refid="test.qa-functional.properties"/>
+            <propertyref name="code.coverage.classpath" />
+        </propertyset>
+        <junit showoutput="true" fork="true" failureproperty="tests.failed" 
errorproperty="tests.failed" filtertrace="${test.filter.trace}" 
tempdir="${build.test.qa-functional.results.dir}" timeout="${test.timeout}">
+            <batchtest todir="${build.test.qa-functional.results.dir}">
+                <fileset dir="${build.test.qa-functional.classes.dir}" 
erroronmissingdir="false">
+                    <include name="**/*.class"/>
+                </fileset>
+
+            </batchtest>
+            <!--
+               This somewhat duplicates the normal JUnit testing target, but 
the
+               cobertura.test.cp  must come first in the testing classpath 
for
+               coverage to work properly and there is no other good way to 
inject it.
+            -->
+            <classpath refid="cobertura.test.cp"/>
+
+            <syspropertyset refid="test.qa-functional.coverage.properties"/>
+
+            <jvmarg line="${test.run.args}"/>
+            <sysproperty key="net.sourceforge.cobertura.datafile" 
file="${cobertura.qa-functional.datafile}" />
+            <formatter type="brief" usefile="false"/>
+            <formatter type="xml"/>
+        </junit>
+        <fail if="tests.failed" unless="continue.after.failing.tests">Some 
tests failed; see details above.</fail>
+    </target>
+
+    <target name="test-coverage-qa-functional" 
depends="netbeans,cobertura-init-qa-functional,cobertura-instrument-qa-functional,test-with-cobertura-qa-functional,test-coverage-restore"/>
+
+    <target name="coverage-report-qa-functional" depends="netbeans, 
test-coverage-qa-functional" description="Creates qa-functional test coverage 
report for this module">
+        <coverage-report test.type="qa-functional" />
+    </target>
+
+</project>
diff --git 
a/apisupport.tc.cobertura/src/org/netbeans/modules/apisupport/tc/cobertura/Bundle.properties
 
b/apisupport.tc.cobertura/src/org/netbeans/modules/apisupport/tc/cobertura/Bundle.properties
new file mode 100644
--- /dev/null
+++ 
b/apisupport.tc.cobertura/src/org/netbeans/modules/apisupport/tc/cobertura/Bundle.properties
@@ -0,0 +1,7 @@
+OpenIDE-Module-Display-Category=Developing NetBeans
+OpenIDE-Module-Long-Description=\
+    Ant targets for measuring test coverage of apisupport projects using 
Cobertura.\n\
+    Run 'display-coverage-report' target on a project to measure results and 
display report in external browser.\n\
+    For integration with Module Build Harness.
+OpenIDE-Module-Name=Cobertura Module Test Coverage
+OpenIDE-Module-Short-Description=Ant targets for measuring test coverage of 
apisupport projects using Cobertura.

[hg] main/contrib: apisupport.tc.cobertura moved to contrib

Milos Kleint 11/23/2012

Project Features

About this Project

APIsupport was started in November 2009, is owned by Antonin Nebuzelsky, and has 43 members.
By use of this website, you agree to the NetBeans Policies and Terms of Use (revision 20131025.e7cbc9d). © 2013, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo
 
 
Close
loading
Please Confirm
Close