harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r795490 - in /harmony/enhanced/classlib/trunk/modules/logging: build.xml make/run-test.xml src/test/java/org/apache/harmony/logging/tests/java/util/logging/LoggerTest.java
Date Sun, 19 Jul 2009 08:05:53 GMT
Author: hindessm
Date: Sun Jul 19 08:05:52 2009
New Revision: 795490

URL: http://svn.apache.org/viewvc?rev=795490&view=rev
Log:
Run logging tests using hdk.

Added:
    harmony/enhanced/classlib/trunk/modules/logging/make/run-test.xml   (with props)
Modified:
    harmony/enhanced/classlib/trunk/modules/logging/build.xml
    harmony/enhanced/classlib/trunk/modules/logging/src/test/java/org/apache/harmony/logging/tests/java/util/logging/LoggerTest.java

Modified: harmony/enhanced/classlib/trunk/modules/logging/build.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/logging/build.xml?rev=795490&r1=795489&r2=795490&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/logging/build.xml (original)
+++ harmony/enhanced/classlib/trunk/modules/logging/build.xml Sun Jul 19 08:05:52 2009
@@ -40,7 +40,12 @@
         </or>
     </fileset>
 
+    <property file="../../make/depends.properties" />
+
     <property name="tests.hdk.dir" value="${hy.hdk}/build/test/logging" />
+    <property name="tests.excludes.hdk.dir" value="${tests.hdk.dir}/excludes" />
+    <property name="tests.resources.hdk.dir"
+              value="${tests.hdk.dir}/resources" />
     <property name="logging.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/logging.jar" />
         <delete file="${hy.jdk}/jre/lib/boot/logging-src.jar" />
+        <delete file="${tests.hdk.dir}/logging_tests.jar" />
         <delete failonerror="false">
             <fileset refid="classes" />
         </delete>
@@ -115,7 +121,65 @@
         </jar>
     </target>
 
-    <target name="compile-tests" depends="copy-test-resources" >
+    <target name="copy-jar-resources">
+        <mkdir dir="../../build/classes" />
+        <copy todir="../../build/classes" includeemptydirs="false">
+            <fileset dir="src/main/java">
+                <exclude name="**/*.java" />
+                <exclude name="**/logging.properties" />
+            </fileset>
+        </copy>
+    </target>
+
+    <target name="copy-resources">
+        <copy todir="${hy.jdk}/jre/lib" flatten="yes">
+            <fileset dir="src/main/java">
+                <include name="**/logging.properties" />
+            </fileset>
+        </copy>
+    </target>
+
+    <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}/logging_tests.jar">
+            <fileset dir="bin/test" />
+            <manifest>
+                <attribute name="Implementation-Version" value="${svn.info}"/> 
+            </manifest>
+            <metainf refid="hy.required.metainf-files"/>
+        </jar>
+        <jar destfile="${tests.hdk.dir}/logging_boot_tests.jar">
+            <fileset dir="bin/test-internal" />
+            <manifest>
+                <attribute name="Implementation-Version" value="${svn.info}"/> 
+            </manifest>
+            <metainf refid="hy.required.metainf-files"/>
+        </jar>
+
+        <copy file="../../support/src/test/resources/config/testing.policy"
+              todir="${hy.hdk}/build/test" outputencoding="UTF-8" />
+
+        <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}">
+            <fileset dir="src/test/resources" />
+        </copy>
+
+        <copy file="../../${junit.jar}" todir="${hy.hdk}/build/test" />
+    </target>
+
+    <target name="compile-tests">
         <compile-tests description="logging internal tests"
                        destdir="bin/test-internal">
             <javac-elements>
@@ -137,113 +201,8 @@
         </compile-tests>
     </target>
 
-    <target name="prepare-exclude">
-       <prepare-exclude-list moduleName="logging" dir="./make"
-                             result="${logging.exclude.file}"/>
-    </target>
-
-    <target name="run-tests">
-
-        <mkdir dir="${tests.output}" />
-
-        <property name="test.jre.home" value="${hy.jdk}/jre" />
-
-        <copy file="../../support/src/test/resources/config/testing.policy" 
-              todir="${hy.hdk}/build/test" outputencoding="UTF-8" />
-
-        <junit fork="yes"
-               forkmode="${hy.test.forkmode}"
-               timeout="${hy.test.timeout}"
-               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}" />
-            <!-- Used by Support_Exec.execJava() -->
-            <jvmarg value="-Dhy.test.vmargs=${hy.test.vmargs}" />
-
-        	<!-- Required by various tests that set security manager etc -->
-            <jvmarg value="-Djava.security.policy=${hy.hdk}/build/test/testing.policy"
/>
-
-            <jvmarg value="-Xbootclasspath/a:bin/test-internal"/>
-
-            <classpath>
-                <pathelement path="bin/test"/>
-            </classpath>
-            <classpath location="${hy.hdk}/build/test/support.jar" />
-            <classpath location="../../build/tests" />
-
-            <formatter type="xml" />
-
-            <!-- run LogManagerTest in separated VM -->
-            <batchtest todir="${tests.output}" haltonfailure="no"
-                unless="test.case">
-
-                <fileset dir="src/test/java">
-                    <include name="org/apache/harmony/logging/tests/java/util/logging/LogManagerTest.java"/>
-                    <excludesfile name="${logging.exclude.file}" />
-                </fileset>
-            </batchtest>
-
-            <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="org/apache/harmony/logging/tests/java/util/logging/*Test.java"
unless="test.case" />
-                    <excludesfile name="${logging.exclude.file}" unless="test.case" />
-
-                    <exclude name="org/apache/harmony/logging/tests/java/util/logging/LogManagerTest.java"
unless="test.case" />
-                </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">logging${line.separator}</echo>
-    </target>
-
-    <target name="touch-errors-file" if="test.errors">
-        <echo file="${tests.output}/test.errors"
-            append="true">logging${line.separator}</echo>
-    </target>
-
-    <target name="copy-jar-resources">
-        <mkdir dir="../../build/classes" />
-        <copy todir="../../build/classes" includeemptydirs="false">
-            <fileset dir="src/main/java">
-                <exclude name="**/*.java" />
-                <exclude name="**/logging.properties" />
-            </fileset>
-        </copy>
-    </target>
-
-    <target name="copy-resources">
-        <copy todir="${hy.jdk}/jre/lib" flatten="yes">
-            <fileset dir="src/main/java">
-                <include name="**/logging.properties" />
-            </fileset>
-        </copy>
-    </target>
-
-    <target name="copy-test-resources">
-        <mkdir dir="bin/test" />
-        <copy todir="bin/test" includeemptydirs="false">
-            <fileset dir="src/test/resources">
-                <exclude name="**/*.java" />
-            </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/logging/make/run-test.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/logging/make/run-test.xml?rev=795490&view=auto
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/logging/make/run-test.xml (added)
+++ harmony/enhanced/classlib/trunk/modules/logging/make/run-test.xml Sun Jul 19 08:05:52
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 Logging 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="logging" jar="logging_tests.jar">
+            <junit-elements>
+                <!-- Required by various tests that set security manager etc -->
+                <jvmarg value="-Djava.security.policy=../testing.policy" />
+
+                <jvmarg value="-Xbootclasspath/a:logging_boot_tests.jar"/>
+            </junit-elements>
+            <excludeorinclude>
+                <exclude name="org/apache/harmony/logging/tests/java/util/logging/*Test.class"
unless="test.case" />
+                <include name="org/apache/harmony/logging/tests/java/util/logging/LogManagerTest.class"/>
+            </excludeorinclude>
+        </run-selected-hdk-tests>
+        <run-selected-hdk-tests module="logging" jar="logging_tests.jar">
+            <junit-elements>
+                <!-- Required by various tests that set security manager etc -->
+                <jvmarg value="-Djava.security.policy=../testing.policy" />
+
+                <jvmarg value="-Xbootclasspath/a:logging_boot_tests.jar"/>
+            </junit-elements>
+            <excludeorinclude>
+                <include name="org/apache/harmony/logging/tests/java/util/logging/*Test.class"
unless="test.case" />
+                <exclude name="org/apache/harmony/logging/tests/java/util/logging/LogManagerTest.class"
unless="test.case" />
+            </excludeorinclude>
+        </run-selected-hdk-tests>
+    </target>
+    
+</project>

Propchange: harmony/enhanced/classlib/trunk/modules/logging/make/run-test.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: harmony/enhanced/classlib/trunk/modules/logging/src/test/java/org/apache/harmony/logging/tests/java/util/logging/LoggerTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/logging/src/test/java/org/apache/harmony/logging/tests/java/util/logging/LoggerTest.java?rev=795490&r1=795489&r2=795490&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/logging/src/test/java/org/apache/harmony/logging/tests/java/util/logging/LoggerTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/logging/src/test/java/org/apache/harmony/logging/tests/java/util/logging/LoggerTest.java
Sun Jul 19 08:05:52 2009
@@ -53,7 +53,7 @@
 
 	private final static String INVALID_RESOURCE_BUNDLE = "impossible_not_existing";
     
-    private final static String LOGGING_CONFIG_FILE= "src/test/resources/config/java/util/logging/logging.config";
+    private final static String LOGGING_CONFIG_FILE= "resources/config/java/util/logging/logging.config";
 
 	private final static String VALID_KEY = "LOGGERTEST";
 



Mime
View raw message