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 14:08:00 UTC

svn commit: r795523 - in /harmony/enhanced/classlib/trunk/modules/sql: ./ make/ src/test/java/org/apache/harmony/sql/tests/internal/rowset/

Author: hindessm
Date: Sun Jul 19 12:08:00 2009
New Revision: 795523

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

Added:
    harmony/enhanced/classlib/trunk/modules/sql/make/run-test.xml   (with props)
Modified:
    harmony/enhanced/classlib/trunk/modules/sql/build.xml
    harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/internal/rowset/CachedRowSetTestCase.java
    harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/internal/rowset/XmlReaderTest.java

Modified: harmony/enhanced/classlib/trunk/modules/sql/build.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/sql/build.xml?rev=795523&r1=795522&r2=795523&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/sql/build.xml (original)
+++ harmony/enhanced/classlib/trunk/modules/sql/build.xml Sun Jul 19 12:08:00 2009
@@ -40,7 +40,12 @@
         </or>
     </fileset>
 
+    <property file="../../make/depends.properties" />
+
     <property name="tests.hdk.dir" value="${hy.hdk}/build/test/sql" />
+    <property name="tests.excludes.hdk.dir" value="${tests.hdk.dir}/excludes" />
+    <property name="tests.resources.hdk.dir"
+              value="${tests.hdk.dir}/resources" />
     <property name="sql.exclude.file"
               location="${tests.hdk.dir}/test.exclude" />
 
@@ -58,16 +63,17 @@
     </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/sql.jar" />
         <delete file="${hy.jdk}/jre/lib/boot/sql-src.jar" />
+        <delete file="${tests.hdk.dir}/sql_tests.jar" />
+        <delete failonerror="false" dir="${tests.resources.hdk.dir}/TESTDB"/>
         <delete failonerror="false">
             <fileset refid="classes" />
         </delete>
         <delete failonerror="false" dir="bin"/>
-        <delete failonerror="false" dir="src/test/resources/TESTDB"/>
     </target>
 
     <target name="compile-java">
@@ -123,6 +129,37 @@
         </jar>
     </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}/sql_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}">
+            <fileset dir="src/test/resources" />
+        </copy>
+        
+        <copy file="../../${junit.jar}" todir="${hy.hdk}/build/test" />
+        <copy file="../../${derby.jar}" todir="${hy.hdk}/build/test" />
+    </target>
+
     <target name="compile-tests">
         <compile-tests description="sql tests"
                        destdir="bin/test">
@@ -134,66 +171,8 @@
         </compile-tests>
     </target>
 
-    <target name="prepare-exclude">
-       <prepare-exclude-list moduleName="sql" dir="./make"
-                             result="${sql.exclude.file}"/>
-    </target>
-
-    <target name="run-tests">
-
-        <mkdir dir="${tests.output}" />
-
-        <property name="test.jre.home" value="${hy.jdk}/jre" />
-
-        <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}" />
-
-            <classpath>
-                <pathelement path="bin/test"/>
-                <pathelement path="src/test/resources"/>
-                <pathelement path="${hy.hdk}/build/test/support.jar"/>
-                <pathelement path="${hy.hdk}/build/test/derby.jar"/>
-            </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" />
-                    <excludesfile name="${sql.exclude.file}" 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">sql${line.separator}</echo>
-    </target>
-
-    <target name="touch-errors-file" if="test.errors">
-        <echo file="${tests.output}/test.errors"
-            append="true">sql${line.separator}</echo>
+    <target name="run-tests" depends="test-jar">
+        <ant dir="${tests.hdk.dir}" target="test-module" />
     </target>
 
 </project>

Added: harmony/enhanced/classlib/trunk/modules/sql/make/run-test.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/sql/make/run-test.xml?rev=795523&view=auto
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/sql/make/run-test.xml (added)
+++ harmony/enhanced/classlib/trunk/modules/sql/make/run-test.xml Sun Jul 19 12:08:00 2009
@@ -0,0 +1,43 @@
+<?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 SQL 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-hdk-tests module="sql" jar="sql_tests.jar">
+            <junit-elements>
+                <classpath location="../derby.jar" />
+                <classpath location="resources" />
+            </junit-elements>
+        </run-hdk-tests>
+    </target>
+    
+</project>

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

Modified: harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/internal/rowset/CachedRowSetTestCase.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/internal/rowset/CachedRowSetTestCase.java?rev=795523&r1=795522&r2=795523&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/internal/rowset/CachedRowSetTestCase.java (original)
+++ harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/internal/rowset/CachedRowSetTestCase.java Sun Jul 19 12:08:00 2009
@@ -34,9 +34,9 @@
 import junit.framework.TestCase;
 
 public class CachedRowSetTestCase extends TestCase {
-    public static final String DERBY_URL_Create = "jdbc:derby:src/test/resources/TESTDB;create=true";
+    public static final String DERBY_URL_Create = "jdbc:derby:resources/TESTDB;create=true";
 
-    public static final String DERBY_URL = "jdbc:derby:src/test/resources/TESTDB";
+    public static final String DERBY_URL = "jdbc:derby:resources/TESTDB";
 
     protected Connection conn = null;
 

Modified: harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/internal/rowset/XmlReaderTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/internal/rowset/XmlReaderTest.java?rev=795523&r1=795522&r2=795523&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/internal/rowset/XmlReaderTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/internal/rowset/XmlReaderTest.java Sun Jul 19 12:08:00 2009
@@ -31,11 +31,11 @@
 
 public class XmlReaderTest extends TestCase {
 
-    public final String XML_SRC_URL_RI = "src/test/resources/org/apache/harmony/sql/internal/rowset/XmlReaderTest_RI.xml";
+    public final String XML_SRC_URL_RI = "resources/org/apache/harmony/sql/internal/rowset/XmlReaderTest_RI.xml";
 
-    public final String XML_SRC_URL_HY = "src/test/resources/org/apache/harmony/sql/internal/rowset/XmlReaderTest_HY.xml";
+    public final String XML_SRC_URL_HY = "resources/org/apache/harmony/sql/internal/rowset/XmlReaderTest_HY.xml";
 
-    public final String XML_SRC_URL_INVALID_HEADER = "src/test/resources/org/apache/harmony/sql/internal/rowset/XmlFile_InvalidHeader.xml";
+    public final String XML_SRC_URL_INVALID_HEADER = "resources/org/apache/harmony/sql/internal/rowset/XmlFile_InvalidHeader.xml";
 
     public String currentUrl;