db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject svn commit: r504432 - in /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests: tests/jdbcapi/JDBCHarnessJavaTest.java tests/lang/LangHarnessJavaTest.java util/HarnessJavaTest.java
Date Wed, 07 Feb 2007 04:25:26 GMT
Author: djd
Date: Tue Feb  6 20:25:25 2007
New Revision: 504432

URL: http://svn.apache.org/viewvc?view=rev&rev=504432
Log:
Updated version of JDBCHarnessJavaTest that includes client/server tests.
Updated version of HarnessJavaTest that supports J2ME/CDC/Foundation.
Initial version of LangHarnessJavaTest that runs 12 tests from derbylang successfully.
These harness test adapters are still not hooked into suites.All and thus the
harness tests they run continue to be run as part of the old derbyall suite.

Added:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/LangHarnessJavaTest.java
  (with props)
Modified:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/JDBCHarnessJavaTest.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/HarnessJavaTest.java

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/JDBCHarnessJavaTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/JDBCHarnessJavaTest.java?view=diff&rev=504432&r1=504431&r2=504432
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/JDBCHarnessJavaTest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/JDBCHarnessJavaTest.java
Tue Feb  6 20:25:25 2007
@@ -24,6 +24,7 @@
 import junit.framework.TestSuite;
 
 import org.apache.derbyTesting.functionTests.util.HarnessJavaTest;
+import org.apache.derbyTesting.junit.JDBC;
 import org.apache.derbyTesting.junit.TestConfiguration;
 
 /**
@@ -50,13 +51,13 @@
             // "statementJdbc20", runs in embedded only
             "resultsetJdbc20",           
             "StmtCloseFunTest",
-            // "dataSourceReference",
+            // "dataSourceReference", TODO: investigate failure/convert
             
             // from old jdbcapi.runall
             // "checkDriver",  TODO: investigate failure/convert
             "derbyStress",
             // "nullSQLText",  TODO: investigate failure/convert
-            "prepStmtMetaData",
+            // "prepStmtMetaData",  TODO: convert - different canon for client
             //"resultset", TODO: investigate failure/convert
             // "resultsetStream", TODO: investigate failure/convert needs ext files
             "maxfieldsize",
@@ -65,23 +66,23 @@
             // "setTransactionIsolation", TODO: investigate failure/convert
             "SetQueryTimeoutTest",
             "prepStmtNull",
-            "testRelative",
+            // "testRelative", TODO: passes embedded, fails client - investigate failure/convert
             "rsgetXXXcolumnNames",
             
             // from old jdk14.runall
             //"autoGeneratedJdbc30", TODO: investigate failure/convert
             //"checkDataSource30", TODO: investigate failure/convert
-            "parameterMetaDataJdbc30",
+            // "parameterMetaDataJdbc30", TODO: passes embedded, fails client - investigate
failure/convert
             // "statementJdbc30", runs in embedded only
-            "savepointJdbc30_JSR169",
-            "savepointJdbc30_XA",
+            // "savepointJdbc30_JSR169", TODO: convert - different canon for client
+            // "savepointJdbc30_XA", TODO: convert - different canon for client
             
             // from old xa.runall
             //"checkDataSource", TODO: investigate failure/convert
-            "dataSourcePermissions",
+            // "dataSourcePermissions", TODO: passes embedded, fails client - investigate
failure/convert
             //"XATest" TODO: investigate failure/convert
     };
-    
+
     /**
      * Tests that only run in embedded.
      */
@@ -91,8 +92,27 @@
         "batchUpdate",
         "statementJdbc20",
         "statementJdbc30",
+        
+        // Tests that run ok in embedded but have a different client master file.
+        "savepointJdbc30_JSR169",
+        "savepointJdbc30_XA",
+        "prepStmtMetaData",
+        
+        // Tests that pass on embedded but fail on client
+        "testRelative",
+    };
+    
+    /**
+     * Tests that require JDBC 3.
+     */
+    private static final String[] JDBCAPI_TESTS_EMEBDDED_JDBC3 =
+    {
+        // Tests that pass on embedded but fail on client
+        "parameterMetaDataJdbc30",
+        "dataSourcePermissions",         
     };
     
+    
     private JDBCHarnessJavaTest(String name) {
         super(name);
      }
@@ -106,9 +126,14 @@
         TestSuite suite = new TestSuite("jdbcapi: old harness java tests");
         suite.addTest(baseSuite("embedded", JDBCAPI_TESTS_BOTH));
         suite.addTest(baseSuite("embedded", JDBCAPI_TESTS_EMEBDDED));
+        if (JDBC.vmSupportsJDBC3())
+        {
+            suite.addTest(baseSuite("embedded_JDBC3",
+                    JDBCAPI_TESTS_EMEBDDED_JDBC3));
+        }
         
-        //suite.addTest(TestConfiguration.clientServerDecorator(
-        //        baseSuite("clientserver", JDBCAPI_TESTS_BOTH)));
+        suite.addTest(TestConfiguration.clientServerDecorator(
+                baseSuite("clientserver", JDBCAPI_TESTS_BOTH)));
         return suite;
     }
    

Added: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/LangHarnessJavaTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/LangHarnessJavaTest.java?view=auto&rev=504432
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/LangHarnessJavaTest.java
(added)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/LangHarnessJavaTest.java
Tue Feb  6 20:25:25 2007
@@ -0,0 +1,120 @@
+/*
+
+   Derby - Class org.apache.derbyTesting.functionTests.tests.ang.LangHarnessJavaTest
+
+   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.lang;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.apache.derbyTesting.functionTests.util.HarnessJavaTest;
+
+/**
+ * Run a lang '.java' test from the old harness in the Junit infrastructure.
+ * The test's output is compared to a master file using the facilities
+ * of the super class CanonTestCase.
+ * <BR>
+ * This allows a faster switch to running all tests under a single
+ * JUnit infrastructure. Running a test using this class does not
+ * preclude it from being converted to a real JUnit assert based test.
+ *
+ */
+public class LangHarnessJavaTest extends HarnessJavaTest {
+    
+    /**
+     * Tests that run in both client and embedded.
+     * Ideally both for a test of JDBC api functionality.
+     */
+    private static final String[] LANG_TESTS_BOTH =
+    {
+    };
+    
+    /**
+     * Tests that only run in embedded.
+     */
+    private static final String[] LANG_TESTS_EMEBDDED=
+    {
+        // old derbylang.runall suite
+        "AIjdbc",
+        // "AggregateClassLoading", TODO: investigate/convert
+        "CharUTF8",
+        "bug4356",
+        "bug5052rts",
+        "bug5054",
+        //"casting", TODO: investigate/convert, uses TestUtil.isNetFramework()
+        //"closed", TODO: investigate/convert
+        // "coalesceTests", TODO: investigate/convert
+        "concateTests",
+        // "currentof", being converted
+        // "cursor", TODO: investigate/convert
+        "dbManagerLimits",
+        "deadlockMode",
+        // "declareGlobalTempTableJava", TODO: investigate/convert
+        // "declareGlobalTempTableJavaJDBC30", TODO: uses TestUtil.isNetFramework()
+        // "errorStream", TODO: investigate/convert
+        // "forbitdata", TODO: investigate/convert
+        // "grantRevoke", TODO: uses TestUtil.isNetFramework()
+        // "holdCursorJavaReflection", TODO don't care holdability supported.
+        "JitTest",
+        // "logStream", TODO: investigate/convert
+        "longStringColumn",
+        // "maxMemPerTab", TODO: investigate/convert
+        // "outparams", TODO: investigate/convert
+        // "procedure", TODO: uses TestUtil.isNetFramework()
+        "repeat", 
+        "simpleThreadWrapper",
+        // "SpillHash", TODO: calls System.exit
+        // "stmtCache3", TODO: investigate/convert
+        // "streams",TODO: convert
+        // "timestampArith", TODO calls exit?
+        // "triggerStream", TODO: investigate/convert - simple master update?
+        // "unaryArithmeticDynamicParameter", TODO: investigate/convert - simple master update?
+        // "updateCursor", TODO: investigate/convert 
+        // "wisconsin", TODO: investigate/convert - needs ext files. 
+        // "ShutdownDatabase", TODO: convert
+        };
+    
+    private LangHarnessJavaTest(String name) {
+        super(name);
+     }
+
+    protected String getArea() {
+        return "lang";
+    }
+    
+    public static Test suite()
+    {
+        TestSuite suite = new TestSuite("jdbcapi: old harness java tests");
+        suite.addTest(baseSuite("embedded", LANG_TESTS_BOTH));
+        suite.addTest(baseSuite("embedded", LANG_TESTS_EMEBDDED));
+        
+        //suite.addTest(TestConfiguration.clientServerDecorator(
+        //        baseSuite("clientserver", LANG_TESTS_BOTH)));
+        return suite;
+    }
+   
+    private static Test baseSuite(String which, String[] set) {
+        TestSuite suite = new TestSuite("lang: " + which);
+        for (int i = 0; i < set.length; i++)
+        {
+            suite.addTest(decorate(new LangHarnessJavaTest(set[i])));
+        }
+        return suite;
+    }
+}

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

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/HarnessJavaTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/HarnessJavaTest.java?view=diff&rev=504432&r1=504431&r2=504432
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/HarnessJavaTest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/HarnessJavaTest.java
Tue Feb  6 20:25:25 2007
@@ -29,6 +29,7 @@
 
 import org.apache.derbyTesting.junit.CleanDatabaseTestSetup;
 import org.apache.derbyTesting.junit.DatabasePropertyTestSetup;
+import org.apache.derbyTesting.junit.JDBC;
 import org.apache.derbyTesting.junit.SystemPropertyTestSetup;
 import org.apache.derbyTesting.junit.TestConfiguration;
 
@@ -104,9 +105,29 @@
         {
             protected void setUp() throws java.lang.Exception
             {
-                newValues.setProperty(
+                TestConfiguration config = TestConfiguration.getCurrent();
+                
+                // With JDBC 3 connect using a JDBC URL
+                if (JDBC.vmSupportsJDBC3())
+                {
+                   newValues.setProperty(
                         "ij.database", 
-                        TestConfiguration.getCurrent().getJDBCUrl());
+                        config.getJDBCUrl());
+                }
+                else if (JDBC.vmSupportsJSR169())
+                {
+                    // Use a data source and set its database name.
+                    // The database will be created by the CleanDatabaseTestSetup
+                    // used for each individual fixture/test.
+                    
+                    newValues.setProperty(
+                        "ij.dataSource", 
+                        "org.apache.derby.jdbc.EmbeddedSimpleDataSource");
+                    
+                    newValues.setProperty(
+                        "ij.dataSource.databaseName",
+                        config.getDefaultDatabaseName());
+                }
                 super.setUp();
             }
         };



Mime
View raw message