db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject svn commit: r430889 - in /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi: ConcurrencyTest.java ConcurrencyTest_app.properties ProcedureTest.java ScrollResultSetTest.java _Suite.java build.xml
Date Fri, 11 Aug 2006 20:38:49 GMT
Author: djd
Date: Fri Aug 11 13:38:49 2006
New Revision: 430889

URL: http://svn.apache.org/viewvc?rev=430889&view=rev
Log:
Junit improvements in the functionTests.tests.jdbcapi package. Add a _Suite to run all the
JUnit tests.
Add checks to ConcurrencyTest, ProcedureTest and ScrollResultSet test to define their own
requirements.
Make ConcurrencyTest not use the old harness to define when it is run.

Added:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/_Suite.java
  (with props)
Removed:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ConcurrencyTest_app.properties
Modified:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ConcurrencyTest.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ProcedureTest.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ScrollResultSetTest.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/build.xml

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ConcurrencyTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ConcurrencyTest.java?rev=430889&r1=430888&r2=430889&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ConcurrencyTest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ConcurrencyTest.java
Fri Aug 11 13:38:49 2006
@@ -21,6 +21,8 @@
 import junit.framework.*;
 import java.sql.*;
 
+import org.apache.derbyTesting.functionTests.util.JDBC;
+
 /**
  * Testing concurrency behaviour in derby when creating the resultsets with
  * different parameters.
@@ -812,6 +814,9 @@
     
     public static Test suite() {
         TestSuite suite = new TestSuite();
+                
+        // Requires holdability
+        if (JDBC.vmSupportsJDBC3() || JDBC.vmSupportsJSR169()) {
         
         suite.addTest(new ConcurrencyTest("testUpdateLockDownGrade1"));
         suite.addTest(new ConcurrencyTest("testAquireUpdateLock1"));
@@ -836,6 +841,7 @@
 //         suite.addTest(new ConcurrencyTest("testTruncateDuringScan"));
         /// ---------------
                 
+        }
             
         return suite;
     }

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ProcedureTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ProcedureTest.java?rev=430889&r1=430888&r2=430889&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ProcedureTest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ProcedureTest.java
Fri Aug 11 13:38:49 2006
@@ -31,6 +31,7 @@
 import junit.framework.TestSuite;
 import org.apache.derbyTesting.functionTests.util.BaseJDBCTestCase;
 import org.apache.derbyTesting.functionTests.util.BaseJDBCTestSetup;
+import org.apache.derbyTesting.functionTests.util.JDBC;
 
 /**
  * Tests of stored procedures.
@@ -662,7 +663,12 @@
      * @return test suite
      */
     public static Test suite() {
-        TestSuite suite = new TestSuite(ProcedureTest.class);
+        TestSuite suite = new TestSuite();
+        
+        // Need JDBC 2 DriverManager to run these tests
+        if (JDBC.vmSupportsJDBC2()) {        	
+        
+        suite.addTestSuite(ProcedureTest.class);
         if (!usingDerbyNet()) {
             suite.addTest
                 (new ProcedureTest
@@ -697,6 +703,7 @@
                 (new ProcedureTest
                  ("xtestRollbackStoredProcWhenExecuteUpdateReturnsResults" +
                   "_prepared"));
+        }
         }
         return new BaseJDBCTestSetup(suite) {
             /**

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ScrollResultSetTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ScrollResultSetTest.java?rev=430889&r1=430888&r2=430889&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ScrollResultSetTest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ScrollResultSetTest.java
Fri Aug 11 13:38:49 2006
@@ -20,8 +20,10 @@
 package org.apache.derbyTesting.functionTests.tests.jdbcapi;
 
 import org.apache.derbyTesting.functionTests.util.BaseJDBCTestCase;
+import org.apache.derbyTesting.functionTests.util.JDBC;
 import org.apache.derbyTesting.functionTests.util.SQLStateConstants;
 import junit.framework.*;
+
 import java.sql.*;
 
 /**
@@ -45,6 +47,17 @@
     /** Creates a new instance of ScrollResultSetTest */
     public ScrollResultSetTest(String name) {
         super(name);
+    }
+    
+    public static Test suite() {
+        TestSuite suite = new TestSuite();
+                
+        // Requires holdability
+        if (JDBC.vmSupportsJDBC3() || JDBC.vmSupportsJSR169()) {
+        	suite.addTestSuite(ScrollResultSetTest.class);
+        }
+        
+        return suite;
     }
 
     /**

Added: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/_Suite.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/_Suite.java?rev=430889&view=auto
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/_Suite.java
(added)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/_Suite.java
Fri Aug 11 13:38:49 2006
@@ -0,0 +1,66 @@
+/*
+
+   Derby - Class org.apache.derbyTesting.functionTests.tests.jdbcapi._Suite
+
+       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
+*/
+package org.apache.derbyTesting.functionTests.tests.jdbcapi;
+
+import org.apache.derbyTesting.functionTests.util.BaseTestCase;
+import org.apache.derbyTesting.functionTests.util.JDBC;
+
+import junit.framework.Test; 
+import junit.framework.TestSuite;
+
+/**
+ * Suite to run all JUnit tests in this package:
+ * org.apache.derbyTesting.functionTests.tests.jdbcapi
+ *
+ */
+public class _Suite extends BaseTestCase  {
+
+	/**
+	 * Use suite method instead.
+	 */
+	private _Suite(String name) {
+		super(name);
+	}
+
+	public static Test suite() {
+
+		TestSuite suite = new TestSuite("jdbcapi");
+
+		suite.addTest(ConcurrencyTest.suite());
+		suite.addTestSuite(HoldabilityTest.class);
+		suite.addTest(ProcedureTest.suite());
+		suite.addTest(SURQueryMixTest.suite());
+		suite.addTest(SURTest.suite());
+		suite.addTest(UpdateXXXTest.suite());
+		suite.addTestSuite(URCoveringIndexTest.class);
+		
+		// Tests that are compiled using 1.4 target need to
+		// be added this way, otherwise creating the suite
+		// will throw an invalid class version error
+		if (JDBC.vmSupportsJDBC3() || JDBC.vmSupportsJSR169())
+		{
+			suite.addTest(ScrollResultSetTest.suite());
+		}
+
+		return suite;
+	}
+}

Propchange: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/_Suite.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/build.xml
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/build.xml?rev=430889&r1=430888&r2=430889&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/build.xml
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/build.xml
Fri Aug 11 13:38:49 2006
@@ -58,14 +58,37 @@
 
 <!--             ============ Begin Targets ==============                -->
  
-  <target name="FTOtestsubdir" depends="compilex,compilet2,compilet1,copyfiles"/>
+  <target name="FTOtestsubdir" depends="compileSuite,copyfiles"/>
 
   <!-- mkdir / init target may not be necessary, just here for reference... -->
   <target name="init">
     <mkdir dir="${out.dir}/${derby.testing.functest.dir}/tests/jdbcapi"/>
   </target>
 
-  <target name="compilet1" depends="compilet2">
+	  <target name="compileSuite" depends="compilet2">
+	    <javac
+	      source="1.3"
+	      target="1.3"
+	      bootclasspath="${empty}"
+	      nowarn="on"
+	      debug="${debug}"
+	      depend="${depend}"
+	      deprecation="${deprecation}"
+	      optimize="${optimize}"
+	      proceed="${proceed}"
+	      verbose="${verbose}" 
+	      srcdir="${derby.testing.src.dir}"
+	      destdir="${out.dir}">
+	      <classpath>
+	        <!--pathelement location="${oro}"/-->
+	        <pathelement path="${compile.classpath}"/>
+			<pathelement path="${junit}"/>
+	      </classpath>
+	      <include name="${this.dir}/_Suite.java"/>
+	    </javac>
+	  </target>
+	
+  <target name="compilet1">
     <javac
       source="1.3"
       target="1.3"
@@ -99,10 +122,11 @@
       <exclude name="${this.dir}/lobStreams.java"/>
       <exclude name="${this.dir}/XATest.java"/>
       <exclude name="${this.dir}/ScrollResultSetTest.java"/>
+      <exclude name="${this.dir}/_Suite.java"/>
     </javac>
   </target>
 
-  <target name="compilet2">
+  <target name="compilet2" depends="compilet1,compilex">
     <javac
       source="1.4"
       target="1.4"



Mime
View raw message