You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by hi...@apache.org on 2009/07/19 09:10:19 UTC
svn commit: r795487 - in /harmony/enhanced/classlib/trunk:
make/properties.xml modules/jndi/build.xml modules/jndi/make/run-test.xml
Author: hindessm
Date: Sun Jul 19 07:10:18 2009
New Revision: 795487
URL: http://svn.apache.org/viewvc?rev=795487&view=rev
Log:
Run jndi tests using hdk.
Added:
harmony/enhanced/classlib/trunk/modules/jndi/make/run-test.xml (with props)
Modified:
harmony/enhanced/classlib/trunk/make/properties.xml
harmony/enhanced/classlib/trunk/modules/jndi/build.xml
Modified: harmony/enhanced/classlib/trunk/make/properties.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/make/properties.xml?rev=795487&r1=795486&r2=795487&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/make/properties.xml (original)
+++ harmony/enhanced/classlib/trunk/make/properties.xml Sun Jul 19 07:10:18 2009
@@ -729,6 +729,81 @@
</sequential>
</macrodef>
+ <!-- TOFIX: Can't seem to override the line:
+ <include name="**/*Test.class" unless="test.case" />
+ so this is just run-hdk-tests without that line -->
+ <macrodef name="run-selected-hdk-tests">
+ <attribute name="module" />
+ <attribute name="jar" />
+ <element name="junit-elements" optional="true"/>
+ <element name="excludeorinclude" optional="true"/>
+ <sequential>
+ <echo message="Running @{module} Unit Test from @{jar}" />
+ <echo message="Tested jre: ${test.jre.home}/bin/java" />
+ <property name="test.module.dir" value="${target.dir}/@{module}" />
+ <property name="test.excludes.dir" value="${test.module.dir}/excludes" />
+ <property name="test.resources.dir" value="${test.module.dir}/resources" />
+ <property name="test.exclude.file" value="${work.dir}/@{module}.exclude" />
+
+ <mkdir dir="${tests.output}" />
+
+ <prepare-exclude-list moduleName="@{module}" dir="${test.excludes.dir}" result="${test.exclude.file}" />
+ <junit fork="yes"
+ forkmode="${hy.test.forkmode}"
+ timeout="${hy.test.timeout}"
+ printsummary="withOutAndErr"
+ errorproperty="test.errors"
+ failureproperty="test.failures"
+ showoutput="on"
+ dir="${work.dir}/@{module}"
+ tempdir="${work.dir}"
+ jvm="${test.jre.home}/bin/java">
+
+ <classpath>
+ <fileset dir="${target.dir}">
+ <include name="*.jar" />
+ </fileset>
+ <pathelement path="${test.resources.dir}/" />
+ <pathelement path="${test.module.dir}/" />
+ <pathelement location="${test.module.dir}/@{jar}" />
+ </classpath>
+
+ <junit-elements />
+
+ <batchtest todir="${tests.output}" haltonfailure="no">
+ <zipfileset src="${test.module.dir}/@{jar}">
+ <exclude name="Test.class" />
+ <exclude name="**/*$*" />
+
+ <!-- if ${test.case} -->
+ <include name="${converted.tc.class}" if="test.case" />
+ <!-- unless ${test.case} -->
+ <excludesfile name="${test.exclude.file}" unless="test.case"/>
+ <excludeorinclude/>
+ </zipfileset>
+ </batchtest>
+
+ <assertions enableSystemAssertions="true">
+ <enable />
+ </assertions>
+
+ <jvmarg line="${hy.test.vmargs}" />
+ <!-- Used by Support_Exec.execJava() -->
+ <jvmarg value="-Dhy.test.vmargs=${hy.test.vmargs}" />
+
+ <formatter type="xml" />
+ </junit>
+
+ <antcall target="touch-failures-file">
+ <param name="module" value="@{module}" />
+ </antcall>
+ <antcall target="touch-errors-file">
+ <param name="module" value="@{module}" />
+ </antcall>
+
+ </sequential>
+ </macrodef>
+
<target name="touch-failures-file" if="test.failures">
<echo file="${tests.output}/test.failures"
append="true">${module}${line.separator}</echo>
Modified: harmony/enhanced/classlib/trunk/modules/jndi/build.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/jndi/build.xml?rev=795487&r1=795486&r2=795487&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/jndi/build.xml (original)
+++ harmony/enhanced/classlib/trunk/modules/jndi/build.xml Sun Jul 19 07:10:18 2009
@@ -40,7 +40,12 @@
</or>
</fileset>
+ <property file="../../make/depends.properties" />
+
<property name="tests.hdk.dir" value="${hy.hdk}/build/test/jndi" />
+ <property name="tests.excludes.hdk.dir" value="${tests.hdk.dir}/excludes" />
+ <property name="tests.resources.hdk.dir"
+ value="${tests.hdk.dir}/resources" />
<property name="jndi.exclude.file"
location="${tests.hdk.dir}/test.exclude" />
@@ -58,11 +63,12 @@
</target>
<!-- internal target for local and global test run sequence -->
- <target name="-test-module" depends="build, compile-tests, prepare-exclude, run-tests" />
+ <target name="-test-module" depends="build, run-tests" />
<target name="clean">
<delete file="${hy.jdk}/jre/lib/boot/jndi.jar" />
<delete file="${hy.jdk}/jre/lib/boot/jndi-src.jar" />
+ <delete file="${tests.hdk.dir}/jndi_tests.jar" />
<delete failonerror="false">
<fileset refid="classes" />
</delete>
@@ -124,7 +130,39 @@
</jar>
</target>
- <target name="compile-tests" depends="copy-test-resources" >
+ <target name="test-jar" depends="svn-info,compile-tests">
+ <mkdir dir="${tests.hdk.dir}" />
+
+ <copy file="make/run-test.xml" tofile="${tests.hdk.dir}/build.xml" />
+
+ <jar destfile="${tests.hdk.dir}/jndi_tests.jar">
+ <fileset dir="bin/test" />
+ <manifest>
+ <attribute name="Implementation-Version" value="${svn.info}"/>
+ </manifest>
+ <metainf refid="hy.required.metainf-files"/>
+ </jar>
+
+ <mkdir dir="${tests.excludes.hdk.dir}"/>
+ <copy todir="${tests.excludes.hdk.dir}">
+ <fileset dir="./make" includes="exclude*"/>
+ <filterchain>
+ <tokenfilter>
+ <replaceregex pattern="\.java" replace="\.class" flags="g"/>
+ </tokenfilter>
+ </filterchain>
+ </copy>
+
+ <copy todir="${tests.resources.hdk.dir}" includeemptydirs="false">
+ <fileset dir="src/test/resources">
+ <exclude name="**/*.java" />
+ </fileset>
+ </copy>
+
+ <copy file="../../${junit.jar}" todir="${hy.hdk}/build/test" />
+ </target>
+
+ <target name="compile-tests">
<compile-tests description="jndi tests"
destdir="bin/test">
<javac-elements>
@@ -135,106 +173,8 @@
</compile-tests>
</target>
- <target name="prepare-exclude">
- <prepare-exclude-list moduleName="jndi" dir="./make"
- result="${jndi.exclude.file}"/>
- </target>
-
- <target name="run-tests">
-
- <mkdir dir="${tests.output}" />
-
- <property name="test.jre.home" value="${hy.jdk}/jre" />
-
- <junit fork="yes"
- forkmode="perBatch"
- printsummary="withOutAndErr"
- errorproperty="test.errors"
- failureproperty="test.failures"
- showoutput="on"
- dir="${basedir}"
- jvm="${test.jre.home}/bin/java">
-
- <assertions enableSystemAssertions="true">
- <enable />
- </assertions>
-
- <jvmarg line="${hy.test.vmargs}" />
-
- <classpath>
- <pathelement path="bin/test"/>
- <fileset dir="${hy.hdk}/build/test/">
- <include name="*.jar" />
- </fileset>
- </classpath>
- <classpath location="../../build/tests" />
-
- <formatter type="xml" />
-
- <batchtest todir="${tests.output}" haltonfailure="no" >
-
- <fileset dir="src/test/java">
- <!-- if ${test.case} -->
- <include name="${converted.tc}" if="test.case" />
- <!-- unless ${test.case} -->
- <include name="**/*Test.java" unless="test.case" />
- <include name="**/Test*.java" unless="test.case" />
- <excludesfile name="${jndi.exclude.file}" unless="test.case" />
-
- <!-- These tests run in a separate jvm below -->
- <exclude name="org/apache/harmony/jndi/tests/javax/naming/spi/NamingManagerBuilderTest.java" unless="test.case" />
- <exclude name="org/apache/harmony/jndi/tests/javax/naming/spi/NamingManagerTest.java" unless="test.case" />
- <exclude name="org/apache/harmony/jndi/tests/javax/naming/spi/DirectoryManagerTest.java" unless="test.case" />
- </fileset>
- </batchtest>
-
- <batchtest todir="${tests.output}" haltonfailure="no"
- unless="test.case">
-
- <fileset dir="src/test/java">
- <include name="org/apache/harmony/jndi/tests/javax/naming/spi/NamingManagerTest.java" />
- </fileset>
- </batchtest>
-
- <batchtest todir="${tests.output}" haltonfailure="no"
- unless="test.case">
-
- <fileset dir="src/test/java">
- <include name="org/apache/harmony/jndi/tests/javax/naming/spi/NamingManagerBuilderTest.java" />
- </fileset>
- </batchtest>
-
- <batchtest todir="${tests.output}" haltonfailure="no"
- unless="test.case">
-
- <fileset dir="src/test/java">
- <include name="org/apache/harmony/jndi/tests/javax/naming/spi/DirectoryManagerTest.java" />
- </fileset>
- </batchtest>
-
- </junit>
- <antcall target="touch-failures-file" />
- <antcall target="touch-errors-file" />
- </target>
-
- <target name="touch-failures-file" if="test.failures">
- <echo file="${tests.output}/test.failures"
- append="true">jndi${line.separator}</echo>
- </target>
-
- <target name="touch-errors-file" if="test.errors">
- <echo file="${tests.output}/test.errors"
- append="true">jndi${line.separator}</echo>
- </target>
-
- <target name="copy-test-resources">
- <mkdir dir="bin/test" />
- <copy todir="bin/test" includeemptydirs="false">
- <fileset dir="src/test/resources">
- <exclude name="**/*.java" />
- <exclude name="**/*.zip" />
- </fileset>
- </copy>
+ <target name="run-tests" depends="test-jar">
+ <ant dir="${tests.hdk.dir}" target="test-module" />
</target>
</project>
Added: harmony/enhanced/classlib/trunk/modules/jndi/make/run-test.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/jndi/make/run-test.xml?rev=795487&view=auto
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/jndi/make/run-test.xml (added)
+++ harmony/enhanced/classlib/trunk/modules/jndi/make/run-test.xml Sun Jul 19 07:10:18 2009
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<project name="Harmony JNDI Test" default="test" basedir=".">
+
+ <property name="hy.hdk" location="../../.." />
+ <property name="test.jre.home" location="${hy.hdk}/jdk/jre" />
+ <property file="../test.properties" />
+ <import file="../../ant/properties.xml" />
+
+ <property name="work.dir" value=".." />
+ <property name="target.dir" value=".." />
+ <property name="tests.output" location="../report" />
+ <property name="junit.jar" location="../junit.jar" />
+
+ <target name="test" depends="test-module" />
+
+ <target name="test-module" depends="test-jre-vm-info">
+ <convert-test-as-class from="test.case" to="converted.tc.class" />
+ <run-selected-hdk-tests module="jndi" jar="jndi_tests.jar">
+ <excludeorinclude>
+ <exclude name="org/apache/harmony/jndi/tests/javax/naming/spi/NamingManagerBuilderTest.class"/>
+ <exclude name="org/apache/harmony/jndi/tests/javax/naming/spi/NamingManagerTest.class"/>
+ <exclude name="org/apache/harmony/jndi/tests/javax/naming/spi/DirectoryManagerTest.class"/>
+ <include name="**/*Test.class" unless="test.case"/>
+ <include name="**/Test*.class" unless="test.case"/>
+ </excludeorinclude>
+ </run-selected-hdk-tests>
+ <run-selected-hdk-tests module="jndi" jar="jndi_tests.jar">
+ <excludeorinclude>
+ <include name="org/apache/harmony/jndi/tests/javax/naming/spi/NamingManagerBuilderTest.class" unless="test.case" />
+ </excludeorinclude>
+ </run-selected-hdk-tests>
+ <run-selected-hdk-tests module="jndi" jar="jndi_tests.jar">
+ <excludeorinclude>
+ <include name="org/apache/harmony/jndi/tests/javax/naming/spi/NamingManagerTest.class" unless="test.case" />
+ </excludeorinclude>
+ </run-selected-hdk-tests>
+ <run-selected-hdk-tests module="jndi" jar="jndi_tests.jar">
+ <excludeorinclude>
+ <include name="org/apache/harmony/jndi/tests/javax/naming/spi/DirectoryManagerTest.class" unless="test.case" />
+ </excludeorinclude>
+ </run-selected-hdk-tests>
+ </target>
+
+</project>
Propchange: harmony/enhanced/classlib/trunk/modules/jndi/make/run-test.xml
------------------------------------------------------------------------------
svn:eol-style = native