1.1 --- a/testng.ant/src/org/netbeans/modules/contrib/testng/ant/testng-build.xml Sun Feb 05 03:50:14 2012 +0100
1.2 +++ b/testng.ant/src/org/netbeans/modules/contrib/testng/ant/testng-build.xml Sun Feb 05 03:51:39 2012 +0100
1.3 @@ -2,7 +2,7 @@
1.4 <!--
1.5 DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
1.6
1.7 -Copyright © 1997-2011 Oracle and/or its affiliates. All rights reserved.
1.8 +Copyright © 1997-2012 Oracle and/or its affiliates. All rights reserved.
1.9
1.10
1.11 The contents of this file are subject to the terms of either the GNU
1.12 @@ -56,27 +56,24 @@
1.13 <!-- Call testng ant task -->
1.14 <target name="-init-macrodef-testng">
1.15 <macrodef name="testng-ant">
1.16 - <attribute name="testincludes" default="${test.includes}"/>
1.17 + <attribute default="${includes}" name="includes"/>
1.18 + <attribute default="${excludes}" name="excludes"/>
1.19 + <attribute default="**" name="testincludes"/>
1.20 <sequential>
1.21 - <pathconvert property="test.includes.classes" pathsep=",">
1.22 - <path location="@{testincludes}" />
1.23 - <globmapper from="${basedir}/*.java" to="*.class"/>
1.24 - </pathconvert>
1.25 + <fileset id="mixed.tests" dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
1.26 + <filename name="@{testincludes}"/>
1.27 + </fileset>
1.28 <taskdef name="testng" classname="org.testng.TestNGAntTask" classpath="${run.test.classpath}"/>
1.29 - <testng workingDir="${basedir}" failureProperty="testng.tests.failed" outputdir="${build.test.results.dir}" dumpCommand="true" useDefaultListeners="true" verbose="2">
1.30 + <testng mode="MIXED" classfilesetref="mixed.tests" workingDir="${basedir}" failureProperty="testng.tests.failed" outputdir="${build.test.results.dir}">
1.31 <classpath>
1.32 <pathelement path="${run.test.classpath}"/>
1.33 <pathelement path="${j2ee.platform.classpath}"/>
1.34 <pathelement path="${build.test.classes.dir}"/>
1.35 </classpath>
1.36 - <classfileset dir="${build.test.classes.dir}">
1.37 - <filename name="${test.includes.classes}"/>
1.38 - </classfileset>
1.39 <propertyset>
1.40 <propertyref prefix="test-sys-prop."/>
1.41 <mapper from="test-sys-prop.*" to="*" type="glob"/>
1.42 </propertyset>
1.43 - <jvmarg value="-ea"/>
1.44 <jvmarg line="${run.jvmargs.prop}"/>
1.45 <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
1.46 </testng>
1.47 @@ -86,7 +83,7 @@
1.48 <attribute name="testSuite" default="${build.dir}/generated/testng/temp-testng-customsuite.xml"/>
1.49 <sequential>
1.50 <taskdef name="testng" classname="org.testng.TestNGAntTask" classpath="${run.test.classpath}"/>
1.51 - <testng workingDir="${basedir}" failureProperty="testng.tests.failed" outputdir="${build.test.results.dir}" dumpCommand="true" useDefaultListeners="true" verbose="2">
1.52 + <testng workingDir="${basedir}" failureProperty="testng.tests.failed" outputdir="${build.test.results.dir}">
1.53 <classpath>
1.54 <pathelement path="${run.test.classpath}"/>
1.55 <pathelement path="${j2ee.platform.classpath}"/>
1.56 @@ -105,7 +102,7 @@
1.57 </macrodef>
1.58 </target>
1.59
1.60 - <target name="-testng" unless="junit.enabled">
1.61 + <target name="-testng">
1.62 <!-- Java SE projects -->
1.63 <macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3">
1.64 <attribute default="${includes}" name="includes"/>
1.65 @@ -167,143 +164,7 @@
1.66 </macrodef>
1.67 </target>
1.68
1.69 - <target name="-testng-junit" if="junit.enabled">
1.70 - <!-- Java SE projects -->
1.71 - <macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3">
1.72 - <attribute default="${includes}" name="includes"/>
1.73 - <attribute default="${excludes}" name="excludes"/>
1.74 - <attribute default="**" name="testincludes"/>
1.75 - <sequential>
1.76 - <junit dir="${basedir}" errorproperty="junit.tests.failed" failureproperty="junit.tests.failed" fork="true" showoutput="true">
1.77 - <batchtest todir="${build.test.results.dir}">
1.78 - <fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
1.79 - <filename name="@{testincludes}"/>
1.80 - </fileset>
1.81 - </batchtest>
1.82 - <classpath>
1.83 - <path path="${run.test.classpath}"/>
1.84 - </classpath>
1.85 - <syspropertyset>
1.86 - <propertyref prefix="test-sys-prop."/>
1.87 - <mapper from="test-sys-prop.*" to="*" type="glob"/>
1.88 - </syspropertyset>
1.89 - <formatter type="brief" usefile="false"/>
1.90 - <formatter type="xml"/>
1.91 - <jvmarg line="${run.jvmargs.prop}"/>
1.92 - </junit>
1.93 - <testng-ant/>
1.94 - <condition property="tests.failed">
1.95 - <and>
1.96 - <isset property="junit.tests.failed"/>
1.97 - <isset property="testng.tests.failed"/>
1.98 - </and>
1.99 - </condition>
1.100 - </sequential>
1.101 - </macrodef>
1.102 -
1.103 - <!-- Web Projects -->
1.104 - <macrodef name="junit" uri="http://www.netbeans.org/ns/j2ee-ejbjarproject/2">
1.105 - <attribute default="${includes}" name="includes"/>
1.106 - <attribute default="${excludes}" name="excludes"/>
1.107 - <attribute default="**" name="testincludes"/>
1.108 - <sequential>
1.109 - <junit dir="${basedir}" errorproperty="junit.tests.failed" failureproperty="junit.tests.failed" fork="true" showoutput="true">
1.110 - <batchtest todir="${build.test.results.dir}">
1.111 - <fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
1.112 - <filename name="@{testincludes}"/>
1.113 - </fileset>
1.114 - </batchtest>
1.115 - <classpath>
1.116 - <path path="${run.test.classpath}:${j2ee.platform.classpath}"/>
1.117 - </classpath>
1.118 - <syspropertyset>
1.119 - <propertyref prefix="test-sys-prop."/>
1.120 - <mapper from="test-sys-prop.*" to="*" type="glob"/>
1.121 - </syspropertyset>
1.122 - <formatter type="brief" usefile="false"/>
1.123 - <formatter type="xml"/>
1.124 - <jvmarg line="${runmain.jvmargs}"/>
1.125 - </junit>
1.126 - <testng-ant/>
1.127 - <condition property="tests.failed">
1.128 - <and>
1.129 - <isset property="junit.tests.failed"/>
1.130 - <isset property="testng.tests.failed"/>
1.131 - </and>
1.132 - </condition>
1.133 - </sequential>
1.134 - </macrodef>
1.135 -
1.136 - <!-- EJB projects -->
1.137 - <macrodef name="junit" uri="http://www.netbeans.org/ns/j2ee-ejbjarproject/2">
1.138 - <attribute default="${includes}" name="includes"/>
1.139 - <attribute default="${excludes}" name="excludes"/>
1.140 - <attribute default="**" name="testincludes"/>
1.141 - <sequential>
1.142 - <junit dir="${basedir}" errorproperty="junit.tests.failed" failureproperty="junit.tests.failed" fork="true" showoutput="true">
1.143 - <batchtest todir="${build.test.results.dir}">
1.144 - <fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
1.145 - <filename name="@{testincludes}"/>
1.146 - </fileset>
1.147 - </batchtest>
1.148 - <classpath>
1.149 - <path path="${run.test.classpath}"/>
1.150 - <path path="${j2ee.platform.classpath}"/>
1.151 - </classpath>
1.152 - <syspropertyset>
1.153 - <propertyref prefix="test-sys-prop."/>
1.154 - <mapper from="test-sys-prop.*" to="*" type="glob"/>
1.155 - </syspropertyset>
1.156 - <formatter type="brief" usefile="false"/>
1.157 - <formatter type="xml"/>
1.158 - <jvmarg line="${runmain.jvmargs}"/>
1.159 - </junit>
1.160 - <testng-ant/>
1.161 - <condition property="tests.failed">
1.162 - <and>
1.163 - <isset property="junit.tests.failed"/>
1.164 - <isset property="testng.tests.failed"/>
1.165 - </and>
1.166 - </condition>
1.167 - </sequential>
1.168 - </macrodef>
1.169 -
1.170 - <!-- Java EE application client projects -->
1.171 - <macrodef name="junit" uri="http://www.netbeans.org/ns/car-project/1">
1.172 - <attribute default="${includes}" name="includes"/>
1.173 - <attribute default="${excludes}" name="excludes"/>
1.174 - <attribute default="**" name="testincludes"/>
1.175 - <sequential>
1.176 - <junit dir="${basedir}" errorproperty="junit.tests.failed" failureproperty="junit.tests.failed" fork="true" showoutput="true">
1.177 - <batchtest todir="${build.test.results.dir}">
1.178 - <fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
1.179 - <filename name="@{testincludes}"/>
1.180 - </fileset>
1.181 - </batchtest>
1.182 - <classpath>
1.183 - <path path="${run.test.classpath}"/>
1.184 - <path path="${j2ee.platform.classpath}"/>
1.185 - </classpath>
1.186 - <syspropertyset>
1.187 - <propertyref prefix="test-sys-prop."/>
1.188 - <mapper from="test-sys-prop.*" to="*" type="glob"/>
1.189 - </syspropertyset>
1.190 - <formatter type="brief" usefile="false"/>
1.191 - <formatter type="xml"/>
1.192 - <jvmarg line="${run.jvmargs.param}"/>
1.193 - </junit>
1.194 - <testng-ant/>
1.195 - <condition property="tests.failed">
1.196 - <and>
1.197 - <isset property="junit.tests.failed"/>
1.198 - <isset property="testng.tests.failed"/>
1.199 - </and>
1.200 - </condition>
1.201 - </sequential>
1.202 - </macrodef>
1.203 - </target>
1.204 -
1.205 - <target name="-reinit-tasks" depends="-init-env, -init-macrodef-testng, -testng, -testng-junit" />
1.206 + <target name="-reinit-tasks" depends="-init-env, -init-macrodef-testng, -testng" />
1.207
1.208 <target name="-run-testng-default" unless="testng.config">
1.209 <testng-ant/>