1.1 --- a/samples/apifest1/day2/stackbasedsolution/nbproject/build-impl.xml Sat Jun 14 09:52:47 2008 +0200
1.2 +++ b/samples/apifest1/day2/stackbasedsolution/nbproject/build-impl.xml Sat Jun 14 09:52:48 2008 +0200
1.3 @@ -18,32 +18,35 @@
1.4 - applet
1.5 - cleanup
1.6
1.7 --->
1.8 -<project name="stackbasedsolution-impl" default="default" basedir=".." xmlns:j2seproject3="http://www.netbeans.org/ns/j2se-project/3" xmlns:j2seproject2="http://www.netbeans.org/ns/j2se-project/2" xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1">
1.9 - <target name="default" depends="test,jar,javadoc" description="Build and test whole project."/>
1.10 + -->
1.11 +<project xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1" xmlns:j2seproject2="http://www.netbeans.org/ns/j2se-project/2" xmlns:j2seproject3="http://www.netbeans.org/ns/j2se-project/3" xmlns:jaxrpc="http://www.netbeans.org/ns/j2se-project/jax-rpc" basedir=".." default="default" name="stackbasedsolution-impl">
1.12 + <target depends="test,jar,javadoc" description="Build and test whole project." name="default"/>
1.13 <!--
1.14 - ======================
1.15 - INITIALIZATION SECTION
1.16 - ======================
1.17 - -->
1.18 + ======================
1.19 + INITIALIZATION SECTION
1.20 + ======================
1.21 + -->
1.22 <target name="-pre-init">
1.23 <!-- Empty placeholder for easier customization. -->
1.24 <!-- You can override this target in the ../build.xml file. -->
1.25 </target>
1.26 - <target name="-init-private" depends="-pre-init">
1.27 + <target depends="-pre-init" name="-init-private">
1.28 + <property file="nbproject/private/config.properties"/>
1.29 + <property file="nbproject/private/configs/${config}.properties"/>
1.30 <property file="nbproject/private/private.properties"/>
1.31 </target>
1.32 - <target name="-init-user" depends="-pre-init,-init-private">
1.33 + <target depends="-pre-init,-init-private" name="-init-user">
1.34 <property file="${user.properties.file}"/>
1.35 <!-- The two properties below are usually overridden -->
1.36 <!-- by the active platform. Just a fallback. -->
1.37 <property name="default.javac.source" value="1.4"/>
1.38 <property name="default.javac.target" value="1.4"/>
1.39 </target>
1.40 - <target name="-init-project" depends="-pre-init,-init-private,-init-user">
1.41 + <target depends="-pre-init,-init-private,-init-user" name="-init-project">
1.42 + <property file="nbproject/configs/${config}.properties"/>
1.43 <property file="nbproject/project.properties"/>
1.44 </target>
1.45 - <target name="-do-init" depends="-pre-init,-init-private,-init-user,-init-project,-init-macrodef-property">
1.46 + <target depends="-pre-init,-init-private,-init-user,-init-project,-init-macrodef-property" name="-do-init">
1.47 <available file="${manifest.file}" property="manifest.available"/>
1.48 <condition property="manifest.available+main.class">
1.49 <and>
1.50 @@ -77,7 +80,10 @@
1.51 </and>
1.52 </condition>
1.53 <condition property="no.javadoc.preview">
1.54 - <isfalse value="${javadoc.preview}"/>
1.55 + <and>
1.56 + <isset property="javadoc.preview"/>
1.57 + <isfalse value="${javadoc.preview}"/>
1.58 + </and>
1.59 </condition>
1.60 <property name="run.jvmargs" value=""/>
1.61 <property name="javac.compilerargs" value=""/>
1.62 @@ -90,12 +96,34 @@
1.63 <property name="javac.debug" value="true"/>
1.64 <property name="javadoc.preview" value="true"/>
1.65 <property name="application.args" value=""/>
1.66 + <property name="source.encoding" value="${file.encoding}"/>
1.67 + <condition property="javadoc.encoding.used" value="${javadoc.encoding}">
1.68 + <and>
1.69 + <isset property="javadoc.encoding"/>
1.70 + <not>
1.71 + <equals arg1="${javadoc.encoding}" arg2=""/>
1.72 + </not>
1.73 + </and>
1.74 + </condition>
1.75 + <property name="javadoc.encoding.used" value="${source.encoding}"/>
1.76 + <property name="includes" value="**"/>
1.77 + <property name="excludes" value=""/>
1.78 + <property name="do.depend" value="false"/>
1.79 + <condition property="do.depend.true">
1.80 + <istrue value="${do.depend}"/>
1.81 + </condition>
1.82 + <condition else="" property="javac.compilerargs.jaxws" value="-Djava.endorsed.dirs='${jaxws.endorsed.dir}'">
1.83 + <and>
1.84 + <isset property="jaxws.endorsed.dir"/>
1.85 + <available file="nbproject/jaxws-build.xml"/>
1.86 + </and>
1.87 + </condition>
1.88 </target>
1.89 <target name="-post-init">
1.90 <!-- Empty placeholder for easier customization. -->
1.91 <!-- You can override this target in the ../build.xml file. -->
1.92 </target>
1.93 - <target name="-init-check" depends="-pre-init,-init-private,-init-user,-init-project,-do-init">
1.94 + <target depends="-pre-init,-init-private,-init-user,-init-project,-do-init" name="-init-check">
1.95 <fail unless="src.dir">Must set src.dir</fail>
1.96 <fail unless="test.src.dir">Must set test.src.dir</fail>
1.97 <fail unless="build.dir">Must set build.dir</fail>
1.98 @@ -118,41 +146,70 @@
1.99 </target>
1.100 <target name="-init-macrodef-javac">
1.101 <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
1.102 - <attribute name="srcdir" default="${src.dir}"/>
1.103 - <attribute name="destdir" default="${build.classes.dir}"/>
1.104 - <attribute name="classpath" default="${javac.classpath}"/>
1.105 - <attribute name="debug" default="${javac.debug}"/>
1.106 + <attribute default="${src.dir}" name="srcdir"/>
1.107 + <attribute default="${build.classes.dir}" name="destdir"/>
1.108 + <attribute default="${javac.classpath}" name="classpath"/>
1.109 + <attribute default="${includes}" name="includes"/>
1.110 + <attribute default="${excludes}" name="excludes"/>
1.111 + <attribute default="${javac.debug}" name="debug"/>
1.112 + <attribute default="" name="sourcepath"/>
1.113 <element name="customize" optional="true"/>
1.114 <sequential>
1.115 - <depend srcdir="@{srcdir}" destdir="@{destdir}" cache="${build.dir}/depcache">
1.116 + <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}">
1.117 + <classpath>
1.118 + <path path="@{classpath}"/>
1.119 + </classpath>
1.120 + <compilerarg line="${javac.compilerargs} ${javac.compilerargs.jaxws}"/>
1.121 + <customize/>
1.122 + </javac>
1.123 + </sequential>
1.124 + </macrodef>
1.125 + <macrodef name="depend" uri="http://www.netbeans.org/ns/j2se-project/3">
1.126 + <attribute default="${src.dir}" name="srcdir"/>
1.127 + <attribute default="${build.classes.dir}" name="destdir"/>
1.128 + <attribute default="${javac.classpath}" name="classpath"/>
1.129 + <sequential>
1.130 + <depend cache="${build.dir}/depcache" destdir="@{destdir}" excludes="${excludes}" includes="${includes}" srcdir="@{srcdir}">
1.131 <classpath>
1.132 <path path="@{classpath}"/>
1.133 </classpath>
1.134 </depend>
1.135 - <javac srcdir="@{srcdir}" destdir="@{destdir}" debug="@{debug}" deprecation="${javac.deprecation}" source="${javac.source}" target="${javac.target}" includeantruntime="false">
1.136 - <classpath>
1.137 - <path path="@{classpath}"/>
1.138 - </classpath>
1.139 - <compilerarg line="${javac.compilerargs}"/>
1.140 - <customize/>
1.141 - </javac>
1.142 + </sequential>
1.143 + </macrodef>
1.144 + <macrodef name="force-recompile" uri="http://www.netbeans.org/ns/j2se-project/3">
1.145 + <attribute default="${build.classes.dir}" name="destdir"/>
1.146 + <sequential>
1.147 + <fail unless="javac.includes">Must set javac.includes</fail>
1.148 + <pathconvert pathsep="," property="javac.includes.binary">
1.149 + <path>
1.150 + <filelist dir="@{destdir}" files="${javac.includes}"/>
1.151 + </path>
1.152 + <globmapper from="*.java" to="*.class"/>
1.153 + </pathconvert>
1.154 + <delete>
1.155 + <files includes="${javac.includes.binary}"/>
1.156 + </delete>
1.157 </sequential>
1.158 </macrodef>
1.159 </target>
1.160 <target name="-init-macrodef-junit">
1.161 <macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3">
1.162 - <attribute name="includes" default="**/*Test.java"/>
1.163 + <attribute default="${includes}" name="includes"/>
1.164 + <attribute default="${excludes}" name="excludes"/>
1.165 + <attribute default="**" name="testincludes"/>
1.166 <sequential>
1.167 - <junit showoutput="true" fork="true" dir="${basedir}" failureproperty="tests.failed" errorproperty="tests.failed">
1.168 + <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" showoutput="true">
1.169 <batchtest todir="${build.test.results.dir}">
1.170 - <fileset dir="${test.src.dir}" includes="@{includes}"/>
1.171 + <fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
1.172 + <filename name="@{testincludes}"/>
1.173 + </fileset>
1.174 </batchtest>
1.175 <classpath>
1.176 <path path="${run.test.classpath}"/>
1.177 </classpath>
1.178 <syspropertyset>
1.179 <propertyref prefix="test-sys-prop."/>
1.180 - <mapper type="glob" from="test-sys-prop.*" to="*"/>
1.181 + <mapper from="test-sys-prop.*" to="*" type="glob"/>
1.182 </syspropertyset>
1.183 <formatter type="brief" usefile="false"/>
1.184 <formatter type="xml"/>
1.185 @@ -163,11 +220,11 @@
1.186 </target>
1.187 <target name="-init-macrodef-nbjpda">
1.188 <macrodef name="nbjpdastart" uri="http://www.netbeans.org/ns/j2se-project/1">
1.189 - <attribute name="name" default="${main.class}"/>
1.190 - <attribute name="classpath" default="${debug.classpath}"/>
1.191 - <attribute name="stopclassname" default=""/>
1.192 + <attribute default="${main.class}" name="name"/>
1.193 + <attribute default="${debug.classpath}" name="classpath"/>
1.194 + <attribute default="" name="stopclassname"/>
1.195 <sequential>
1.196 - <nbjpdastart transport="dt_socket" addressproperty="jpda.address" name="@{name}" stopclassname="@{stopclassname}">
1.197 + <nbjpdastart addressproperty="jpda.address" name="@{name}" stopclassname="@{stopclassname}" transport="dt_socket">
1.198 <classpath>
1.199 <path path="@{classpath}"/>
1.200 </classpath>
1.201 @@ -175,24 +232,36 @@
1.202 </sequential>
1.203 </macrodef>
1.204 <macrodef name="nbjpdareload" uri="http://www.netbeans.org/ns/j2se-project/1">
1.205 - <attribute name="dir" default="${build.classes.dir}"/>
1.206 + <attribute default="${build.classes.dir}" name="dir"/>
1.207 <sequential>
1.208 <nbjpdareload>
1.209 - <fileset includes="${fix.includes}*.class" dir="@{dir}"/>
1.210 + <fileset dir="@{dir}" includes="${fix.includes}*.class"/>
1.211 </nbjpdareload>
1.212 </sequential>
1.213 </macrodef>
1.214 </target>
1.215 - <target name="-init-macrodef-debug">
1.216 + <target name="-init-debug-args">
1.217 + <property name="version-output" value="java version "${ant.java.version}"/>
1.218 + <condition property="have-jdk-older-than-1.4">
1.219 + <or>
1.220 + <contains string="${version-output}" substring="java version "1.0"/>
1.221 + <contains string="${version-output}" substring="java version "1.1"/>
1.222 + <contains string="${version-output}" substring="java version "1.2"/>
1.223 + <contains string="${version-output}" substring="java version "1.3"/>
1.224 + </or>
1.225 + </condition>
1.226 + <condition else="-Xdebug" property="debug-args-line" value="-Xdebug -Xnoagent -Djava.compiler=none">
1.227 + <istrue value="${have-jdk-older-than-1.4}"/>
1.228 + </condition>
1.229 + </target>
1.230 + <target depends="-init-debug-args" name="-init-macrodef-debug">
1.231 <macrodef name="debug" uri="http://www.netbeans.org/ns/j2se-project/3">
1.232 - <attribute name="classname" default="${main.class}"/>
1.233 - <attribute name="classpath" default="${debug.classpath}"/>
1.234 + <attribute default="${main.class}" name="classname"/>
1.235 + <attribute default="${debug.classpath}" name="classpath"/>
1.236 <element name="customize" optional="true"/>
1.237 <sequential>
1.238 - <java fork="true" classname="@{classname}" dir="${work.dir}">
1.239 - <jvmarg value="-Xdebug"/>
1.240 - <jvmarg value="-Xnoagent"/>
1.241 - <jvmarg value="-Djava.compiler=none"/>
1.242 + <java classname="@{classname}" dir="${work.dir}" fork="true">
1.243 + <jvmarg line="${debug-args-line}"/>
1.244 <jvmarg value="-Xrunjdwp:transport=dt_socket,address=${jpda.address}"/>
1.245 <jvmarg line="${run.jvmargs}"/>
1.246 <classpath>
1.247 @@ -200,7 +269,7 @@
1.248 </classpath>
1.249 <syspropertyset>
1.250 <propertyref prefix="run-sys-prop."/>
1.251 - <mapper type="glob" from="run-sys-prop.*" to="*"/>
1.252 + <mapper from="run-sys-prop.*" to="*" type="glob"/>
1.253 </syspropertyset>
1.254 <customize/>
1.255 </java>
1.256 @@ -209,17 +278,17 @@
1.257 </target>
1.258 <target name="-init-macrodef-java">
1.259 <macrodef name="java" uri="http://www.netbeans.org/ns/j2se-project/1">
1.260 - <attribute name="classname" default="${main.class}"/>
1.261 + <attribute default="${main.class}" name="classname"/>
1.262 <element name="customize" optional="true"/>
1.263 <sequential>
1.264 - <java fork="true" classname="@{classname}" dir="${work.dir}">
1.265 + <java classname="@{classname}" dir="${work.dir}" fork="true">
1.266 <jvmarg line="${run.jvmargs}"/>
1.267 <classpath>
1.268 <path path="${run.classpath}"/>
1.269 </classpath>
1.270 <syspropertyset>
1.271 <propertyref prefix="run-sys-prop."/>
1.272 - <mapper type="glob" from="run-sys-prop.*" to="*"/>
1.273 + <mapper from="run-sys-prop.*" to="*" type="glob"/>
1.274 </syspropertyset>
1.275 <customize/>
1.276 </java>
1.277 @@ -228,102 +297,102 @@
1.278 </target>
1.279 <target name="-init-presetdef-jar">
1.280 <presetdef name="jar" uri="http://www.netbeans.org/ns/j2se-project/1">
1.281 - <jar jarfile="${dist.jar}" compress="${jar.compress}">
1.282 + <jar compress="${jar.compress}" jarfile="${dist.jar}">
1.283 <j2seproject1:fileset dir="${build.classes.dir}"/>
1.284 </jar>
1.285 </presetdef>
1.286 </target>
1.287 - <target name="init" depends="-pre-init,-init-private,-init-user,-init-project,-do-init,-post-init,-init-check,-init-macrodef-property,-init-macrodef-javac,-init-macrodef-junit,-init-macrodef-nbjpda,-init-macrodef-debug,-init-macrodef-java,-init-presetdef-jar"/>
1.288 + <target depends="-pre-init,-init-private,-init-user,-init-project,-do-init,-post-init,-init-check,-init-macrodef-property,-init-macrodef-javac,-init-macrodef-junit,-init-macrodef-nbjpda,-init-macrodef-debug,-init-macrodef-java,-init-presetdef-jar" name="init"/>
1.289 <!--
1.290 - ===================
1.291 - COMPILATION SECTION
1.292 - ===================
1.293 - -->
1.294 - <target name="deps-jar" depends="init" unless="no.deps"/>
1.295 - <target name="-pre-pre-compile" depends="init,deps-jar">
1.296 + ===================
1.297 + COMPILATION SECTION
1.298 + ===================
1.299 + -->
1.300 + <target depends="init" name="deps-jar" unless="no.deps"/>
1.301 + <target depends="init,deps-jar" name="-pre-pre-compile">
1.302 <mkdir dir="${build.classes.dir}"/>
1.303 </target>
1.304 <target name="-pre-compile">
1.305 <!-- Empty placeholder for easier customization. -->
1.306 <!-- You can override this target in the ../build.xml file. -->
1.307 </target>
1.308 - <target name="-do-compile" depends="init,deps-jar,-pre-pre-compile,-pre-compile" if="have.sources">
1.309 + <target if="do.depend.true" name="-compile-depend">
1.310 + <j2seproject3:depend/>
1.311 + </target>
1.312 + <target depends="init,deps-jar,-pre-pre-compile,-pre-compile,-compile-depend" if="have.sources" name="-do-compile">
1.313 <j2seproject3:javac/>
1.314 <copy todir="${build.classes.dir}">
1.315 - <fileset dir="${src.dir}" excludes="${build.classes.excludes}"/>
1.316 + <fileset dir="${src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
1.317 </copy>
1.318 </target>
1.319 <target name="-post-compile">
1.320 <!-- Empty placeholder for easier customization. -->
1.321 <!-- You can override this target in the ../build.xml file. -->
1.322 </target>
1.323 - <target name="compile" depends="init,deps-jar,-pre-pre-compile,-pre-compile,-do-compile,-post-compile" description="Compile project."/>
1.324 + <target depends="init,deps-jar,-pre-pre-compile,-pre-compile,-do-compile,-post-compile" description="Compile project." name="compile"/>
1.325 <target name="-pre-compile-single">
1.326 <!-- Empty placeholder for easier customization. -->
1.327 <!-- You can override this target in the ../build.xml file. -->
1.328 </target>
1.329 - <target name="-do-compile-single" depends="init,deps-jar,-pre-pre-compile">
1.330 + <target depends="init,deps-jar,-pre-pre-compile" name="-do-compile-single">
1.331 <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
1.332 - <j2seproject3:javac>
1.333 - <customize>
1.334 - <patternset includes="${javac.includes}"/>
1.335 - </customize>
1.336 - </j2seproject3:javac>
1.337 + <j2seproject3:force-recompile/>
1.338 + <j2seproject3:javac excludes="" includes="${javac.includes}" sourcepath="${src.dir}"/>
1.339 </target>
1.340 <target name="-post-compile-single">
1.341 <!-- Empty placeholder for easier customization. -->
1.342 <!-- You can override this target in the ../build.xml file. -->
1.343 </target>
1.344 - <target name="compile-single" depends="init,deps-jar,-pre-pre-compile,-pre-compile-single,-do-compile-single,-post-compile-single"/>
1.345 + <target depends="init,deps-jar,-pre-pre-compile,-pre-compile-single,-do-compile-single,-post-compile-single" name="compile-single"/>
1.346 <!--
1.347 - ====================
1.348 - JAR BUILDING SECTION
1.349 - ====================
1.350 - -->
1.351 - <target name="-pre-pre-jar" depends="init">
1.352 - <dirname property="dist.jar.dir" file="${dist.jar}"/>
1.353 + ====================
1.354 + JAR BUILDING SECTION
1.355 + ====================
1.356 + -->
1.357 + <target depends="init" name="-pre-pre-jar">
1.358 + <dirname file="${dist.jar}" property="dist.jar.dir"/>
1.359 <mkdir dir="${dist.jar.dir}"/>
1.360 </target>
1.361 <target name="-pre-jar">
1.362 <!-- Empty placeholder for easier customization. -->
1.363 <!-- You can override this target in the ../build.xml file. -->
1.364 </target>
1.365 - <target name="-do-jar-without-manifest" depends="init,compile,-pre-pre-jar,-pre-jar" unless="manifest.available">
1.366 + <target depends="init,compile,-pre-pre-jar,-pre-jar" name="-do-jar-without-manifest" unless="manifest.available">
1.367 <j2seproject1:jar/>
1.368 </target>
1.369 - <target name="-do-jar-with-manifest" depends="init,compile,-pre-pre-jar,-pre-jar" if="manifest.available" unless="manifest.available+main.class">
1.370 + <target depends="init,compile,-pre-pre-jar,-pre-jar" if="manifest.available" name="-do-jar-with-manifest" unless="manifest.available+main.class">
1.371 <j2seproject1:jar manifest="${manifest.file}"/>
1.372 </target>
1.373 - <target name="-do-jar-with-mainclass" depends="init,compile,-pre-pre-jar,-pre-jar" if="manifest.available+main.class" unless="manifest.available+main.class+mkdist.available">
1.374 + <target depends="init,compile,-pre-pre-jar,-pre-jar" if="manifest.available+main.class" name="-do-jar-with-mainclass" unless="manifest.available+main.class+mkdist.available">
1.375 <j2seproject1:jar manifest="${manifest.file}">
1.376 <j2seproject1:manifest>
1.377 <j2seproject1:attribute name="Main-Class" value="${main.class}"/>
1.378 </j2seproject1:manifest>
1.379 </j2seproject1:jar>
1.380 <echo>To run this application from the command line without Ant, try:</echo>
1.381 - <property name="build.classes.dir.resolved" location="${build.classes.dir}"/>
1.382 - <property name="dist.jar.resolved" location="${dist.jar}"/>
1.383 + <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
1.384 + <property location="${dist.jar}" name="dist.jar.resolved"/>
1.385 <pathconvert property="run.classpath.with.dist.jar">
1.386 <path path="${run.classpath}"/>
1.387 <map from="${build.classes.dir.resolved}" to="${dist.jar.resolved}"/>
1.388 </pathconvert>
1.389 <echo>java -cp "${run.classpath.with.dist.jar}" ${main.class}</echo>
1.390 </target>
1.391 - <target name="-do-jar-with-libraries" depends="init,compile,-pre-pre-jar,-pre-jar" if="manifest.available+main.class+mkdist.available">
1.392 - <property name="build.classes.dir.resolved" location="${build.classes.dir}"/>
1.393 + <target depends="init,compile,-pre-pre-jar,-pre-jar" if="manifest.available+main.class+mkdist.available" name="-do-jar-with-libraries">
1.394 + <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
1.395 <pathconvert property="run.classpath.without.build.classes.dir">
1.396 <path path="${run.classpath}"/>
1.397 <map from="${build.classes.dir.resolved}" to=""/>
1.398 </pathconvert>
1.399 - <pathconvert property="jar.classpath" pathsep=" ">
1.400 + <pathconvert pathsep=" " property="jar.classpath">
1.401 <path path="${run.classpath.without.build.classes.dir}"/>
1.402 <chainedmapper>
1.403 <flattenmapper/>
1.404 <globmapper from="*" to="lib/*"/>
1.405 </chainedmapper>
1.406 </pathconvert>
1.407 - <taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" name="copylibs" classpath="${libs.CopyLibs.classpath}"/>
1.408 - <copylibs manifest="${manifest.file}" runtimeclasspath="${run.classpath.without.build.classes.dir}" jarfile="${dist.jar}" compress="${jar.compress}">
1.409 + <taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/>
1.410 + <copylibs compress="${jar.compress}" jarfile="${dist.jar}" manifest="${manifest.file}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
1.411 <fileset dir="${build.classes.dir}"/>
1.412 <manifest>
1.413 <attribute name="Main-Class" value="${main.class}"/>
1.414 @@ -331,183 +400,194 @@
1.415 </manifest>
1.416 </copylibs>
1.417 <echo>To run this application from the command line without Ant, try:</echo>
1.418 - <property name="dist.jar.resolved" location="${dist.jar}"/>
1.419 + <property location="${dist.jar}" name="dist.jar.resolved"/>
1.420 <echo>java -jar "${dist.jar.resolved}"</echo>
1.421 </target>
1.422 <target name="-post-jar">
1.423 <!-- Empty placeholder for easier customization. -->
1.424 <!-- You can override this target in the ../build.xml file. -->
1.425 </target>
1.426 - <target name="jar" depends="init,compile,-pre-jar,-do-jar-with-manifest,-do-jar-without-manifest,-do-jar-with-mainclass,-do-jar-with-libraries,-post-jar" description="Build JAR."/>
1.427 + <target depends="init,compile,-pre-jar,-do-jar-with-manifest,-do-jar-without-manifest,-do-jar-with-mainclass,-do-jar-with-libraries,-post-jar" description="Build JAR." name="jar"/>
1.428 <!--
1.429 - =================
1.430 - EXECUTION SECTION
1.431 - =================
1.432 - -->
1.433 - <target name="run" depends="init,compile" description="Run a main class.">
1.434 + =================
1.435 + EXECUTION SECTION
1.436 + =================
1.437 + -->
1.438 + <target depends="init,compile" description="Run a main class." name="run">
1.439 <j2seproject1:java>
1.440 <customize>
1.441 <arg line="${application.args}"/>
1.442 </customize>
1.443 </j2seproject1:java>
1.444 </target>
1.445 - <target name="run-single" depends="init,compile-single">
1.446 + <target name="-do-not-recompile">
1.447 + <property name="javac.includes.binary" value=""/>
1.448 + </target>
1.449 + <target depends="init,-do-not-recompile,compile-single" name="run-single">
1.450 <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
1.451 <j2seproject1:java classname="${run.class}"/>
1.452 </target>
1.453 <!--
1.454 - =================
1.455 - DEBUGGING SECTION
1.456 - =================
1.457 - -->
1.458 - <target name="-debug-start-debugger" if="netbeans.home" depends="init">
1.459 + =================
1.460 + DEBUGGING SECTION
1.461 + =================
1.462 + -->
1.463 + <target depends="init" if="netbeans.home" name="-debug-start-debugger">
1.464 <j2seproject1:nbjpdastart name="${debug.class}"/>
1.465 </target>
1.466 - <target name="-debug-start-debuggee" depends="init,compile">
1.467 + <target depends="init,compile" name="-debug-start-debuggee">
1.468 <j2seproject3:debug>
1.469 <customize>
1.470 <arg line="${application.args}"/>
1.471 </customize>
1.472 </j2seproject3:debug>
1.473 </target>
1.474 - <target name="debug" if="netbeans.home" depends="init,compile,-debug-start-debugger,-debug-start-debuggee" description="Debug project in IDE."/>
1.475 - <target name="-debug-start-debugger-stepinto" if="netbeans.home" depends="init">
1.476 + <target depends="init,compile,-debug-start-debugger,-debug-start-debuggee" description="Debug project in IDE." if="netbeans.home" name="debug"/>
1.477 + <target depends="init" if="netbeans.home" name="-debug-start-debugger-stepinto">
1.478 <j2seproject1:nbjpdastart stopclassname="${main.class}"/>
1.479 </target>
1.480 - <target name="debug-stepinto" if="netbeans.home" depends="init,compile,-debug-start-debugger-stepinto,-debug-start-debuggee"/>
1.481 - <target name="-debug-start-debuggee-single" if="netbeans.home" depends="init,compile-single">
1.482 + <target depends="init,compile,-debug-start-debugger-stepinto,-debug-start-debuggee" if="netbeans.home" name="debug-stepinto"/>
1.483 + <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-single">
1.484 <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
1.485 <j2seproject3:debug classname="${debug.class}"/>
1.486 </target>
1.487 - <target name="debug-single" if="netbeans.home" depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-single"/>
1.488 - <target name="-pre-debug-fix" depends="init">
1.489 + <target depends="init,-do-not-recompile,compile-single,-debug-start-debugger,-debug-start-debuggee-single" if="netbeans.home" name="debug-single"/>
1.490 + <target depends="init" name="-pre-debug-fix">
1.491 <fail unless="fix.includes">Must set fix.includes</fail>
1.492 <property name="javac.includes" value="${fix.includes}.java"/>
1.493 </target>
1.494 - <target name="-do-debug-fix" if="netbeans.home" depends="init,-pre-debug-fix,compile-single">
1.495 + <target depends="init,-pre-debug-fix,compile-single" if="netbeans.home" name="-do-debug-fix">
1.496 <j2seproject1:nbjpdareload/>
1.497 </target>
1.498 - <target name="debug-fix" if="netbeans.home" depends="init,-pre-debug-fix,-do-debug-fix"/>
1.499 + <target depends="init,-pre-debug-fix,-do-debug-fix" if="netbeans.home" name="debug-fix"/>
1.500 <!--
1.501 - ===============
1.502 - JAVADOC SECTION
1.503 - ===============
1.504 - -->
1.505 - <target name="-javadoc-build" depends="init">
1.506 + ===============
1.507 + JAVADOC SECTION
1.508 + ===============
1.509 + -->
1.510 + <target depends="init" name="-javadoc-build">
1.511 <mkdir dir="${dist.javadoc.dir}"/>
1.512 - <javadoc destdir="${dist.javadoc.dir}" source="${javac.source}" notree="${javadoc.notree}" use="${javadoc.use}" nonavbar="${javadoc.nonavbar}" noindex="${javadoc.noindex}" splitindex="${javadoc.splitindex}" author="${javadoc.author}" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}" private="${javadoc.private}" additionalparam="${javadoc.additionalparam}" failonerror="true" useexternalfile="true">
1.513 + <javadoc additionalparam="${javadoc.additionalparam}" author="${javadoc.author}" charset="UTF-8" destdir="${dist.javadoc.dir}" docencoding="UTF-8" encoding="${javadoc.encoding.used}" failonerror="true" noindex="${javadoc.noindex}" nonavbar="${javadoc.nonavbar}" notree="${javadoc.notree}" private="${javadoc.private}" source="${javac.source}" splitindex="${javadoc.splitindex}" use="${javadoc.use}" useexternalfile="true" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}">
1.514 <classpath>
1.515 <path path="${javac.classpath}"/>
1.516 </classpath>
1.517 - <sourcepath>
1.518 - <pathelement location="${src.dir}"/>
1.519 - </sourcepath>
1.520 - <packageset dir="${src.dir}" includes="*/**"/>
1.521 - <fileset dir="${src.dir}" includes="*.java"/>
1.522 + <fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
1.523 + <filename name="**/*.java"/>
1.524 + </fileset>
1.525 </javadoc>
1.526 </target>
1.527 - <target name="-javadoc-browse" if="netbeans.home" unless="no.javadoc.preview" depends="init,-javadoc-build">
1.528 + <target depends="init,-javadoc-build" if="netbeans.home" name="-javadoc-browse" unless="no.javadoc.preview">
1.529 <nbbrowse file="${dist.javadoc.dir}/index.html"/>
1.530 </target>
1.531 - <target name="javadoc" depends="init,-javadoc-build,-javadoc-browse" description="Build Javadoc."/>
1.532 + <target depends="init,-javadoc-build,-javadoc-browse" description="Build Javadoc." name="javadoc"/>
1.533 <!--
1.534 - =========================
1.535 - JUNIT COMPILATION SECTION
1.536 - =========================
1.537 - -->
1.538 - <target name="-pre-pre-compile-test" if="have.tests" depends="init,compile">
1.539 + =========================
1.540 + JUNIT COMPILATION SECTION
1.541 + =========================
1.542 + -->
1.543 + <target depends="init,compile" if="have.tests" name="-pre-pre-compile-test">
1.544 <mkdir dir="${build.test.classes.dir}"/>
1.545 </target>
1.546 <target name="-pre-compile-test">
1.547 <!-- Empty placeholder for easier customization. -->
1.548 <!-- You can override this target in the ../build.xml file. -->
1.549 </target>
1.550 - <target name="-do-compile-test" if="have.tests" depends="init,compile,-pre-pre-compile-test,-pre-compile-test">
1.551 - <j2seproject3:javac srcdir="${test.src.dir}" destdir="${build.test.classes.dir}" debug="true" classpath="${javac.test.classpath}"/>
1.552 + <target if="do.depend.true" name="-compile-test-depend">
1.553 + <j2seproject3:depend classpath="${javac.test.classpath}" destdir="${build.test.classes.dir}" srcdir="${test.src.dir}"/>
1.554 + </target>
1.555 + <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-compile-test-depend" if="have.tests" name="-do-compile-test">
1.556 + <j2seproject3:javac classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" srcdir="${test.src.dir}"/>
1.557 <copy todir="${build.test.classes.dir}">
1.558 - <fileset dir="${test.src.dir}" excludes="**/*.java"/>
1.559 + <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
1.560 </copy>
1.561 </target>
1.562 <target name="-post-compile-test">
1.563 <!-- Empty placeholder for easier customization. -->
1.564 <!-- You can override this target in the ../build.xml file. -->
1.565 </target>
1.566 - <target name="compile-test" depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-do-compile-test,-post-compile-test"/>
1.567 + <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-do-compile-test,-post-compile-test" name="compile-test"/>
1.568 <target name="-pre-compile-test-single">
1.569 <!-- Empty placeholder for easier customization. -->
1.570 <!-- You can override this target in the ../build.xml file. -->
1.571 </target>
1.572 - <target name="-do-compile-test-single" if="have.tests" depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single">
1.573 + <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single" if="have.tests" name="-do-compile-test-single">
1.574 <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
1.575 - <j2seproject3:javac srcdir="${test.src.dir}" destdir="${build.test.classes.dir}" debug="true" classpath="${javac.test.classpath}">
1.576 - <customize>
1.577 - <patternset includes="${javac.includes}"/>
1.578 - </customize>
1.579 - </j2seproject3:javac>
1.580 + <j2seproject3:force-recompile destdir="${build.test.classes.dir}"/>
1.581 + <j2seproject3:javac classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" excludes="" includes="${javac.includes}" sourcepath="${test.src.dir}" srcdir="${test.src.dir}"/>
1.582 <copy todir="${build.test.classes.dir}">
1.583 - <fileset dir="${test.src.dir}" excludes="**/*.java"/>
1.584 + <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
1.585 </copy>
1.586 </target>
1.587 <target name="-post-compile-test-single">
1.588 <!-- Empty placeholder for easier customization. -->
1.589 <!-- You can override this target in the ../build.xml file. -->
1.590 </target>
1.591 - <target name="compile-test-single" depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single,-do-compile-test-single,-post-compile-test-single"/>
1.592 + <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single,-do-compile-test-single,-post-compile-test-single" name="compile-test-single"/>
1.593 <!--
1.594 - =======================
1.595 - JUNIT EXECUTION SECTION
1.596 - =======================
1.597 - -->
1.598 - <target name="-pre-test-run" if="have.tests" depends="init">
1.599 + =======================
1.600 + JUNIT EXECUTION SECTION
1.601 + =======================
1.602 + -->
1.603 + <target depends="init" if="have.tests" name="-pre-test-run">
1.604 <mkdir dir="${build.test.results.dir}"/>
1.605 </target>
1.606 - <target name="-do-test-run" if="have.tests" depends="init,compile-test,-pre-test-run">
1.607 - <j2seproject3:junit/>
1.608 + <target depends="init,compile-test,-pre-test-run" if="have.tests" name="-do-test-run">
1.609 + <j2seproject3:junit testincludes="**/*Test.java"/>
1.610 </target>
1.611 - <target name="-post-test-run" if="have.tests" depends="init,compile-test,-pre-test-run,-do-test-run">
1.612 + <target depends="init,compile-test,-pre-test-run,-do-test-run" if="have.tests" name="-post-test-run">
1.613 <fail if="tests.failed">Some tests failed; see details above.</fail>
1.614 </target>
1.615 - <target name="test-report" if="have.tests" depends="init"/>
1.616 - <target name="-test-browse" if="netbeans.home+have.tests" depends="init"/>
1.617 - <target name="test" depends="init,compile-test,-pre-test-run,-do-test-run,test-report,-post-test-run,-test-browse" description="Run unit tests."/>
1.618 - <target name="-pre-test-run-single" if="have.tests" depends="init">
1.619 + <target depends="init" if="have.tests" name="test-report"/>
1.620 + <target depends="init" if="netbeans.home+have.tests" name="-test-browse"/>
1.621 + <target depends="init,compile-test,-pre-test-run,-do-test-run,test-report,-post-test-run,-test-browse" description="Run unit tests." name="test"/>
1.622 + <target depends="init" if="have.tests" name="-pre-test-run-single">
1.623 <mkdir dir="${build.test.results.dir}"/>
1.624 </target>
1.625 - <target name="-do-test-run-single" if="have.tests" depends="init,compile-test-single,-pre-test-run-single">
1.626 + <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single">
1.627 <fail unless="test.includes">Must select some files in the IDE or set test.includes</fail>
1.628 - <j2seproject3:junit includes="${test.includes}"/>
1.629 + <j2seproject3:junit excludes="" includes="${test.includes}"/>
1.630 </target>
1.631 - <target name="-post-test-run-single" if="have.tests" depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single">
1.632 + <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single" if="have.tests" name="-post-test-run-single">
1.633 <fail if="tests.failed">Some tests failed; see details above.</fail>
1.634 </target>
1.635 - <target name="test-single" depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single,-post-test-run-single" description="Run single unit test."/>
1.636 + <target depends="init,-do-not-recompile,compile-test-single,-pre-test-run-single,-do-test-run-single,-post-test-run-single" description="Run single unit test." name="test-single"/>
1.637 <!--
1.638 - =======================
1.639 - JUNIT DEBUGGING SECTION
1.640 - =======================
1.641 - -->
1.642 - <target name="-debug-start-debuggee-test" if="have.tests" depends="init,compile-test">
1.643 + =======================
1.644 + JUNIT DEBUGGING SECTION
1.645 + =======================
1.646 + -->
1.647 + <target depends="init,compile-test" if="have.tests" name="-debug-start-debuggee-test">
1.648 <fail unless="test.class">Must select one file in the IDE or set test.class</fail>
1.649 - <j2seproject3:debug classname="junit.textui.TestRunner" classpath="${debug.test.classpath}">
1.650 + <property location="${build.test.results.dir}/TEST-${test.class}.xml" name="test.report.file"/>
1.651 + <delete file="${test.report.file}"/>
1.652 + <mkdir dir="${build.test.results.dir}"/>
1.653 + <j2seproject3:debug classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner" classpath="${ant.home}/lib/ant.jar:${ant.home}/lib/ant-junit.jar:${debug.test.classpath}">
1.654 <customize>
1.655 - <arg line="${test.class}"/>
1.656 + <syspropertyset>
1.657 + <propertyref prefix="test-sys-prop."/>
1.658 + <mapper from="test-sys-prop.*" to="*" type="glob"/>
1.659 + </syspropertyset>
1.660 + <arg value="${test.class}"/>
1.661 + <arg value="showoutput=true"/>
1.662 + <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.BriefJUnitResultFormatter"/>
1.663 + <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,${test.report.file}"/>
1.664 </customize>
1.665 </j2seproject3:debug>
1.666 </target>
1.667 - <target name="-debug-start-debugger-test" if="netbeans.home+have.tests" depends="init,compile-test">
1.668 - <j2seproject1:nbjpdastart name="${test.class}" classpath="${debug.test.classpath}"/>
1.669 + <target depends="init,compile-test" if="netbeans.home+have.tests" name="-debug-start-debugger-test">
1.670 + <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${test.class}"/>
1.671 </target>
1.672 - <target name="debug-test" depends="init,compile-test,-debug-start-debugger-test,-debug-start-debuggee-test"/>
1.673 - <target name="-do-debug-fix-test" if="netbeans.home" depends="init,-pre-debug-fix,compile-test-single">
1.674 + <target depends="init,-do-not-recompile,compile-test-single,-debug-start-debugger-test,-debug-start-debuggee-test" name="debug-test"/>
1.675 + <target depends="init,-pre-debug-fix,compile-test-single" if="netbeans.home" name="-do-debug-fix-test">
1.676 <j2seproject1:nbjpdareload dir="${build.test.classes.dir}"/>
1.677 </target>
1.678 - <target name="debug-fix-test" if="netbeans.home" depends="init,-pre-debug-fix,-do-debug-fix-test"/>
1.679 + <target depends="init,-pre-debug-fix,-do-debug-fix-test" if="netbeans.home" name="debug-fix-test"/>
1.680 <!--
1.681 - =========================
1.682 - APPLET EXECUTION SECTION
1.683 - =========================
1.684 - -->
1.685 - <target name="run-applet" depends="init,compile-single">
1.686 + =========================
1.687 + APPLET EXECUTION SECTION
1.688 + =========================
1.689 + -->
1.690 + <target depends="init,compile-single" name="run-applet">
1.691 <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
1.692 <j2seproject1:java classname="sun.applet.AppletViewer">
1.693 <customize>
1.694 @@ -516,11 +596,11 @@
1.695 </j2seproject1:java>
1.696 </target>
1.697 <!--
1.698 - =========================
1.699 - APPLET DEBUGGING SECTION
1.700 - =========================
1.701 - -->
1.702 - <target name="-debug-start-debuggee-applet" if="netbeans.home" depends="init,compile-single">
1.703 + =========================
1.704 + APPLET DEBUGGING SECTION
1.705 + =========================
1.706 + -->
1.707 + <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-applet">
1.708 <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
1.709 <j2seproject3:debug classname="sun.applet.AppletViewer">
1.710 <customize>
1.711 @@ -528,14 +608,14 @@
1.712 </customize>
1.713 </j2seproject3:debug>
1.714 </target>
1.715 - <target name="debug-applet" if="netbeans.home" depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-applet"/>
1.716 + <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-applet" if="netbeans.home" name="debug-applet"/>
1.717 <!--
1.718 - ===============
1.719 - CLEANUP SECTION
1.720 - ===============
1.721 - -->
1.722 - <target name="deps-clean" depends="init" unless="no.deps"/>
1.723 - <target name="-do-clean" depends="init">
1.724 + ===============
1.725 + CLEANUP SECTION
1.726 + ===============
1.727 + -->
1.728 + <target depends="init" name="deps-clean" unless="no.deps"/>
1.729 + <target depends="init" name="-do-clean">
1.730 <delete dir="${build.dir}"/>
1.731 <delete dir="${dist.dir}"/>
1.732 </target>
1.733 @@ -543,5 +623,5 @@
1.734 <!-- Empty placeholder for easier customization. -->
1.735 <!-- You can override this target in the ../build.xml file. -->
1.736 </target>
1.737 - <target name="clean" depends="init,deps-clean,-do-clean,-post-clean" description="Clean build products."/>
1.738 + <target depends="init,deps-clean,-do-clean,-post-clean" description="Clean build products." name="clean"/>
1.739 </project>
2.1 --- a/samples/apifest1/day2/stackbasedsolution/nbproject/genfiles.properties Sat Jun 14 09:52:47 2008 +0200
2.2 +++ b/samples/apifest1/day2/stackbasedsolution/nbproject/genfiles.properties Sat Jun 14 09:52:48 2008 +0200
2.3 @@ -1,8 +1,8 @@
2.4 build.xml.data.CRC32=10562595
2.5 build.xml.script.CRC32=8e100d5a
2.6 -build.xml.stylesheet.CRC32=a12b3d02
2.7 +build.xml.stylesheet.CRC32=be360661
2.8 # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
2.9 # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
2.10 nbproject/build-impl.xml.data.CRC32=10562595
2.11 -nbproject/build-impl.xml.script.CRC32=50f3448d
2.12 -nbproject/build-impl.xml.stylesheet.CRC32=c10f1eac
2.13 +nbproject/build-impl.xml.script.CRC32=4a74b13c
2.14 +nbproject/build-impl.xml.stylesheet.CRC32=f1d9da08
3.1 --- a/samples/apifest1/day2/stackbasedsolution/nbproject/project.properties Sat Jun 14 09:52:47 2008 +0200
3.2 +++ b/samples/apifest1/day2/stackbasedsolution/nbproject/project.properties Sat Jun 14 09:52:48 2008 +0200
3.3 @@ -15,6 +15,8 @@
3.4 dist.dir=dist
3.5 dist.jar=${dist.dir}/boolcircuit.jar
3.6 dist.javadoc.dir=${dist.dir}/javadoc
3.7 +excludes=
3.8 +includes=**
3.9 jar.compress=false
3.10 javac.classpath=
3.11 # Space-separated list of extra javac options
4.1 --- a/samples/apifest1/day2/stackbasedsolution/nbproject/project.xml Sat Jun 14 09:52:47 2008 +0200
4.2 +++ b/samples/apifest1/day2/stackbasedsolution/nbproject/project.xml Sat Jun 14 09:52:48 2008 +0200
4.3 @@ -3,7 +3,7 @@
4.4 <type>org.netbeans.modules.java.j2seproject</type>
4.5 <configuration>
4.6 <data xmlns="http://www.netbeans.org/ns/j2se-project/3">
4.7 - <name>stackbasedsolution</name>
4.8 + <name>stackbasedsolution - day2</name>
4.9 <minimum-ant-version>1.6.5</minimum-ant-version>
4.10 <source-roots>
4.11 <root id="src.dir"/>
5.1 --- a/samples/apifest1/day2/stackbasedsolution/src/org/netbeans/apifest/boolcircuit/Circuit2.java Sat Jun 14 09:52:47 2008 +0200
5.2 +++ b/samples/apifest1/day2/stackbasedsolution/src/org/netbeans/apifest/boolcircuit/Circuit2.java Sat Jun 14 09:52:48 2008 +0200
5.3 @@ -23,6 +23,8 @@
5.4
5.5 /**
5.6 */
5.7 +//BEGIN: apifest.day2.stackbasedsolution.Circuit2
5.8 public interface Circuit2 extends Circuit {
5.9 public double evaluate (double ... input) throws IllegalArgumentException;
5.10 }
5.11 +//END: apifest.day2.stackbasedsolution.Circuit2
6.1 --- a/samples/apifest1/day2/subclassingsolution/nbproject/build-impl.xml Sat Jun 14 09:52:47 2008 +0200
6.2 +++ b/samples/apifest1/day2/subclassingsolution/nbproject/build-impl.xml Sat Jun 14 09:52:48 2008 +0200
6.3 @@ -18,32 +18,35 @@
6.4 - applet
6.5 - cleanup
6.6
6.7 --->
6.8 -<project name="subclassingsolution-impl" default="default" basedir=".." xmlns:j2seproject3="http://www.netbeans.org/ns/j2se-project/3" xmlns:j2seproject2="http://www.netbeans.org/ns/j2se-project/2" xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1">
6.9 - <target name="default" depends="test,jar,javadoc" description="Build and test whole project."/>
6.10 + -->
6.11 +<project xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1" xmlns:j2seproject2="http://www.netbeans.org/ns/j2se-project/2" xmlns:j2seproject3="http://www.netbeans.org/ns/j2se-project/3" xmlns:jaxrpc="http://www.netbeans.org/ns/j2se-project/jax-rpc" basedir=".." default="default" name="subclassingsolution-impl">
6.12 + <target depends="test,jar,javadoc" description="Build and test whole project." name="default"/>
6.13 <!--
6.14 - ======================
6.15 - INITIALIZATION SECTION
6.16 - ======================
6.17 - -->
6.18 + ======================
6.19 + INITIALIZATION SECTION
6.20 + ======================
6.21 + -->
6.22 <target name="-pre-init">
6.23 <!-- Empty placeholder for easier customization. -->
6.24 <!-- You can override this target in the ../build.xml file. -->
6.25 </target>
6.26 - <target name="-init-private" depends="-pre-init">
6.27 + <target depends="-pre-init" name="-init-private">
6.28 + <property file="nbproject/private/config.properties"/>
6.29 + <property file="nbproject/private/configs/${config}.properties"/>
6.30 <property file="nbproject/private/private.properties"/>
6.31 </target>
6.32 - <target name="-init-user" depends="-pre-init,-init-private">
6.33 + <target depends="-pre-init,-init-private" name="-init-user">
6.34 <property file="${user.properties.file}"/>
6.35 <!-- The two properties below are usually overridden -->
6.36 <!-- by the active platform. Just a fallback. -->
6.37 <property name="default.javac.source" value="1.4"/>
6.38 <property name="default.javac.target" value="1.4"/>
6.39 </target>
6.40 - <target name="-init-project" depends="-pre-init,-init-private,-init-user">
6.41 + <target depends="-pre-init,-init-private,-init-user" name="-init-project">
6.42 + <property file="nbproject/configs/${config}.properties"/>
6.43 <property file="nbproject/project.properties"/>
6.44 </target>
6.45 - <target name="-do-init" depends="-pre-init,-init-private,-init-user,-init-project,-init-macrodef-property">
6.46 + <target depends="-pre-init,-init-private,-init-user,-init-project,-init-macrodef-property" name="-do-init">
6.47 <available file="${manifest.file}" property="manifest.available"/>
6.48 <condition property="manifest.available+main.class">
6.49 <and>
6.50 @@ -77,7 +80,10 @@
6.51 </and>
6.52 </condition>
6.53 <condition property="no.javadoc.preview">
6.54 - <isfalse value="${javadoc.preview}"/>
6.55 + <and>
6.56 + <isset property="javadoc.preview"/>
6.57 + <isfalse value="${javadoc.preview}"/>
6.58 + </and>
6.59 </condition>
6.60 <property name="run.jvmargs" value=""/>
6.61 <property name="javac.compilerargs" value=""/>
6.62 @@ -90,12 +96,34 @@
6.63 <property name="javac.debug" value="true"/>
6.64 <property name="javadoc.preview" value="true"/>
6.65 <property name="application.args" value=""/>
6.66 + <property name="source.encoding" value="${file.encoding}"/>
6.67 + <condition property="javadoc.encoding.used" value="${javadoc.encoding}">
6.68 + <and>
6.69 + <isset property="javadoc.encoding"/>
6.70 + <not>
6.71 + <equals arg1="${javadoc.encoding}" arg2=""/>
6.72 + </not>
6.73 + </and>
6.74 + </condition>
6.75 + <property name="javadoc.encoding.used" value="${source.encoding}"/>
6.76 + <property name="includes" value="**"/>
6.77 + <property name="excludes" value=""/>
6.78 + <property name="do.depend" value="false"/>
6.79 + <condition property="do.depend.true">
6.80 + <istrue value="${do.depend}"/>
6.81 + </condition>
6.82 + <condition else="" property="javac.compilerargs.jaxws" value="-Djava.endorsed.dirs='${jaxws.endorsed.dir}'">
6.83 + <and>
6.84 + <isset property="jaxws.endorsed.dir"/>
6.85 + <available file="nbproject/jaxws-build.xml"/>
6.86 + </and>
6.87 + </condition>
6.88 </target>
6.89 <target name="-post-init">
6.90 <!-- Empty placeholder for easier customization. -->
6.91 <!-- You can override this target in the ../build.xml file. -->
6.92 </target>
6.93 - <target name="-init-check" depends="-pre-init,-init-private,-init-user,-init-project,-do-init">
6.94 + <target depends="-pre-init,-init-private,-init-user,-init-project,-do-init" name="-init-check">
6.95 <fail unless="src.dir">Must set src.dir</fail>
6.96 <fail unless="test.src.dir">Must set test.src.dir</fail>
6.97 <fail unless="build.dir">Must set build.dir</fail>
6.98 @@ -118,41 +146,70 @@
6.99 </target>
6.100 <target name="-init-macrodef-javac">
6.101 <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
6.102 - <attribute name="srcdir" default="${src.dir}"/>
6.103 - <attribute name="destdir" default="${build.classes.dir}"/>
6.104 - <attribute name="classpath" default="${javac.classpath}"/>
6.105 - <attribute name="debug" default="${javac.debug}"/>
6.106 + <attribute default="${src.dir}" name="srcdir"/>
6.107 + <attribute default="${build.classes.dir}" name="destdir"/>
6.108 + <attribute default="${javac.classpath}" name="classpath"/>
6.109 + <attribute default="${includes}" name="includes"/>
6.110 + <attribute default="${excludes}" name="excludes"/>
6.111 + <attribute default="${javac.debug}" name="debug"/>
6.112 + <attribute default="" name="sourcepath"/>
6.113 <element name="customize" optional="true"/>
6.114 <sequential>
6.115 - <depend srcdir="@{srcdir}" destdir="@{destdir}" cache="${build.dir}/depcache">
6.116 + <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}">
6.117 + <classpath>
6.118 + <path path="@{classpath}"/>
6.119 + </classpath>
6.120 + <compilerarg line="${javac.compilerargs} ${javac.compilerargs.jaxws}"/>
6.121 + <customize/>
6.122 + </javac>
6.123 + </sequential>
6.124 + </macrodef>
6.125 + <macrodef name="depend" uri="http://www.netbeans.org/ns/j2se-project/3">
6.126 + <attribute default="${src.dir}" name="srcdir"/>
6.127 + <attribute default="${build.classes.dir}" name="destdir"/>
6.128 + <attribute default="${javac.classpath}" name="classpath"/>
6.129 + <sequential>
6.130 + <depend cache="${build.dir}/depcache" destdir="@{destdir}" excludes="${excludes}" includes="${includes}" srcdir="@{srcdir}">
6.131 <classpath>
6.132 <path path="@{classpath}"/>
6.133 </classpath>
6.134 </depend>
6.135 - <javac srcdir="@{srcdir}" destdir="@{destdir}" debug="@{debug}" deprecation="${javac.deprecation}" source="${javac.source}" target="${javac.target}" includeantruntime="false">
6.136 - <classpath>
6.137 - <path path="@{classpath}"/>
6.138 - </classpath>
6.139 - <compilerarg line="${javac.compilerargs}"/>
6.140 - <customize/>
6.141 - </javac>
6.142 + </sequential>
6.143 + </macrodef>
6.144 + <macrodef name="force-recompile" uri="http://www.netbeans.org/ns/j2se-project/3">
6.145 + <attribute default="${build.classes.dir}" name="destdir"/>
6.146 + <sequential>
6.147 + <fail unless="javac.includes">Must set javac.includes</fail>
6.148 + <pathconvert pathsep="," property="javac.includes.binary">
6.149 + <path>
6.150 + <filelist dir="@{destdir}" files="${javac.includes}"/>
6.151 + </path>
6.152 + <globmapper from="*.java" to="*.class"/>
6.153 + </pathconvert>
6.154 + <delete>
6.155 + <files includes="${javac.includes.binary}"/>
6.156 + </delete>
6.157 </sequential>
6.158 </macrodef>
6.159 </target>
6.160 <target name="-init-macrodef-junit">
6.161 <macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3">
6.162 - <attribute name="includes" default="**/*Test.java"/>
6.163 + <attribute default="${includes}" name="includes"/>
6.164 + <attribute default="${excludes}" name="excludes"/>
6.165 + <attribute default="**" name="testincludes"/>
6.166 <sequential>
6.167 - <junit showoutput="true" fork="true" dir="${basedir}" failureproperty="tests.failed" errorproperty="tests.failed">
6.168 + <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" showoutput="true">
6.169 <batchtest todir="${build.test.results.dir}">
6.170 - <fileset dir="${test.src.dir}" includes="@{includes}"/>
6.171 + <fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
6.172 + <filename name="@{testincludes}"/>
6.173 + </fileset>
6.174 </batchtest>
6.175 <classpath>
6.176 <path path="${run.test.classpath}"/>
6.177 </classpath>
6.178 <syspropertyset>
6.179 <propertyref prefix="test-sys-prop."/>
6.180 - <mapper type="glob" from="test-sys-prop.*" to="*"/>
6.181 + <mapper from="test-sys-prop.*" to="*" type="glob"/>
6.182 </syspropertyset>
6.183 <formatter type="brief" usefile="false"/>
6.184 <formatter type="xml"/>
6.185 @@ -163,11 +220,11 @@
6.186 </target>
6.187 <target name="-init-macrodef-nbjpda">
6.188 <macrodef name="nbjpdastart" uri="http://www.netbeans.org/ns/j2se-project/1">
6.189 - <attribute name="name" default="${main.class}"/>
6.190 - <attribute name="classpath" default="${debug.classpath}"/>
6.191 - <attribute name="stopclassname" default=""/>
6.192 + <attribute default="${main.class}" name="name"/>
6.193 + <attribute default="${debug.classpath}" name="classpath"/>
6.194 + <attribute default="" name="stopclassname"/>
6.195 <sequential>
6.196 - <nbjpdastart transport="dt_socket" addressproperty="jpda.address" name="@{name}" stopclassname="@{stopclassname}">
6.197 + <nbjpdastart addressproperty="jpda.address" name="@{name}" stopclassname="@{stopclassname}" transport="dt_socket">
6.198 <classpath>
6.199 <path path="@{classpath}"/>
6.200 </classpath>
6.201 @@ -175,24 +232,36 @@
6.202 </sequential>
6.203 </macrodef>
6.204 <macrodef name="nbjpdareload" uri="http://www.netbeans.org/ns/j2se-project/1">
6.205 - <attribute name="dir" default="${build.classes.dir}"/>
6.206 + <attribute default="${build.classes.dir}" name="dir"/>
6.207 <sequential>
6.208 <nbjpdareload>
6.209 - <fileset includes="${fix.includes}*.class" dir="@{dir}"/>
6.210 + <fileset dir="@{dir}" includes="${fix.includes}*.class"/>
6.211 </nbjpdareload>
6.212 </sequential>
6.213 </macrodef>
6.214 </target>
6.215 - <target name="-init-macrodef-debug">
6.216 + <target name="-init-debug-args">
6.217 + <property name="version-output" value="java version "${ant.java.version}"/>
6.218 + <condition property="have-jdk-older-than-1.4">
6.219 + <or>
6.220 + <contains string="${version-output}" substring="java version "1.0"/>
6.221 + <contains string="${version-output}" substring="java version "1.1"/>
6.222 + <contains string="${version-output}" substring="java version "1.2"/>
6.223 + <contains string="${version-output}" substring="java version "1.3"/>
6.224 + </or>
6.225 + </condition>
6.226 + <condition else="-Xdebug" property="debug-args-line" value="-Xdebug -Xnoagent -Djava.compiler=none">
6.227 + <istrue value="${have-jdk-older-than-1.4}"/>
6.228 + </condition>
6.229 + </target>
6.230 + <target depends="-init-debug-args" name="-init-macrodef-debug">
6.231 <macrodef name="debug" uri="http://www.netbeans.org/ns/j2se-project/3">
6.232 - <attribute name="classname" default="${main.class}"/>
6.233 - <attribute name="classpath" default="${debug.classpath}"/>
6.234 + <attribute default="${main.class}" name="classname"/>
6.235 + <attribute default="${debug.classpath}" name="classpath"/>
6.236 <element name="customize" optional="true"/>
6.237 <sequential>
6.238 - <java fork="true" classname="@{classname}" dir="${work.dir}">
6.239 - <jvmarg value="-Xdebug"/>
6.240 - <jvmarg value="-Xnoagent"/>
6.241 - <jvmarg value="-Djava.compiler=none"/>
6.242 + <java classname="@{classname}" dir="${work.dir}" fork="true">
6.243 + <jvmarg line="${debug-args-line}"/>
6.244 <jvmarg value="-Xrunjdwp:transport=dt_socket,address=${jpda.address}"/>
6.245 <jvmarg line="${run.jvmargs}"/>
6.246 <classpath>
6.247 @@ -200,7 +269,7 @@
6.248 </classpath>
6.249 <syspropertyset>
6.250 <propertyref prefix="run-sys-prop."/>
6.251 - <mapper type="glob" from="run-sys-prop.*" to="*"/>
6.252 + <mapper from="run-sys-prop.*" to="*" type="glob"/>
6.253 </syspropertyset>
6.254 <customize/>
6.255 </java>
6.256 @@ -209,17 +278,17 @@
6.257 </target>
6.258 <target name="-init-macrodef-java">
6.259 <macrodef name="java" uri="http://www.netbeans.org/ns/j2se-project/1">
6.260 - <attribute name="classname" default="${main.class}"/>
6.261 + <attribute default="${main.class}" name="classname"/>
6.262 <element name="customize" optional="true"/>
6.263 <sequential>
6.264 - <java fork="true" classname="@{classname}" dir="${work.dir}">
6.265 + <java classname="@{classname}" dir="${work.dir}" fork="true">
6.266 <jvmarg line="${run.jvmargs}"/>
6.267 <classpath>
6.268 <path path="${run.classpath}"/>
6.269 </classpath>
6.270 <syspropertyset>
6.271 <propertyref prefix="run-sys-prop."/>
6.272 - <mapper type="glob" from="run-sys-prop.*" to="*"/>
6.273 + <mapper from="run-sys-prop.*" to="*" type="glob"/>
6.274 </syspropertyset>
6.275 <customize/>
6.276 </java>
6.277 @@ -228,102 +297,102 @@
6.278 </target>
6.279 <target name="-init-presetdef-jar">
6.280 <presetdef name="jar" uri="http://www.netbeans.org/ns/j2se-project/1">
6.281 - <jar jarfile="${dist.jar}" compress="${jar.compress}">
6.282 + <jar compress="${jar.compress}" jarfile="${dist.jar}">
6.283 <j2seproject1:fileset dir="${build.classes.dir}"/>
6.284 </jar>
6.285 </presetdef>
6.286 </target>
6.287 - <target name="init" depends="-pre-init,-init-private,-init-user,-init-project,-do-init,-post-init,-init-check,-init-macrodef-property,-init-macrodef-javac,-init-macrodef-junit,-init-macrodef-nbjpda,-init-macrodef-debug,-init-macrodef-java,-init-presetdef-jar"/>
6.288 + <target depends="-pre-init,-init-private,-init-user,-init-project,-do-init,-post-init,-init-check,-init-macrodef-property,-init-macrodef-javac,-init-macrodef-junit,-init-macrodef-nbjpda,-init-macrodef-debug,-init-macrodef-java,-init-presetdef-jar" name="init"/>
6.289 <!--
6.290 - ===================
6.291 - COMPILATION SECTION
6.292 - ===================
6.293 - -->
6.294 - <target name="deps-jar" depends="init" unless="no.deps"/>
6.295 - <target name="-pre-pre-compile" depends="init,deps-jar">
6.296 + ===================
6.297 + COMPILATION SECTION
6.298 + ===================
6.299 + -->
6.300 + <target depends="init" name="deps-jar" unless="no.deps"/>
6.301 + <target depends="init,deps-jar" name="-pre-pre-compile">
6.302 <mkdir dir="${build.classes.dir}"/>
6.303 </target>
6.304 <target name="-pre-compile">
6.305 <!-- Empty placeholder for easier customization. -->
6.306 <!-- You can override this target in the ../build.xml file. -->
6.307 </target>
6.308 - <target name="-do-compile" depends="init,deps-jar,-pre-pre-compile,-pre-compile" if="have.sources">
6.309 + <target if="do.depend.true" name="-compile-depend">
6.310 + <j2seproject3:depend/>
6.311 + </target>
6.312 + <target depends="init,deps-jar,-pre-pre-compile,-pre-compile,-compile-depend" if="have.sources" name="-do-compile">
6.313 <j2seproject3:javac/>
6.314 <copy todir="${build.classes.dir}">
6.315 - <fileset dir="${src.dir}" excludes="${build.classes.excludes}"/>
6.316 + <fileset dir="${src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
6.317 </copy>
6.318 </target>
6.319 <target name="-post-compile">
6.320 <!-- Empty placeholder for easier customization. -->
6.321 <!-- You can override this target in the ../build.xml file. -->
6.322 </target>
6.323 - <target name="compile" depends="init,deps-jar,-pre-pre-compile,-pre-compile,-do-compile,-post-compile" description="Compile project."/>
6.324 + <target depends="init,deps-jar,-pre-pre-compile,-pre-compile,-do-compile,-post-compile" description="Compile project." name="compile"/>
6.325 <target name="-pre-compile-single">
6.326 <!-- Empty placeholder for easier customization. -->
6.327 <!-- You can override this target in the ../build.xml file. -->
6.328 </target>
6.329 - <target name="-do-compile-single" depends="init,deps-jar,-pre-pre-compile">
6.330 + <target depends="init,deps-jar,-pre-pre-compile" name="-do-compile-single">
6.331 <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
6.332 - <j2seproject3:javac>
6.333 - <customize>
6.334 - <patternset includes="${javac.includes}"/>
6.335 - </customize>
6.336 - </j2seproject3:javac>
6.337 + <j2seproject3:force-recompile/>
6.338 + <j2seproject3:javac excludes="" includes="${javac.includes}" sourcepath="${src.dir}"/>
6.339 </target>
6.340 <target name="-post-compile-single">
6.341 <!-- Empty placeholder for easier customization. -->
6.342 <!-- You can override this target in the ../build.xml file. -->
6.343 </target>
6.344 - <target name="compile-single" depends="init,deps-jar,-pre-pre-compile,-pre-compile-single,-do-compile-single,-post-compile-single"/>
6.345 + <target depends="init,deps-jar,-pre-pre-compile,-pre-compile-single,-do-compile-single,-post-compile-single" name="compile-single"/>
6.346 <!--
6.347 - ====================
6.348 - JAR BUILDING SECTION
6.349 - ====================
6.350 - -->
6.351 - <target name="-pre-pre-jar" depends="init">
6.352 - <dirname property="dist.jar.dir" file="${dist.jar}"/>
6.353 + ====================
6.354 + JAR BUILDING SECTION
6.355 + ====================
6.356 + -->
6.357 + <target depends="init" name="-pre-pre-jar">
6.358 + <dirname file="${dist.jar}" property="dist.jar.dir"/>
6.359 <mkdir dir="${dist.jar.dir}"/>
6.360 </target>
6.361 <target name="-pre-jar">
6.362 <!-- Empty placeholder for easier customization. -->
6.363 <!-- You can override this target in the ../build.xml file. -->
6.364 </target>
6.365 - <target name="-do-jar-without-manifest" depends="init,compile,-pre-pre-jar,-pre-jar" unless="manifest.available">
6.366 + <target depends="init,compile,-pre-pre-jar,-pre-jar" name="-do-jar-without-manifest" unless="manifest.available">
6.367 <j2seproject1:jar/>
6.368 </target>
6.369 - <target name="-do-jar-with-manifest" depends="init,compile,-pre-pre-jar,-pre-jar" if="manifest.available" unless="manifest.available+main.class">
6.370 + <target depends="init,compile,-pre-pre-jar,-pre-jar" if="manifest.available" name="-do-jar-with-manifest" unless="manifest.available+main.class">
6.371 <j2seproject1:jar manifest="${manifest.file}"/>
6.372 </target>
6.373 - <target name="-do-jar-with-mainclass" depends="init,compile,-pre-pre-jar,-pre-jar" if="manifest.available+main.class" unless="manifest.available+main.class+mkdist.available">
6.374 + <target depends="init,compile,-pre-pre-jar,-pre-jar" if="manifest.available+main.class" name="-do-jar-with-mainclass" unless="manifest.available+main.class+mkdist.available">
6.375 <j2seproject1:jar manifest="${manifest.file}">
6.376 <j2seproject1:manifest>
6.377 <j2seproject1:attribute name="Main-Class" value="${main.class}"/>
6.378 </j2seproject1:manifest>
6.379 </j2seproject1:jar>
6.380 <echo>To run this application from the command line without Ant, try:</echo>
6.381 - <property name="build.classes.dir.resolved" location="${build.classes.dir}"/>
6.382 - <property name="dist.jar.resolved" location="${dist.jar}"/>
6.383 + <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
6.384 + <property location="${dist.jar}" name="dist.jar.resolved"/>
6.385 <pathconvert property="run.classpath.with.dist.jar">
6.386 <path path="${run.classpath}"/>
6.387 <map from="${build.classes.dir.resolved}" to="${dist.jar.resolved}"/>
6.388 </pathconvert>
6.389 <echo>java -cp "${run.classpath.with.dist.jar}" ${main.class}</echo>
6.390 </target>
6.391 - <target name="-do-jar-with-libraries" depends="init,compile,-pre-pre-jar,-pre-jar" if="manifest.available+main.class+mkdist.available">
6.392 - <property name="build.classes.dir.resolved" location="${build.classes.dir}"/>
6.393 + <target depends="init,compile,-pre-pre-jar,-pre-jar" if="manifest.available+main.class+mkdist.available" name="-do-jar-with-libraries">
6.394 + <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
6.395 <pathconvert property="run.classpath.without.build.classes.dir">
6.396 <path path="${run.classpath}"/>
6.397 <map from="${build.classes.dir.resolved}" to=""/>
6.398 </pathconvert>
6.399 - <pathconvert property="jar.classpath" pathsep=" ">
6.400 + <pathconvert pathsep=" " property="jar.classpath">
6.401 <path path="${run.classpath.without.build.classes.dir}"/>
6.402 <chainedmapper>
6.403 <flattenmapper/>
6.404 <globmapper from="*" to="lib/*"/>
6.405 </chainedmapper>
6.406 </pathconvert>
6.407 - <taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" name="copylibs" classpath="${libs.CopyLibs.classpath}"/>
6.408 - <copylibs manifest="${manifest.file}" runtimeclasspath="${run.classpath.without.build.classes.dir}" jarfile="${dist.jar}" compress="${jar.compress}">
6.409 + <taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/>
6.410 + <copylibs compress="${jar.compress}" jarfile="${dist.jar}" manifest="${manifest.file}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
6.411 <fileset dir="${build.classes.dir}"/>
6.412 <manifest>
6.413 <attribute name="Main-Class" value="${main.class}"/>
6.414 @@ -331,183 +400,194 @@
6.415 </manifest>
6.416 </copylibs>
6.417 <echo>To run this application from the command line without Ant, try:</echo>
6.418 - <property name="dist.jar.resolved" location="${dist.jar}"/>
6.419 + <property location="${dist.jar}" name="dist.jar.resolved"/>
6.420 <echo>java -jar "${dist.jar.resolved}"</echo>
6.421 </target>
6.422 <target name="-post-jar">
6.423 <!-- Empty placeholder for easier customization. -->
6.424 <!-- You can override this target in the ../build.xml file. -->
6.425 </target>
6.426 - <target name="jar" depends="init,compile,-pre-jar,-do-jar-with-manifest,-do-jar-without-manifest,-do-jar-with-mainclass,-do-jar-with-libraries,-post-jar" description="Build JAR."/>
6.427 + <target depends="init,compile,-pre-jar,-do-jar-with-manifest,-do-jar-without-manifest,-do-jar-with-mainclass,-do-jar-with-libraries,-post-jar" description="Build JAR." name="jar"/>
6.428 <!--
6.429 - =================
6.430 - EXECUTION SECTION
6.431 - =================
6.432 - -->
6.433 - <target name="run" depends="init,compile" description="Run a main class.">
6.434 + =================
6.435 + EXECUTION SECTION
6.436 + =================
6.437 + -->
6.438 + <target depends="init,compile" description="Run a main class." name="run">
6.439 <j2seproject1:java>
6.440 <customize>
6.441 <arg line="${application.args}"/>
6.442 </customize>
6.443 </j2seproject1:java>
6.444 </target>
6.445 - <target name="run-single" depends="init,compile-single">
6.446 + <target name="-do-not-recompile">
6.447 + <property name="javac.includes.binary" value=""/>
6.448 + </target>
6.449 + <target depends="init,-do-not-recompile,compile-single" name="run-single">
6.450 <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
6.451 <j2seproject1:java classname="${run.class}"/>
6.452 </target>
6.453 <!--
6.454 - =================
6.455 - DEBUGGING SECTION
6.456 - =================
6.457 - -->
6.458 - <target name="-debug-start-debugger" if="netbeans.home" depends="init">
6.459 + =================
6.460 + DEBUGGING SECTION
6.461 + =================
6.462 + -->
6.463 + <target depends="init" if="netbeans.home" name="-debug-start-debugger">
6.464 <j2seproject1:nbjpdastart name="${debug.class}"/>
6.465 </target>
6.466 - <target name="-debug-start-debuggee" depends="init,compile">
6.467 + <target depends="init,compile" name="-debug-start-debuggee">
6.468 <j2seproject3:debug>
6.469 <customize>
6.470 <arg line="${application.args}"/>
6.471 </customize>
6.472 </j2seproject3:debug>
6.473 </target>
6.474 - <target name="debug" if="netbeans.home" depends="init,compile,-debug-start-debugger,-debug-start-debuggee" description="Debug project in IDE."/>
6.475 - <target name="-debug-start-debugger-stepinto" if="netbeans.home" depends="init">
6.476 + <target depends="init,compile,-debug-start-debugger,-debug-start-debuggee" description="Debug project in IDE." if="netbeans.home" name="debug"/>
6.477 + <target depends="init" if="netbeans.home" name="-debug-start-debugger-stepinto">
6.478 <j2seproject1:nbjpdastart stopclassname="${main.class}"/>
6.479 </target>
6.480 - <target name="debug-stepinto" if="netbeans.home" depends="init,compile,-debug-start-debugger-stepinto,-debug-start-debuggee"/>
6.481 - <target name="-debug-start-debuggee-single" if="netbeans.home" depends="init,compile-single">
6.482 + <target depends="init,compile,-debug-start-debugger-stepinto,-debug-start-debuggee" if="netbeans.home" name="debug-stepinto"/>
6.483 + <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-single">
6.484 <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
6.485 <j2seproject3:debug classname="${debug.class}"/>
6.486 </target>
6.487 - <target name="debug-single" if="netbeans.home" depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-single"/>
6.488 - <target name="-pre-debug-fix" depends="init">
6.489 + <target depends="init,-do-not-recompile,compile-single,-debug-start-debugger,-debug-start-debuggee-single" if="netbeans.home" name="debug-single"/>
6.490 + <target depends="init" name="-pre-debug-fix">
6.491 <fail unless="fix.includes">Must set fix.includes</fail>
6.492 <property name="javac.includes" value="${fix.includes}.java"/>
6.493 </target>
6.494 - <target name="-do-debug-fix" if="netbeans.home" depends="init,-pre-debug-fix,compile-single">
6.495 + <target depends="init,-pre-debug-fix,compile-single" if="netbeans.home" name="-do-debug-fix">
6.496 <j2seproject1:nbjpdareload/>
6.497 </target>
6.498 - <target name="debug-fix" if="netbeans.home" depends="init,-pre-debug-fix,-do-debug-fix"/>
6.499 + <target depends="init,-pre-debug-fix,-do-debug-fix" if="netbeans.home" name="debug-fix"/>
6.500 <!--
6.501 - ===============
6.502 - JAVADOC SECTION
6.503 - ===============
6.504 - -->
6.505 - <target name="-javadoc-build" depends="init">
6.506 + ===============
6.507 + JAVADOC SECTION
6.508 + ===============
6.509 + -->
6.510 + <target depends="init" name="-javadoc-build">
6.511 <mkdir dir="${dist.javadoc.dir}"/>
6.512 - <javadoc destdir="${dist.javadoc.dir}" source="${javac.source}" notree="${javadoc.notree}" use="${javadoc.use}" nonavbar="${javadoc.nonavbar}" noindex="${javadoc.noindex}" splitindex="${javadoc.splitindex}" author="${javadoc.author}" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}" private="${javadoc.private}" additionalparam="${javadoc.additionalparam}" failonerror="true" useexternalfile="true">
6.513 + <javadoc additionalparam="${javadoc.additionalparam}" author="${javadoc.author}" charset="UTF-8" destdir="${dist.javadoc.dir}" docencoding="UTF-8" encoding="${javadoc.encoding.used}" failonerror="true" noindex="${javadoc.noindex}" nonavbar="${javadoc.nonavbar}" notree="${javadoc.notree}" private="${javadoc.private}" source="${javac.source}" splitindex="${javadoc.splitindex}" use="${javadoc.use}" useexternalfile="true" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}">
6.514 <classpath>
6.515 <path path="${javac.classpath}"/>
6.516 </classpath>
6.517 - <sourcepath>
6.518 - <pathelement location="${src.dir}"/>
6.519 - </sourcepath>
6.520 - <packageset dir="${src.dir}" includes="*/**"/>
6.521 - <fileset dir="${src.dir}" includes="*.java"/>
6.522 + <fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
6.523 + <filename name="**/*.java"/>
6.524 + </fileset>
6.525 </javadoc>
6.526 </target>
6.527 - <target name="-javadoc-browse" if="netbeans.home" unless="no.javadoc.preview" depends="init,-javadoc-build">
6.528 + <target depends="init,-javadoc-build" if="netbeans.home" name="-javadoc-browse" unless="no.javadoc.preview">
6.529 <nbbrowse file="${dist.javadoc.dir}/index.html"/>
6.530 </target>
6.531 - <target name="javadoc" depends="init,-javadoc-build,-javadoc-browse" description="Build Javadoc."/>
6.532 + <target depends="init,-javadoc-build,-javadoc-browse" description="Build Javadoc." name="javadoc"/>
6.533 <!--
6.534 - =========================
6.535 - JUNIT COMPILATION SECTION
6.536 - =========================
6.537 - -->
6.538 - <target name="-pre-pre-compile-test" if="have.tests" depends="init,compile">
6.539 + =========================
6.540 + JUNIT COMPILATION SECTION
6.541 + =========================
6.542 + -->
6.543 + <target depends="init,compile" if="have.tests" name="-pre-pre-compile-test">
6.544 <mkdir dir="${build.test.classes.dir}"/>
6.545 </target>
6.546 <target name="-pre-compile-test">
6.547 <!-- Empty placeholder for easier customization. -->
6.548 <!-- You can override this target in the ../build.xml file. -->
6.549 </target>
6.550 - <target name="-do-compile-test" if="have.tests" depends="init,compile,-pre-pre-compile-test,-pre-compile-test">
6.551 - <j2seproject3:javac srcdir="${test.src.dir}" destdir="${build.test.classes.dir}" debug="true" classpath="${javac.test.classpath}"/>
6.552 + <target if="do.depend.true" name="-compile-test-depend">
6.553 + <j2seproject3:depend classpath="${javac.test.classpath}" destdir="${build.test.classes.dir}" srcdir="${test.src.dir}"/>
6.554 + </target>
6.555 + <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-compile-test-depend" if="have.tests" name="-do-compile-test">
6.556 + <j2seproject3:javac classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" srcdir="${test.src.dir}"/>
6.557 <copy todir="${build.test.classes.dir}">
6.558 - <fileset dir="${test.src.dir}" excludes="**/*.java"/>
6.559 + <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
6.560 </copy>
6.561 </target>
6.562 <target name="-post-compile-test">
6.563 <!-- Empty placeholder for easier customization. -->
6.564 <!-- You can override this target in the ../build.xml file. -->
6.565 </target>
6.566 - <target name="compile-test" depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-do-compile-test,-post-compile-test"/>
6.567 + <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-do-compile-test,-post-compile-test" name="compile-test"/>
6.568 <target name="-pre-compile-test-single">
6.569 <!-- Empty placeholder for easier customization. -->
6.570 <!-- You can override this target in the ../build.xml file. -->
6.571 </target>
6.572 - <target name="-do-compile-test-single" if="have.tests" depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single">
6.573 + <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single" if="have.tests" name="-do-compile-test-single">
6.574 <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
6.575 - <j2seproject3:javac srcdir="${test.src.dir}" destdir="${build.test.classes.dir}" debug="true" classpath="${javac.test.classpath}">
6.576 - <customize>
6.577 - <patternset includes="${javac.includes}"/>
6.578 - </customize>
6.579 - </j2seproject3:javac>
6.580 + <j2seproject3:force-recompile destdir="${build.test.classes.dir}"/>
6.581 + <j2seproject3:javac classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" excludes="" includes="${javac.includes}" sourcepath="${test.src.dir}" srcdir="${test.src.dir}"/>
6.582 <copy todir="${build.test.classes.dir}">
6.583 - <fileset dir="${test.src.dir}" excludes="**/*.java"/>
6.584 + <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
6.585 </copy>
6.586 </target>
6.587 <target name="-post-compile-test-single">
6.588 <!-- Empty placeholder for easier customization. -->
6.589 <!-- You can override this target in the ../build.xml file. -->
6.590 </target>
6.591 - <target name="compile-test-single" depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single,-do-compile-test-single,-post-compile-test-single"/>
6.592 + <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single,-do-compile-test-single,-post-compile-test-single" name="compile-test-single"/>
6.593 <!--
6.594 - =======================
6.595 - JUNIT EXECUTION SECTION
6.596 - =======================
6.597 - -->
6.598 - <target name="-pre-test-run" if="have.tests" depends="init">
6.599 + =======================
6.600 + JUNIT EXECUTION SECTION
6.601 + =======================
6.602 + -->
6.603 + <target depends="init" if="have.tests" name="-pre-test-run">
6.604 <mkdir dir="${build.test.results.dir}"/>
6.605 </target>
6.606 - <target name="-do-test-run" if="have.tests" depends="init,compile-test,-pre-test-run">
6.607 - <j2seproject3:junit/>
6.608 + <target depends="init,compile-test,-pre-test-run" if="have.tests" name="-do-test-run">
6.609 + <j2seproject3:junit testincludes="**/*Test.java"/>
6.610 </target>
6.611 - <target name="-post-test-run" if="have.tests" depends="init,compile-test,-pre-test-run,-do-test-run">
6.612 + <target depends="init,compile-test,-pre-test-run,-do-test-run" if="have.tests" name="-post-test-run">
6.613 <fail if="tests.failed">Some tests failed; see details above.</fail>
6.614 </target>
6.615 - <target name="test-report" if="have.tests" depends="init"/>
6.616 - <target name="-test-browse" if="netbeans.home+have.tests" depends="init"/>
6.617 - <target name="test" depends="init,compile-test,-pre-test-run,-do-test-run,test-report,-post-test-run,-test-browse" description="Run unit tests."/>
6.618 - <target name="-pre-test-run-single" if="have.tests" depends="init">
6.619 + <target depends="init" if="have.tests" name="test-report"/>
6.620 + <target depends="init" if="netbeans.home+have.tests" name="-test-browse"/>
6.621 + <target depends="init,compile-test,-pre-test-run,-do-test-run,test-report,-post-test-run,-test-browse" description="Run unit tests." name="test"/>
6.622 + <target depends="init" if="have.tests" name="-pre-test-run-single">
6.623 <mkdir dir="${build.test.results.dir}"/>
6.624 </target>
6.625 - <target name="-do-test-run-single" if="have.tests" depends="init,compile-test-single,-pre-test-run-single">
6.626 + <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single">
6.627 <fail unless="test.includes">Must select some files in the IDE or set test.includes</fail>
6.628 - <j2seproject3:junit includes="${test.includes}"/>
6.629 + <j2seproject3:junit excludes="" includes="${test.includes}"/>
6.630 </target>
6.631 - <target name="-post-test-run-single" if="have.tests" depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single">
6.632 + <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single" if="have.tests" name="-post-test-run-single">
6.633 <fail if="tests.failed">Some tests failed; see details above.</fail>
6.634 </target>
6.635 - <target name="test-single" depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single,-post-test-run-single" description="Run single unit test."/>
6.636 + <target depends="init,-do-not-recompile,compile-test-single,-pre-test-run-single,-do-test-run-single,-post-test-run-single" description="Run single unit test." name="test-single"/>
6.637 <!--
6.638 - =======================
6.639 - JUNIT DEBUGGING SECTION
6.640 - =======================
6.641 - -->
6.642 - <target name="-debug-start-debuggee-test" if="have.tests" depends="init,compile-test">
6.643 + =======================
6.644 + JUNIT DEBUGGING SECTION
6.645 + =======================
6.646 + -->
6.647 + <target depends="init,compile-test" if="have.tests" name="-debug-start-debuggee-test">
6.648 <fail unless="test.class">Must select one file in the IDE or set test.class</fail>
6.649 - <j2seproject3:debug classname="junit.textui.TestRunner" classpath="${debug.test.classpath}">
6.650 + <property location="${build.test.results.dir}/TEST-${test.class}.xml" name="test.report.file"/>
6.651 + <delete file="${test.report.file}"/>
6.652 + <mkdir dir="${build.test.results.dir}"/>
6.653 + <j2seproject3:debug classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner" classpath="${ant.home}/lib/ant.jar:${ant.home}/lib/ant-junit.jar:${debug.test.classpath}">
6.654 <customize>
6.655 - <arg line="${test.class}"/>
6.656 + <syspropertyset>
6.657 + <propertyref prefix="test-sys-prop."/>
6.658 + <mapper from="test-sys-prop.*" to="*" type="glob"/>
6.659 + </syspropertyset>
6.660 + <arg value="${test.class}"/>
6.661 + <arg value="showoutput=true"/>
6.662 + <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.BriefJUnitResultFormatter"/>
6.663 + <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,${test.report.file}"/>
6.664 </customize>
6.665 </j2seproject3:debug>
6.666 </target>
6.667 - <target name="-debug-start-debugger-test" if="netbeans.home+have.tests" depends="init,compile-test">
6.668 - <j2seproject1:nbjpdastart name="${test.class}" classpath="${debug.test.classpath}"/>
6.669 + <target depends="init,compile-test" if="netbeans.home+have.tests" name="-debug-start-debugger-test">
6.670 + <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${test.class}"/>
6.671 </target>
6.672 - <target name="debug-test" depends="init,compile-test,-debug-start-debugger-test,-debug-start-debuggee-test"/>
6.673 - <target name="-do-debug-fix-test" if="netbeans.home" depends="init,-pre-debug-fix,compile-test-single">
6.674 + <target depends="init,-do-not-recompile,compile-test-single,-debug-start-debugger-test,-debug-start-debuggee-test" name="debug-test"/>
6.675 + <target depends="init,-pre-debug-fix,compile-test-single" if="netbeans.home" name="-do-debug-fix-test">
6.676 <j2seproject1:nbjpdareload dir="${build.test.classes.dir}"/>
6.677 </target>
6.678 - <target name="debug-fix-test" if="netbeans.home" depends="init,-pre-debug-fix,-do-debug-fix-test"/>
6.679 + <target depends="init,-pre-debug-fix,-do-debug-fix-test" if="netbeans.home" name="debug-fix-test"/>
6.680 <!--
6.681 - =========================
6.682 - APPLET EXECUTION SECTION
6.683 - =========================
6.684 - -->
6.685 - <target name="run-applet" depends="init,compile-single">
6.686 + =========================
6.687 + APPLET EXECUTION SECTION
6.688 + =========================
6.689 + -->
6.690 + <target depends="init,compile-single" name="run-applet">
6.691 <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
6.692 <j2seproject1:java classname="sun.applet.AppletViewer">
6.693 <customize>
6.694 @@ -516,11 +596,11 @@
6.695 </j2seproject1:java>
6.696 </target>
6.697 <!--
6.698 - =========================
6.699 - APPLET DEBUGGING SECTION
6.700 - =========================
6.701 - -->
6.702 - <target name="-debug-start-debuggee-applet" if="netbeans.home" depends="init,compile-single">
6.703 + =========================
6.704 + APPLET DEBUGGING SECTION
6.705 + =========================
6.706 + -->
6.707 + <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-applet">
6.708 <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
6.709 <j2seproject3:debug classname="sun.applet.AppletViewer">
6.710 <customize>
6.711 @@ -528,14 +608,14 @@
6.712 </customize>
6.713 </j2seproject3:debug>
6.714 </target>
6.715 - <target name="debug-applet" if="netbeans.home" depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-applet"/>
6.716 + <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-applet" if="netbeans.home" name="debug-applet"/>
6.717 <!--
6.718 - ===============
6.719 - CLEANUP SECTION
6.720 - ===============
6.721 - -->
6.722 - <target name="deps-clean" depends="init" unless="no.deps"/>
6.723 - <target name="-do-clean" depends="init">
6.724 + ===============
6.725 + CLEANUP SECTION
6.726 + ===============
6.727 + -->
6.728 + <target depends="init" name="deps-clean" unless="no.deps"/>
6.729 + <target depends="init" name="-do-clean">
6.730 <delete dir="${build.dir}"/>
6.731 <delete dir="${dist.dir}"/>
6.732 </target>
6.733 @@ -543,5 +623,5 @@
6.734 <!-- Empty placeholder for easier customization. -->
6.735 <!-- You can override this target in the ../build.xml file. -->
6.736 </target>
6.737 - <target name="clean" depends="init,deps-clean,-do-clean,-post-clean" description="Clean build products."/>
6.738 + <target depends="init,deps-clean,-do-clean,-post-clean" description="Clean build products." name="clean"/>
6.739 </project>
7.1 --- a/samples/apifest1/day2/subclassingsolution/nbproject/genfiles.properties Sat Jun 14 09:52:47 2008 +0200
7.2 +++ b/samples/apifest1/day2/subclassingsolution/nbproject/genfiles.properties Sat Jun 14 09:52:48 2008 +0200
7.3 @@ -4,5 +4,5 @@
7.4 # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
7.5 # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
7.6 nbproject/build-impl.xml.data.CRC32=0f6dc18a
7.7 -nbproject/build-impl.xml.script.CRC32=079f4b62
7.8 -nbproject/build-impl.xml.stylesheet.CRC32=c10f1eac
7.9 +nbproject/build-impl.xml.script.CRC32=fde9979b
7.10 +nbproject/build-impl.xml.stylesheet.CRC32=f1d9da08
8.1 --- a/samples/apifest1/day2/subclassingsolution/nbproject/project.properties Sat Jun 14 09:52:47 2008 +0200
8.2 +++ b/samples/apifest1/day2/subclassingsolution/nbproject/project.properties Sat Jun 14 09:52:48 2008 +0200
8.3 @@ -15,6 +15,8 @@
8.4 dist.dir=dist
8.5 dist.jar=${dist.dir}/boolcircuit.jar
8.6 dist.javadoc.dir=${dist.dir}/javadoc
8.7 +excludes=
8.8 +includes=**
8.9 jar.compress=false
8.10 javac.classpath=
8.11 # Space-separated list of extra javac options
9.1 --- a/samples/apifest1/day2/subclassingsolution/nbproject/project.xml Sat Jun 14 09:52:47 2008 +0200
9.2 +++ b/samples/apifest1/day2/subclassingsolution/nbproject/project.xml Sat Jun 14 09:52:48 2008 +0200
9.3 @@ -3,7 +3,7 @@
9.4 <type>org.netbeans.modules.java.j2seproject</type>
9.5 <configuration>
9.6 <data xmlns="http://www.netbeans.org/ns/j2se-project/3">
9.7 - <name>subclassingsolution</name>
9.8 + <name>subclassingsolution - day2</name>
9.9 <minimum-ant-version>1.6.5</minimum-ant-version>
9.10 <source-roots>
9.11 <root id="src.dir"/>
10.1 --- a/samples/apifest1/day2/subclassingsolution/src/org/netbeans/apifest/boolcircuit/FuzzyCircuit.java Sat Jun 14 09:52:47 2008 +0200
10.2 +++ b/samples/apifest1/day2/subclassingsolution/src/org/netbeans/apifest/boolcircuit/FuzzyCircuit.java Sat Jun 14 09:52:48 2008 +0200
10.3 @@ -9,10 +9,6 @@
10.4
10.5 package org.netbeans.apifest.boolcircuit;
10.6
10.7 -/**
10.8 - *
10.9 - * @author phrebejk
10.10 - */
10.11 public abstract class FuzzyCircuit extends Circuit {
10.12
10.13 /** Feel free to implement and don't hesitate to throw IllegalArgumentEception
11.1 --- a/samples/apifest1/day2/welltestedsolution/nbproject/build-impl.xml Sat Jun 14 09:52:47 2008 +0200
11.2 +++ b/samples/apifest1/day2/welltestedsolution/nbproject/build-impl.xml Sat Jun 14 09:52:48 2008 +0200
11.3 @@ -18,32 +18,35 @@
11.4 - applet
11.5 - cleanup
11.6
11.7 --->
11.8 -<project name="welltestedsolution-impl" default="default" basedir=".." xmlns:j2seproject3="http://www.netbeans.org/ns/j2se-project/3" xmlns:j2seproject2="http://www.netbeans.org/ns/j2se-project/2" xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1">
11.9 - <target name="default" depends="test,jar,javadoc" description="Build and test whole project."/>
11.10 + -->
11.11 +<project xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1" xmlns:j2seproject2="http://www.netbeans.org/ns/j2se-project/2" xmlns:j2seproject3="http://www.netbeans.org/ns/j2se-project/3" xmlns:jaxrpc="http://www.netbeans.org/ns/j2se-project/jax-rpc" basedir=".." default="default" name="welltestedsolution-impl">
11.12 + <target depends="test,jar,javadoc" description="Build and test whole project." name="default"/>
11.13 <!--
11.14 - ======================
11.15 - INITIALIZATION SECTION
11.16 - ======================
11.17 - -->
11.18 + ======================
11.19 + INITIALIZATION SECTION
11.20 + ======================
11.21 + -->
11.22 <target name="-pre-init">
11.23 <!-- Empty placeholder for easier customization. -->
11.24 <!-- You can override this target in the ../build.xml file. -->
11.25 </target>
11.26 - <target name="-init-private" depends="-pre-init">
11.27 + <target depends="-pre-init" name="-init-private">
11.28 + <property file="nbproject/private/config.properties"/>
11.29 + <property file="nbproject/private/configs/${config}.properties"/>
11.30 <property file="nbproject/private/private.properties"/>
11.31 </target>
11.32 - <target name="-init-user" depends="-pre-init,-init-private">
11.33 + <target depends="-pre-init,-init-private" name="-init-user">
11.34 <property file="${user.properties.file}"/>
11.35 <!-- The two properties below are usually overridden -->
11.36 <!-- by the active platform. Just a fallback. -->
11.37 <property name="default.javac.source" value="1.4"/>
11.38 <property name="default.javac.target" value="1.4"/>
11.39 </target>
11.40 - <target name="-init-project" depends="-pre-init,-init-private,-init-user">
11.41 + <target depends="-pre-init,-init-private,-init-user" name="-init-project">
11.42 + <property file="nbproject/configs/${config}.properties"/>
11.43 <property file="nbproject/project.properties"/>
11.44 </target>
11.45 - <target name="-do-init" depends="-pre-init,-init-private,-init-user,-init-project,-init-macrodef-property">
11.46 + <target depends="-pre-init,-init-private,-init-user,-init-project,-init-macrodef-property" name="-do-init">
11.47 <available file="${manifest.file}" property="manifest.available"/>
11.48 <condition property="manifest.available+main.class">
11.49 <and>
11.50 @@ -77,7 +80,10 @@
11.51 </and>
11.52 </condition>
11.53 <condition property="no.javadoc.preview">
11.54 - <isfalse value="${javadoc.preview}"/>
11.55 + <and>
11.56 + <isset property="javadoc.preview"/>
11.57 + <isfalse value="${javadoc.preview}"/>
11.58 + </and>
11.59 </condition>
11.60 <property name="run.jvmargs" value=""/>
11.61 <property name="javac.compilerargs" value=""/>
11.62 @@ -90,12 +96,34 @@
11.63 <property name="javac.debug" value="true"/>
11.64 <property name="javadoc.preview" value="true"/>
11.65 <property name="application.args" value=""/>
11.66 + <property name="source.encoding" value="${file.encoding}"/>
11.67 + <condition property="javadoc.encoding.used" value="${javadoc.encoding}">
11.68 + <and>
11.69 + <isset property="javadoc.encoding"/>
11.70 + <not>
11.71 + <equals arg1="${javadoc.encoding}" arg2=""/>
11.72 + </not>
11.73 + </and>
11.74 + </condition>
11.75 + <property name="javadoc.encoding.used" value="${source.encoding}"/>
11.76 + <property name="includes" value="**"/>
11.77 + <property name="excludes" value=""/>
11.78 + <property name="do.depend" value="false"/>
11.79 + <condition property="do.depend.true">
11.80 + <istrue value="${do.depend}"/>
11.81 + </condition>
11.82 + <condition else="" property="javac.compilerargs.jaxws" value="-Djava.endorsed.dirs='${jaxws.endorsed.dir}'">
11.83 + <and>
11.84 + <isset property="jaxws.endorsed.dir"/>
11.85 + <available file="nbproject/jaxws-build.xml"/>
11.86 + </and>
11.87 + </condition>
11.88 </target>
11.89 <target name="-post-init">
11.90 <!-- Empty placeholder for easier customization. -->
11.91 <!-- You can override this target in the ../build.xml file. -->
11.92 </target>
11.93 - <target name="-init-check" depends="-pre-init,-init-private,-init-user,-init-project,-do-init">
11.94 + <target depends="-pre-init,-init-private,-init-user,-init-project,-do-init" name="-init-check">
11.95 <fail unless="src.dir">Must set src.dir</fail>
11.96 <fail unless="test.src.dir">Must set test.src.dir</fail>
11.97 <fail unless="build.dir">Must set build.dir</fail>
11.98 @@ -118,41 +146,70 @@
11.99 </target>
11.100 <target name="-init-macrodef-javac">
11.101 <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
11.102 - <attribute name="srcdir" default="${src.dir}"/>
11.103 - <attribute name="destdir" default="${build.classes.dir}"/>
11.104 - <attribute name="classpath" default="${javac.classpath}"/>
11.105 - <attribute name="debug" default="${javac.debug}"/>
11.106 + <attribute default="${src.dir}" name="srcdir"/>
11.107 + <attribute default="${build.classes.dir}" name="destdir"/>
11.108 + <attribute default="${javac.classpath}" name="classpath"/>
11.109 + <attribute default="${includes}" name="includes"/>
11.110 + <attribute default="${excludes}" name="excludes"/>
11.111 + <attribute default="${javac.debug}" name="debug"/>
11.112 + <attribute default="" name="sourcepath"/>
11.113 <element name="customize" optional="true"/>
11.114 <sequential>
11.115 - <depend srcdir="@{srcdir}" destdir="@{destdir}" cache="${build.dir}/depcache">
11.116 + <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}">
11.117 + <classpath>
11.118 + <path path="@{classpath}"/>
11.119 + </classpath>
11.120 + <compilerarg line="${javac.compilerargs} ${javac.compilerargs.jaxws}"/>
11.121 + <customize/>
11.122 + </javac>
11.123 + </sequential>
11.124 + </macrodef>
11.125 + <macrodef name="depend" uri="http://www.netbeans.org/ns/j2se-project/3">
11.126 + <attribute default="${src.dir}" name="srcdir"/>
11.127 + <attribute default="${build.classes.dir}" name="destdir"/>
11.128 + <attribute default="${javac.classpath}" name="classpath"/>
11.129 + <sequential>
11.130 + <depend cache="${build.dir}/depcache" destdir="@{destdir}" excludes="${excludes}" includes="${includes}" srcdir="@{srcdir}">
11.131 <classpath>
11.132 <path path="@{classpath}"/>
11.133 </classpath>
11.134 </depend>
11.135 - <javac srcdir="@{srcdir}" destdir="@{destdir}" debug="@{debug}" deprecation="${javac.deprecation}" source="${javac.source}" target="${javac.target}" includeantruntime="false">
11.136 - <classpath>
11.137 - <path path="@{classpath}"/>
11.138 - </classpath>
11.139 - <compilerarg line="${javac.compilerargs}"/>
11.140 - <customize/>
11.141 - </javac>
11.142 + </sequential>
11.143 + </macrodef>
11.144 + <macrodef name="force-recompile" uri="http://www.netbeans.org/ns/j2se-project/3">
11.145 + <attribute default="${build.classes.dir}" name="destdir"/>
11.146 + <sequential>
11.147 + <fail unless="javac.includes">Must set javac.includes</fail>
11.148 + <pathconvert pathsep="," property="javac.includes.binary">
11.149 + <path>
11.150 + <filelist dir="@{destdir}" files="${javac.includes}"/>
11.151 + </path>
11.152 + <globmapper from="*.java" to="*.class"/>
11.153 + </pathconvert>
11.154 + <delete>
11.155 + <files includes="${javac.includes.binary}"/>
11.156 + </delete>
11.157 </sequential>
11.158 </macrodef>
11.159 </target>
11.160 <target name="-init-macrodef-junit">
11.161 <macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3">
11.162 - <attribute name="includes" default="**/*Test.java"/>
11.163 + <attribute default="${includes}" name="includes"/>
11.164 + <attribute default="${excludes}" name="excludes"/>
11.165 + <attribute default="**" name="testincludes"/>
11.166 <sequential>
11.167 - <junit showoutput="true" fork="true" dir="${basedir}" failureproperty="tests.failed" errorproperty="tests.failed">
11.168 + <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" showoutput="true">
11.169 <batchtest todir="${build.test.results.dir}">
11.170 - <fileset dir="${test.src.dir}" includes="@{includes}"/>
11.171 + <fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
11.172 + <filename name="@{testincludes}"/>
11.173 + </fileset>
11.174 </batchtest>
11.175 <classpath>
11.176 <path path="${run.test.classpath}"/>
11.177 </classpath>
11.178 <syspropertyset>
11.179 <propertyref prefix="test-sys-prop."/>
11.180 - <mapper type="glob" from="test-sys-prop.*" to="*"/>
11.181 + <mapper from="test-sys-prop.*" to="*" type="glob"/>
11.182 </syspropertyset>
11.183 <formatter type="brief" usefile="false"/>
11.184 <formatter type="xml"/>
11.185 @@ -163,11 +220,11 @@
11.186 </target>
11.187 <target name="-init-macrodef-nbjpda">
11.188 <macrodef name="nbjpdastart" uri="http://www.netbeans.org/ns/j2se-project/1">
11.189 - <attribute name="name" default="${main.class}"/>
11.190 - <attribute name="classpath" default="${debug.classpath}"/>
11.191 - <attribute name="stopclassname" default=""/>
11.192 + <attribute default="${main.class}" name="name"/>
11.193 + <attribute default="${debug.classpath}" name="classpath"/>
11.194 + <attribute default="" name="stopclassname"/>
11.195 <sequential>
11.196 - <nbjpdastart transport="dt_socket" addressproperty="jpda.address" name="@{name}" stopclassname="@{stopclassname}">
11.197 + <nbjpdastart addressproperty="jpda.address" name="@{name}" stopclassname="@{stopclassname}" transport="dt_socket">
11.198 <classpath>
11.199 <path path="@{classpath}"/>
11.200 </classpath>
11.201 @@ -175,24 +232,36 @@
11.202 </sequential>
11.203 </macrodef>
11.204 <macrodef name="nbjpdareload" uri="http://www.netbeans.org/ns/j2se-project/1">
11.205 - <attribute name="dir" default="${build.classes.dir}"/>
11.206 + <attribute default="${build.classes.dir}" name="dir"/>
11.207 <sequential>
11.208 <nbjpdareload>
11.209 - <fileset includes="${fix.includes}*.class" dir="@{dir}"/>
11.210 + <fileset dir="@{dir}" includes="${fix.includes}*.class"/>
11.211 </nbjpdareload>
11.212 </sequential>
11.213 </macrodef>
11.214 </target>
11.215 - <target name="-init-macrodef-debug">
11.216 + <target name="-init-debug-args">
11.217 + <property name="version-output" value="java version "${ant.java.version}"/>
11.218 + <condition property="have-jdk-older-than-1.4">
11.219 + <or>
11.220 + <contains string="${version-output}" substring="java version "1.0"/>
11.221 + <contains string="${version-output}" substring="java version "1.1"/>
11.222 + <contains string="${version-output}" substring="java version "1.2"/>
11.223 + <contains string="${version-output}" substring="java version "1.3"/>
11.224 + </or>
11.225 + </condition>
11.226 + <condition else="-Xdebug" property="debug-args-line" value="-Xdebug -Xnoagent -Djava.compiler=none">
11.227 + <istrue value="${have-jdk-older-than-1.4}"/>
11.228 + </condition>
11.229 + </target>
11.230 + <target depends="-init-debug-args" name="-init-macrodef-debug">
11.231 <macrodef name="debug" uri="http://www.netbeans.org/ns/j2se-project/3">
11.232 - <attribute name="classname" default="${main.class}"/>
11.233 - <attribute name="classpath" default="${debug.classpath}"/>
11.234 + <attribute default="${main.class}" name="classname"/>
11.235 + <attribute default="${debug.classpath}" name="classpath"/>
11.236 <element name="customize" optional="true"/>
11.237 <sequential>
11.238 - <java fork="true" classname="@{classname}" dir="${work.dir}">
11.239 - <jvmarg value="-Xdebug"/>
11.240 - <jvmarg value="-Xnoagent"/>
11.241 - <jvmarg value="-Djava.compiler=none"/>
11.242 + <java classname="@{classname}" dir="${work.dir}" fork="true">
11.243 + <jvmarg line="${debug-args-line}"/>
11.244 <jvmarg value="-Xrunjdwp:transport=dt_socket,address=${jpda.address}"/>
11.245 <jvmarg line="${run.jvmargs}"/>
11.246 <classpath>
11.247 @@ -200,7 +269,7 @@
11.248 </classpath>
11.249 <syspropertyset>
11.250 <propertyref prefix="run-sys-prop."/>
11.251 - <mapper type="glob" from="run-sys-prop.*" to="*"/>
11.252 + <mapper from="run-sys-prop.*" to="*" type="glob"/>
11.253 </syspropertyset>
11.254 <customize/>
11.255 </java>
11.256 @@ -209,17 +278,17 @@
11.257 </target>
11.258 <target name="-init-macrodef-java">
11.259 <macrodef name="java" uri="http://www.netbeans.org/ns/j2se-project/1">
11.260 - <attribute name="classname" default="${main.class}"/>
11.261 + <attribute default="${main.class}" name="classname"/>
11.262 <element name="customize" optional="true"/>
11.263 <sequential>
11.264 - <java fork="true" classname="@{classname}" dir="${work.dir}">
11.265 + <java classname="@{classname}" dir="${work.dir}" fork="true">
11.266 <jvmarg line="${run.jvmargs}"/>
11.267 <classpath>
11.268 <path path="${run.classpath}"/>
11.269 </classpath>
11.270 <syspropertyset>
11.271 <propertyref prefix="run-sys-prop."/>
11.272 - <mapper type="glob" from="run-sys-prop.*" to="*"/>
11.273 + <mapper from="run-sys-prop.*" to="*" type="glob"/>
11.274 </syspropertyset>
11.275 <customize/>
11.276 </java>
11.277 @@ -228,102 +297,102 @@
11.278 </target>
11.279 <target name="-init-presetdef-jar">
11.280 <presetdef name="jar" uri="http://www.netbeans.org/ns/j2se-project/1">
11.281 - <jar jarfile="${dist.jar}" compress="${jar.compress}">
11.282 + <jar compress="${jar.compress}" jarfile="${dist.jar}">
11.283 <j2seproject1:fileset dir="${build.classes.dir}"/>
11.284 </jar>
11.285 </presetdef>
11.286 </target>
11.287 - <target name="init" depends="-pre-init,-init-private,-init-user,-init-project,-do-init,-post-init,-init-check,-init-macrodef-property,-init-macrodef-javac,-init-macrodef-junit,-init-macrodef-nbjpda,-init-macrodef-debug,-init-macrodef-java,-init-presetdef-jar"/>
11.288 + <target depends="-pre-init,-init-private,-init-user,-init-project,-do-init,-post-init,-init-check,-init-macrodef-property,-init-macrodef-javac,-init-macrodef-junit,-init-macrodef-nbjpda,-init-macrodef-debug,-init-macrodef-java,-init-presetdef-jar" name="init"/>
11.289 <!--
11.290 - ===================
11.291 - COMPILATION SECTION
11.292 - ===================
11.293 - -->
11.294 - <target name="deps-jar" depends="init" unless="no.deps"/>
11.295 - <target name="-pre-pre-compile" depends="init,deps-jar">
11.296 + ===================
11.297 + COMPILATION SECTION
11.298 + ===================
11.299 + -->
11.300 + <target depends="init" name="deps-jar" unless="no.deps"/>
11.301 + <target depends="init,deps-jar" name="-pre-pre-compile">
11.302 <mkdir dir="${build.classes.dir}"/>
11.303 </target>
11.304 <target name="-pre-compile">
11.305 <!-- Empty placeholder for easier customization. -->
11.306 <!-- You can override this target in the ../build.xml file. -->
11.307 </target>
11.308 - <target name="-do-compile" depends="init,deps-jar,-pre-pre-compile,-pre-compile" if="have.sources">
11.309 + <target if="do.depend.true" name="-compile-depend">
11.310 + <j2seproject3:depend/>
11.311 + </target>
11.312 + <target depends="init,deps-jar,-pre-pre-compile,-pre-compile,-compile-depend" if="have.sources" name="-do-compile">
11.313 <j2seproject3:javac/>
11.314 <copy todir="${build.classes.dir}">
11.315 - <fileset dir="${src.dir}" excludes="${build.classes.excludes}"/>
11.316 + <fileset dir="${src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
11.317 </copy>
11.318 </target>
11.319 <target name="-post-compile">
11.320 <!-- Empty placeholder for easier customization. -->
11.321 <!-- You can override this target in the ../build.xml file. -->
11.322 </target>
11.323 - <target name="compile" depends="init,deps-jar,-pre-pre-compile,-pre-compile,-do-compile,-post-compile" description="Compile project."/>
11.324 + <target depends="init,deps-jar,-pre-pre-compile,-pre-compile,-do-compile,-post-compile" description="Compile project." name="compile"/>
11.325 <target name="-pre-compile-single">
11.326 <!-- Empty placeholder for easier customization. -->
11.327 <!-- You can override this target in the ../build.xml file. -->
11.328 </target>
11.329 - <target name="-do-compile-single" depends="init,deps-jar,-pre-pre-compile">
11.330 + <target depends="init,deps-jar,-pre-pre-compile" name="-do-compile-single">
11.331 <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
11.332 - <j2seproject3:javac>
11.333 - <customize>
11.334 - <patternset includes="${javac.includes}"/>
11.335 - </customize>
11.336 - </j2seproject3:javac>
11.337 + <j2seproject3:force-recompile/>
11.338 + <j2seproject3:javac excludes="" includes="${javac.includes}" sourcepath="${src.dir}"/>
11.339 </target>
11.340 <target name="-post-compile-single">
11.341 <!-- Empty placeholder for easier customization. -->
11.342 <!-- You can override this target in the ../build.xml file. -->
11.343 </target>
11.344 - <target name="compile-single" depends="init,deps-jar,-pre-pre-compile,-pre-compile-single,-do-compile-single,-post-compile-single"/>
11.345 + <target depends="init,deps-jar,-pre-pre-compile,-pre-compile-single,-do-compile-single,-post-compile-single" name="compile-single"/>
11.346 <!--
11.347 - ====================
11.348 - JAR BUILDING SECTION
11.349 - ====================
11.350 - -->
11.351 - <target name="-pre-pre-jar" depends="init">
11.352 - <dirname property="dist.jar.dir" file="${dist.jar}"/>
11.353 + ====================
11.354 + JAR BUILDING SECTION
11.355 + ====================
11.356 + -->
11.357 + <target depends="init" name="-pre-pre-jar">
11.358 + <dirname file="${dist.jar}" property="dist.jar.dir"/>
11.359 <mkdir dir="${dist.jar.dir}"/>
11.360 </target>
11.361 <target name="-pre-jar">
11.362 <!-- Empty placeholder for easier customization. -->
11.363 <!-- You can override this target in the ../build.xml file. -->
11.364 </target>
11.365 - <target name="-do-jar-without-manifest" depends="init,compile,-pre-pre-jar,-pre-jar" unless="manifest.available">
11.366 + <target depends="init,compile,-pre-pre-jar,-pre-jar" name="-do-jar-without-manifest" unless="manifest.available">
11.367 <j2seproject1:jar/>
11.368 </target>
11.369 - <target name="-do-jar-with-manifest" depends="init,compile,-pre-pre-jar,-pre-jar" if="manifest.available" unless="manifest.available+main.class">
11.370 + <target depends="init,compile,-pre-pre-jar,-pre-jar" if="manifest.available" name="-do-jar-with-manifest" unless="manifest.available+main.class">
11.371 <j2seproject1:jar manifest="${manifest.file}"/>
11.372 </target>
11.373 - <target name="-do-jar-with-mainclass" depends="init,compile,-pre-pre-jar,-pre-jar" if="manifest.available+main.class" unless="manifest.available+main.class+mkdist.available">
11.374 + <target depends="init,compile,-pre-pre-jar,-pre-jar" if="manifest.available+main.class" name="-do-jar-with-mainclass" unless="manifest.available+main.class+mkdist.available">
11.375 <j2seproject1:jar manifest="${manifest.file}">
11.376 <j2seproject1:manifest>
11.377 <j2seproject1:attribute name="Main-Class" value="${main.class}"/>
11.378 </j2seproject1:manifest>
11.379 </j2seproject1:jar>
11.380 <echo>To run this application from the command line without Ant, try:</echo>
11.381 - <property name="build.classes.dir.resolved" location="${build.classes.dir}"/>
11.382 - <property name="dist.jar.resolved" location="${dist.jar}"/>
11.383 + <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
11.384 + <property location="${dist.jar}" name="dist.jar.resolved"/>
11.385 <pathconvert property="run.classpath.with.dist.jar">
11.386 <path path="${run.classpath}"/>
11.387 <map from="${build.classes.dir.resolved}" to="${dist.jar.resolved}"/>
11.388 </pathconvert>
11.389 <echo>java -cp "${run.classpath.with.dist.jar}" ${main.class}</echo>
11.390 </target>
11.391 - <target name="-do-jar-with-libraries" depends="init,compile,-pre-pre-jar,-pre-jar" if="manifest.available+main.class+mkdist.available">
11.392 - <property name="build.classes.dir.resolved" location="${build.classes.dir}"/>
11.393 + <target depends="init,compile,-pre-pre-jar,-pre-jar" if="manifest.available+main.class+mkdist.available" name="-do-jar-with-libraries">
11.394 + <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
11.395 <pathconvert property="run.classpath.without.build.classes.dir">
11.396 <path path="${run.classpath}"/>
11.397 <map from="${build.classes.dir.resolved}" to=""/>
11.398 </pathconvert>
11.399 - <pathconvert property="jar.classpath" pathsep=" ">
11.400 + <pathconvert pathsep=" " property="jar.classpath">
11.401 <path path="${run.classpath.without.build.classes.dir}"/>
11.402 <chainedmapper>
11.403 <flattenmapper/>
11.404 <globmapper from="*" to="lib/*"/>
11.405 </chainedmapper>
11.406 </pathconvert>
11.407 - <taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" name="copylibs" classpath="${libs.CopyLibs.classpath}"/>
11.408 - <copylibs manifest="${manifest.file}" runtimeclasspath="${run.classpath.without.build.classes.dir}" jarfile="${dist.jar}" compress="${jar.compress}">
11.409 + <taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/>
11.410 + <copylibs compress="${jar.compress}" jarfile="${dist.jar}" manifest="${manifest.file}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
11.411 <fileset dir="${build.classes.dir}"/>
11.412 <manifest>
11.413 <attribute name="Main-Class" value="${main.class}"/>
11.414 @@ -331,183 +400,194 @@
11.415 </manifest>
11.416 </copylibs>
11.417 <echo>To run this application from the command line without Ant, try:</echo>
11.418 - <property name="dist.jar.resolved" location="${dist.jar}"/>
11.419 + <property location="${dist.jar}" name="dist.jar.resolved"/>
11.420 <echo>java -jar "${dist.jar.resolved}"</echo>
11.421 </target>
11.422 <target name="-post-jar">
11.423 <!-- Empty placeholder for easier customization. -->
11.424 <!-- You can override this target in the ../build.xml file. -->
11.425 </target>
11.426 - <target name="jar" depends="init,compile,-pre-jar,-do-jar-with-manifest,-do-jar-without-manifest,-do-jar-with-mainclass,-do-jar-with-libraries,-post-jar" description="Build JAR."/>
11.427 + <target depends="init,compile,-pre-jar,-do-jar-with-manifest,-do-jar-without-manifest,-do-jar-with-mainclass,-do-jar-with-libraries,-post-jar" description="Build JAR." name="jar"/>
11.428 <!--
11.429 - =================
11.430 - EXECUTION SECTION
11.431 - =================
11.432 - -->
11.433 - <target name="run" depends="init,compile" description="Run a main class.">
11.434 + =================
11.435 + EXECUTION SECTION
11.436 + =================
11.437 + -->
11.438 + <target depends="init,compile" description="Run a main class." name="run">
11.439 <j2seproject1:java>
11.440 <customize>
11.441 <arg line="${application.args}"/>
11.442 </customize>
11.443 </j2seproject1:java>
11.444 </target>
11.445 - <target name="run-single" depends="init,compile-single">
11.446 + <target name="-do-not-recompile">
11.447 + <property name="javac.includes.binary" value=""/>
11.448 + </target>
11.449 + <target depends="init,-do-not-recompile,compile-single" name="run-single">
11.450 <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
11.451 <j2seproject1:java classname="${run.class}"/>
11.452 </target>
11.453 <!--
11.454 - =================
11.455 - DEBUGGING SECTION
11.456 - =================
11.457 - -->
11.458 - <target name="-debug-start-debugger" if="netbeans.home" depends="init">
11.459 + =================
11.460 + DEBUGGING SECTION
11.461 + =================
11.462 + -->
11.463 + <target depends="init" if="netbeans.home" name="-debug-start-debugger">
11.464 <j2seproject1:nbjpdastart name="${debug.class}"/>
11.465 </target>
11.466 - <target name="-debug-start-debuggee" depends="init,compile">
11.467 + <target depends="init,compile" name="-debug-start-debuggee">
11.468 <j2seproject3:debug>
11.469 <customize>
11.470 <arg line="${application.args}"/>
11.471 </customize>
11.472 </j2seproject3:debug>
11.473 </target>
11.474 - <target name="debug" if="netbeans.home" depends="init,compile,-debug-start-debugger,-debug-start-debuggee" description="Debug project in IDE."/>
11.475 - <target name="-debug-start-debugger-stepinto" if="netbeans.home" depends="init">
11.476 + <target depends="init,compile,-debug-start-debugger,-debug-start-debuggee" description="Debug project in IDE." if="netbeans.home" name="debug"/>
11.477 + <target depends="init" if="netbeans.home" name="-debug-start-debugger-stepinto">
11.478 <j2seproject1:nbjpdastart stopclassname="${main.class}"/>
11.479 </target>
11.480 - <target name="debug-stepinto" if="netbeans.home" depends="init,compile,-debug-start-debugger-stepinto,-debug-start-debuggee"/>
11.481 - <target name="-debug-start-debuggee-single" if="netbeans.home" depends="init,compile-single">
11.482 + <target depends="init,compile,-debug-start-debugger-stepinto,-debug-start-debuggee" if="netbeans.home" name="debug-stepinto"/>
11.483 + <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-single">
11.484 <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
11.485 <j2seproject3:debug classname="${debug.class}"/>
11.486 </target>
11.487 - <target name="debug-single" if="netbeans.home" depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-single"/>
11.488 - <target name="-pre-debug-fix" depends="init">
11.489 + <target depends="init,-do-not-recompile,compile-single,-debug-start-debugger,-debug-start-debuggee-single" if="netbeans.home" name="debug-single"/>
11.490 + <target depends="init" name="-pre-debug-fix">
11.491 <fail unless="fix.includes">Must set fix.includes</fail>
11.492 <property name="javac.includes" value="${fix.includes}.java"/>
11.493 </target>
11.494 - <target name="-do-debug-fix" if="netbeans.home" depends="init,-pre-debug-fix,compile-single">
11.495 + <target depends="init,-pre-debug-fix,compile-single" if="netbeans.home" name="-do-debug-fix">
11.496 <j2seproject1:nbjpdareload/>
11.497 </target>
11.498 - <target name="debug-fix" if="netbeans.home" depends="init,-pre-debug-fix,-do-debug-fix"/>
11.499 + <target depends="init,-pre-debug-fix,-do-debug-fix" if="netbeans.home" name="debug-fix"/>
11.500 <!--
11.501 - ===============
11.502 - JAVADOC SECTION
11.503 - ===============
11.504 - -->
11.505 - <target name="-javadoc-build" depends="init">
11.506 + ===============
11.507 + JAVADOC SECTION
11.508 + ===============
11.509 + -->
11.510 + <target depends="init" name="-javadoc-build">
11.511 <mkdir dir="${dist.javadoc.dir}"/>
11.512 - <javadoc destdir="${dist.javadoc.dir}" source="${javac.source}" notree="${javadoc.notree}" use="${javadoc.use}" nonavbar="${javadoc.nonavbar}" noindex="${javadoc.noindex}" splitindex="${javadoc.splitindex}" author="${javadoc.author}" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}" private="${javadoc.private}" additionalparam="${javadoc.additionalparam}" failonerror="true" useexternalfile="true">
11.513 + <javadoc additionalparam="${javadoc.additionalparam}" author="${javadoc.author}" charset="UTF-8" destdir="${dist.javadoc.dir}" docencoding="UTF-8" encoding="${javadoc.encoding.used}" failonerror="true" noindex="${javadoc.noindex}" nonavbar="${javadoc.nonavbar}" notree="${javadoc.notree}" private="${javadoc.private}" source="${javac.source}" splitindex="${javadoc.splitindex}" use="${javadoc.use}" useexternalfile="true" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}">
11.514 <classpath>
11.515 <path path="${javac.classpath}"/>
11.516 </classpath>
11.517 - <sourcepath>
11.518 - <pathelement location="${src.dir}"/>
11.519 - </sourcepath>
11.520 - <packageset dir="${src.dir}" includes="*/**"/>
11.521 - <fileset dir="${src.dir}" includes="*.java"/>
11.522 + <fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
11.523 + <filename name="**/*.java"/>
11.524 + </fileset>
11.525 </javadoc>
11.526 </target>
11.527 - <target name="-javadoc-browse" if="netbeans.home" unless="no.javadoc.preview" depends="init,-javadoc-build">
11.528 + <target depends="init,-javadoc-build" if="netbeans.home" name="-javadoc-browse" unless="no.javadoc.preview">
11.529 <nbbrowse file="${dist.javadoc.dir}/index.html"/>
11.530 </target>
11.531 - <target name="javadoc" depends="init,-javadoc-build,-javadoc-browse" description="Build Javadoc."/>
11.532 + <target depends="init,-javadoc-build,-javadoc-browse" description="Build Javadoc." name="javadoc"/>
11.533 <!--
11.534 - =========================
11.535 - JUNIT COMPILATION SECTION
11.536 - =========================
11.537 - -->
11.538 - <target name="-pre-pre-compile-test" if="have.tests" depends="init,compile">
11.539 + =========================
11.540 + JUNIT COMPILATION SECTION
11.541 + =========================
11.542 + -->
11.543 + <target depends="init,compile" if="have.tests" name="-pre-pre-compile-test">
11.544 <mkdir dir="${build.test.classes.dir}"/>
11.545 </target>
11.546 <target name="-pre-compile-test">
11.547 <!-- Empty placeholder for easier customization. -->
11.548 <!-- You can override this target in the ../build.xml file. -->
11.549 </target>
11.550 - <target name="-do-compile-test" if="have.tests" depends="init,compile,-pre-pre-compile-test,-pre-compile-test">
11.551 - <j2seproject3:javac srcdir="${test.src.dir}" destdir="${build.test.classes.dir}" debug="true" classpath="${javac.test.classpath}"/>
11.552 + <target if="do.depend.true" name="-compile-test-depend">
11.553 + <j2seproject3:depend classpath="${javac.test.classpath}" destdir="${build.test.classes.dir}" srcdir="${test.src.dir}"/>
11.554 + </target>
11.555 + <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-compile-test-depend" if="have.tests" name="-do-compile-test">
11.556 + <j2seproject3:javac classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" srcdir="${test.src.dir}"/>
11.557 <copy todir="${build.test.classes.dir}">
11.558 - <fileset dir="${test.src.dir}" excludes="**/*.java"/>
11.559 + <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
11.560 </copy>
11.561 </target>
11.562 <target name="-post-compile-test">
11.563 <!-- Empty placeholder for easier customization. -->
11.564 <!-- You can override this target in the ../build.xml file. -->
11.565 </target>
11.566 - <target name="compile-test" depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-do-compile-test,-post-compile-test"/>
11.567 + <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-do-compile-test,-post-compile-test" name="compile-test"/>
11.568 <target name="-pre-compile-test-single">
11.569 <!-- Empty placeholder for easier customization. -->
11.570 <!-- You can override this target in the ../build.xml file. -->
11.571 </target>
11.572 - <target name="-do-compile-test-single" if="have.tests" depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single">
11.573 + <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single" if="have.tests" name="-do-compile-test-single">
11.574 <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
11.575 - <j2seproject3:javac srcdir="${test.src.dir}" destdir="${build.test.classes.dir}" debug="true" classpath="${javac.test.classpath}">
11.576 - <customize>
11.577 - <patternset includes="${javac.includes}"/>
11.578 - </customize>
11.579 - </j2seproject3:javac>
11.580 + <j2seproject3:force-recompile destdir="${build.test.classes.dir}"/>
11.581 + <j2seproject3:javac classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" excludes="" includes="${javac.includes}" sourcepath="${test.src.dir}" srcdir="${test.src.dir}"/>
11.582 <copy todir="${build.test.classes.dir}">
11.583 - <fileset dir="${test.src.dir}" excludes="**/*.java"/>
11.584 + <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
11.585 </copy>
11.586 </target>
11.587 <target name="-post-compile-test-single">
11.588 <!-- Empty placeholder for easier customization. -->
11.589 <!-- You can override this target in the ../build.xml file. -->
11.590 </target>
11.591 - <target name="compile-test-single" depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single,-do-compile-test-single,-post-compile-test-single"/>
11.592 + <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single,-do-compile-test-single,-post-compile-test-single" name="compile-test-single"/>
11.593 <!--
11.594 - =======================
11.595 - JUNIT EXECUTION SECTION
11.596 - =======================
11.597 - -->
11.598 - <target name="-pre-test-run" if="have.tests" depends="init">
11.599 + =======================
11.600 + JUNIT EXECUTION SECTION
11.601 + =======================
11.602 + -->
11.603 + <target depends="init" if="have.tests" name="-pre-test-run">
11.604 <mkdir dir="${build.test.results.dir}"/>
11.605 </target>
11.606 - <target name="-do-test-run" if="have.tests" depends="init,compile-test,-pre-test-run">
11.607 - <j2seproject3:junit/>
11.608 + <target depends="init,compile-test,-pre-test-run" if="have.tests" name="-do-test-run">
11.609 + <j2seproject3:junit testincludes="**/*Test.java"/>
11.610 </target>
11.611 - <target name="-post-test-run" if="have.tests" depends="init,compile-test,-pre-test-run,-do-test-run">
11.612 + <target depends="init,compile-test,-pre-test-run,-do-test-run" if="have.tests" name="-post-test-run">
11.613 <fail if="tests.failed">Some tests failed; see details above.</fail>
11.614 </target>
11.615 - <target name="test-report" if="have.tests" depends="init"/>
11.616 - <target name="-test-browse" if="netbeans.home+have.tests" depends="init"/>
11.617 - <target name="test" depends="init,compile-test,-pre-test-run,-do-test-run,test-report,-post-test-run,-test-browse" description="Run unit tests."/>
11.618 - <target name="-pre-test-run-single" if="have.tests" depends="init">
11.619 + <target depends="init" if="have.tests" name="test-report"/>
11.620 + <target depends="init" if="netbeans.home+have.tests" name="-test-browse"/>
11.621 + <target depends="init,compile-test,-pre-test-run,-do-test-run,test-report,-post-test-run,-test-browse" description="Run unit tests." name="test"/>
11.622 + <target depends="init" if="have.tests" name="-pre-test-run-single">
11.623 <mkdir dir="${build.test.results.dir}"/>
11.624 </target>
11.625 - <target name="-do-test-run-single" if="have.tests" depends="init,compile-test-single,-pre-test-run-single">
11.626 + <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single">
11.627 <fail unless="test.includes">Must select some files in the IDE or set test.includes</fail>
11.628 - <j2seproject3:junit includes="${test.includes}"/>
11.629 + <j2seproject3:junit excludes="" includes="${test.includes}"/>
11.630 </target>
11.631 - <target name="-post-test-run-single" if="have.tests" depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single">
11.632 + <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single" if="have.tests" name="-post-test-run-single">
11.633 <fail if="tests.failed">Some tests failed; see details above.</fail>
11.634 </target>
11.635 - <target name="test-single" depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single,-post-test-run-single" description="Run single unit test."/>
11.636 + <target depends="init,-do-not-recompile,compile-test-single,-pre-test-run-single,-do-test-run-single,-post-test-run-single" description="Run single unit test." name="test-single"/>
11.637 <!--
11.638 - =======================
11.639 - JUNIT DEBUGGING SECTION
11.640 - =======================
11.641 - -->
11.642 - <target name="-debug-start-debuggee-test" if="have.tests" depends="init,compile-test">
11.643 + =======================
11.644 + JUNIT DEBUGGING SECTION
11.645 + =======================
11.646 + -->
11.647 + <target depends="init,compile-test" if="have.tests" name="-debug-start-debuggee-test">
11.648 <fail unless="test.class">Must select one file in the IDE or set test.class</fail>
11.649 - <j2seproject3:debug classname="junit.textui.TestRunner" classpath="${debug.test.classpath}">
11.650 + <property location="${build.test.results.dir}/TEST-${test.class}.xml" name="test.report.file"/>
11.651 + <delete file="${test.report.file}"/>
11.652 + <mkdir dir="${build.test.results.dir}"/>
11.653 + <j2seproject3:debug classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner" classpath="${ant.home}/lib/ant.jar:${ant.home}/lib/ant-junit.jar:${debug.test.classpath}">
11.654 <customize>
11.655 - <arg line="${test.class}"/>
11.656 + <syspropertyset>
11.657 + <propertyref prefix="test-sys-prop."/>
11.658 + <mapper from="test-sys-prop.*" to="*" type="glob"/>
11.659 + </syspropertyset>
11.660 + <arg value="${test.class}"/>
11.661 + <arg value="showoutput=true"/>
11.662 + <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.BriefJUnitResultFormatter"/>
11.663 + <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,${test.report.file}"/>
11.664 </customize>
11.665 </j2seproject3:debug>
11.666 </target>
11.667 - <target name="-debug-start-debugger-test" if="netbeans.home+have.tests" depends="init,compile-test">
11.668 - <j2seproject1:nbjpdastart name="${test.class}" classpath="${debug.test.classpath}"/>
11.669 + <target depends="init,compile-test" if="netbeans.home+have.tests" name="-debug-start-debugger-test">
11.670 + <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${test.class}"/>
11.671 </target>
11.672 - <target name="debug-test" depends="init,compile-test,-debug-start-debugger-test,-debug-start-debuggee-test"/>
11.673 - <target name="-do-debug-fix-test" if="netbeans.home" depends="init,-pre-debug-fix,compile-test-single">
11.674 + <target depends="init,-do-not-recompile,compile-test-single,-debug-start-debugger-test,-debug-start-debuggee-test" name="debug-test"/>
11.675 + <target depends="init,-pre-debug-fix,compile-test-single" if="netbeans.home" name="-do-debug-fix-test">
11.676 <j2seproject1:nbjpdareload dir="${build.test.classes.dir}"/>
11.677 </target>
11.678 - <target name="debug-fix-test" if="netbeans.home" depends="init,-pre-debug-fix,-do-debug-fix-test"/>
11.679 + <target depends="init,-pre-debug-fix,-do-debug-fix-test" if="netbeans.home" name="debug-fix-test"/>
11.680 <!--
11.681 - =========================
11.682 - APPLET EXECUTION SECTION
11.683 - =========================
11.684 - -->
11.685 - <target name="run-applet" depends="init,compile-single">
11.686 + =========================
11.687 + APPLET EXECUTION SECTION
11.688 + =========================
11.689 + -->
11.690 + <target depends="init,compile-single" name="run-applet">
11.691 <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
11.692 <j2seproject1:java classname="sun.applet.AppletViewer">
11.693 <customize>
11.694 @@ -516,11 +596,11 @@
11.695 </j2seproject1:java>
11.696 </target>
11.697 <!--
11.698 - =========================
11.699 - APPLET DEBUGGING SECTION
11.700 - =========================
11.701 - -->
11.702 - <target name="-debug-start-debuggee-applet" if="netbeans.home" depends="init,compile-single">
11.703 + =========================
11.704 + APPLET DEBUGGING SECTION
11.705 + =========================
11.706 + -->
11.707 + <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-applet">
11.708 <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
11.709 <j2seproject3:debug classname="sun.applet.AppletViewer">
11.710 <customize>
11.711 @@ -528,14 +608,14 @@
11.712 </customize>
11.713 </j2seproject3:debug>
11.714 </target>
11.715 - <target name="debug-applet" if="netbeans.home" depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-applet"/>
11.716 + <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-applet" if="netbeans.home" name="debug-applet"/>
11.717 <!--
11.718 - ===============
11.719 - CLEANUP SECTION
11.720 - ===============
11.721 - -->
11.722 - <target name="deps-clean" depends="init" unless="no.deps"/>
11.723 - <target name="-do-clean" depends="init">
11.724 + ===============
11.725 + CLEANUP SECTION
11.726 + ===============
11.727 + -->
11.728 + <target depends="init" name="deps-clean" unless="no.deps"/>
11.729 + <target depends="init" name="-do-clean">
11.730 <delete dir="${build.dir}"/>
11.731 <delete dir="${dist.dir}"/>
11.732 </target>
11.733 @@ -543,5 +623,5 @@
11.734 <!-- Empty placeholder for easier customization. -->
11.735 <!-- You can override this target in the ../build.xml file. -->
11.736 </target>
11.737 - <target name="clean" depends="init,deps-clean,-do-clean,-post-clean" description="Clean build products."/>
11.738 + <target depends="init,deps-clean,-do-clean,-post-clean" description="Clean build products." name="clean"/>
11.739 </project>
12.1 --- a/samples/apifest1/day2/welltestedsolution/nbproject/genfiles.properties Sat Jun 14 09:52:47 2008 +0200
12.2 +++ b/samples/apifest1/day2/welltestedsolution/nbproject/genfiles.properties Sat Jun 14 09:52:48 2008 +0200
12.3 @@ -1,8 +1,8 @@
12.4 build.xml.data.CRC32=3022b908
12.5 build.xml.script.CRC32=fdb77cae
12.6 -build.xml.stylesheet.CRC32=a12b3d02
12.7 +build.xml.stylesheet.CRC32=be360661
12.8 # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
12.9 # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
12.10 nbproject/build-impl.xml.data.CRC32=3022b908
12.11 -nbproject/build-impl.xml.script.CRC32=b9627854
12.12 -nbproject/build-impl.xml.stylesheet.CRC32=c10f1eac
12.13 +nbproject/build-impl.xml.script.CRC32=8c67cdf0
12.14 +nbproject/build-impl.xml.stylesheet.CRC32=f1d9da08
13.1 --- a/samples/apifest1/day2/welltestedsolution/nbproject/project.properties Sat Jun 14 09:52:47 2008 +0200
13.2 +++ b/samples/apifest1/day2/welltestedsolution/nbproject/project.properties Sat Jun 14 09:52:48 2008 +0200
13.3 @@ -15,6 +15,8 @@
13.4 dist.dir=dist
13.5 dist.jar=${dist.dir}/boolcircuit.jar
13.6 dist.javadoc.dir=${dist.dir}/javadoc
13.7 +excludes=
13.8 +includes=**
13.9 jar.compress=false
13.10 javac.classpath=
13.11 # Space-separated list of extra javac options
14.1 --- a/samples/apifest1/day2/welltestedsolution/test/org/netbeans/apifest/boolcircuit/RealTest.java Sat Jun 14 09:52:47 2008 +0200
14.2 +++ b/samples/apifest1/day2/welltestedsolution/test/org/netbeans/apifest/boolcircuit/RealTest.java Sat Jun 14 09:52:48 2008 +0200
14.3 @@ -55,6 +55,7 @@
14.4 * own "element" type. This is all going to be exercise in the tests bellow
14.5 * which you are supposed to implement.
14.6 */
14.7 +// BEGIN: apifest.day2.welltestedsolution.RealTest
14.8 public class RealTest extends TestCase {
14.9 static {
14.10 // your code shall run without any permissions
14.11 @@ -171,3 +172,5 @@
14.12 assertEquals("0 0 0", 0.0, c.evaluateFuzzy(0.0, 0.0, 0.0), 0.0);
14.13 }
14.14 }
14.15 +// END: apifest.day2.welltestedsolution.RealTest
14.16 +
15.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
15.2 +++ b/samples/apifest1/day3-intermezzo/jtulach/against-stackbasedsolution/build.xml Sat Jun 14 09:52:48 2008 +0200
15.3 @@ -0,0 +1,97 @@
15.4 +<?xml version="1.0" encoding="UTF-8"?>
15.5 +<!-- this is a template file to test -->
15.6 +<project name="testing-template" default="run" basedir=".">
15.7 + <description>Builds the test against first version and runs them against two</description>
15.8 +
15.9 + <loadproperties srcfile="project.properties"/>
15.10 +
15.11 + <target name="make-sure-projects-are-compiled">
15.12 + <ant dir="${dayA}/${apitotest}" target="compile"/>
15.13 + <ant dir="${dayB}/${apitotest}" target="compile"/>
15.14 + </target>
15.15 +
15.16 + <target name="compile" depends="make-sure-projects-are-compiled">
15.17 + <mkdir dir="build/tests"/>
15.18 + <javac destdir="build/tests" srcdir="test">
15.19 + <classpath>
15.20 + <pathelement location="${apiA}"/>
15.21 + <pathelement location="${apifest}/lib/junit-3.8.2.jar"/>
15.22 + </classpath>
15.23 + </javac>
15.24 + </target>
15.25 +
15.26 + <target name="run" depends="-run-binary-check,-run-source-check">
15.27 + <fail message="The test shall either compile against A and not B or run on A and fail on B, nothing like that happened">
15.28 + <condition>
15.29 + <not><or>
15.30 + <isset property="execution.failed"/>
15.31 + <isset property="compilation.failed"/>
15.32 + </or></not>
15.33 + </condition>
15.34 + </fail>
15.35 + </target>
15.36 +
15.37 + <target name="-run-binary-check" depends="compile">
15.38 + <mkdir dir="build/testresultA"/>
15.39 + <junit dir="build/tests" failureproperty="run.on.A.shall.succeed">
15.40 + <batchtest todir="build/testresultA">
15.41 + <fileset dir="test" includes="**/*.java"/>
15.42 + </batchtest>
15.43 + <formatter type="brief" usefile="false"/>
15.44 + <formatter type="xml"/>
15.45 + <classpath>
15.46 + <pathelement location="${apiA}"/>
15.47 + <pathelement location="${apifest}/lib/junit-3.8.2.jar"/>
15.48 + <pathelement location="build/tests"/>
15.49 + </classpath>
15.50 + </junit>
15.51 +
15.52 + <mkdir dir="build/testresultB"/>
15.53 + <junit dir="build/tests" failureproperty="run.on.B.shall.fail">
15.54 + <batchtest todir="build/testresultB">
15.55 + <fileset dir="test" includes="**/*.java"/>
15.56 + </batchtest>
15.57 + <formatter type="brief" usefile="false"/>
15.58 + <formatter type="xml"/>
15.59 + <classpath>
15.60 + <pathelement location="${apiB}"/>
15.61 + <pathelement location="${apifest}/lib/junit-3.8.2.jar"/>
15.62 + <pathelement location="build/tests"/>
15.63 + </classpath>
15.64 + </junit>
15.65 +
15.66 + <condition property="execution.failed">
15.67 + <and>
15.68 + <isset property="run.on.B.shall.fail"/>
15.69 + <not><isset property="run.on.A.shall.succeed"/></not>
15.70 + </and>
15.71 + </condition>
15.72 + </target>
15.73 +
15.74 + <target name="-run-source-check" depends="compile" unless="execution.failed">
15.75 +
15.76 + <property name="build.b" location="build/verifyitbuildsagainstB"/>
15.77 + <delete dir="${build.b}"/>
15.78 + <mkdir dir="${build.b}"/>
15.79 + <javac destdir="${build.b}" srcdir="test" failonerror="false">
15.80 + <classpath>
15.81 + <pathelement location="${apiB}"/>
15.82 + <pathelement location="${apifest}/lib/junit-3.8.2.jar"/>
15.83 + </classpath>
15.84 + </javac>
15.85 +
15.86 +
15.87 + <uptodate property="compilation.failed">
15.88 + <srcfiles dir="${build.b}" includes="**/*.class"/>
15.89 + <mapper type="glob" from="*" to="build/tests/*"/>
15.90 + </uptodate>
15.91 +
15.92 +
15.93 + </target>
15.94 +
15.95 + <target name="test" depends="run"/>
15.96 +
15.97 + <target name="clean">
15.98 + <delete dir="build"/>
15.99 + </target>
15.100 +</project>
16.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
16.2 +++ b/samples/apifest1/day3-intermezzo/jtulach/against-stackbasedsolution/nbproject/project.xml Sat Jun 14 09:52:48 2008 +0200
16.3 @@ -0,0 +1,77 @@
16.4 +<?xml version="1.0" encoding="UTF-8"?>
16.5 +<project xmlns="http://www.netbeans.org/ns/project/1">
16.6 + <type>org.netbeans.modules.ant.freeform</type>
16.7 + <configuration>
16.8 + <general-data xmlns="http://www.netbeans.org/ns/freeform-project/1">
16.9 + <!-- Do not use Project Properties customizer when editing this file manually. -->
16.10 + <name>Against Stack Based Solution</name>
16.11 + <properties>
16.12 + <property name="ant.script">build.xml</property>
16.13 + <property-file>project.properties</property-file>
16.14 + </properties>
16.15 + <folders>
16.16 + <source-folder>
16.17 + <label>test</label>
16.18 + <type>java</type>
16.19 + <location>test</location>
16.20 + </source-folder>
16.21 + </folders>
16.22 + <ide-actions>
16.23 + <action name="build">
16.24 + <script>${ant.script}</script>
16.25 + <target>compile</target>
16.26 + </action>
16.27 + <action name="clean">
16.28 + <script>${ant.script}</script>
16.29 + <target>clean</target>
16.30 + </action>
16.31 + <action name="run">
16.32 + <script>${ant.script}</script>
16.33 + <target>test</target>
16.34 + </action>
16.35 + <action name="test">
16.36 + <script>${ant.script}</script>
16.37 + <target>test</target>
16.38 + </action>
16.39 + <action name="rebuild">
16.40 + <script>${ant.script}</script>
16.41 + <target>clean</target>
16.42 + <target>compile</target>
16.43 + </action>
16.44 + </ide-actions>
16.45 + <export>
16.46 + <type>folder</type>
16.47 + <location>build/tests</location>
16.48 + <script>${ant.script}</script>
16.49 + <build-target>compile</build-target>
16.50 + </export>
16.51 + <view>
16.52 + <items>
16.53 + <source-folder style="packages">
16.54 + <label>test</label>
16.55 + <location>test</location>
16.56 + </source-folder>
16.57 + <source-file>
16.58 + <location>${ant.script}</location>
16.59 + </source-file>
16.60 + </items>
16.61 + <context-menu>
16.62 + <ide-action name="build"/>
16.63 + <ide-action name="clean"/>
16.64 + <ide-action name="run"/>
16.65 + <ide-action name="test"/>
16.66 + <ide-action name="rebuild"/>
16.67 + </context-menu>
16.68 + </view>
16.69 + <subprojects/>
16.70 + </general-data>
16.71 + <java-data xmlns="http://www.netbeans.org/ns/freeform-project-java/1">
16.72 + <compilation-unit>
16.73 + <package-root>test</package-root>
16.74 + <classpath mode="compile">${apiA}:${apifest}/lib/junit-3.8.2.jar</classpath>
16.75 + <built-to>build/tests</built-to>
16.76 + <source-level>1.5</source-level>
16.77 + </compilation-unit>
16.78 + </java-data>
16.79 + </configuration>
16.80 +</project>
17.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
17.2 +++ b/samples/apifest1/day3-intermezzo/jtulach/against-stackbasedsolution/project.properties Sat Jun 14 09:52:48 2008 +0200
17.3 @@ -0,0 +1,17 @@
17.4 +
17.5 +# location to root of the repository with apifest projects
17.6 +apifest=../../..
17.7 +
17.8 +# name of a project to test
17.9 +apitotest=stackbasedsolution
17.10 +
17.11 +# the test shall expose a problem between two versions
17.12 +# of one API. select the first version - dayA and a second
17.13 +# version of the of the API dayB
17.14 +dayA=${apifest}/day1
17.15 +dayB=${apifest}/day2
17.16 +
17.17 +# usual locations of API classes for each version
17.18 +apiA=${dayA}/${apitotest}/build/classes/
17.19 +apiB=${dayB}/${apitotest}/build/classes/
17.20 +
18.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
18.2 +++ b/samples/apifest1/day3-intermezzo/jtulach/against-stackbasedsolution/test/apifest/CircuitTest.java Sat Jun 14 09:52:48 2008 +0200
18.3 @@ -0,0 +1,58 @@
18.4 +/*
18.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
18.6 + *
18.7 + * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
18.8 + *
18.9 + * The contents of this file are subject to the terms of either the GNU
18.10 + * General Public License Version 2 only ("GPL") or the Common
18.11 + * Development and Distribution License("CDDL") (collectively, the
18.12 + * "License"). You may not use this file except in compliance with the
18.13 + * License. You can obtain a copy of the License at
18.14 + * http://www.netbeans.org/cddl-gplv2.html
18.15 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
18.16 + * specific language governing permissions and limitations under the
18.17 + * License. When distributing the software, include this License Header
18.18 + * Notice in each file and include the License file at
18.19 + * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
18.20 + * particular file as subject to the "Classpath" exception as provided
18.21 + * by Sun in the GPL Version 2 section of the License file that
18.22 + * accompanied this code. If applicable, add the following below the
18.23 + * License Header, with the fields enclosed by brackets [] replaced by
18.24 + * your own identifying information:
18.25 + * "Portions Copyrighted [year] [name of copyright owner]"
18.26 + *
18.27 + * Contributor(s):
18.28 + *
18.29 + * The Original Software is NetBeans. The Initial Developer of the Original
18.30 + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
18.31 + * Microsystems, Inc. All Rights Reserved.
18.32 + *
18.33 + * If you wish your version of this file to be governed by only the CDDL
18.34 + * or only the GPL Version 2, indicate your decision by adding
18.35 + * "[Contributor] elects to include this software in this distribution
18.36 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
18.37 + * single choice of license, a recipient has the option to distribute
18.38 + * your version of this file under either the CDDL, the GPL Version 2 or
18.39 + * to extend the choice of license to its licensees as provided above.
18.40 + * However, if you add GPL Version 2 code and therefore, elected the GPL
18.41 + * Version 2 license, then the option applies only if the new code is
18.42 + * made subject to such option by the copyright holder.
18.43 + */
18.44 +package apifest;
18.45 +
18.46 +import junit.framework.TestCase;
18.47 +import org.netbeans.apifest.boolcircuit.Circuit;
18.48 +import org.netbeans.apifest.boolcircuit.CircuitFactory;
18.49 +
18.50 +
18.51 +/** Write a test that works with version from day A and fails with version B.
18.52 + */
18.53 +public class CircuitTest extends TestCase {
18.54 + public CircuitTest(String n) {
18.55 + super(n);
18.56 + }
18.57 +
18.58 + public void testClass() throws Exception {
18.59 + Circuit c = CircuitFactory.getBasicCircuit(null);
18.60 + }
18.61 +}
19.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
19.2 +++ b/samples/apifest1/day3-intermezzo/jtulach/against-subclassingsolution/build.xml Sat Jun 14 09:52:48 2008 +0200
19.3 @@ -0,0 +1,97 @@
19.4 +<?xml version="1.0" encoding="UTF-8"?>
19.5 +<!-- this is a template file to test -->
19.6 +<project name="testing-template" default="run" basedir=".">
19.7 + <description>Builds the test against first version and runs them against two</description>
19.8 +
19.9 + <loadproperties srcfile="project.properties"/>
19.10 +
19.11 + <target name="make-sure-projects-are-compiled">
19.12 + <ant dir="${dayA}/${apitotest}" target="compile"/>
19.13 + <ant dir="${dayB}/${apitotest}" target="compile"/>
19.14 + </target>
19.15 +
19.16 + <target name="compile" depends="make-sure-projects-are-compiled">
19.17 + <mkdir dir="build/tests"/>
19.18 + <javac destdir="build/tests" srcdir="test">
19.19 + <classpath>
19.20 + <pathelement location="${apiA}"/>
19.21 + <pathelement location="${apifest}/lib/junit-3.8.2.jar"/>
19.22 + </classpath>
19.23 + </javac>
19.24 + </target>
19.25 +
19.26 + <target name="run" depends="-run-binary-check,-run-source-check">
19.27 + <fail message="The test shall either compile against A and not B or run on A and fail on B, nothing like that happened">
19.28 + <condition>
19.29 + <not><or>
19.30 + <isset property="execution.failed"/>
19.31 + <isset property="compilation.failed"/>
19.32 + </or></not>
19.33 + </condition>
19.34 + </fail>
19.35 + </target>
19.36 +
19.37 + <target name="-run-binary-check" depends="compile">
19.38 + <mkdir dir="build/testresultA"/>
19.39 + <junit dir="build/tests" failureproperty="run.on.A.shall.succeed">
19.40 + <batchtest todir="build/testresultA">
19.41 + <fileset dir="test" includes="**/*.java"/>
19.42 + </batchtest>
19.43 + <formatter type="brief" usefile="false"/>
19.44 + <formatter type="xml"/>
19.45 + <classpath>
19.46 + <pathelement location="${apiA}"/>
19.47 + <pathelement location="${apifest}/lib/junit-3.8.2.jar"/>
19.48 + <pathelement location="build/tests"/>
19.49 + </classpath>
19.50 + </junit>
19.51 +
19.52 + <mkdir dir="build/testresultB"/>
19.53 + <junit dir="build/tests" failureproperty="run.on.B.shall.fail">
19.54 + <batchtest todir="build/testresultB">
19.55 + <fileset dir="test" includes="**/*.java"/>
19.56 + </batchtest>
19.57 + <formatter type="brief" usefile="false"/>
19.58 + <formatter type="xml"/>
19.59 + <classpath>
19.60 + <pathelement location="${apiB}"/>
19.61 + <pathelement location="${apifest}/lib/junit-3.8.2.jar"/>
19.62 + <pathelement location="build/tests"/>
19.63 + </classpath>
19.64 + </junit>
19.65 +
19.66 + <condition property="execution.failed">
19.67 + <and>
19.68 + <isset property="run.on.B.shall.fail"/>
19.69 + <not><isset property="run.on.A.shall.succeed"/></not>
19.70 + </and>
19.71 + </condition>
19.72 + </target>
19.73 +
19.74 + <target name="-run-source-check" depends="compile" unless="execution.failed">
19.75 +
19.76 + <property name="build.b" location="build/verifyitbuildsagainstB"/>
19.77 + <delete dir="${build.b}"/>
19.78 + <mkdir dir="${build.b}"/>
19.79 + <javac destdir="${build.b}" srcdir="test" failonerror="false">
19.80 + <classpath>
19.81 + <pathelement location="${apiB}"/>
19.82 + <pathelement location="${apifest}/lib/junit-3.8.2.jar"/>
19.83 + </classpath>
19.84 + </javac>
19.85 +
19.86 +
19.87 + <uptodate property="compilation.failed">
19.88 + <srcfiles dir="${build.b}" includes="**/*.class"/>
19.89 + <mapper type="glob" from="*" to="build/tests/*"/>
19.90 + </uptodate>
19.91 +
19.92 +
19.93 + </target>
19.94 +
19.95 + <target name="test" depends="run"/>
19.96 +
19.97 + <target name="clean">
19.98 + <delete dir="build"/>
19.99 + </target>
19.100 +</project>
20.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
20.2 +++ b/samples/apifest1/day3-intermezzo/jtulach/against-subclassingsolution/nbproject/project.xml Sat Jun 14 09:52:48 2008 +0200
20.3 @@ -0,0 +1,77 @@
20.4 +<?xml version="1.0" encoding="UTF-8"?>
20.5 +<project xmlns="http://www.netbeans.org/ns/project/1">
20.6 + <type>org.netbeans.modules.ant.freeform</type>
20.7 + <configuration>
20.8 + <general-data xmlns="http://www.netbeans.org/ns/freeform-project/1">
20.9 + <!-- Do not use Project Properties customizer when editing this file manually. -->
20.10 + <name>Against Subclassing Solution</name>
20.11 + <properties>
20.12 + <property name="ant.script">build.xml</property>
20.13 + <property-file>project.properties</property-file>
20.14 + </properties>
20.15 + <folders>
20.16 + <source-folder>
20.17 + <label>test</label>
20.18 + <type>java</type>
20.19 + <location>test</location>
20.20 + </source-folder>
20.21 + </folders>
20.22 + <ide-actions>
20.23 + <action name="build">
20.24 + <script>${ant.script}</script>
20.25 + <target>compile</target>
20.26 + </action>
20.27 + <action name="clean">
20.28 + <script>${ant.script}</script>
20.29 + <target>clean</target>
20.30 + </action>
20.31 + <action name="run">
20.32 + <script>${ant.script}</script>
20.33 + <target>test</target>
20.34 + </action>
20.35 + <action name="test">
20.36 + <script>${ant.script}</script>
20.37 + <target>test</target>
20.38 + </action>
20.39 + <action name="rebuild">
20.40 + <script>${ant.script}</script>
20.41 + <target>clean</target>
20.42 + <target>compile</target>
20.43 + </action>
20.44 + </ide-actions>
20.45 + <export>
20.46 + <type>folder</type>
20.47 + <location>build/tests</location>
20.48 + <script>${ant.script}</script>
20.49 + <build-target>compile</build-target>
20.50 + </export>
20.51 + <view>
20.52 + <items>
20.53 + <source-folder style="packages">
20.54 + <label>test</label>
20.55 + <location>test</location>
20.56 + </source-folder>
20.57 + <source-file>
20.58 + <location>${ant.script}</location>
20.59 + </source-file>
20.60 + </items>
20.61 + <context-menu>
20.62 + <ide-action name="build"/>
20.63 + <ide-action name="clean"/>
20.64 + <ide-action name="run"/>
20.65 + <ide-action name="test"/>
20.66 + <ide-action name="rebuild"/>
20.67 + </context-menu>
20.68 + </view>
20.69 + <subprojects/>
20.70 + </general-data>
20.71 + <java-data xmlns="http://www.netbeans.org/ns/freeform-project-java/1">
20.72 + <compilation-unit>
20.73 + <package-root>test</package-root>
20.74 + <classpath mode="compile">${apiA}:${apifest}/lib/junit-3.8.2.jar</classpath>
20.75 + <built-to>build/tests</built-to>
20.76 + <source-level>1.5</source-level>
20.77 + </compilation-unit>
20.78 + </java-data>
20.79 + </configuration>
20.80 +</project>
21.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
21.2 +++ b/samples/apifest1/day3-intermezzo/jtulach/against-subclassingsolution/project.properties Sat Jun 14 09:52:48 2008 +0200
21.3 @@ -0,0 +1,17 @@
21.4 +
21.5 +# location to root of the repository with apifest projects
21.6 +apifest=../../..
21.7 +
21.8 +# name of a project to test
21.9 +apitotest=subclassingsolution
21.10 +
21.11 +# the test shall expose a problem between two versions
21.12 +# of one API. select the first version - dayA and a second
21.13 +# version of the of the API dayB
21.14 +dayA=${apifest}/day1
21.15 +dayB=${apifest}/day2
21.16 +
21.17 +# usual locations of API classes for each version
21.18 +apiA=${dayA}/${apitotest}/build/classes/
21.19 +apiB=${dayB}/${apitotest}/build/classes/
21.20 +
22.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
22.2 +++ b/samples/apifest1/day3-intermezzo/jtulach/against-subclassingsolution/test/apifest/CircuitTest.java Sat Jun 14 09:52:48 2008 +0200
22.3 @@ -0,0 +1,57 @@
22.4 +/*
22.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
22.6 + *
22.7 + * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
22.8 + *
22.9 + * The contents of this file are subject to the terms of either the GNU
22.10 + * General Public License Version 2 only ("GPL") or the Common
22.11 + * Development and Distribution License("CDDL") (collectively, the
22.12 + * "License"). You may not use this file except in compliance with the
22.13 + * License. You can obtain a copy of the License at
22.14 + * http://www.netbeans.org/cddl-gplv2.html
22.15 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
22.16 + * specific language governing permissions and limitations under the
22.17 + * License. When distributing the software, include this License Header
22.18 + * Notice in each file and include the License file at
22.19 + * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
22.20 + * particular file as subject to the "Classpath" exception as provided
22.21 + * by Sun in the GPL Version 2 section of the License file that
22.22 + * accompanied this code. If applicable, add the following below the
22.23 + * License Header, with the fields enclosed by brackets [] replaced by
22.24 + * your own identifying information:
22.25 + * "Portions Copyrighted [year] [name of copyright owner]"
22.26 + *
22.27 + * Contributor(s):
22.28 + *
22.29 + * The Original Software is NetBeans. The Initial Developer of the Original
22.30 + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
22.31 + * Microsystems, Inc. All Rights Reserved.
22.32 + *
22.33 + * If you wish your version of this file to be governed by only the CDDL
22.34 + * or only the GPL Version 2, indicate your decision by adding
22.35 + * "[Contributor] elects to include this software in this distribution
22.36 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
22.37 + * single choice of license, a recipient has the option to distribute
22.38 + * your version of this file under either the CDDL, the GPL Version 2 or
22.39 + * to extend the choice of license to its licensees as provided above.
22.40 + * However, if you add GPL Version 2 code and therefore, elected the GPL
22.41 + * Version 2 license, then the option applies only if the new code is
22.42 + * made subject to such option by the copyright holder.
22.43 + */
22.44 +package apifest;
22.45 +
22.46 +import junit.framework.TestCase;
22.47 +import org.netbeans.apifest.boolcircuit.Circuit;
22.48 +
22.49 +
22.50 +/** Write a test that works with version from day A and fails with version B.
22.51 + */
22.52 +public class CircuitTest extends TestCase {
22.53 + public CircuitTest(String n) {
22.54 + super(n);
22.55 + }
22.56 +
22.57 + public void testClass() throws Exception {
22.58 + Circuit c = Circuit.AND;
22.59 + }
22.60 +}
23.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
23.2 +++ b/samples/apifest1/day3-intermezzo/jtulach/against-welltestedsolution/build.xml Sat Jun 14 09:52:48 2008 +0200
23.3 @@ -0,0 +1,97 @@
23.4 +<?xml version="1.0" encoding="UTF-8"?>
23.5 +<!-- this is a template file to test -->
23.6 +<project name="testing-template" default="run" basedir=".">
23.7 + <description>Builds the test against first version and runs them against two</description>
23.8 +
23.9 + <loadproperties srcfile="project.properties"/>
23.10 +
23.11 + <target name="make-sure-projects-are-compiled">
23.12 + <ant dir="${dayA}/${apitotest}" target="compile"/>
23.13 + <ant dir="${dayB}/${apitotest}" target="compile"/>
23.14 + </target>
23.15 +
23.16 + <target name="compile" depends="make-sure-projects-are-compiled">
23.17 + <mkdir dir="build/tests"/>
23.18 + <javac destdir="build/tests" srcdir="test">
23.19 + <classpath>
23.20 + <pathelement location="${apiA}"/>
23.21 + <pathelement location="${apifest}/lib/junit-3.8.2.jar"/>
23.22 + </classpath>
23.23 + </javac>
23.24 + </target>
23.25 +
23.26 + <target name="run" depends="-run-binary-check,-run-source-check">
23.27 + <fail message="The test shall either compile against A and not B or run on A and fail on B, nothing like that happened">
23.28 + <condition>
23.29 + <not><or>
23.30 + <isset property="execution.failed"/>
23.31 + <isset property="compilation.failed"/>
23.32 + </or></not>
23.33 + </condition>
23.34 + </fail>
23.35 + </target>
23.36 +
23.37 + <target name="-run-binary-check" depends="compile">
23.38 + <mkdir dir="build/testresultA"/>
23.39 + <junit dir="build/tests" failureproperty="run.on.A.shall.succeed">
23.40 + <batchtest todir="build/testresultA">
23.41 + <fileset dir="test" includes="**/*.java"/>
23.42 + </batchtest>
23.43 + <formatter type="brief" usefile="false"/>
23.44 + <formatter type="xml"/>
23.45 + <classpath>
23.46 + <pathelement location="${apiA}"/>
23.47 + <pathelement location="${apifest}/lib/junit-3.8.2.jar"/>
23.48 + <pathelement location="build/tests"/>
23.49 + </classpath>
23.50 + </junit>
23.51 +
23.52 + <mkdir dir="build/testresultB"/>
23.53 + <junit dir="build/tests" failureproperty="run.on.B.shall.fail">
23.54 + <batchtest todir="build/testresultB">
23.55 + <fileset dir="test" includes="**/*.java"/>
23.56 + </batchtest>
23.57 + <formatter type="brief" usefile="false"/>
23.58 + <formatter type="xml"/>
23.59 + <classpath>
23.60 + <pathelement location="${apiB}"/>
23.61 + <pathelement location="${apifest}/lib/junit-3.8.2.jar"/>
23.62 + <pathelement location="build/tests"/>
23.63 + </classpath>
23.64 + </junit>
23.65 +
23.66 + <condition property="execution.failed">
23.67 + <and>
23.68 + <isset property="run.on.B.shall.fail"/>
23.69 + <not><isset property="run.on.A.shall.succeed"/></not>
23.70 + </and>
23.71 + </condition>
23.72 + </target>
23.73 +
23.74 + <target name="-run-source-check" depends="compile" unless="execution.failed">
23.75 +
23.76 + <property name="build.b" location="build/verifyitbuildsagainstB"/>
23.77 + <delete dir="${build.b}"/>
23.78 + <mkdir dir="${build.b}"/>
23.79 + <javac destdir="${build.b}" srcdir="test" failonerror="false">
23.80 + <classpath>
23.81 + <pathelement location="${apiB}"/>
23.82 + <pathelement location="${apifest}/lib/junit-3.8.2.jar"/>
23.83 + </classpath>
23.84 + </javac>
23.85 +
23.86 +
23.87 + <uptodate property="compilation.failed">
23.88 + <srcfiles dir="${build.b}" includes="**/*.class"/>
23.89 + <mapper type="glob" from="*" to="build/tests/*"/>
23.90 + </uptodate>
23.91 +
23.92 +
23.93 + </target>
23.94 +
23.95 + <target name="test" depends="run"/>
23.96 +
23.97 + <target name="clean">
23.98 + <delete dir="build"/>
23.99 + </target>
23.100 +</project>
24.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
24.2 +++ b/samples/apifest1/day3-intermezzo/jtulach/against-welltestedsolution/nbproject/project.xml Sat Jun 14 09:52:48 2008 +0200
24.3 @@ -0,0 +1,77 @@
24.4 +<?xml version="1.0" encoding="UTF-8"?>
24.5 +<project xmlns="http://www.netbeans.org/ns/project/1">
24.6 + <type>org.netbeans.modules.ant.freeform</type>
24.7 + <configuration>
24.8 + <general-data xmlns="http://www.netbeans.org/ns/freeform-project/1">
24.9 + <!-- Do not use Project Properties customizer when editing this file manually. -->
24.10 + <name>Against Well Tested Solution</name>
24.11 + <properties>
24.12 + <property name="ant.script">build.xml</property>
24.13 + <property-file>project.properties</property-file>
24.14 + </properties>
24.15 + <folders>
24.16 + <source-folder>
24.17 + <label>test</label>
24.18 + <type>java</type>
24.19 + <location>test</location>
24.20 + </source-folder>
24.21 + </folders>
24.22 + <ide-actions>
24.23 + <action name="build">
24.24 + <script>${ant.script}</script>
24.25 + <target>compile</target>
24.26 + </action>
24.27 + <action name="clean">
24.28 + <script>${ant.script}</script>
24.29 + <target>clean</target>
24.30 + </action>
24.31 + <action name="run">
24.32 + <script>${ant.script}</script>
24.33 + <target>test</target>
24.34 + </action>
24.35 + <action name="test">
24.36 + <script>${ant.script}</script>
24.37 + <target>test</target>
24.38 + </action>
24.39 + <action name="rebuild">
24.40 + <script>${ant.script}</script>
24.41 + <target>clean</target>
24.42 + <target>compile</target>
24.43 + </action>
24.44 + </ide-actions>
24.45 + <export>
24.46 + <type>folder</type>
24.47 + <location>build/tests</location>
24.48 + <script>${ant.script}</script>
24.49 + <build-target>compile</build-target>
24.50 + </export>
24.51 + <view>
24.52 + <items>
24.53 + <source-folder style="packages">
24.54 + <label>test</label>
24.55 + <location>test</location>
24.56 + </source-folder>
24.57 + <source-file>
24.58 + <location>${ant.script}</location>
24.59 + </source-file>
24.60 + </items>
24.61 + <context-menu>
24.62 + <ide-action name="build"/>
24.63 + <ide-action name="clean"/>
24.64 + <ide-action name="run"/>
24.65 + <ide-action name="test"/>
24.66 + <ide-action name="rebuild"/>
24.67 + </context-menu>
24.68 + </view>
24.69 + <subprojects/>
24.70 + </general-data>
24.71 + <java-data xmlns="http://www.netbeans.org/ns/freeform-project-java/1">
24.72 + <compilation-unit>
24.73 + <package-root>test</package-root>
24.74 + <classpath mode="compile">${apiA}:${apifest}/lib/junit-3.8.2.jar</classpath>
24.75 + <built-to>build/tests</built-to>
24.76 + <source-level>1.5</source-level>
24.77 + </compilation-unit>
24.78 + </java-data>
24.79 + </configuration>
24.80 +</project>
25.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
25.2 +++ b/samples/apifest1/day3-intermezzo/jtulach/against-welltestedsolution/project.properties Sat Jun 14 09:52:48 2008 +0200
25.3 @@ -0,0 +1,17 @@
25.4 +
25.5 +# location to root of the repository with apifest projects
25.6 +apifest=../../..
25.7 +
25.8 +# name of a project to test
25.9 +apitotest=welltestedsolution
25.10 +
25.11 +# the test shall expose a problem between two versions
25.12 +# of one API. select the first version - dayA and a second
25.13 +# version of the of the API dayB
25.14 +dayA=${apifest}/day1
25.15 +dayB=${apifest}/day2
25.16 +
25.17 +# usual locations of API classes for each version
25.18 +apiA=${dayA}/${apitotest}/build/classes/
25.19 +apiB=${dayB}/${apitotest}/build/classes/
25.20 +
26.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
26.2 +++ b/samples/apifest1/day3-intermezzo/jtulach/against-welltestedsolution/test/apifest/CircuitTest.java Sat Jun 14 09:52:48 2008 +0200
26.3 @@ -0,0 +1,60 @@
26.4 +/*
26.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
26.6 + *
26.7 + * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
26.8 + *
26.9 + * The contents of this file are subject to the terms of either the GNU
26.10 + * General Public License Version 2 only ("GPL") or the Common
26.11 + * Development and Distribution License("CDDL") (collectively, the
26.12 + * "License"). You may not use this file except in compliance with the
26.13 + * License. You can obtain a copy of the License at
26.14 + * http://www.netbeans.org/cddl-gplv2.html
26.15 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
26.16 + * specific language governing permissions and limitations under the
26.17 + * License. When distributing the software, include this License Header
26.18 + * Notice in each file and include the License file at
26.19 + * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
26.20 + * particular file as subject to the "Classpath" exception as provided
26.21 + * by Sun in the GPL Version 2 section of the License file that
26.22 + * accompanied this code. If applicable, add the following below the
26.23 + * License Header, with the fields enclosed by brackets [] replaced by
26.24 + * your own identifying information:
26.25 + * "Portions Copyrighted [year] [name of copyright owner]"
26.26 + *
26.27 + * Contributor(s):
26.28 + *
26.29 + * The Original Software is NetBeans. The Initial Developer of the Original
26.30 + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
26.31 + * Microsystems, Inc. All Rights Reserved.
26.32 + *
26.33 + * If you wish your version of this file to be governed by only the CDDL
26.34 + * or only the GPL Version 2, indicate your decision by adding
26.35 + * "[Contributor] elects to include this software in this distribution
26.36 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
26.37 + * single choice of license, a recipient has the option to distribute
26.38 + * your version of this file under either the CDDL, the GPL Version 2 or
26.39 + * to extend the choice of license to its licensees as provided above.
26.40 + * However, if you add GPL Version 2 code and therefore, elected the GPL
26.41 + * Version 2 license, then the option applies only if the new code is
26.42 + * made subject to such option by the copyright holder.
26.43 + */
26.44 +package apifest;
26.45 +
26.46 +import junit.framework.TestCase;
26.47 +import org.netbeans.apifest.boolcircuit.Circuit;
26.48 +
26.49 +
26.50 +/** Write a test that works with version from day A and fails with version B.
26.51 + */
26.52 +public class CircuitTest extends TestCase {
26.53 + public CircuitTest(String n) {
26.54 + super(n);
26.55 + }
26.56 +
26.57 + public void testClass() throws Exception {
26.58 + // I know this is not fair
26.59 + if (!Circuit.createNotCircuit(null).getClass().getName().endsWith("Circuit")) {
26.60 + fail("My class is not a Circuit");
26.61 + }
26.62 + }
26.63 +}
27.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
27.2 +++ b/samples/apifest1/day3-intermezzo/pnejedly/against-alwayscreatenewcircuit/build.xml Sat Jun 14 09:52:48 2008 +0200
27.3 @@ -0,0 +1,97 @@
27.4 +<?xml version="1.0" encoding="UTF-8"?>
27.5 +<!-- this is a template file to test -->
27.6 +<project name="testing-template" default="run" basedir=".">
27.7 + <description>Builds the test against first version and runs them against two</description>
27.8 +
27.9 + <loadproperties srcfile="project.properties"/>
27.10 +
27.11 + <target name="make-sure-projects-are-compiled">
27.12 + <ant dir="${dayA}/${apitotest}" target="compile"/>
27.13 + <ant dir="${dayB}/${apitotest}" target="compile"/>
27.14 + </target>
27.15 +
27.16 + <target name="compile" depends="make-sure-projects-are-compiled">
27.17 + <mkdir dir="build/tests"/>
27.18 + <javac destdir="build/tests" srcdir="test">
27.19 + <classpath>
27.20 + <pathelement location="${apiA}"/>
27.21 + <pathelement location="${apifest}/lib/junit-3.8.2.jar"/>
27.22 + </classpath>
27.23 + </javac>
27.24 + </target>
27.25 +
27.26 + <target name="run" depends="-run-binary-check,-run-source-check">
27.27 + <fail message="The test shall either compile against A and not B or run on A and fail on B, nothing like that happened">
27.28 + <condition>
27.29 + <not><or>
27.30 + <isset property="execution.failed"/>
27.31 + <isset property="compilation.failed"/>
27.32 + </or></not>
27.33 + </condition>
27.34 + </fail>
27.35 + </target>
27.36 +
27.37 + <target name="-run-binary-check" depends="compile">
27.38 + <mkdir dir="build/testresultA"/>
27.39 + <junit dir="build/tests" failureproperty="run.on.A.shall.succeed">
27.40 + <batchtest todir="build/testresultA">
27.41 + <fileset dir="test" includes="**/*.java"/>
27.42 + </batchtest>
27.43 + <formatter type="brief" usefile="false"/>
27.44 + <formatter type="xml"/>
27.45 + <classpath>
27.46 + <pathelement location="${apiA}"/>
27.47 + <pathelement location="${apifest}/lib/junit-3.8.2.jar"/>
27.48 + <pathelement location="build/tests"/>
27.49 + </classpath>
27.50 + </junit>
27.51 +
27.52 + <mkdir dir="build/testresultB"/>
27.53 + <junit dir="build/tests" failureproperty="run.on.B.shall.fail">
27.54 + <batchtest todir="build/testresultB">
27.55 + <fileset dir="test" includes="**/*.java"/>
27.56 + </batchtest>
27.57 + <formatter type="brief" usefile="false"/>
27.58 + <formatter type="xml"/>
27.59 + <classpath>
27.60 + <pathelement location="${apiB}"/>
27.61 + <pathelement location="${apifest}/lib/junit-3.8.2.jar"/>
27.62 + <pathelement location="build/tests"/>
27.63 + </classpath>
27.64 + </junit>
27.65 +
27.66 + <condition property="execution.failed">
27.67 + <and>
27.68 + <isset property="run.on.B.shall.fail"/>
27.69 + <not><isset property="run.on.A.shall.succeed"/></not>
27.70 + </and>
27.71 + </condition>
27.72 + </target>
27.73 +
27.74 + <target name="-run-source-check" depends="compile" unless="execution.failed">
27.75 +
27.76 + <property name="build.b" location="build/verifyitbuildsagainstB"/>
27.77 + <delete dir="${build.b}"/>
27.78 + <mkdir dir="${build.b}"/>
27.79 + <javac destdir="${build.b}" srcdir="test" failonerror="false">
27.80 + <classpath>
27.81 + <pathelement location="${apiB}"/>
27.82 + <pathelement location="${apifest}/lib/junit-3.8.2.jar"/>
27.83 + </classpath>
27.84 + </javac>
27.85 +
27.86 +
27.87 + <uptodate property="compilation.failed">
27.88 + <srcfiles dir="${build.b}" includes="**/*.class"/>
27.89 + <mapper type="glob" from="*" to="build/tests/*"/>
27.90 + </uptodate>
27.91 +
27.92 +
27.93 + </target>
27.94 +
27.95 + <target name="test" depends="run"/>
27.96 +
27.97 + <target name="clean">
27.98 + <delete dir="build"/>
27.99 + </target>
27.100 +</project>
28.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
28.2 +++ b/samples/apifest1/day3-intermezzo/pnejedly/against-alwayscreatenewcircuit/nbproject/project.xml Sat Jun 14 09:52:48 2008 +0200
28.3 @@ -0,0 +1,77 @@
28.4 +<?xml version="1.0" encoding="UTF-8"?>
28.5 +<project xmlns="http://www.netbeans.org/ns/project/1">
28.6 + <type>org.netbeans.modules.ant.freeform</type>
28.7 + <configuration>
28.8 + <general-data xmlns="http://www.netbeans.org/ns/freeform-project/1">
28.9 + <!-- Do not use Project Properties customizer when editing this file manually. -->
28.10 + <name>against-alwayscreatenewcircuit</name>
28.11 + <properties>
28.12 + <property name="ant.script">build.xml</property>
28.13 + <property-file>project.properties</property-file>
28.14 + </properties>
28.15 + <folders>
28.16 + <source-folder>
28.17 + <label>test</label>
28.18 + <type>java</type>
28.19 + <location>test</location>
28.20 + </source-folder>
28.21 + </folders>
28.22 + <ide-actions>
28.23 + <action name="build">
28.24 + <script>${ant.script}</script>
28.25 + <target>compile</target>
28.26 + </action>
28.27 + <action name="clean">
28.28 + <script>${ant.script}</script>
28.29 + <target>clean</target>
28.30 + </action>
28.31 + <action name="run">
28.32 + <script>${ant.script}</script>
28.33 + <target>test</target>
28.34 + </action>
28.35 + <action name="test">
28.36 + <script>${ant.script}</script>
28.37 + <target>test</target>
28.38 + </action>
28.39 + <action name="rebuild">
28.40 + <script>${ant.script}</script>
28.41 + <target>clean</target>
28.42 + <target>compile</target>
28.43 + </action>
28.44 + </ide-actions>
28.45 + <export>
28.46 + <type>folder</type>
28.47 + <location>build/tests</location>
28.48 + <script>${ant.script}</script>
28.49 + <build-target>compile</build-target>
28.50 + </export>
28.51 + <view>
28.52 + <items>
28.53 + <source-folder style="packages">
28.54 + <label>test</label>
28.55 + <location>test</location>
28.56 + </source-folder>
28.57 + <source-file>
28.58 + <location>${ant.script}</location>
28.59 + </source-file>
28.60 + </items>
28.61 + <context-menu>
28.62 + <ide-action name="build"/>
28.63 + <ide-action name="clean"/>
28.64 + <ide-action name="run"/>
28.65 + <ide-action name="test"/>
28.66 + <ide-action name="rebuild"/>
28.67 + </context-menu>
28.68 + </view>
28.69 + <subprojects/>
28.70 + </general-data>
28.71 + <java-data xmlns="http://www.netbeans.org/ns/freeform-project-java/1">
28.72 + <compilation-unit>
28.73 + <package-root>test</package-root>
28.74 + <classpath mode="compile">${apiA}:${apifest}/lib/junit-3.8.2.jar</classpath>
28.75 + <built-to>build/tests</built-to>
28.76 + <source-level>1.5</source-level>
28.77 + </compilation-unit>
28.78 + </java-data>
28.79 + </configuration>
28.80 +</project>
29.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
29.2 +++ b/samples/apifest1/day3-intermezzo/pnejedly/against-alwayscreatenewcircuit/project.properties Sat Jun 14 09:52:48 2008 +0200
29.3 @@ -0,0 +1,17 @@
29.4 +
29.5 +# location to root of the repository with apifest projects
29.6 +apifest=../../..
29.7 +
29.8 +# name of a project to test
29.9 +apitotest=alwayscreatenewcircuit
29.10 +
29.11 +# the test shall expose a problem between two versions
29.12 +# of one API. select the first version - dayA and a second
29.13 +# version of the of the API dayB
29.14 +dayA=${apifest}/day1
29.15 +dayB=${apifest}/day2
29.16 +
29.17 +# usual locations of API classes for each version
29.18 +apiA=${dayA}/${apitotest}/build/classes/
29.19 +apiB=${dayB}/${apitotest}/build/classes/
29.20 +
30.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
30.2 +++ b/samples/apifest1/day3-intermezzo/pnejedly/against-alwayscreatenewcircuit/test/apifest/CircuitTest.java Sat Jun 14 09:52:48 2008 +0200
30.3 @@ -0,0 +1,58 @@
30.4 +/*
30.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
30.6 + *
30.7 + * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
30.8 + *
30.9 + * The contents of this file are subject to the terms of either the GNU
30.10 + * General Public License Version 2 only ("GPL") or the Common
30.11 + * Development and Distribution License("CDDL") (collectively, the
30.12 + * "License"). You may not use this file except in compliance with the
30.13 + * License. You can obtain a copy of the License at
30.14 + * http://www.netbeans.org/cddl-gplv2.html
30.15 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
30.16 + * specific language governing permissions and limitations under the
30.17 + * License. When distributing the software, include this License Header
30.18 + * Notice in each file and include the License file at
30.19 + * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
30.20 + * particular file as subject to the "Classpath" exception as provided
30.21 + * by Sun in the GPL Version 2 section of the License file that
30.22 + * accompanied this code. If applicable, add the following below the
30.23 + * License Header, with the fields enclosed by brackets [] replaced by
30.24 + * your own identifying information:
30.25 + * "Portions Copyrighted [year] [name of copyright owner]"
30.26 + *
30.27 + * Contributor(s):
30.28 + *
30.29 + * The Original Software is NetBeans. The Initial Developer of the Original
30.30 + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
30.31 + * Microsystems, Inc. All Rights Reserved.
30.32 + *
30.33 + * If you wish your version of this file to be governed by only the CDDL
30.34 + * or only the GPL Version 2, indicate your decision by adding
30.35 + * "[Contributor] elects to include this software in this distribution
30.36 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
30.37 + * single choice of license, a recipient has the option to distribute
30.38 + * your version of this file under either the CDDL, the GPL Version 2 or
30.39 + * to extend the choice of license to its licensees as provided above.
30.40 + * However, if you add GPL Version 2 code and therefore, elected the GPL
30.41 + * Version 2 license, then the option applies only if the new code is
30.42 + * made subject to such option by the copyright holder.
30.43 + */
30.44 +package apifest;
30.45 +
30.46 +import junit.framework.TestCase;
30.47 +import org.netbeans.apifest.boolcircuit.Circuit;
30.48 +
30.49 +
30.50 +/** Write a test that works with version from day A and fails with version B.
30.51 + */
30.52 +public class CircuitTest extends TestCase {
30.53 + public CircuitTest(String n) {
30.54 + super(n);
30.55 + }
30.56 +
30.57 + public void testReallyUnrealistic() throws Exception {
30.58 + // OK, this is not fair, right?
30.59 + assertEquals(null, Circuit.or(false, false).getClass().getSuperclass().getSuperclass().getSuperclass());
30.60 + }
30.61 +}
31.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
31.2 +++ b/samples/apifest1/day3-intermezzo/pnejedly/against-elementbasedsolution/build.xml Sat Jun 14 09:52:48 2008 +0200
31.3 @@ -0,0 +1,97 @@
31.4 +<?xml version="1.0" encoding="UTF-8"?>
31.5 +<!-- this is a template file to test -->
31.6 +<project name="testing-template" default="run" basedir=".">
31.7 + <description>Builds the test against first version and runs them against two</description>
31.8 +
31.9 + <loadproperties srcfile="project.properties"/>
31.10 +
31.11 + <target name="make-sure-projects-are-compiled">
31.12 + <ant dir="${dayA}/${apitotest}" target="compile"/>
31.13 + <ant dir="${dayB}/${apitotest}" target="compile"/>
31.14 + </target>
31.15 +
31.16 + <target name="compile" depends="make-sure-projects-are-compiled">
31.17 + <mkdir dir="build/tests"/>
31.18 + <javac destdir="build/tests" srcdir="test">
31.19 + <classpath>
31.20 + <pathelement location="${apiA}"/>
31.21 + <pathelement location="${apifest}/lib/junit-3.8.2.jar"/>
31.22 + </classpath>
31.23 + </javac>
31.24 + </target>
31.25 +
31.26 + <target name="run" depends="-run-binary-check,-run-source-check">
31.27 + <fail message="The test shall either compile against A and not B or run on A and fail on B, nothing like that happened">
31.28 + <condition>
31.29 + <not><or>
31.30 + <isset property="execution.failed"/>
31.31 + <isset property="compilation.failed"/>
31.32 + </or></not>
31.33 + </condition>
31.34 + </fail>
31.35 + </target>
31.36 +
31.37 + <target name="-run-binary-check" depends="compile">
31.38 + <mkdir dir="build/testresultA"/>
31.39 + <junit dir="build/tests" failureproperty="run.on.A.shall.succeed">
31.40 + <batchtest todir="build/testresultA">
31.41 + <fileset dir="test" includes="**/*.java"/>
31.42 + </batchtest>
31.43 + <formatter type="brief" usefile="false"/>
31.44 + <formatter type="xml"/>
31.45 + <classpath>
31.46 + <pathelement location="${apiA}"/>
31.47 + <pathelement location="${apifest}/lib/junit-3.8.2.jar"/>
31.48 + <pathelement location="build/tests"/>
31.49 + </classpath>
31.50 + </junit>
31.51 +
31.52 + <mkdir dir="build/testresultB"/>
31.53 + <junit dir="build/tests" failureproperty="run.on.B.shall.fail">
31.54 + <batchtest todir="build/testresultB">
31.55 + <fileset dir="test" includes="**/*.java"/>
31.56 + </batchtest>
31.57 + <formatter type="brief" usefile="false"/>
31.58 + <formatter type="xml"/>
31.59 + <classpath>
31.60 + <pathelement location="${apiB}"/>
31.61 + <pathelement location="${apifest}/lib/junit-3.8.2.jar"/>
31.62 + <pathelement location="build/tests"/>
31.63 + </classpath>
31.64 + </junit>
31.65 +
31.66 + <condition property="execution.failed">
31.67 + <and>
31.68 + <isset property="run.on.B.shall.fail"/>
31.69 + <not><isset property="run.on.A.shall.succeed"/></not>
31.70 + </and>
31.71 + </condition>
31.72 + </target>
31.73 +
31.74 + <target name="-run-source-check" depends="compile" unless="execution.failed">
31.75 +
31.76 + <property name="build.b" location="build/verifyitbuildsagainstB"/>
31.77 + <delete dir="${build.b}"/>
31.78 + <mkdir dir="${build.b}"/>
31.79 + <javac destdir="${build.b}" srcdir="test" failonerror="false">
31.80 + <classpath>
31.81 + <pathelement location="${apiB}"/>
31.82 + <pathelement location="${apifest}/lib/junit-3.8.2.jar"/>
31.83 + </classpath>
31.84 + </javac>
31.85 +
31.86 +
31.87 + <uptodate property="compilation.failed">
31.88 + <srcfiles dir="${build.b}" includes="**/*.class"/>
31.89 + <mapper type="glob" from="*" to="build/tests/*"/>
31.90 + </uptodate>
31.91 +
31.92 +
31.93 + </target>
31.94 +
31.95 + <target name="test" depends="run"/>
31.96 +
31.97 + <target name="clean">
31.98 + <delete dir="build"/>
31.99 + </target>
31.100 +</project>
32.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
32.2 +++ b/samples/apifest1/day3-intermezzo/pnejedly/against-elementbasedsolution/nbproject/project.xml Sat Jun 14 09:52:48 2008 +0200
32.3 @@ -0,0 +1,77 @@
32.4 +<?xml version="1.0" encoding="UTF-8"?>
32.5 +<project xmlns="http://www.netbeans.org/ns/project/1">
32.6 + <type>org.netbeans.modules.ant.freeform</type>
32.7 + <configuration>
32.8 + <general-data xmlns="http://www.netbeans.org/ns/freeform-project/1">
32.9 + <!-- Do not use Project Properties customizer when editing this file manually. -->
32.10 + <name>against-elementbasedsolution</name>
32.11 + <properties>
32.12 + <property name="ant.script">build.xml</property>
32.13 + <property-file>project.properties</property-file>
32.14 + </properties>
32.15 + <folders>
32.16 + <source-folder>
32.17 + <label>test</label>
32.18 + <type>java</type>
32.19 + <location>test</location>
32.20 + </source-folder>
32.21 + </folders>
32.22 + <ide-actions>
32.23 + <action name="build">
32.24 + <script>${ant.script}</script>
32.25 + <target>compile</target>
32.26 + </action>
32.27 + <action name="clean">
32.28 + <script>${ant.script}</script>
32.29 + <target>clean</target>
32.30 + </action>
32.31 + <action name="run">
32.32 + <script>${ant.script}</script>
32.33 + <target>test</target>
32.34 + </action>
32.35 + <action name="test">
32.36 + <script>${ant.script}</script>
32.37 + <target>test</target>
32.38 + </action>
32.39 + <action name="rebuild">
32.40 + <script>${ant.script}</script>
32.41 + <target>clean</target>
32.42 + <target>compile</target>
32.43 + </action>
32.44 + </ide-actions>
32.45 + <export>
32.46 + <type>folder</type>
32.47 + <location>build/tests</location>
32.48 + <script>${ant.script}</script>
32.49 + <build-target>compile</build-target>
32.50 + </export>
32.51 + <view>
32.52 + <items>
32.53 + <source-folder style="packages">
32.54 + <label>test</label>
32.55 + <location>test</location>
32.56 + </source-folder>
32.57 + <source-file>
32.58 + <location>${ant.script}</location>
32.59 + </source-file>
32.60 + </items>
32.61 + <context-menu>
32.62 + <ide-action name="build"/>
32.63 + <ide-action name="clean"/>
32.64 + <ide-action name="run"/>
32.65 + <ide-action name="test"/>
32.66 + <ide-action name="rebuild"/>
32.67 + </context-menu>
32.68 + </view>
32.69 + <subprojects/>
32.70 + </general-data>
32.71 + <java-data xmlns="http://www.netbeans.org/ns/freeform-project-java/1">
32.72 + <compilation-unit>
32.73 + <package-root>test</package-root>
32.74 + <classpath mode="compile">${apiA}:${apifest}/lib/junit-3.8.2.jar</classpath>
32.75 + <built-to>build/tests</built-to>
32.76 + <source-level>1.5</source-level>
32.77 + </compilation-unit>
32.78 + </java-data>
32.79 + </configuration>
32.80 +</project>
33.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
33.2 +++ b/samples/apifest1/day3-intermezzo/pnejedly/against-elementbasedsolution/project.properties Sat Jun 14 09:52:48 2008 +0200
33.3 @@ -0,0 +1,17 @@
33.4 +
33.5 +# location to root of the repository with apifest projects
33.6 +apifest=../../..
33.7 +
33.8 +# name of a project to test
33.9 +apitotest=elementbasedsolution
33.10 +
33.11 +# the test shall expose a problem between two versions
33.12 +# of one API. select the first version - dayA and a second
33.13 +# version of the of the API dayB
33.14 +dayA=${apifest}/day1
33.15 +dayB=${apifest}/day2
33.16 +
33.17 +# usual locations of API classes for each version
33.18 +apiA=${dayA}/${apitotest}/build/classes/
33.19 +apiB=${dayB}/${apitotest}/build/classes/
33.20 +
34.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
34.2 +++ b/samples/apifest1/day3-intermezzo/pnejedly/against-elementbasedsolution/test/apifest/CircuitTest.java Sat Jun 14 09:52:48 2008 +0200
34.3 @@ -0,0 +1,63 @@
34.4 +/*
34.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
34.6 + *
34.7 + * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
34.8 + *
34.9 + * The contents of this file are subject to the terms of either the GNU
34.10 + * General Public License Version 2 only ("GPL") or the Common
34.11 + * Development and Distribution License("CDDL") (collectively, the
34.12 + * "License"). You may not use this file except in compliance with the
34.13 + * License. You can obtain a copy of the License at
34.14 + * http://www.netbeans.org/cddl-gplv2.html
34.15 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
34.16 + * specific language governing permissions and limitations under the
34.17 + * License. When distributing the software, include this License Header
34.18 + * Notice in each file and include the License file at
34.19 + * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
34.20 + * particular file as subject to the "Classpath" exception as provided
34.21 + * by Sun in the GPL Version 2 section of the License file that
34.22 + * accompanied this code. If applicable, add the following below the
34.23 + * License Header, with the fields enclosed by brackets [] replaced by
34.24 + * your own identifying information:
34.25 + * "Portions Copyrighted [year] [name of copyright owner]"
34.26 + *
34.27 + * Contributor(s):
34.28 + *
34.29 + * The Original Software is NetBeans. The Initial Developer of the Original
34.30 + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
34.31 + * Microsystems, Inc. All Rights Reserved.
34.32 + *
34.33 + * If you wish your version of this file to be governed by only the CDDL
34.34 + * or only the GPL Version 2, indicate your decision by adding
34.35 + * "[Contributor] elects to include this software in this distribution
34.36 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
34.37 + * single choice of license, a recipient has the option to distribute
34.38 + * your version of this file under either the CDDL, the GPL Version 2 or
34.39 + * to extend the choice of license to its licensees as provided above.
34.40 + * However, if you add GPL Version 2 code and therefore, elected the GPL
34.41 + * Version 2 license, then the option applies only if the new code is
34.42 + * made subject to such option by the copyright holder.
34.43 + */
34.44 +package apifest;
34.45 +
34.46 +import junit.framework.TestCase;
34.47 +import org.netbeans.apifest.boolcircuit.Circuit;
34.48 +
34.49 +
34.50 +/** Write a test that works with version from day A and fails with version B.
34.51 + */
34.52 +public class CircuitTest extends TestCase {
34.53 + public CircuitTest(String n) {
34.54 + super(n);
34.55 + }
34.56 + /**
34.57 + * OK, elementbasedsolution looked bulletproof. Every code path was exactly
34.58 + * the same as in the initial version. Except one.
34.59 + */
34.60 + public void testEvaluateWithoutAssign() throws Exception {
34.61 + Circuit.Variable var = Circuit.var();
34.62 + Circuit.Element circuit = Circuit.not(var);
34.63 +
34.64 + assertTrue (circuit.result());
34.65 + }
34.66 +}
35.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
35.2 +++ b/samples/apifest1/day3-intermezzo/pnejedly/against-inputandoperation/build.xml Sat Jun 14 09:52:48 2008 +0200
35.3 @@ -0,0 +1,97 @@
35.4 +<?xml version="1.0" encoding="UTF-8"?>
35.5 +<!-- this is a template file to test -->
35.6 +<project name="testing-template" default="run" basedir=".">
35.7 + <description>Builds the test against first version and runs them against two</description>
35.8 +
35.9 + <loadproperties srcfile="project.properties"/>
35.10 +
35.11 + <target name="make-sure-projects-are-compiled">
35.12 + <ant dir="${dayA}/${apitotest}" target="compile"/>
35.13 + <ant dir="${dayB}/${apitotest}" target="compile"/>
35.14 + </target>
35.15 +
35.16 + <target name="compile" depends="make-sure-projects-are-compiled">
35.17 + <mkdir dir="build/tests"/>
35.18 + <javac destdir="build/tests" srcdir="test">
35.19 + <classpath>
35.20 + <pathelement location="${apiA}"/>
35.21 + <pathelement location="${apifest}/lib/junit-3.8.2.jar"/>
35.22 + </classpath>
35.23 + </javac>
35.24 + </target>
35.25 +
35.26 + <target name="run" depends="-run-binary-check,-run-source-check">
35.27 + <fail message="The test shall either compile against A and not B or run on A and fail on B, nothing like that happened">
35.28 + <condition>
35.29 + <not><or>
35.30 + <isset property="execution.failed"/>
35.31 + <isset property="compilation.failed"/>
35.32 + </or></not>
35.33 + </condition>
35.34 + </fail>
35.35 + </target>
35.36 +
35.37 + <target name="-run-binary-check" depends="compile">
35.38 + <mkdir dir="build/testresultA"/>
35.39 + <junit dir="build/tests" failureproperty="run.on.A.shall.succeed">
35.40 + <batchtest todir="build/testresultA">
35.41 + <fileset dir="test" includes="**/*.java"/>
35.42 + </batchtest>
35.43 + <formatter type="brief" usefile="false"/>
35.44 + <formatter type="xml"/>
35.45 + <classpath>
35.46 + <pathelement location="${apiA}"/>
35.47 + <pathelement location="${apifest}/lib/junit-3.8.2.jar"/>
35.48 + <pathelement location="build/tests"/>
35.49 + </classpath>
35.50 + </junit>
35.51 +
35.52 + <mkdir dir="build/testresultB"/>
35.53 + <junit dir="build/tests" failureproperty="run.on.B.shall.fail">
35.54 + <batchtest todir="build/testresultB">
35.55 + <fileset dir="test" includes="**/*.java"/>
35.56 + </batchtest>
35.57 + <formatter type="brief" usefile="false"/>
35.58 + <formatter type="xml"/>
35.59 + <classpath>
35.60 + <pathelement location="${apiB}"/>
35.61 + <pathelement location="${apifest}/lib/junit-3.8.2.jar"/>
35.62 + <pathelement location="build/tests"/>
35.63 + </classpath>
35.64 + </junit>
35.65 +
35.66 + <condition property="execution.failed">
35.67 + <and>
35.68 + <isset property="run.on.B.shall.fail"/>
35.69 + <not><isset property="run.on.A.shall.succeed"/></not>
35.70 + </and>
35.71 + </condition>
35.72 + </target>
35.73 +
35.74 + <target name="-run-source-check" depends="compile" unless="execution.failed">
35.75 +
35.76 + <property name="build.b" location="build/verifyitbuildsagainstB"/>
35.77 + <delete dir="${build.b}"/>
35.78 + <mkdir dir="${build.b}"/>
35.79 + <javac destdir="${build.b}" srcdir="test" failonerror="false">
35.80 + <classpath>
35.81 + <pathelement location="${apiB}"/>
35.82 + <pathelement location="${apifest}/lib/junit-3.8.2.jar"/>
35.83 + </classpath>
35.84 + </javac>
35.85 +
35.86 +
35.87 + <uptodate property="compilation.failed">
35.88 + <srcfiles dir="${build.b}" includes="**/*.class"/>
35.89 + <mapper type="glob" from="*" to="build/tests/*"/>
35.90 + </uptodate>
35.91 +
35.92 +
35.93 + </target>
35.94 +
35.95 + <target name="test" depends="run"/>
35.96 +
35.97 + <target name="clean">
35.98 + <delete dir="build"/>
35.99 + </target>
35.100 +</project>
36.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
36.2 +++ b/samples/apifest1/day3-intermezzo/pnejedly/against-inputandoperation/nbproject/project.xml Sat Jun 14 09:52:48 2008 +0200
36.3 @@ -0,0 +1,77 @@
36.4 +<?xml version="1.0" encoding="UTF-8"?>
36.5 +<project xmlns="http://www.netbeans.org/ns/project/1">
36.6 + <type>org.netbeans.modules.ant.freeform</type>
36.7 + <configuration>
36.8 + <general-data xmlns="http://www.netbeans.org/ns/freeform-project/1">
36.9 + <!-- Do not use Project Properties customizer when editing this file manually. -->
36.10 + <name>against-inputandoperation</name>
36.11 + <properties>
36.12 + <property name="ant.script">build.xml</property>
36.13 + <property-file>project.properties</property-file>
36.14 + </properties>
36.15 + <folders>
36.16 + <source-folder>
36.17 + <label>test</label>
36.18 + <type>java</type>
36.19 + <location>test</location>
36.20 + </source-folder>
36.21 + </folders>
36.22 + <ide-actions>
36.23 + <action name="build">
36.24 + <script>${ant.script}</script>
36.25 + <target>compile</target>
36.26 + </action>
36.27 + <action name="clean">
36.28 + <script>${ant.script}</script>
36.29 + <target>clean</target>
36.30 + </action>
36.31 + <action name="run">
36.32 + <script>${ant.script}</script>
36.33 + <target>test</target>
36.34 + </action>
36.35 + <action name="test">
36.36 + <script>${ant.script}</script>
36.37 + <target>test</target>
36.38 + </action>
36.39 + <action name="rebuild">
36.40 + <script>${ant.script}</script>
36.41 + <target>clean</target>
36.42 + <target>compile</target>
36.43 + </action>
36.44 + </ide-actions>
36.45 + <export>
36.46 + <type>folder</type>
36.47 + <location>build/tests</location>
36.48 + <script>${ant.script}</script>
36.49 + <build-target>compile</build-target>
36.50 + </export>
36.51 + <view>
36.52 + <items>
36.53 + <source-folder style="packages">
36.54 + <label>test</label>
36.55 + <location>test</location>
36.56 + </source-folder>
36.57 + <source-file>
36.58 + <location>${ant.script}</location>
36.59 + </source-file>
36.60 + </items>
36.61 + <context-menu>
36.62 + <ide-action name="build"/>
36.63 + <ide-action name="clean"/>
36.64 + <ide-action name="run"/>
36.65 + <ide-action name="test"/>
36.66 + <ide-action name="rebuild"/>
36.67 + </context-menu>
36.68 + </view>
36.69 + <subprojects/>
36.70 + </general-data>
36.71 + <java-data xmlns="http://www.netbeans.org/ns/freeform-project-java/1">
36.72 + <compilation-unit>
36.73 + <package-root>test</package-root>
36.74 + <classpath mode="compile">${apiA}:${apifest}/lib/junit-3.8.2.jar</classpath>
36.75 + <built-to>build/tests</built-to>
36.76 + <source-level>1.5</source-level>
36.77 + </compilation-unit>
36.78 + </java-data>
36.79 + </configuration>
36.80 +</project>
37.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
37.2 +++ b/samples/apifest1/day3-intermezzo/pnejedly/against-inputandoperation/project.properties Sat Jun 14 09:52:48 2008 +0200
37.3 @@ -0,0 +1,17 @@
37.4 +
37.5 +# location to root of the repository with apifest projects
37.6 +apifest=../../..
37.7 +
37.8 +# name of a project to test
37.9 +apitotest=inputandoperation
37.10 +
37.11 +# the test shall expose a problem between two versions
37.12 +# of one API. select the first version - dayA and a second
37.13 +# version of the of the API dayB
37.14 +dayA=${apifest}/day1
37.15 +dayB=${apifest}/day2
37.16 +
37.17 +# usual locations of API classes for each version
37.18 +apiA=${dayA}/${apitotest}/build/classes/
37.19 +apiB=${dayB}/${apitotest}/build/classes/
37.20 +
38.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
38.2 +++ b/samples/apifest1/day3-intermezzo/pnejedly/against-inputandoperation/test/apifest/CircuitTest.java Sat Jun 14 09:52:48 2008 +0200
38.3 @@ -0,0 +1,64 @@
38.4 +/*
38.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
38.6 + *
38.7 + * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
38.8 + *
38.9 + * The contents of this file are subject to the terms of either the GNU
38.10 + * General Public License Version 2 only ("GPL") or the Common
38.11 + * Development and Distribution License("CDDL") (collectively, the
38.12 + * "License"). You may not use this file except in compliance with the
38.13 + * License. You can obtain a copy of the License at
38.14 + * http://www.netbeans.org/cddl-gplv2.html
38.15 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
38.16 + * specific language governing permissions and limitations under the
38.17 + * License. When distributing the software, include this License Header
38.18 + * Notice in each file and include the License file at
38.19 + * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
38.20 + * particular file as subject to the "Classpath" exception as provided
38.21 + * by Sun in the GPL Version 2 section of the License file that
38.22 + * accompanied this code. If applicable, add the following below the
38.23 + * License Header, with the fields enclosed by brackets [] replaced by
38.24 + * your own identifying information:
38.25 + * "Portions Copyrighted [year] [name of copyright owner]"
38.26 + *
38.27 + * Contributor(s):
38.28 + *
38.29 + * The Original Software is NetBeans. The Initial Developer of the Original
38.30 + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
38.31 + * Microsystems, Inc. All Rights Reserved.
38.32 + *
38.33 + * If you wish your version of this file to be governed by only the CDDL
38.34 + * or only the GPL Version 2, indicate your decision by adding
38.35 + * "[Contributor] elects to include this software in this distribution
38.36 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
38.37 + * single choice of license, a recipient has the option to distribute
38.38 + * your version of this file under either the CDDL, the GPL Version 2 or
38.39 + * to extend the choice of license to its licensees as provided above.
38.40 + * However, if you add GPL Version 2 code and therefore, elected the GPL
38.41 + * Version 2 license, then the option applies only if the new code is
38.42 + * made subject to such option by the copyright holder.
38.43 + */
38.44 +package apifest;
38.45 +
38.46 +import junit.framework.TestCase;
38.47 +import org.netbeans.apifest.boolcircuit.Circuit;
38.48 +import org.netbeans.apifest.boolcircuit.Operation;
38.49 +
38.50 +/** Write a test that works with version from day A and fails with version B.
38.51 + */
38.52 +public class CircuitTest extends TestCase {
38.53 + public CircuitTest(String n) {
38.54 + super(n);
38.55 + }
38.56 +
38.57 + public void testSourceCompatibility() throws Exception {
38.58 + }
38.59 +
38.60 + // One forgotten final and the dissaster is here.
38.61 + // Of course Circuit has to be public, but it has to be anyway to be usable
38.62 + class MyCircuit extends Circuit {
38.63 + public double evaluateRealOperation(Operation op) {
38.64 + return 0;
38.65 + }
38.66 + }
38.67 +}
39.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
39.2 +++ b/samples/apifest1/day3-intermezzo/pnejedly/against-stackbasedsolution/build.xml Sat Jun 14 09:52:48 2008 +0200
39.3 @@ -0,0 +1,97 @@
39.4 +<?xml version="1.0" encoding="UTF-8"?>
39.5 +<!-- this is a template file to test -->
39.6 +<project name="testing-template" default="run" basedir=".">
39.7 + <description>Builds the test against first version and runs them against two</description>
39.8 +
39.9 + <loadproperties srcfile="project.properties"/>
39.10 +
39.11 + <target name="make-sure-projects-are-compiled">
39.12 + <ant dir="${dayA}/${apitotest}" target="compile"/>
39.13 + <ant dir="${dayB}/${apitotest}" target="compile"/>
39.14 + </target>
39.15 +
39.16 + <target name="compile" depends="make-sure-projects-are-compiled">
39.17 + <mkdir dir="build/tests"/>
39.18 + <javac destdir="build/tests" srcdir="test">
39.19 + <classpath>
39.20 + <pathelement location="${apiA}"/>
39.21 + <pathelement location="${apifest}/lib/junit-3.8.2.jar"/>
39.22 + </classpath>
39.23 + </javac>
39.24 + </target>
39.25 +
39.26 + <target name="run" depends="-run-binary-check,-run-source-check">
39.27 + <fail message="The test shall either compile against A and not B or run on A and fail on B, nothing like that happened">
39.28 + <condition>
39.29 + <not><or>
39.30 + <isset property="execution.failed"/>
39.31 + <isset property="compilation.failed"/>
39.32 + </or></not>
39.33 + </condition>
39.34 + </fail>
39.35 + </target>
39.36 +
39.37 + <target name="-run-binary-check" depends="compile">
39.38 + <mkdir dir="build/testresultA"/>
39.39 + <junit dir="build/tests" failureproperty="run.on.A.shall.succeed">
39.40 + <batchtest todir="build/testresultA">
39.41 + <fileset dir="test" includes="**/*.java"/>
39.42 + </batchtest>
39.43 + <formatter type="brief" usefile="false"/>
39.44 + <formatter type="xml"/>
39.45 + <classpath>
39.46 + <pathelement location="${apiA}"/>
39.47 + <pathelement location="${apifest}/lib/junit-3.8.2.jar"/>
39.48 + <pathelement location="build/tests"/>
39.49 + </classpath>
39.50 + </junit>
39.51 +
39.52 + <mkdir dir="build/testresultB"/>
39.53 + <junit dir="build/tests" failureproperty="run.on.B.shall.fail">
39.54 + <batchtest todir="build/testresultB">
39.55 + <fileset dir="test" includes="**/*.java"/>
39.56 + </batchtest>
39.57 + <formatter type="brief" usefile="false"/>
39.58 + <formatter type="xml"/>
39.59 + <classpath>
39.60 + <pathelement location="${apiB}"/>
39.61 + <pathelement location="${apifest}/lib/junit-3.8.2.jar"/>
39.62 + <pathelement location="build/tests"/>
39.63 + </classpath>
39.64 + </junit>
39.65 +
39.66 + <condition property="execution.failed">
39.67 + <and>
39.68 + <isset property="run.on.B.shall.fail"/>
39.69 + <not><isset property="run.on.A.shall.succeed"/></not>
39.70 + </and>
39.71 + </condition>
39.72 + </target>
39.73 +
39.74 + <target name="-run-source-check" depends="compile" unless="execution.failed">
39.75 +
39.76 + <property name="build.b" location="build/verifyitbuildsagainstB"/>
39.77 + <delete dir="${build.b}"/>
39.78 + <mkdir dir="${build.b}"/>
39.79 + <javac destdir="${build.b}" srcdir="test" failonerror="false">
39.80 + <classpath>
39.81 + <pathelement location="${apiB}"/>
39.82 + <pathelement location="${apifest}/lib/junit-3.8.2.jar"/>
39.83 + </classpath>
39.84 + </javac>
39.85 +
39.86 +
39.87 + <uptodate property="compilation.failed">
39.88 + <srcfiles dir="${build.b}" includes="**/*.class"/>
39.89 + <mapper type="glob" from="*" to="build/tests/*"/>
39.90 + </uptodate>
39.91 +
39.92 +
39.93 + </target>
39.94 +
39.95 + <target name="test" depends="run"/>
39.96 +
39.97 + <target name="clean">
39.98 + <delete dir="build"/>
39.99 + </target>
39.100 +</project>
40.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
40.2 +++ b/samples/apifest1/day3-intermezzo/pnejedly/against-stackbasedsolution/nbproject/project.xml Sat Jun 14 09:52:48 2008 +0200
40.3 @@ -0,0 +1,77 @@
40.4 +<?xml version="1.0" encoding="UTF-8"?>
40.5 +<project xmlns="http://www.netbeans.org/ns/project/1">
40.6 + <type>org.netbeans.modules.ant.freeform</type>
40.7 + <configuration>
40.8 + <general-data xmlns="http://www.netbeans.org/ns/freeform-project/1">
40.9 + <!-- Do not use Project Properties customizer when editing this file manually. -->
40.10 + <name>against-stackbasedsolution</name>
40.11 + <properties>
40.12 + <property name="ant.script">build.xml</property>
40.13 + <property-file>project.properties</property-file>
40.14 + </properties>
40.15 + <folders>
40.16 + <source-folder>
40.17 + <label>test</label>
40.18 + <type>java</type>
40.19 + <location>test</location>
40.20 + </source-folder>
40.21 + </folders>
40.22 + <ide-actions>
40.23 + <action name="build">
40.24 + <script>${ant.script}</script>
40.25 + <target>compile</target>
40.26 + </action>
40.27 + <action name="clean">
40.28 + <script>${ant.script}</script>
40.29 + <target>clean</target>
40.30 + </action>
40.31 + <action name="run">
40.32 + <script>${ant.script}</script>
40.33 + <target>test</target>
40.34 + </action>
40.35 + <action name="test">
40.36 + <script>${ant.script}</script>
40.37 + <target>test</target>
40.38 + </action>
40.39 + <action name="rebuild">
40.40 + <script>${ant.script}</script>
40.41 + <target>clean</target>
40.42 + <target>compile</target>
40.43 + </action>
40.44 + </ide-actions>
40.45 + <export>
40.46 + <type>folder</type>
40.47 + <location>build/tests</location>
40.48 + <script>${ant.script}</script>
40.49 + <build-target>compile</build-target>
40.50 + </export>
40.51 + <view>
40.52 + <items>
40.53 + <source-folder style="packages">
40.54 + <label>test</label>
40.55 + <location>test</location>
40.56 + </source-folder>
40.57 + <source-file>
40.58 + <location>${ant.script}</location>
40.59 + </source-file>
40.60 + </items>
40.61 + <context-menu>
40.62 + <ide-action name="build"/>
40.63 + <ide-action name="clean"/>
40.64 + <ide-action name="run"/>
40.65 + <ide-action name="test"/>
40.66 + <ide-action name="rebuild"/>
40.67 + </context-menu>
40.68 + </view>
40.69 + <subprojects/>
40.70 + </general-data>
40.71 + <java-data xmlns="http://www.netbeans.org/ns/freeform-project-java/1">
40.72 + <compilation-unit>
40.73 + <package-root>test</package-root>
40.74 + <classpath mode="compile">../../../lib/junit-3.8.2.jar:../../../day1/stackbasedsolution/dist/boolcircuit.jar</classpath>
40.75 + <built-to>build/tests</built-to>
40.76 + <source-level>1.5</source-level>
40.77 + </compilation-unit>
40.78 + </java-data>
40.79 + </configuration>
40.80 +</project>
41.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
41.2 +++ b/samples/apifest1/day3-intermezzo/pnejedly/against-stackbasedsolution/project.properties Sat Jun 14 09:52:48 2008 +0200
41.3 @@ -0,0 +1,17 @@
41.4 +
41.5 +# location to root of the repository with apifest projects
41.6 +apifest=../../..
41.7 +
41.8 +# name of a project to test
41.9 +apitotest=stackbasedsolution
41.10 +
41.11 +# the test shall expose a problem between two versions
41.12 +# of one API. select the first version - dayA and a second
41.13 +# version of the of the API dayB
41.14 +dayA=${apifest}/day1
41.15 +dayB=${apifest}/day2
41.16 +
41.17 +# usual locations of API classes for each version
41.18 +apiA=${dayA}/${apitotest}/build/classes/
41.19 +apiB=${dayB}/${apitotest}/build/classes/
41.20 +
42.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
42.2 +++ b/samples/apifest1/day3-intermezzo/pnejedly/against-stackbasedsolution/test/apifest/CircuitTest.java Sat Jun 14 09:52:48 2008 +0200
42.3 @@ -0,0 +1,95 @@
42.4 +/*
42.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
42.6 + *
42.7 + * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
42.8 + *
42.9 + * The contents of this file are subject to the terms of either the GNU
42.10 + * General Public License Version 2 only ("GPL") or the Common
42.11 + * Development and Distribution License("CDDL") (collectively, the
42.12 + * "License"). You may not use this file except in compliance with the
42.13 + * License. You can obtain a copy of the License at
42.14 + * http://www.netbeans.org/cddl-gplv2.html
42.15 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
42.16 + * specific language governing permissions and limitations under the
42.17 + * License. When distributing the software, include this License Header
42.18 + * Notice in each file and include the License file at
42.19 + * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
42.20 + * particular file as subject to the "Classpath" exception as provided
42.21 + * by Sun in the GPL Version 2 section of the License file that
42.22 + * accompanied this code. If applicable, add the following below the
42.23 + * License Header, with the fields enclosed by brackets [] replaced by
42.24 + * your own identifying information:
42.25 + * "Portions Copyrighted [year] [name of copyright owner]"
42.26 + *
42.27 + * Contributor(s):
42.28 + *
42.29 + * The Original Software is NetBeans. The Initial Developer of the Original
42.30 + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
42.31 + * Microsystems, Inc. All Rights Reserved.
42.32 + *
42.33 + * If you wish your version of this file to be governed by only the CDDL
42.34 + * or only the GPL Version 2, indicate your decision by adding
42.35 + * "[Contributor] elects to include this software in this distribution
42.36 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
42.37 + * single choice of license, a recipient has the option to distribute
42.38 + * your version of this file under either the CDDL, the GPL Version 2 or
42.39 + * to extend the choice of license to its licensees as provided above.
42.40 + * However, if you add GPL Version 2 code and therefore, elected the GPL
42.41 + * Version 2 license, then the option applies only if the new code is
42.42 + * made subject to such option by the copyright holder.
42.43 + */
42.44 +package apifest;
42.45 +
42.46 +import java.util.Arrays;
42.47 +import java.util.Stack;
42.48 +import junit.framework.TestCase;
42.49 +import org.netbeans.apifest.boolcircuit.Circuit;
42.50 +import org.netbeans.apifest.boolcircuit.CircuitFactory;
42.51 +import org.netbeans.apifest.boolcircuit.Operation;
42.52 +
42.53 +
42.54 +/** Write a test that works with version from day A and fails with version B.
42.55 + */
42.56 +public class CircuitTest extends TestCase {
42.57 + public CircuitTest(String n) {
42.58 + super(n);
42.59 + }
42.60 +
42.61 + // no need to comment
42.62 +
42.63 + public void testSourceComp() throws Exception {
42.64 + Operation nand = new Operation() {
42.65 + public char evaluate(char i1, char i2) throws IllegalArgumentException {
42.66 + return i1 == '1' && i2 == '1' ? '0' : '1';
42.67 + }
42.68 + };
42.69 + }
42.70 +
42.71 + public void testSourceComp2() throws Exception {
42.72 + Operation nand = new Operation() {
42.73 + public char evaluate(char i1, char i2) throws IllegalArgumentException {
42.74 + evaluate(1, 2);
42.75 + return i1 == '1' && i2 == '1' ? '0' : '1';
42.76 + }
42.77 + // checker
42.78 + public char evaluate(double d1, double d2) {
42.79 + return '1';
42.80 + }
42.81 + };
42.82 + }
42.83 +
42.84 + public void testBinaryComp() throws Exception {
42.85 + Operation nand = new Operation() {
42.86 + public char evaluate(char i1, char i2) throws IllegalArgumentException {
42.87 + return i1 == '1' && i2 == '1' ? '0' : '1';
42.88 + }
42.89 + };
42.90 + Circuit cir = CircuitFactory.getBasicCircuit(nand);
42.91 +
42.92 + Stack<Character> s = new Stack<Character> ();
42.93 + s.addAll(Arrays.asList('0', '1'));
42.94 +
42.95 + assertEquals('1', cir.evaluate(s));
42.96 + }
42.97 +
42.98 +}
43.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
43.2 +++ b/samples/apifest1/day3-intermezzo/pnejedly/against-subclassingsolution/build.xml Sat Jun 14 09:52:48 2008 +0200
43.3 @@ -0,0 +1,97 @@
43.4 +<?xml version="1.0" encoding="UTF-8"?>
43.5 +<!-- this is a template file to test -->
43.6 +<project name="testing-template" default="run" basedir=".">
43.7 + <description>Builds the test against first version and runs them against two</description>
43.8 +
43.9 + <loadproperties srcfile="project.properties"/>
43.10 +
43.11 + <target name="make-sure-projects-are-compiled">
43.12 + <ant dir="${dayA}/${apitotest}" target="compile"/>
43.13 + <ant dir="${dayB}/${apitotest}" target="compile"/>
43.14 + </target>
43.15 +
43.16 + <target name="compile" depends="make-sure-projects-are-compiled">
43.17 + <mkdir dir="build/tests"/>
43.18 + <javac destdir="build/tests" srcdir="test">
43.19 + <classpath>
43.20 + <pathelement location="${apiA}"/>
43.21 + <pathelement location="${apifest}/lib/junit-3.8.2.jar"/>
43.22 + </classpath>
43.23 + </javac>
43.24 + </target>
43.25 +
43.26 + <target name="run" depends="-run-binary-check,-run-source-check">
43.27 + <fail message="The test shall either compile against A and not B or run on A and fail on B, nothing like that happened">
43.28 + <condition>
43.29 + <not><or>
43.30 + <isset property="execution.failed"/>
43.31 + <isset property="compilation.failed"/>
43.32 + </or></not>
43.33 + </condition>
43.34 + </fail>
43.35 + </target>
43.36 +
43.37 + <target name="-run-binary-check" depends="compile">
43.38 + <mkdir dir="build/testresultA"/>
43.39 + <junit dir="build/tests" failureproperty="run.on.A.shall.succeed">
43.40 + <batchtest todir="build/testresultA">
43.41 + <fileset dir="test" includes="**/*.java"/>
43.42 + </batchtest>
43.43 + <formatter type="brief" usefile="false"/>
43.44 + <formatter type="xml"/>
43.45 + <classpath>
43.46 + <pathelement location="${apiA}"/>
43.47 + <pathelement location="${apifest}/lib/junit-3.8.2.jar"/>
43.48 + <pathelement location="build/tests"/>
43.49 + </classpath>
43.50 + </junit>
43.51 +
43.52 + <mkdir dir="build/testresultB"/>
43.53 + <junit dir="build/tests" failureproperty="run.on.B.shall.fail">
43.54 + <batchtest todir="build/testresultB">
43.55 + <fileset dir="test" includes="**/*.java"/>
43.56 + </batchtest>
43.57 + <formatter type="brief" usefile="false"/>
43.58 + <formatter type="xml"/>
43.59 + <classpath>
43.60 + <pathelement location="${apiB}"/>
43.61 + <pathelement location="${apifest}/lib/junit-3.8.2.jar"/>
43.62 + <pathelement location="build/tests"/>
43.63 + </classpath>
43.64 + </junit>
43.65 +
43.66 + <condition property="execution.failed">
43.67 + <and>
43.68 + <isset property="run.on.B.shall.fail"/>
43.69 + <not><isset property="run.on.A.shall.succeed"/></not>
43.70 + </and>
43.71 + </condition>
43.72 + </target>
43.73 +
43.74 + <target name="-run-source-check" depends="compile" unless="execution.failed">
43.75 +
43.76 + <property name="build.b" location="build/verifyitbuildsagainstB"/>
43.77 + <delete dir="${build.b}"/>
43.78 + <mkdir dir="${build.b}"/>
43.79 + <javac destdir="${build.b}" srcdir="test" failonerror="false">
43.80 + <classpath>
43.81 + <pathelement location="${apiB}"/>
43.82 + <pathelement location="${apifest}/lib/junit-3.8.2.jar"/>
43.83 + </classpath>
43.84 + </javac>
43.85 +
43.86 +
43.87 + <uptodate property="compilation.failed">
43.88 + <srcfiles dir="${build.b}" includes="**/*.class"/>
43.89 + <mapper type="glob" from="*" to="build/tests/*"/>
43.90 + </uptodate>
43.91 +
43.92 +
43.93 + </target>
43.94 +
43.95 + <target name="test" depends="run"/>
43.96 +
43.97 + <target name="clean">
43.98 + <delete dir="build"/>
43.99 + </target>
43.100 +</project>
44.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
44.2 +++ b/samples/apifest1/day3-intermezzo/pnejedly/against-subclassingsolution/nbproject/project.xml Sat Jun 14 09:52:48 2008 +0200
44.3 @@ -0,0 +1,77 @@
44.4 +<?xml version="1.0" encoding="UTF-8"?>
44.5 +<project xmlns="http://www.netbeans.org/ns/project/1">
44.6 + <type>org.netbeans.modules.ant.freeform</type>
44.7 + <configuration>
44.8 + <general-data xmlns="http://www.netbeans.org/ns/freeform-project/1">
44.9 + <!-- Do not use Project Properties customizer when editing this file manually. -->
44.10 + <name>against-subclassingsolution</name>
44.11 + <properties>
44.12 + <property name="ant.script">build.xml</property>
44.13 + <property-file>project.properties</property-file>
44.14 + </properties>
44.15 + <folders>
44.16 + <source-folder>
44.17 + <label>test</label>
44.18 + <type>java</type>
44.19 + <location>test</location>
44.20 + </source-folder>
44.21 + </folders>
44.22 + <ide-actions>
44.23 + <action name="build">
44.24 + <script>${ant.script}</script>
44.25 + <target>compile</target>
44.26 + </action>
44.27 + <action name="clean">
44.28 + <script>${ant.script}</script>
44.29 + <target>clean</target>
44.30 + </action>
44.31 + <action name="run">
44.32 + <script>${ant.script}</script>
44.33 + <target>test</target>
44.34 + </action>
44.35 + <action name="test">
44.36 + <script>${ant.script}</script>
44.37 + <target>test</target>
44.38 + </action>
44.39 + <action name="rebuild">
44.40 + <script>${ant.script}</script>
44.41 + <target>clean</target>
44.42 + <target>compile</target>
44.43 + </action>
44.44 + </ide-actions>
44.45 + <export>
44.46 + <type>folder</type>
44.47 + <location>build/tests</location>
44.48 + <script>${ant.script}</script>
44.49 + <build-target>compile</build-target>
44.50 + </export>
44.51 + <view>
44.52 + <items>
44.53 + <source-folder style="packages">
44.54 + <label>test</label>
44.55 + <location>test</location>
44.56 + </source-folder>
44.57 + <source-file>
44.58 + <location>${ant.script}</location>
44.59 + </source-file>
44.60 + </items>
44.61 + <context-menu>
44.62 + <ide-action name="build"/>
44.63 + <ide-action name="clean"/>
44.64 + <ide-action name="run"/>
44.65 + <ide-action name="test"/>
44.66 + <ide-action name="rebuild"/>
44.67 + </context-menu>
44.68 + </view>
44.69 + <subprojects/>
44.70 + </general-data>
44.71 + <java-data xmlns="http://www.netbeans.org/ns/freeform-project-java/1">
44.72 + <compilation-unit>
44.73 + <package-root>test</package-root>
44.74 + <classpath mode="compile">${apiA}:${apifest}/lib/junit-3.8.2.jar</classpath>
44.75 + <built-to>build/tests</built-to>
44.76 + <source-level>1.5</source-level>
44.77 + </compilation-unit>
44.78 + </java-data>
44.79 + </configuration>
44.80 +</project>
45.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
45.2 +++ b/samples/apifest1/day3-intermezzo/pnejedly/against-subclassingsolution/project.properties Sat Jun 14 09:52:48 2008 +0200
45.3 @@ -0,0 +1,17 @@
45.4 +
45.5 +# location to root of the repository with apifest projects
45.6 +apifest=../../..
45.7 +
45.8 +# name of a project to test
45.9 +apitotest=subclassingsolution
45.10 +
45.11 +# the test shall expose a problem between two versions
45.12 +# of one API. select the first version - dayA and a second
45.13 +# version of the of the API dayB
45.14 +dayA=${apifest}/day1
45.15 +dayB=${apifest}/day2
45.16 +
45.17 +# usual locations of API classes for each version
45.18 +apiA=${dayA}/${apitotest}/build/classes/
45.19 +apiB=${dayB}/${apitotest}/build/classes/
45.20 +
46.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
46.2 +++ b/samples/apifest1/day3-intermezzo/pnejedly/against-subclassingsolution/test/apifest/CircuitTest.java Sat Jun 14 09:52:48 2008 +0200
46.3 @@ -0,0 +1,67 @@
46.4 +/*
46.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
46.6 + *
46.7 + * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
46.8 + *
46.9 + * The contents of this file are subject to the terms of either the GNU
46.10 + * General Public License Version 2 only ("GPL") or the Common
46.11 + * Development and Distribution License("CDDL") (collectively, the
46.12 + * "License"). You may not use this file except in compliance with the
46.13 + * License. You can obtain a copy of the License at
46.14 + * http://www.netbeans.org/cddl-gplv2.html
46.15 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
46.16 + * specific language governing permissions and limitations under the
46.17 + * License. When distributing the software, include this License Header
46.18 + * Notice in each file and include the License file at
46.19 + * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
46.20 + * particular file as subject to the "Classpath" exception as provided
46.21 + * by Sun in the GPL Version 2 section of the License file that
46.22 + * accompanied this code. If applicable, add the following below the
46.23 + * License Header, with the fields enclosed by brackets [] replaced by
46.24 + * your own identifying information:
46.25 + * "Portions Copyrighted [year] [name of copyright owner]"
46.26 + *
46.27 + * Contributor(s):
46.28 + *
46.29 + * The Original Software is NetBeans. The Initial Developer of the Original
46.30 + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
46.31 + * Microsystems, Inc. All Rights Reserved.
46.32 + *
46.33 + * If you wish your version of this file to be governed by only the CDDL
46.34 + * or only the GPL Version 2, indicate your decision by adding
46.35 + * "[Contributor] elects to include this software in this distribution
46.36 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
46.37 + * single choice of license, a recipient has the option to distribute
46.38 + * your version of this file under either the CDDL, the GPL Version 2 or
46.39 + * to extend the choice of license to its licensees as provided above.
46.40 + * However, if you add GPL Version 2 code and therefore, elected the GPL
46.41 + * Version 2 license, then the option applies only if the new code is
46.42 + * made subject to such option by the copyright holder.
46.43 + */
46.44 +package apifest;
46.45 +
46.46 +import junit.framework.TestCase;
46.47 +import org.netbeans.apifest.boolcircuit.Circuit;
46.48 +
46.49 +
46.50 +/** Write a test that works with version from day A and fails with version B.
46.51 + */
46.52 +public class CircuitTest extends TestCase {
46.53 + public CircuitTest(String n) {
46.54 + super(n);
46.55 + }
46.56 +
46.57 + // changing field type is incompatible
46.58 + public void testAnd() throws Exception {
46.59 + Circuit and = Circuit.AND;
46.60 + }
46.61 +
46.62 + // changing field type is incompatible
46.63 + public void testOr() throws Exception {
46.64 + Circuit or = Circuit.OR;
46.65 + }
46.66 +
46.67 + public void testNot() throws Exception {
46.68 + Circuit not = Circuit.NOT;
46.69 + }
46.70 +}
47.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
47.2 +++ b/samples/apifest1/day3-intermezzo/pnejedly/against-welltestedsolution/build.xml Sat Jun 14 09:52:48 2008 +0200
47.3 @@ -0,0 +1,97 @@
47.4 +<?xml version="1.0" encoding="UTF-8"?>
47.5 +<!-- this is a template file to test -->
47.6 +<project name="testing-template" default="run" basedir=".">
47.7 + <description>Builds the test against first version and runs them against two</description>
47.8 +
47.9 + <loadproperties srcfile="project.properties"/>
47.10 +
47.11 + <target name="make-sure-projects-are-compiled">
47.12 + <ant dir="${dayA}/${apitotest}" target="compile"/>
47.13 + <ant dir="${dayB}/${apitotest}" target="compile"/>
47.14 + </target>
47.15 +
47.16 + <target name="compile" depends="make-sure-projects-are-compiled">
47.17 + <mkdir dir="build/tests"/>
47.18 + <javac destdir="build/tests" srcdir="test">
47.19 + <classpath>
47.20 + <pathelement location="${apiA}"/>
47.21 + <pathelement location="${apifest}/lib/junit-3.8.2.jar"/>
47.22 + </classpath>
47.23 + </javac>
47.24 + </target>
47.25 +
47.26 + <target name="run" depends="-run-binary-check,-run-source-check">
47.27 + <fail message="The test shall either compile against A and not B or run on A and fail on B, nothing like that happened">
47.28 + <condition>
47.29 + <not><or>
47.30 + <isset property="execution.failed"/>
47.31 + <isset property="compilation.failed"/>
47.32 + </or></not>
47.33 + </condition>
47.34 + </fail>
47.35 + </target>
47.36 +
47.37 + <target name="-run-binary-check" depends="compile">
47.38 + <mkdir dir="build/testresultA"/>
47.39 + <junit dir="build/tests" failureproperty="run.on.A.shall.succeed">
47.40 + <batchtest todir="build/testresultA">
47.41 + <fileset dir="test" includes="**/*.java"/>
47.42 + </batchtest>
47.43 + <formatter type="brief" usefile="false"/>
47.44 + <formatter type="xml"/>
47.45 + <classpath>
47.46 + <pathelement location="${apiA}"/>
47.47 + <pathelement location="${apifest}/lib/junit-3.8.2.jar"/>
47.48 + <pathelement location="build/tests"/>
47.49 + </classpath>
47.50 + </junit>
47.51 +
47.52 + <mkdir dir="build/testresultB"/>
47.53 + <junit dir="build/tests" failureproperty="run.on.B.shall.fail">
47.54 + <batchtest todir="build/testresultB">
47.55 + <fileset dir="test" includes="**/*.java"/>
47.56 + </batchtest>
47.57 + <formatter type="brief" usefile="false"/>
47.58 + <formatter type="xml"/>
47.59 + <classpath>
47.60 + <pathelement location="${apiB}"/>
47.61 + <pathelement location="${apifest}/lib/junit-3.8.2.jar"/>
47.62 + <pathelement location="build/tests"/>
47.63 + </classpath>
47.64 + </junit>
47.65 +
47.66 + <condition property="execution.failed">
47.67 + <and>
47.68 + <isset property="run.on.B.shall.fail"/>
47.69 + <not><isset property="run.on.A.shall.succeed"/></not>
47.70 + </and>
47.71 + </condition>
47.72 + </target>
47.73 +
47.74 + <target name="-run-source-check" depends="compile" unless="execution.failed">
47.75 +
47.76 + <property name="build.b" location="build/verifyitbuildsagainstB"/>
47.77 + <delete dir="${build.b}"/>
47.78 + <mkdir dir="${build.b}"/>
47.79 + <javac destdir="${build.b}" srcdir="test" failonerror="false">
47.80 + <classpath>
47.81 + <pathelement location="${apiB}"/>
47.82 + <pathelement location="${apifest}/lib/junit-3.8.2.jar"/>
47.83 + </classpath>
47.84 + </javac>
47.85 +
47.86 +
47.87 + <uptodate property="compilation.failed">
47.88 + <srcfiles dir="${build.b}" includes="**/*.class"/>
47.89 + <mapper type="glob" from="*" to="build/tests/*"/>
47.90 + </uptodate>
47.91 +
47.92 +
47.93 + </target>
47.94 +
47.95 + <target name="test" depends="run"/>
47.96 +
47.97 + <target name="clean">
47.98 + <delete dir="build"/>
47.99 + </target>
47.100 +</project>
48.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
48.2 +++ b/samples/apifest1/day3-intermezzo/pnejedly/against-welltestedsolution/nbproject/project.xml Sat Jun 14 09:52:48 2008 +0200
48.3 @@ -0,0 +1,77 @@
48.4 +<?xml version="1.0" encoding="UTF-8"?>
48.5 +<project xmlns="http://www.netbeans.org/ns/project/1">
48.6 + <type>org.netbeans.modules.ant.freeform</type>
48.7 + <configuration>
48.8 + <general-data xmlns="http://www.netbeans.org/ns/freeform-project/1">
48.9 + <!-- Do not use Project Properties customizer when editing this file manually. -->
48.10 + <name>Against Well Tested Solution</name>
48.11 + <properties>
48.12 + <property name="ant.script">build.xml</property>
48.13 + <property-file>project.properties</property-file>
48.14 + </properties>
48.15 + <folders>
48.16 + <source-folder>
48.17 + <label>test</label>
48.18 + <type>java</type>
48.19 + <location>test</location>
48.20 + </source-folder>
48.21 + </folders>
48.22 + <ide-actions>
48.23 + <action name="build">
48.24 + <script>${ant.script}</script>
48.25 + <target>compile</target>
48.26 + </action>
48.27 + <action name="clean">
48.28 + <script>${ant.script}</script>
48.29 + <target>clean</target>
48.30 + </action>
48.31 + <action name="run">
48.32 + <script>${ant.script}</script>
48.33 + <target>test</target>
48.34 + </action>
48.35 + <action name="test">
48.36 + <script>${ant.script}</script>
48.37 + <target>test</target>
48.38 + </action>
48.39 + <action name="rebuild">
48.40 + <script>${ant.script}</script>
48.41 + <target>clean</target>
48.42 + <target>compile</target>
48.43 + </action>
48.44 + </ide-actions>
48.45 + <export>
48.46 + <type>folder</type>
48.47 + <location>build/tests</location>
48.48 + <script>${ant.script}</script>
48.49 + <build-target>compile</build-target>
48.50 + </export>
48.51 + <view>
48.52 + <items>
48.53 + <source-folder style="packages">
48.54 + <label>test</label>
48.55 + <location>test</location>
48.56 + </source-folder>
48.57 + <source-file>
48.58 + <location>${ant.script}</location>
48.59 + </source-file>
48.60 + </items>
48.61 + <context-menu>
48.62 + <ide-action name="build"/>
48.63 + <ide-action name="clean"/>
48.64 + <ide-action name="run"/>
48.65 + <ide-action name="test"/>
48.66 + <ide-action name="rebuild"/>
48.67 + </context-menu>
48.68 + </view>
48.69 + <subprojects/>
48.70 + </general-data>
48.71 + <java-data xmlns="http://www.netbeans.org/ns/freeform-project-java/1">
48.72 + <compilation-unit>
48.73 + <package-root>test</package-root>
48.74 + <classpath mode="compile">${apiA}:${apifest}/lib/junit-3.8.2.jar</classpath>
48.75 + <built-to>build/tests</built-to>
48.76 + <source-level>1.5</source-level>
48.77 + </compilation-unit>
48.78 + </java-data>
48.79 + </configuration>
48.80 +</project>
49.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
49.2 +++ b/samples/apifest1/day3-intermezzo/pnejedly/against-welltestedsolution/project.properties Sat Jun 14 09:52:48 2008 +0200
49.3 @@ -0,0 +1,17 @@
49.4 +
49.5 +# location to root of the repository with apifest projects
49.6 +apifest=../../..
49.7 +
49.8 +# name of a project to test
49.9 +apitotest=welltestedsolution
49.10 +
49.11 +# the test shall expose a problem between two versions
49.12 +# of one API. select the first version - dayA and a second
49.13 +# version of the of the API dayB
49.14 +dayA=${apifest}/day1
49.15 +dayB=${apifest}/day2
49.16 +
49.17 +# usual locations of API classes for each version
49.18 +apiA=${dayA}/${apitotest}/build/classes/
49.19 +apiB=${dayB}/${apitotest}/build/classes/
49.20 +
50.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
50.2 +++ b/samples/apifest1/day3-intermezzo/pnejedly/against-welltestedsolution/test/apifest/CircuitTest.java Sat Jun 14 09:52:48 2008 +0200
50.3 @@ -0,0 +1,67 @@
50.4 +/*
50.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
50.6 + *
50.7 + * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
50.8 + *
50.9 + * The contents of this file are subject to the terms of either the GNU
50.10 + * General Public License Version 2 only ("GPL") or the Common
50.11 + * Development and Distribution License("CDDL") (collectively, the
50.12 + * "License"). You may not use this file except in compliance with the
50.13 + * License. You can obtain a copy of the License at
50.14 + * http://www.netbeans.org/cddl-gplv2.html
50.15 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
50.16 + * specific language governing permissions and limitations under the
50.17 + * License. When distributing the software, include this License Header
50.18 + * Notice in each file and include the License file at
50.19 + * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
50.20 + * particular file as subject to the "Classpath" exception as provided
50.21 + * by Sun in the GPL Version 2 section of the License file that
50.22 + * accompanied this code. If applicable, add the following below the
50.23 + * License Header, with the fields enclosed by brackets [] replaced by
50.24 + * your own identifying information:
50.25 + * "Portions Copyrighted [year] [name of copyright owner]"
50.26 + *
50.27 + * Contributor(s):
50.28 + *
50.29 + * The Original Software is NetBeans. The Initial Developer of the Original
50.30 + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
50.31 + * Microsystems, Inc. All Rights Reserved.
50.32 + *
50.33 + * If you wish your version of this file to be governed by only the CDDL
50.34 + * or only the GPL Version 2, indicate your decision by adding
50.35 + * "[Contributor] elects to include this software in this distribution
50.36 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
50.37 + * single choice of license, a recipient has the option to distribute
50.38 + * your version of this file under either the CDDL, the GPL Version 2 or
50.39 + * to extend the choice of license to its licensees as provided above.
50.40 + * However, if you add GPL Version 2 code and therefore, elected the GPL
50.41 + * Version 2 license, then the option applies only if the new code is
50.42 + * made subject to such option by the copyright holder.
50.43 + */
50.44 +package apifest;
50.45 +
50.46 +import junit.framework.TestCase;
50.47 +import org.netbeans.apifest.boolcircuit.Circuit;
50.48 +
50.49 +
50.50 +/** Write a test that works with version from day A and fails with version B.
50.51 + */
50.52 +public class CircuitTest extends TestCase {
50.53 + public CircuitTest(String n) {
50.54 + super(n);
50.55 + }
50.56 +
50.57 + public void testClass() throws Exception {
50.58 + // OK, this is not fair as well.
50.59 + assertEquals("Created AND circuit", "AndCircuit", getName(Circuit.createAndCircuit(null, null)));
50.60 + assertEquals("Created OR circuit", "OrCircuit", getName(Circuit.createOrCircuit(null, null)));
50.61 + }
50.62 +
50.63 + private String getName(Object obj) {
50.64 + String base = obj.getClass().getName();
50.65 + int lastDot = base.lastIndexOf('.');
50.66 + int last = base.lastIndexOf('$');
50.67 + if (lastDot > last) last = lastDot;
50.68 + return base.substring(last+1);
50.69 + }
50.70 +}