1.1 --- a/samples/libs/build.xml Sat Jun 14 09:56:36 2008 +0200
1.2 +++ b/samples/libs/build.xml Sat Jun 14 09:56:56 2008 +0200
1.3 @@ -11,6 +11,11 @@
1.4 <param name="url" value="http://deadlock.netbeans.org/hudson/job/javadoc-nbms/lastSuccessfulBuild/artifact/nbbuild/nbms/platform8/org-openide-util.nbm"/>
1.5 </antcall>
1.6 <antcall target="-library-from-zip">
1.7 + <param name="library" value="org-openide-filesystems"/>
1.8 + <param name="library.include" value="**/org-openide-filesystems.jar"/>
1.9 + <param name="url" value="http://deadlock.netbeans.org/hudson/job/javadoc-nbms/lastSuccessfulBuild/artifact/nbbuild/nbms/platform8/org-openide-filesystems.nbm"/>
1.10 + </antcall>
1.11 + <antcall target="-library-from-zip">
1.12 <param name="library" value="org-netbeans-modules-nbjunit"/>
1.13 <param name="library.include" value="**/org-netbeans-modules-nbjunit.jar"/>
1.14 <param name="url" value="http://deadlock.netbeans.org/hudson/job/javadoc-nbms/lastSuccessfulBuild/artifact/nbbuild/nbms/testtools/org-netbeans-modules-nbjunit.nbm"/>
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2.2 +++ b/samples/unionfs/build.xml Sat Jun 14 09:56:56 2008 +0200
2.3 @@ -0,0 +1,69 @@
2.4 +<?xml version="1.0" encoding="UTF-8"?>
2.5 +<!-- You may freely edit this file. See commented blocks below for -->
2.6 +<!-- some examples of how to customize the build. -->
2.7 +<!-- (If you delete it and reopen the project it will be recreated.) -->
2.8 +<project name="unionfs" default="default" basedir=".">
2.9 + <description>Builds, tests, and runs the project unionfs.</description>
2.10 + <import file="nbproject/build-impl.xml"/>
2.11 + <!--
2.12 +
2.13 + There exist several targets which are by default empty and which can be
2.14 + used for execution of your tasks. These targets are usually executed
2.15 + before and after some main targets. They are:
2.16 +
2.17 + -pre-init: called before initialization of project properties
2.18 + -post-init: called after initialization of project properties
2.19 + -pre-compile: called before javac compilation
2.20 + -post-compile: called after javac compilation
2.21 + -pre-compile-single: called before javac compilation of single file
2.22 + -post-compile-single: called after javac compilation of single file
2.23 + -pre-compile-test: called before javac compilation of JUnit tests
2.24 + -post-compile-test: called after javac compilation of JUnit tests
2.25 + -pre-compile-test-single: called before javac compilation of single JUnit test
2.26 + -post-compile-test-single: called after javac compilation of single JUunit test
2.27 + -pre-jar: called before JAR building
2.28 + -post-jar: called after JAR building
2.29 + -post-clean: called after cleaning build products
2.30 +
2.31 + (Targets beginning with '-' are not intended to be called on their own.)
2.32 +
2.33 + Example of inserting an obfuscator after compilation could look like this:
2.34 +
2.35 + <target name="-post-compile">
2.36 + <obfuscate>
2.37 + <fileset dir="${build.classes.dir}"/>
2.38 + </obfuscate>
2.39 + </target>
2.40 +
2.41 + For list of available properties check the imported
2.42 + nbproject/build-impl.xml file.
2.43 +
2.44 +
2.45 + Another way to customize the build is by overriding existing main targets.
2.46 + The targets of interest are:
2.47 +
2.48 + -init-macrodef-javac: defines macro for javac compilation
2.49 + -init-macrodef-junit: defines macro for junit execution
2.50 + -init-macrodef-debug: defines macro for class debugging
2.51 + -init-macrodef-java: defines macro for class execution
2.52 + -do-jar-with-manifest: JAR building (if you are using a manifest)
2.53 + -do-jar-without-manifest: JAR building (if you are not using a manifest)
2.54 + run: execution of project
2.55 + -javadoc-build: Javadoc generation
2.56 + test-report: JUnit report generation
2.57 +
2.58 + An example of overriding the target for project execution could look like this:
2.59 +
2.60 + <target name="run" depends="unionfs-impl.jar">
2.61 + <exec dir="bin" executable="launcher.exe">
2.62 + <arg file="${dist.jar}"/>
2.63 + </exec>
2.64 + </target>
2.65 +
2.66 + Notice that the overridden target depends on the jar target and not only on
2.67 + the compile target as the regular run target does. Again, for a list of available
2.68 + properties which you can use, check the target you are overriding in the
2.69 + nbproject/build-impl.xml file.
2.70 +
2.71 + -->
2.72 +</project>
3.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
3.2 +++ b/samples/unionfs/nbproject/build-impl.xml Sat Jun 14 09:56:56 2008 +0200
3.3 @@ -0,0 +1,627 @@
3.4 +<?xml version="1.0" encoding="UTF-8"?>
3.5 +<!--
3.6 +*** GENERATED FROM project.xml - DO NOT EDIT ***
3.7 +*** EDIT ../build.xml INSTEAD ***
3.8 +
3.9 +For the purpose of easier reading the script
3.10 +is divided into following sections:
3.11 +
3.12 + - initialization
3.13 + - compilation
3.14 + - jar
3.15 + - execution
3.16 + - debugging
3.17 + - javadoc
3.18 + - junit compilation
3.19 + - junit execution
3.20 + - junit debugging
3.21 + - applet
3.22 + - cleanup
3.23 +
3.24 + -->
3.25 +<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="unionfs-impl">
3.26 + <target depends="test,jar,javadoc" description="Build and test whole project." name="default"/>
3.27 + <!--
3.28 + ======================
3.29 + INITIALIZATION SECTION
3.30 + ======================
3.31 + -->
3.32 + <target name="-pre-init">
3.33 + <!-- Empty placeholder for easier customization. -->
3.34 + <!-- You can override this target in the ../build.xml file. -->
3.35 + </target>
3.36 + <target depends="-pre-init" name="-init-private">
3.37 + <property file="nbproject/private/config.properties"/>
3.38 + <property file="nbproject/private/configs/${config}.properties"/>
3.39 + <property file="nbproject/private/private.properties"/>
3.40 + </target>
3.41 + <target depends="-pre-init,-init-private" name="-init-user">
3.42 + <property file="${user.properties.file}"/>
3.43 + <!-- The two properties below are usually overridden -->
3.44 + <!-- by the active platform. Just a fallback. -->
3.45 + <property name="default.javac.source" value="1.4"/>
3.46 + <property name="default.javac.target" value="1.4"/>
3.47 + </target>
3.48 + <target depends="-pre-init,-init-private,-init-user" name="-init-project">
3.49 + <property file="nbproject/configs/${config}.properties"/>
3.50 + <property file="nbproject/project.properties"/>
3.51 + </target>
3.52 + <target depends="-pre-init,-init-private,-init-user,-init-project,-init-macrodef-property" name="-do-init">
3.53 + <available file="${manifest.file}" property="manifest.available"/>
3.54 + <condition property="manifest.available+main.class">
3.55 + <and>
3.56 + <isset property="manifest.available"/>
3.57 + <isset property="main.class"/>
3.58 + <not>
3.59 + <equals arg1="${main.class}" arg2="" trim="true"/>
3.60 + </not>
3.61 + </and>
3.62 + </condition>
3.63 + <condition property="manifest.available+main.class+mkdist.available">
3.64 + <and>
3.65 + <istrue value="${manifest.available+main.class}"/>
3.66 + <isset property="libs.CopyLibs.classpath"/>
3.67 + </and>
3.68 + </condition>
3.69 + <condition property="have.tests">
3.70 + <or>
3.71 + <available file="${test.src.dir}"/>
3.72 + </or>
3.73 + </condition>
3.74 + <condition property="have.sources">
3.75 + <or>
3.76 + <available file="${src.dir}"/>
3.77 + </or>
3.78 + </condition>
3.79 + <condition property="netbeans.home+have.tests">
3.80 + <and>
3.81 + <isset property="netbeans.home"/>
3.82 + <isset property="have.tests"/>
3.83 + </and>
3.84 + </condition>
3.85 + <condition property="no.javadoc.preview">
3.86 + <and>
3.87 + <isset property="javadoc.preview"/>
3.88 + <isfalse value="${javadoc.preview}"/>
3.89 + </and>
3.90 + </condition>
3.91 + <property name="run.jvmargs" value=""/>
3.92 + <property name="javac.compilerargs" value=""/>
3.93 + <property name="work.dir" value="${basedir}"/>
3.94 + <condition property="no.deps">
3.95 + <and>
3.96 + <istrue value="${no.dependencies}"/>
3.97 + </and>
3.98 + </condition>
3.99 + <property name="javac.debug" value="true"/>
3.100 + <property name="javadoc.preview" value="true"/>
3.101 + <property name="application.args" value=""/>
3.102 + <property name="source.encoding" value="${file.encoding}"/>
3.103 + <condition property="javadoc.encoding.used" value="${javadoc.encoding}">
3.104 + <and>
3.105 + <isset property="javadoc.encoding"/>
3.106 + <not>
3.107 + <equals arg1="${javadoc.encoding}" arg2=""/>
3.108 + </not>
3.109 + </and>
3.110 + </condition>
3.111 + <property name="javadoc.encoding.used" value="${source.encoding}"/>
3.112 + <property name="includes" value="**"/>
3.113 + <property name="excludes" value=""/>
3.114 + <property name="do.depend" value="false"/>
3.115 + <condition property="do.depend.true">
3.116 + <istrue value="${do.depend}"/>
3.117 + </condition>
3.118 + <condition else="" property="javac.compilerargs.jaxws" value="-Djava.endorsed.dirs='${jaxws.endorsed.dir}'">
3.119 + <and>
3.120 + <isset property="jaxws.endorsed.dir"/>
3.121 + <available file="nbproject/jaxws-build.xml"/>
3.122 + </and>
3.123 + </condition>
3.124 + </target>
3.125 + <target name="-post-init">
3.126 + <!-- Empty placeholder for easier customization. -->
3.127 + <!-- You can override this target in the ../build.xml file. -->
3.128 + </target>
3.129 + <target depends="-pre-init,-init-private,-init-user,-init-project,-do-init" name="-init-check">
3.130 + <fail unless="src.dir">Must set src.dir</fail>
3.131 + <fail unless="test.src.dir">Must set test.src.dir</fail>
3.132 + <fail unless="build.dir">Must set build.dir</fail>
3.133 + <fail unless="dist.dir">Must set dist.dir</fail>
3.134 + <fail unless="build.classes.dir">Must set build.classes.dir</fail>
3.135 + <fail unless="dist.javadoc.dir">Must set dist.javadoc.dir</fail>
3.136 + <fail unless="build.test.classes.dir">Must set build.test.classes.dir</fail>
3.137 + <fail unless="build.test.results.dir">Must set build.test.results.dir</fail>
3.138 + <fail unless="build.classes.excludes">Must set build.classes.excludes</fail>
3.139 + <fail unless="dist.jar">Must set dist.jar</fail>
3.140 + </target>
3.141 + <target name="-init-macrodef-property">
3.142 + <macrodef name="property" uri="http://www.netbeans.org/ns/j2se-project/1">
3.143 + <attribute name="name"/>
3.144 + <attribute name="value"/>
3.145 + <sequential>
3.146 + <property name="@{name}" value="${@{value}}"/>
3.147 + </sequential>
3.148 + </macrodef>
3.149 + </target>
3.150 + <target name="-init-macrodef-javac">
3.151 + <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
3.152 + <attribute default="${src.dir}" name="srcdir"/>
3.153 + <attribute default="${build.classes.dir}" name="destdir"/>
3.154 + <attribute default="${javac.classpath}" name="classpath"/>
3.155 + <attribute default="${includes}" name="includes"/>
3.156 + <attribute default="${excludes}" name="excludes"/>
3.157 + <attribute default="${javac.debug}" name="debug"/>
3.158 + <attribute default="" name="sourcepath"/>
3.159 + <element name="customize" optional="true"/>
3.160 + <sequential>
3.161 + <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}">
3.162 + <classpath>
3.163 + <path path="@{classpath}"/>
3.164 + </classpath>
3.165 + <compilerarg line="${javac.compilerargs} ${javac.compilerargs.jaxws}"/>
3.166 + <customize/>
3.167 + </javac>
3.168 + </sequential>
3.169 + </macrodef>
3.170 + <macrodef name="depend" uri="http://www.netbeans.org/ns/j2se-project/3">
3.171 + <attribute default="${src.dir}" name="srcdir"/>
3.172 + <attribute default="${build.classes.dir}" name="destdir"/>
3.173 + <attribute default="${javac.classpath}" name="classpath"/>
3.174 + <sequential>
3.175 + <depend cache="${build.dir}/depcache" destdir="@{destdir}" excludes="${excludes}" includes="${includes}" srcdir="@{srcdir}">
3.176 + <classpath>
3.177 + <path path="@{classpath}"/>
3.178 + </classpath>
3.179 + </depend>
3.180 + </sequential>
3.181 + </macrodef>
3.182 + <macrodef name="force-recompile" uri="http://www.netbeans.org/ns/j2se-project/3">
3.183 + <attribute default="${build.classes.dir}" name="destdir"/>
3.184 + <sequential>
3.185 + <fail unless="javac.includes">Must set javac.includes</fail>
3.186 + <pathconvert pathsep="," property="javac.includes.binary">
3.187 + <path>
3.188 + <filelist dir="@{destdir}" files="${javac.includes}"/>
3.189 + </path>
3.190 + <globmapper from="*.java" to="*.class"/>
3.191 + </pathconvert>
3.192 + <delete>
3.193 + <files includes="${javac.includes.binary}"/>
3.194 + </delete>
3.195 + </sequential>
3.196 + </macrodef>
3.197 + </target>
3.198 + <target name="-init-macrodef-junit">
3.199 + <macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3">
3.200 + <attribute default="${includes}" name="includes"/>
3.201 + <attribute default="${excludes}" name="excludes"/>
3.202 + <attribute default="**" name="testincludes"/>
3.203 + <sequential>
3.204 + <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" showoutput="true">
3.205 + <batchtest todir="${build.test.results.dir}">
3.206 + <fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
3.207 + <filename name="@{testincludes}"/>
3.208 + </fileset>
3.209 + </batchtest>
3.210 + <classpath>
3.211 + <path path="${run.test.classpath}"/>
3.212 + </classpath>
3.213 + <syspropertyset>
3.214 + <propertyref prefix="test-sys-prop."/>
3.215 + <mapper from="test-sys-prop.*" to="*" type="glob"/>
3.216 + </syspropertyset>
3.217 + <formatter type="brief" usefile="false"/>
3.218 + <formatter type="xml"/>
3.219 + <jvmarg line="${run.jvmargs}"/>
3.220 + </junit>
3.221 + </sequential>
3.222 + </macrodef>
3.223 + </target>
3.224 + <target name="-init-macrodef-nbjpda">
3.225 + <macrodef name="nbjpdastart" uri="http://www.netbeans.org/ns/j2se-project/1">
3.226 + <attribute default="${main.class}" name="name"/>
3.227 + <attribute default="${debug.classpath}" name="classpath"/>
3.228 + <attribute default="" name="stopclassname"/>
3.229 + <sequential>
3.230 + <nbjpdastart addressproperty="jpda.address" name="@{name}" stopclassname="@{stopclassname}" transport="dt_socket">
3.231 + <classpath>
3.232 + <path path="@{classpath}"/>
3.233 + </classpath>
3.234 + </nbjpdastart>
3.235 + </sequential>
3.236 + </macrodef>
3.237 + <macrodef name="nbjpdareload" uri="http://www.netbeans.org/ns/j2se-project/1">
3.238 + <attribute default="${build.classes.dir}" name="dir"/>
3.239 + <sequential>
3.240 + <nbjpdareload>
3.241 + <fileset dir="@{dir}" includes="${fix.includes}*.class"/>
3.242 + </nbjpdareload>
3.243 + </sequential>
3.244 + </macrodef>
3.245 + </target>
3.246 + <target name="-init-debug-args">
3.247 + <property name="version-output" value="java version "${ant.java.version}"/>
3.248 + <condition property="have-jdk-older-than-1.4">
3.249 + <or>
3.250 + <contains string="${version-output}" substring="java version "1.0"/>
3.251 + <contains string="${version-output}" substring="java version "1.1"/>
3.252 + <contains string="${version-output}" substring="java version "1.2"/>
3.253 + <contains string="${version-output}" substring="java version "1.3"/>
3.254 + </or>
3.255 + </condition>
3.256 + <condition else="-Xdebug" property="debug-args-line" value="-Xdebug -Xnoagent -Djava.compiler=none">
3.257 + <istrue value="${have-jdk-older-than-1.4}"/>
3.258 + </condition>
3.259 + </target>
3.260 + <target depends="-init-debug-args" name="-init-macrodef-debug">
3.261 + <macrodef name="debug" uri="http://www.netbeans.org/ns/j2se-project/3">
3.262 + <attribute default="${main.class}" name="classname"/>
3.263 + <attribute default="${debug.classpath}" name="classpath"/>
3.264 + <element name="customize" optional="true"/>
3.265 + <sequential>
3.266 + <java classname="@{classname}" dir="${work.dir}" fork="true">
3.267 + <jvmarg line="${debug-args-line}"/>
3.268 + <jvmarg value="-Xrunjdwp:transport=dt_socket,address=${jpda.address}"/>
3.269 + <jvmarg line="${run.jvmargs}"/>
3.270 + <classpath>
3.271 + <path path="@{classpath}"/>
3.272 + </classpath>
3.273 + <syspropertyset>
3.274 + <propertyref prefix="run-sys-prop."/>
3.275 + <mapper from="run-sys-prop.*" to="*" type="glob"/>
3.276 + </syspropertyset>
3.277 + <customize/>
3.278 + </java>
3.279 + </sequential>
3.280 + </macrodef>
3.281 + </target>
3.282 + <target name="-init-macrodef-java">
3.283 + <macrodef name="java" uri="http://www.netbeans.org/ns/j2se-project/1">
3.284 + <attribute default="${main.class}" name="classname"/>
3.285 + <element name="customize" optional="true"/>
3.286 + <sequential>
3.287 + <java classname="@{classname}" dir="${work.dir}" fork="true">
3.288 + <jvmarg line="${run.jvmargs}"/>
3.289 + <classpath>
3.290 + <path path="${run.classpath}"/>
3.291 + </classpath>
3.292 + <syspropertyset>
3.293 + <propertyref prefix="run-sys-prop."/>
3.294 + <mapper from="run-sys-prop.*" to="*" type="glob"/>
3.295 + </syspropertyset>
3.296 + <customize/>
3.297 + </java>
3.298 + </sequential>
3.299 + </macrodef>
3.300 + </target>
3.301 + <target name="-init-presetdef-jar">
3.302 + <presetdef name="jar" uri="http://www.netbeans.org/ns/j2se-project/1">
3.303 + <jar compress="${jar.compress}" jarfile="${dist.jar}">
3.304 + <j2seproject1:fileset dir="${build.classes.dir}"/>
3.305 + </jar>
3.306 + </presetdef>
3.307 + </target>
3.308 + <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"/>
3.309 + <!--
3.310 + ===================
3.311 + COMPILATION SECTION
3.312 + ===================
3.313 + -->
3.314 + <target depends="init" name="deps-jar" unless="no.deps"/>
3.315 + <target depends="init,deps-jar" name="-pre-pre-compile">
3.316 + <mkdir dir="${build.classes.dir}"/>
3.317 + </target>
3.318 + <target name="-pre-compile">
3.319 + <!-- Empty placeholder for easier customization. -->
3.320 + <!-- You can override this target in the ../build.xml file. -->
3.321 + </target>
3.322 + <target if="do.depend.true" name="-compile-depend">
3.323 + <j2seproject3:depend/>
3.324 + </target>
3.325 + <target depends="init,deps-jar,-pre-pre-compile,-pre-compile,-compile-depend" if="have.sources" name="-do-compile">
3.326 + <j2seproject3:javac/>
3.327 + <copy todir="${build.classes.dir}">
3.328 + <fileset dir="${src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
3.329 + </copy>
3.330 + </target>
3.331 + <target name="-post-compile">
3.332 + <!-- Empty placeholder for easier customization. -->
3.333 + <!-- You can override this target in the ../build.xml file. -->
3.334 + </target>
3.335 + <target depends="init,deps-jar,-pre-pre-compile,-pre-compile,-do-compile,-post-compile" description="Compile project." name="compile"/>
3.336 + <target name="-pre-compile-single">
3.337 + <!-- Empty placeholder for easier customization. -->
3.338 + <!-- You can override this target in the ../build.xml file. -->
3.339 + </target>
3.340 + <target depends="init,deps-jar,-pre-pre-compile" name="-do-compile-single">
3.341 + <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
3.342 + <j2seproject3:force-recompile/>
3.343 + <j2seproject3:javac excludes="" includes="${javac.includes}" sourcepath="${src.dir}"/>
3.344 + </target>
3.345 + <target name="-post-compile-single">
3.346 + <!-- Empty placeholder for easier customization. -->
3.347 + <!-- You can override this target in the ../build.xml file. -->
3.348 + </target>
3.349 + <target depends="init,deps-jar,-pre-pre-compile,-pre-compile-single,-do-compile-single,-post-compile-single" name="compile-single"/>
3.350 + <!--
3.351 + ====================
3.352 + JAR BUILDING SECTION
3.353 + ====================
3.354 + -->
3.355 + <target depends="init" name="-pre-pre-jar">
3.356 + <dirname file="${dist.jar}" property="dist.jar.dir"/>
3.357 + <mkdir dir="${dist.jar.dir}"/>
3.358 + </target>
3.359 + <target name="-pre-jar">
3.360 + <!-- Empty placeholder for easier customization. -->
3.361 + <!-- You can override this target in the ../build.xml file. -->
3.362 + </target>
3.363 + <target depends="init,compile,-pre-pre-jar,-pre-jar" name="-do-jar-without-manifest" unless="manifest.available">
3.364 + <j2seproject1:jar/>
3.365 + </target>
3.366 + <target depends="init,compile,-pre-pre-jar,-pre-jar" if="manifest.available" name="-do-jar-with-manifest" unless="manifest.available+main.class">
3.367 + <j2seproject1:jar manifest="${manifest.file}"/>
3.368 + </target>
3.369 + <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">
3.370 + <j2seproject1:jar manifest="${manifest.file}">
3.371 + <j2seproject1:manifest>
3.372 + <j2seproject1:attribute name="Main-Class" value="${main.class}"/>
3.373 + </j2seproject1:manifest>
3.374 + </j2seproject1:jar>
3.375 + <echo>To run this application from the command line without Ant, try:</echo>
3.376 + <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
3.377 + <property location="${dist.jar}" name="dist.jar.resolved"/>
3.378 + <pathconvert property="run.classpath.with.dist.jar">
3.379 + <path path="${run.classpath}"/>
3.380 + <map from="${build.classes.dir.resolved}" to="${dist.jar.resolved}"/>
3.381 + </pathconvert>
3.382 + <echo>java -cp "${run.classpath.with.dist.jar}" ${main.class}</echo>
3.383 + </target>
3.384 + <target depends="init,compile,-pre-pre-jar,-pre-jar" if="manifest.available+main.class+mkdist.available" name="-do-jar-with-libraries">
3.385 + <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
3.386 + <pathconvert property="run.classpath.without.build.classes.dir">
3.387 + <path path="${run.classpath}"/>
3.388 + <map from="${build.classes.dir.resolved}" to=""/>
3.389 + </pathconvert>
3.390 + <pathconvert pathsep=" " property="jar.classpath">
3.391 + <path path="${run.classpath.without.build.classes.dir}"/>
3.392 + <chainedmapper>
3.393 + <flattenmapper/>
3.394 + <globmapper from="*" to="lib/*"/>
3.395 + </chainedmapper>
3.396 + </pathconvert>
3.397 + <taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/>
3.398 + <copylibs compress="${jar.compress}" jarfile="${dist.jar}" manifest="${manifest.file}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
3.399 + <fileset dir="${build.classes.dir}"/>
3.400 + <manifest>
3.401 + <attribute name="Main-Class" value="${main.class}"/>
3.402 + <attribute name="Class-Path" value="${jar.classpath}"/>
3.403 + </manifest>
3.404 + </copylibs>
3.405 + <echo>To run this application from the command line without Ant, try:</echo>
3.406 + <property location="${dist.jar}" name="dist.jar.resolved"/>
3.407 + <echo>java -jar "${dist.jar.resolved}"</echo>
3.408 + </target>
3.409 + <target name="-post-jar">
3.410 + <!-- Empty placeholder for easier customization. -->
3.411 + <!-- You can override this target in the ../build.xml file. -->
3.412 + </target>
3.413 + <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"/>
3.414 + <!--
3.415 + =================
3.416 + EXECUTION SECTION
3.417 + =================
3.418 + -->
3.419 + <target depends="init,compile" description="Run a main class." name="run">
3.420 + <j2seproject1:java>
3.421 + <customize>
3.422 + <arg line="${application.args}"/>
3.423 + </customize>
3.424 + </j2seproject1:java>
3.425 + </target>
3.426 + <target name="-do-not-recompile">
3.427 + <property name="javac.includes.binary" value=""/>
3.428 + </target>
3.429 + <target depends="init,-do-not-recompile,compile-single" name="run-single">
3.430 + <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
3.431 + <j2seproject1:java classname="${run.class}"/>
3.432 + </target>
3.433 + <!--
3.434 + =================
3.435 + DEBUGGING SECTION
3.436 + =================
3.437 + -->
3.438 + <target depends="init" if="netbeans.home" name="-debug-start-debugger">
3.439 + <j2seproject1:nbjpdastart name="${debug.class}"/>
3.440 + </target>
3.441 + <target depends="init,compile" name="-debug-start-debuggee">
3.442 + <j2seproject3:debug>
3.443 + <customize>
3.444 + <arg line="${application.args}"/>
3.445 + </customize>
3.446 + </j2seproject3:debug>
3.447 + </target>
3.448 + <target depends="init,compile,-debug-start-debugger,-debug-start-debuggee" description="Debug project in IDE." if="netbeans.home" name="debug"/>
3.449 + <target depends="init" if="netbeans.home" name="-debug-start-debugger-stepinto">
3.450 + <j2seproject1:nbjpdastart stopclassname="${main.class}"/>
3.451 + </target>
3.452 + <target depends="init,compile,-debug-start-debugger-stepinto,-debug-start-debuggee" if="netbeans.home" name="debug-stepinto"/>
3.453 + <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-single">
3.454 + <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
3.455 + <j2seproject3:debug classname="${debug.class}"/>
3.456 + </target>
3.457 + <target depends="init,-do-not-recompile,compile-single,-debug-start-debugger,-debug-start-debuggee-single" if="netbeans.home" name="debug-single"/>
3.458 + <target depends="init" name="-pre-debug-fix">
3.459 + <fail unless="fix.includes">Must set fix.includes</fail>
3.460 + <property name="javac.includes" value="${fix.includes}.java"/>
3.461 + </target>
3.462 + <target depends="init,-pre-debug-fix,compile-single" if="netbeans.home" name="-do-debug-fix">
3.463 + <j2seproject1:nbjpdareload/>
3.464 + </target>
3.465 + <target depends="init,-pre-debug-fix,-do-debug-fix" if="netbeans.home" name="debug-fix"/>
3.466 + <!--
3.467 + ===============
3.468 + JAVADOC SECTION
3.469 + ===============
3.470 + -->
3.471 + <target depends="init" name="-javadoc-build">
3.472 + <mkdir dir="${dist.javadoc.dir}"/>
3.473 + <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}">
3.474 + <classpath>
3.475 + <path path="${javac.classpath}"/>
3.476 + </classpath>
3.477 + <fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
3.478 + <filename name="**/*.java"/>
3.479 + </fileset>
3.480 + </javadoc>
3.481 + </target>
3.482 + <target depends="init,-javadoc-build" if="netbeans.home" name="-javadoc-browse" unless="no.javadoc.preview">
3.483 + <nbbrowse file="${dist.javadoc.dir}/index.html"/>
3.484 + </target>
3.485 + <target depends="init,-javadoc-build,-javadoc-browse" description="Build Javadoc." name="javadoc"/>
3.486 + <!--
3.487 + =========================
3.488 + JUNIT COMPILATION SECTION
3.489 + =========================
3.490 + -->
3.491 + <target depends="init,compile" if="have.tests" name="-pre-pre-compile-test">
3.492 + <mkdir dir="${build.test.classes.dir}"/>
3.493 + </target>
3.494 + <target name="-pre-compile-test">
3.495 + <!-- Empty placeholder for easier customization. -->
3.496 + <!-- You can override this target in the ../build.xml file. -->
3.497 + </target>
3.498 + <target if="do.depend.true" name="-compile-test-depend">
3.499 + <j2seproject3:depend classpath="${javac.test.classpath}" destdir="${build.test.classes.dir}" srcdir="${test.src.dir}"/>
3.500 + </target>
3.501 + <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-compile-test-depend" if="have.tests" name="-do-compile-test">
3.502 + <j2seproject3:javac classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" srcdir="${test.src.dir}"/>
3.503 + <copy todir="${build.test.classes.dir}">
3.504 + <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
3.505 + </copy>
3.506 + </target>
3.507 + <target name="-post-compile-test">
3.508 + <!-- Empty placeholder for easier customization. -->
3.509 + <!-- You can override this target in the ../build.xml file. -->
3.510 + </target>
3.511 + <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-do-compile-test,-post-compile-test" name="compile-test"/>
3.512 + <target name="-pre-compile-test-single">
3.513 + <!-- Empty placeholder for easier customization. -->
3.514 + <!-- You can override this target in the ../build.xml file. -->
3.515 + </target>
3.516 + <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single" if="have.tests" name="-do-compile-test-single">
3.517 + <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
3.518 + <j2seproject3:force-recompile destdir="${build.test.classes.dir}"/>
3.519 + <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}"/>
3.520 + <copy todir="${build.test.classes.dir}">
3.521 + <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
3.522 + </copy>
3.523 + </target>
3.524 + <target name="-post-compile-test-single">
3.525 + <!-- Empty placeholder for easier customization. -->
3.526 + <!-- You can override this target in the ../build.xml file. -->
3.527 + </target>
3.528 + <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single,-do-compile-test-single,-post-compile-test-single" name="compile-test-single"/>
3.529 + <!--
3.530 + =======================
3.531 + JUNIT EXECUTION SECTION
3.532 + =======================
3.533 + -->
3.534 + <target depends="init" if="have.tests" name="-pre-test-run">
3.535 + <mkdir dir="${build.test.results.dir}"/>
3.536 + </target>
3.537 + <target depends="init,compile-test,-pre-test-run" if="have.tests" name="-do-test-run">
3.538 + <j2seproject3:junit testincludes="**/*Test.java"/>
3.539 + </target>
3.540 + <target depends="init,compile-test,-pre-test-run,-do-test-run" if="have.tests" name="-post-test-run">
3.541 + <fail if="tests.failed">Some tests failed; see details above.</fail>
3.542 + </target>
3.543 + <target depends="init" if="have.tests" name="test-report"/>
3.544 + <target depends="init" if="netbeans.home+have.tests" name="-test-browse"/>
3.545 + <target depends="init,compile-test,-pre-test-run,-do-test-run,test-report,-post-test-run,-test-browse" description="Run unit tests." name="test"/>
3.546 + <target depends="init" if="have.tests" name="-pre-test-run-single">
3.547 + <mkdir dir="${build.test.results.dir}"/>
3.548 + </target>
3.549 + <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single">
3.550 + <fail unless="test.includes">Must select some files in the IDE or set test.includes</fail>
3.551 + <j2seproject3:junit excludes="" includes="${test.includes}"/>
3.552 + </target>
3.553 + <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single" if="have.tests" name="-post-test-run-single">
3.554 + <fail if="tests.failed">Some tests failed; see details above.</fail>
3.555 + </target>
3.556 + <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"/>
3.557 + <!--
3.558 + =======================
3.559 + JUNIT DEBUGGING SECTION
3.560 + =======================
3.561 + -->
3.562 + <target depends="init,compile-test" if="have.tests" name="-debug-start-debuggee-test">
3.563 + <fail unless="test.class">Must select one file in the IDE or set test.class</fail>
3.564 + <property location="${build.test.results.dir}/TEST-${test.class}.xml" name="test.report.file"/>
3.565 + <delete file="${test.report.file}"/>
3.566 + <mkdir dir="${build.test.results.dir}"/>
3.567 + <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}">
3.568 + <customize>
3.569 + <syspropertyset>
3.570 + <propertyref prefix="test-sys-prop."/>
3.571 + <mapper from="test-sys-prop.*" to="*" type="glob"/>
3.572 + </syspropertyset>
3.573 + <arg value="${test.class}"/>
3.574 + <arg value="showoutput=true"/>
3.575 + <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.BriefJUnitResultFormatter"/>
3.576 + <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,${test.report.file}"/>
3.577 + </customize>
3.578 + </j2seproject3:debug>
3.579 + </target>
3.580 + <target depends="init,compile-test" if="netbeans.home+have.tests" name="-debug-start-debugger-test">
3.581 + <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${test.class}"/>
3.582 + </target>
3.583 + <target depends="init,-do-not-recompile,compile-test-single,-debug-start-debugger-test,-debug-start-debuggee-test" name="debug-test"/>
3.584 + <target depends="init,-pre-debug-fix,compile-test-single" if="netbeans.home" name="-do-debug-fix-test">
3.585 + <j2seproject1:nbjpdareload dir="${build.test.classes.dir}"/>
3.586 + </target>
3.587 + <target depends="init,-pre-debug-fix,-do-debug-fix-test" if="netbeans.home" name="debug-fix-test"/>
3.588 + <!--
3.589 + =========================
3.590 + APPLET EXECUTION SECTION
3.591 + =========================
3.592 + -->
3.593 + <target depends="init,compile-single" name="run-applet">
3.594 + <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
3.595 + <j2seproject1:java classname="sun.applet.AppletViewer">
3.596 + <customize>
3.597 + <arg value="${applet.url}"/>
3.598 + </customize>
3.599 + </j2seproject1:java>
3.600 + </target>
3.601 + <!--
3.602 + =========================
3.603 + APPLET DEBUGGING SECTION
3.604 + =========================
3.605 + -->
3.606 + <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-applet">
3.607 + <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
3.608 + <j2seproject3:debug classname="sun.applet.AppletViewer">
3.609 + <customize>
3.610 + <arg value="${applet.url}"/>
3.611 + </customize>
3.612 + </j2seproject3:debug>
3.613 + </target>
3.614 + <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-applet" if="netbeans.home" name="debug-applet"/>
3.615 + <!--
3.616 + ===============
3.617 + CLEANUP SECTION
3.618 + ===============
3.619 + -->
3.620 + <target depends="init" name="deps-clean" unless="no.deps"/>
3.621 + <target depends="init" name="-do-clean">
3.622 + <delete dir="${build.dir}"/>
3.623 + <delete dir="${dist.dir}"/>
3.624 + </target>
3.625 + <target name="-post-clean">
3.626 + <!-- Empty placeholder for easier customization. -->
3.627 + <!-- You can override this target in the ../build.xml file. -->
3.628 + </target>
3.629 + <target depends="init,deps-clean,-do-clean,-post-clean" description="Clean build products." name="clean"/>
3.630 +</project>
4.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
4.2 +++ b/samples/unionfs/nbproject/genfiles.properties Sat Jun 14 09:56:56 2008 +0200
4.3 @@ -0,0 +1,8 @@
4.4 +build.xml.data.CRC32=31076a65
4.5 +build.xml.script.CRC32=977a9029
4.6 +build.xml.stylesheet.CRC32=be360661
4.7 +# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
4.8 +# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
4.9 +nbproject/build-impl.xml.data.CRC32=31076a65
4.10 +nbproject/build-impl.xml.script.CRC32=3625d6eb
4.11 +nbproject/build-impl.xml.stylesheet.CRC32=f1d9da08
5.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
5.2 +++ b/samples/unionfs/nbproject/project.properties Sat Jun 14 09:56:56 2008 +0200
5.3 @@ -0,0 +1,63 @@
5.4 +application.title=unionfs
5.5 +application.vendor=jarda
5.6 +build.classes.dir=${build.dir}/classes
5.7 +build.classes.excludes=**/*.java,**/*.form
5.8 +# This directory is removed when the project is cleaned:
5.9 +build.dir=build
5.10 +build.generated.dir=${build.dir}/generated
5.11 +# Only compile against the classpath explicitly listed here:
5.12 +build.sysclasspath=ignore
5.13 +build.test.classes.dir=${build.dir}/test/classes
5.14 +build.test.results.dir=${build.dir}/test/results
5.15 +debug.classpath=\
5.16 + ${run.classpath}
5.17 +debug.test.classpath=\
5.18 + ${run.test.classpath}
5.19 +# This directory is removed when the project is cleaned:
5.20 +dist.dir=dist
5.21 +dist.jar=${dist.dir}/unionfs.jar
5.22 +dist.javadoc.dir=${dist.dir}/javadoc
5.23 +excludes=
5.24 +file.reference.junit-4.4.jar=../libs/dist/junit-4.4.jar
5.25 +file.reference.org-openide-filesystems.jar=../libs/dist/org-openide-filesystems.jar
5.26 +file.reference.org-openide-util.jar=../libs/dist/org-openide-util.jar
5.27 +includes=**
5.28 +jar.compress=false
5.29 +javac.classpath=\
5.30 + ${file.reference.org-openide-util.jar}:\
5.31 + ${file.reference.org-openide-filesystems.jar}
5.32 +# Space-separated list of extra javac options
5.33 +javac.compilerargs=
5.34 +javac.deprecation=false
5.35 +javac.source=1.5
5.36 +javac.target=1.5
5.37 +javac.test.classpath=\
5.38 + ${javac.classpath}:\
5.39 + ${build.classes.dir}:\
5.40 + ${file.reference.junit-4.4.jar}
5.41 +javadoc.additionalparam=
5.42 +javadoc.author=false
5.43 +javadoc.encoding=${source.encoding}
5.44 +javadoc.noindex=false
5.45 +javadoc.nonavbar=false
5.46 +javadoc.notree=false
5.47 +javadoc.private=false
5.48 +javadoc.splitindex=true
5.49 +javadoc.use=true
5.50 +javadoc.version=false
5.51 +javadoc.windowtitle=
5.52 +meta.inf.dir=${src.dir}/META-INF
5.53 +platform.active=default_platform
5.54 +run.classpath=\
5.55 + ${javac.classpath}:\
5.56 + ${build.classes.dir}
5.57 +# Space-separated list of JVM arguments used when running the project
5.58 +# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value
5.59 +# or test-sys-prop.name=value to set system properties for unit tests):
5.60 +run.jvmargs=
5.61 +run.test.classpath=\
5.62 + ${javac.test.classpath}:\
5.63 + ${build.test.classes.dir}
5.64 +source.encoding=UTF-8
5.65 +src.dir=src
5.66 +test.src.dir=test
6.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
6.2 +++ b/samples/unionfs/nbproject/project.xml Sat Jun 14 09:56:56 2008 +0200
6.3 @@ -0,0 +1,16 @@
6.4 +<?xml version="1.0" encoding="UTF-8"?>
6.5 +<project xmlns="http://www.netbeans.org/ns/project/1">
6.6 + <type>org.netbeans.modules.java.j2seproject</type>
6.7 + <configuration>
6.8 + <data xmlns="http://www.netbeans.org/ns/j2se-project/3">
6.9 + <name>unionfs</name>
6.10 + <minimum-ant-version>1.6.5</minimum-ant-version>
6.11 + <source-roots>
6.12 + <root id="src.dir"/>
6.13 + </source-roots>
6.14 + <test-roots>
6.15 + <root id="test.src.dir"/>
6.16 + </test-roots>
6.17 + </data>
6.18 + </configuration>
6.19 +</project>
7.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
7.2 +++ b/samples/unionfs/src/org/apidesign/unionfs/UnionFS.java Sat Jun 14 09:56:56 2008 +0200
7.3 @@ -0,0 +1,20 @@
7.4 +package org.apidesign.unionfs;
7.5 +
7.6 +import java.net.URL;
7.7 +import org.openide.filesystems.FileSystem;
7.8 +import org.openide.filesystems.MultiFileSystem;
7.9 +import org.openide.filesystems.XMLFileSystem;
7.10 +import org.xml.sax.SAXException;
7.11 +
7.12 +public final class UnionFS {
7.13 + private UnionFS() {
7.14 + }
7.15 +
7.16 + public static FileSystem union(FileSystem... toUnion) {
7.17 + return new MultiFileSystem(toUnion);
7.18 + }
7.19 +
7.20 + public static FileSystem fromResource(URL stream) throws SAXException {
7.21 + return new XMLFileSystem(stream);
7.22 + }
7.23 +}
8.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
8.2 +++ b/samples/unionfs/src/org/apidesign/unionfs/fs-one.xml Sat Jun 14 09:56:56 2008 +0200
8.3 @@ -0,0 +1,10 @@
8.4 +<?xml version="1.0" encoding="UTF-8"?>
8.5 +<!DOCTYPE filesystem PUBLIC "-//NetBeans//DTD Filesystem 1.1//EN" "http://www.netbeans.org/dtds/filesystem-1_1.dtd">
8.6 +<!-- BEGIN: layer.xml -->
8.7 +<filesystem>
8.8 + <folder name="Menu">
8.9 + <file name="Open.instance"/>
8.10 + </folder>
8.11 +</filesystem>
8.12 +<!-- END: layer.xml -->
8.13 +
9.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
9.2 +++ b/samples/unionfs/src/org/apidesign/unionfs/fs-two.xml Sat Jun 14 09:56:56 2008 +0200
9.3 @@ -0,0 +1,7 @@
9.4 +<?xml version="1.0" encoding="UTF-8"?>
9.5 +<!DOCTYPE filesystem PUBLIC "-//NetBeans//DTD Filesystem 1.1//EN" "http://www.netbeans.org/dtds/filesystem-1_1.dtd">
9.6 +<filesystem>
9.7 + <folder name="Menu">
9.8 + <file name="Close.instance"/>
9.9 + </folder>
9.10 +</filesystem>
10.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
10.2 +++ b/samples/unionfs/test/org/apidesign/unionfs/UnionFSTest.java Sat Jun 14 09:56:56 2008 +0200
10.3 @@ -0,0 +1,65 @@
10.4 +package org.apidesign.unionfs;
10.5 +
10.6 +import java.util.Arrays;
10.7 +import java.util.HashSet;
10.8 +import java.util.Set;
10.9 +import org.junit.After;
10.10 +import org.junit.AfterClass;
10.11 +import org.junit.Before;
10.12 +import org.junit.BeforeClass;
10.13 +import org.junit.Test;
10.14 +import org.openide.filesystems.FileObject;
10.15 +import static org.junit.Assert.*;
10.16 +import org.openide.filesystems.FileSystem;
10.17 +import org.xml.sax.SAXException;
10.18 +
10.19 +public class UnionFSTest {
10.20 +
10.21 + public UnionFSTest() {
10.22 + }
10.23 +
10.24 + @BeforeClass
10.25 + public static void setUpClass() throws Exception {
10.26 + }
10.27 +
10.28 + @AfterClass
10.29 + public static void tearDownClass() throws Exception {
10.30 + }
10.31 +
10.32 + @Before
10.33 + public void setUp() {
10.34 + }
10.35 +
10.36 + @After
10.37 + public void tearDown() {
10.38 + }
10.39 +
10.40 + @Test
10.41 + public void union() throws SAXException {
10.42 + FileSystem one = UnionFS.fromResource(UnionFSTest.class.getResource("fs-one.xml"));
10.43 + assertChildren("There is just one file in the folder", one, "Menu", "Open.instance");
10.44 +
10.45 + FileSystem two = UnionFS.fromResource(UnionFSTest.class.getResource("fs-two.xml"));
10.46 + assertChildren("There is just one file in the other folder", two, "Menu", "Close.instance");
10.47 +
10.48 + FileSystem union = UnionFS.union(one, two);
10.49 + assertChildren("There both in the union", union, "Menu", "Open.instance", "Close.instance");
10.50 + }
10.51 +
10.52 + private static void assertChildren(String msg, FileSystem fs, String folder, String... expect) {
10.53 + Set<String> names = new HashSet<String>();
10.54 + names.addAll(Arrays.asList(expect));
10.55 +
10.56 + FileObject fo = fs.getRoot().getFileObject(folder);
10.57 + assertNotNull(msg + " folder " + folder + " has to exist", fo);
10.58 +
10.59 + for (FileObject ch : fo.getChildren()) {
10.60 + names.remove(ch.getNameExt());
10.61 + }
10.62 +
10.63 + if (!names.isEmpty()) {
10.64 + fail(msg + " - expected files not found " + names);
10.65 + }
10.66 + }
10.67 +
10.68 +}
10.69 \ No newline at end of file