Making the schema2beans tests up to date with the latest changes in the build infrastructure. Now all 28 tests pass.
1.1 --- a/schema2beans/test/build-unit.xml Wed Aug 04 15:49:56 2004 +0000
1.2 +++ b/schema2beans/test/build-unit.xml Fri Aug 06 13:46:22 2004 +0000
1.3 @@ -12,83 +12,26 @@
1.4 Microsystems, Inc. All Rights Reserved.
1.5 -->
1.6
1.7 -<project name="schema2beans logging tests compilers and executors" basedir="." default="all">
1.8 +<project name="schema2beans tests compilers and executors" basedir="." default="all">
1.9
1.10 -<!-- =================== -->
1.11 - <!-- Setting classpathes -->
1.12 - <!-- =================== -->
1.13
1.14 - <target name="set_classpath" depends="prepare-compile-classpath,prepare-codetest-classpath">
1.15 + <path id="schema2beans_test_cp">
1.16 + <pathelement location="${openide.dir}/${nb.lib.dir}/openide.jar"/>
1.17 + <pathelement location="${schema2beans/rt.dir}/${nb.modules.dir}/org-netbeans-modules-schema2beans.jar"/>
1.18 + <pathelement location="${schema2beans/dev.dir}/${nb.modules/autoload.dir}/schema2beansdev.jar"/>
1.19 + </path>
1.20
1.21 - <!-- During filling classpathes remember that only <module>/test
1.22 - is checked out during automated test execution so <module>/src
1.23 - or <module>/netbeans isn't available. If you need to add something
1.24 - from <module>/src or <module>/netbeans to classpath,
1.25 - look below to "setting advanced claspathes" part of this target.
1.26 - -->
1.27 -
1.28 - <!-- List of directories where jars will be searched. -->
1.29 - <property name="xtest.extra.jars.path" location="${netbeans.home}/lib"/>
1.30 -
1.31 - <!-- This jars is used for compilation, execution codetests and also for
1.32 - execution ide tests (it means this classpath will be mounted in repository).
1.33 - You can also write only name of jar or zip file, not in which directory it is and
1.34 - this file will be searched in directories specified by property xtest.extra.jars.path
1.35 - example: <property name="xtest.extra.jars" value="jemmy.jar;jelly.jar"/>
1.36 - -->
1.37 - <property name="xtest.extra.jars" value="openide.jar"/>
1.38 -
1.39 - <!-- These jars will be copied to directory ${netebans.home}/lib/ext.
1.40 - Again you can write only name of jar or zip file, not in which directory it is and
1.41 - this file will be searched in directories specified by property xtest.extra.jars.path
1.42 - example: <property name="xtest.extra.jars.ide" value="jdbc_driver1.zip;jdbcd_river2.jar"/>
1.43 - -->
1.44 - <property name="xtest.extra.jars.ide" value=""/>
1.45 -
1.46 -
1.47 - <!-- Arguments which will be added into commandline of starting IDE.
1.48 - example: <property name="xtest.ide.commandline.suffix" value="-J-Dxtest.useclassloader=org.openidex.util"/>
1.49 - -->
1.50 - <property name="xtest.ide.commandline.suffix" value=""/>
1.51 -
1.52 - <!-- =========================== -->
1.53 - <!-- Setting avanced classpathes -->
1.54 - <!-- =========================== -->
1.55 -
1.56 - <!-- If you need to add something from <module>/src or <module>/netbeans
1.57 - to classpath use target prepare-compile-classpath or prepare-codetest-classpath
1.58 - which fills path according to property xtest.source.location. This property
1.59 - can have values "src" (compilation and execution against sources), "jar" (compil.
1.60 - and execut. against jars) or "ide" (compil. and execut. against installed IDE).
1.61 - "ide" mode is used during automated test execution so it has to be always supported.
1.62 - -->
1.63 -
1.64 - <!-- This classpath is beside jars in xtest.extra.jars also used for compilation,
1.65 - but it depends on property xtest.source.location which classpath will be used.
1.66 - Fill apropriate classpathes in targets "${xtest.source.location}compile-classath". -->
1.67 - <property name="compiletest.classpath" refid="compiletest.classpath"/>
1.68 -
1.69 - <!-- This classpath is beside jars in xtest.extra.jars also used for execution codetests,
1.70 - but it depends on property xtest.source.location which classpath will be used.
1.71 - Fill apropriate classpathes in targets "${xtest.source.location}test-classath". -->
1.72 - <property name="codetest.classpath" refid="codetest.classpath"/>
1.73 -
1.74 - </target>
1.75
1.76 <!-- ========= -->
1.77 <!-- Compilers -->
1.78 <!-- ========= -->
1.79
1.80 - <target name="unit-compiler" depends="set_classpath">
1.81 - <ant dir="." antfile="${xtest.module_harness.antfile}"
1.82 - target="buildtests">
1.83 - <!-- This property contains directories to compile.
1.84 - These directories will be compiled separately.
1.85 - example: <property name="compile.srcdir" value="unit/src1;unit/src2"/>
1.86 - -->
1.87 - <property name="compile.srcdir" value="unit/src"/>
1.88 - <property name="compile.excludes" value="**/data/**"/>
1.89 - </ant>
1.90 + <target name="unit-compiler">
1.91 + <buildTests srcDir="unit/src" compileExcludes="**/data/**">
1.92 + <classpath>
1.93 + <path refid="schema2beans_test_cp"/>
1.94 + </classpath>
1.95 + </buildTests>
1.96 </target>
1.97
1.98 <!-- ========= -->
1.99 @@ -97,126 +40,31 @@
1.100
1.101 <!-- This target is executed from test-executor in newly created Project -->
1.102 <!-- Name of this task is defined in cfg-xxx.xml -->
1.103 + <!-- This target executes tests inside IDE -->
1.104 + <target name="run-in-ide">
1.105 + <executeTests pluginName="ide">
1.106 + <classpath refid="schema2beans_test_cp"/>
1.107 + </executeTests>
1.108 + </target>
1.109 +
1.110 + <!-- This target is executed from test-executor in newly created Project -->
1.111 + <!-- Name of this task is defined in cfg-xxx.xml -->
1.112 <!-- This target executes standalone tests -->
1.113 - <target name="runcodetest" depends="set_classpath">
1.114 - <ant dir="." antfile="${xtest.module_harness.antfile}"
1.115 - target="test">
1.116 - <property name="xtest.exectype" value="code"/>
1.117 - </ant>
1.118 + <target name="run-in-jvm">
1.119 + <executeTests pluginName="jvm">
1.120 + <classpath>
1.121 + <path refid="schema2beans_test_cp"/>
1.122 + </classpath>
1.123 + </executeTests>
1.124 </target>
1.125
1.126
1.127 - <!-- =============================================================
1.128 - Following targets are for "advanced" users who needs more
1.129 - compilacated classpathes, which depends on way of execution.
1.130 - ============================================================= -->
1.131 -
1.132 - <!-- this "switch" will decide how to create classpath -->
1.133 - <target name="which-classpath">
1.134 - <condition property="jarcode.classpath">
1.135 - <equals arg1="${xtest.source.location}" arg2="jar"/>
1.136 - </condition>
1.137 - <condition property="srccode.classpath">
1.138 - <equals arg1="${xtest.source.location}" arg2="src"/>
1.139 - </condition>
1.140 - <condition property="idecode.classpath">
1.141 - <equals arg1="${xtest.source.location}" arg2="ide"/>
1.142 - </condition>
1.143 - </target>
1.144 -
1.145 - <!-- ========================= -->
1.146 - <!-- Classpath for compilation -->
1.147 - <!-- ========================= -->
1.148 -
1.149 - <target name="prepare-compile-classpath"
1.150 - depends="jarcompile-classpath,srccompile-classpath,idecompile-classpath"/>
1.151 -
1.152 - <target name="jarcompile-classpath" depends="which-classpath" if="jarcode.classpath">
1.153 - <echo message="Using jars classpath for compilation."/>
1.154 - <!-- this classpath will be used for compiling tests against jars -->
1.155 - <path id="compiletest.classpath">
1.156 - <!-- If you need e.g. openide.jar, write this:
1.157 - <pathelement location="../netbeans/lib/openide.jar"/>
1.158 - -->
1.159 - <pathelement location="${netbeans.home}/modules/autoload/schema2beans.jar"/>
1.160 - <pathelement location="${netbeans.home}/modules/autoload/schema2beansdev.jar"/>
1.161 - </path>
1.162 - </target>
1.163 -
1.164 - <target name="srccompile-classpath" depends="which-classpath" if="srccode.classpath">
1.165 - <echo message="Using srcs classpath for compilation."/>
1.166 - <!-- this classpath will be used for compiling tests against sources -->
1.167 - <path id="compiletest.classpath">
1.168 - <!-- If you need e.g. openide.jar, write this:
1.169 - <pathelement location="../netbeans/lib/openide.jar"/>
1.170 - If you need e.g. sources of your tested module, write this:
1.171 - <pathelement location="../src"/>
1.172 - -->
1.173 - <pathelement location="../src"/>
1.174 - </path>
1.175 + <!-- Default target saying this build script is not supposed to be run from
1.176 + command line. You shoud not modify this unless you know what you are doing.
1.177 + -->
1.178 + <target name="all">
1.179 + <fail message="This buildfile is not intended to be directly executed. It contains executors and compilers. Use build.xml to execute tests."/>
1.180 </target>
1.181
1.182 - <!-- we're not using this, because mymodule is not a part of IDE :-) -->
1.183 - <target name="idecompile-classpath" depends="which-classpath" if="idecode.classpath">
1.184 - <echo message="Using IDE classpath for compilation."/>
1.185 - <!-- this classpath will be used for compiling tests against installed IDE -->
1.186 - <path id="compiletest.classpath">
1.187 - <!-- If you need e.g. openide.jar, write this:
1.188 - <pathelement location="${netbeans.home}/lib/openide.jar"/>
1.189 - If you need e.g. your tested module, write this:
1.190 - <pathelement location="${netbeans.home}/modules/somemodule.jar"/>
1.191 - -->
1.192 - <pathelement location="${netbeans.home}/modules/autoload/schema2beans.jar"/>
1.193 - <pathelement location="${netbeans.home}/modules/autoload/schema2beansdev.jar"/>
1.194 - </path>
1.195 - </target>
1.196 -
1.197 - <!-- ================================== -->
1.198 - <!-- Classpath for execution code tests -->
1.199 - <!-- ================================== -->
1.200 -
1.201 - <target name="prepare-codetest-classpath"
1.202 - depends="jartest-classpath,srctest-classpath,idetest-classpath"/>
1.203 -
1.204 - <target name="jartest-classpath" depends="which-classpath" if="jarcode.classpath">
1.205 - <echo message="Using jars classpath."/>
1.206 - <!-- this classpath will be used for executing tests against jars -->
1.207 - <path id="codetest.classpath">
1.208 - <!-- If you need e.g. openide.jar, write this:
1.209 - <pathelement location="../netbeans/lib/openide.jar"/>
1.210 - -->
1.211 - <!-- <pathelement location="/home/cliffwd/cvs/current/f4j_all/jwsdp/release/modules/autoload/ext/jax-qname.jar"/> -->
1.212 - <pathelement location="${netbeans.home}/modules/autoload/schema2beans.jar"/>
1.213 - <pathelement location="${netbeans.home}/modules/autoload/schema2beansdev.jar"/>
1.214 - </path>
1.215 - </target>
1.216 -
1.217 - <target name="srctest-classpath" depends="which-classpath" if="srccode.classpath">
1.218 - <echo message="Using srcs classpath."/>
1.219 - <!-- this classpath will be used for executing tests against sources -->
1.220 - <path id="codetest.classpath">
1.221 - <!-- If you need e.g. openide.jar, write this:
1.222 - <pathelement location="../netbeans/lib/openide.jar"/>
1.223 - If you need e.g. sources of your tested module, write this:
1.224 - <pathelement location="../src"/>
1.225 - -->
1.226 - <pathelement location="../src"/>
1.227 - </path>
1.228 - </target>
1.229 +</project>
1.230
1.231 -
1.232 - <target name="idetest-classpath" depends="which-classpath" if="idecode.classpath">
1.233 - <echo message="Using IDE classpath."/>
1.234 - <!-- this classpath will be used for executing tests against installed IDE -->
1.235 - <path id="codetest.classpath">
1.236 - <!-- If you need e.g. openide.jar, write this:
1.237 - <pathelement location="${netbeans.home}/lib/openide.jar"/>
1.238 - If you need e.g. your tested module, write this:
1.239 - <pathelement location="${netbeans.home}/modules/somemodule.jar"/>
1.240 - -->
1.241 - <pathelement location="${netbeans.home}/modules/autoload/schema2beans.jar"/>
1.242 - <pathelement location="${netbeans.home}/modules/autoload/schema2beansdev.jar"/>
1.243 - </path>
1.244 - </target>
1.245 -
1.246 -</project>
2.1 --- a/schema2beans/test/build.xml Wed Aug 04 15:49:56 2004 +0000
2.2 +++ b/schema2beans/test/build.xml Fri Aug 06 13:46:22 2004 +0000
2.3 @@ -8,90 +8,21 @@
2.4 http://www.sun.com/
2.5
2.6 The Original Code is NetBeans. The Initial Developer of the Original
2.7 -Code is Sun Microsystems, Inc. Portions Copyright 1997-2000 Sun
2.8 +Code is Sun Microsystems, Inc. Portions Copyright 1997-2004 Sun
2.9 Microsystems, Inc. All Rights Reserved.
2.10 -->
2.11
2.12 -<project name="schema2beans tests build script" basedir="." default="all">
2.13 +<project name="schema2beans module test build script" basedir="." default="all">
2.14
2.15 - <!-- Ant property. Value 'ignore' means that system classpath is ignored
2.16 - and only classpath specified in build file is used. -->
2.17 - <property name="build.sysclasspath" value="ignore"/>
2.18 -
2.19 - <!-- Points to directory with IDE to test-->
2.20 - <property name="netbeans.home" location="../../nbbuild/netbeans"/>
2.21 -
2.22 <!-- Name of tested module -->
2.23 <property name="xtest.module" value="schema2beans"/>
2.24
2.25 - <!-- Home of XTest -->
2.26 - <property name="xtest.home" location="../../xtest"/>
2.27 -
2.28 + <!-- Imports buildtests, cleantests, runtest, cleanresults, realclean, printconfig targets. -->
2.29 + <import file="../../nbbuild/templates/xtest.xml"/>
2.30 +
2.31 <!-- default testtypes, attributes used when no value is supplied from command line -->
2.32 <property name="xtest.testtype" value="unit"/>
2.33 - <property name="xtest.attribs" value="all,code,ide"/>
2.34 -
2.35 - <!-- Points to antfile with module's harness.
2.36 - Targets from that antfile is called from this build.xml -->
2.37 - <property name="xtest.module_harness.antfile" location="${xtest.home}/lib/module_harness.xml"/>
2.38 + <property name="xtest.attribs" value="stable"/>
2.39
2.40 - <!-- Says how to create classpath for compilation and for execution code tests by default.
2.41 - Can have values src, jar, ide -->
2.42 - <property name="xtest.source.location" value="jar"/>
2.43 -
2.44 -
2.45 -
2.46 - <!-- ============ -->
2.47 - <!-- Main targets -->
2.48 - <!-- ============ -->
2.49 -
2.50 - <target name="all" depends="runtests"/>
2.51 -
2.52 - <!-- This calls target which will call compilers according to cfg file.
2.53 - You should not change this target unless you realy know what you are doing -->
2.54 - <target name="buildtests">
2.55 - <ant dir="." antfile="${xtest.module_harness.antfile}"
2.56 - target="compiler-launcher"/>
2.57 - </target>
2.58 -
2.59 - <!-- This calls common clean process. -->
2.60 - <!-- You can write your own if you need something special -->
2.61 - <target name="cleantests">
2.62 - <ant dir="." antfile="${xtest.module_harness.antfile}"
2.63 - target="cleantests"/>
2.64 - </target>
2.65 -
2.66 - <!-- This target runs tests. You should not change this -->
2.67 - <!-- target unless you realy know what you are doing -->
2.68 - <target name="runtests" depends="buildtests">
2.69 - <echo message="Module: Running tests for ${xtest.module}, testtype ${xtest.testtype}, attribs=${xtest.attribs}"/>
2.70 - <ant dir="." antfile="${xtest.module_harness.antfile}"
2.71 - target="runtests"/>
2.72 - </target>
2.73 -
2.74 - <!-- This target is executed from test-executor in newly created Project -->
2.75 - <!-- Name of this task is defined in cfg-xxx.xml -->
2.76 - <target name="test_report">
2.77 - <ant dir="." antfile="${xtest.module_harness.antfile}"
2.78 - target="test_report"/>
2.79 - </target>
2.80 -
2.81 - <target name="cleanresults">
2.82 - <ant dir="." antfile="${xtest.module_harness.antfile}"
2.83 - target="cleanresults"/>
2.84 - </target>
2.85 -
2.86 - <target name="realclean" depends="cleantests,cleanresults">
2.87 - <ant dir="." antfile="${xtest.module_harness.antfile}"
2.88 - target="realclean"/>
2.89 - </target>
2.90 -
2.91 - <target name="printconfig">
2.92 - <echo message="Default config is testtype: ${xtest.testtype}, attributes: ${xtest.attribs}."/>
2.93 - </target>
2.94 -
2.95 - <target name="build">
2.96 - <ant dir=".." antfile="build.xml" target="build" />
2.97 - </target>
2.98 </project>
2.99
3.1 --- a/schema2beans/test/cfg-unit.xml Wed Aug 04 15:49:56 2004 +0000
3.2 +++ b/schema2beans/test/cfg-unit.xml Fri Aug 06 13:46:22 2004 +0000
3.3 @@ -9,7 +9,7 @@
3.4 http://www.sun.com/
3.5
3.6 The Original Code is NetBeans. The Initial Developer of the Original
3.7 -Code is Sun Microsystems, Inc. Portions Copyright 1997-2000 Sun
3.8 +Code is Sun Microsystems, Inc. Portions Copyright 1997-2004 Sun
3.9 Microsystems, Inc. All Rights Reserved.
3.10 -->
3.11
3.12 @@ -27,7 +27,7 @@
3.13
3.14 <!-- testbag with all schema2beans tests running in code mode (i.e. in standard JVM)
3.15 use ant runtests -Dxtest.attribs=stable,code to run this testbag -->
3.16 - <testbag testattribs="all and code" executor="code" name="all tests (no ide)" >
3.17 + <testbag testattribs="stable" executor="code" name="all tests (no ide)" >
3.18 <testset dir="unit/src">
3.19 <patternset>
3.20 <include name="TestMain.class"/>
3.21 @@ -80,12 +80,8 @@
3.22 then call this one. It is handy when some servers (e.g. rmi registry)
3.23 have to be started before tests are run and stopped after
3.24 the run. -->
3.25 - <executor name="code" antfile="build-unit.xml" target="runcodetest"/>
3.26 + <executor name="code" antfile="build-unit.xml" target="run-in-jvm"/>
3.27
3.28 <compiler name="unit-compiler" antfile="build-unit.xml" target="unit-compiler" default="true"/>
3.29
3.30 - <!-- standard results processor - currently there is only one results processor
3.31 - in XTest -->
3.32 - <resultsprocessor name="unit" antfile="build.xml" target="test_report" default="true"/>
3.33 -
3.34 </mconfig>