db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject svn commit: r495704 - in /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi: JDBCDriversAllTest.java JDBCDriversClientTest.java JDBCDriversEmbeddedTest.java JDBCDriversPropertyTest.java
Date Fri, 12 Jan 2007 19:37:22 GMT
Author: djd
Date: Fri Jan 12 11:37:22 2007
New Revision: 495704

URL: http://svn.apache.org/viewvc?view=rev&rev=495704
Log:
DERBY-1952 (partial) Add some junit test cases that are wrappers around jdbcapi.autoloadTest
that set jdbc.drivers as a System property before running jdbcapi.autoloadTest fixtures.
These tests are intended only to be run standalone, ie a single run on one test class
in a jvm, as they test autoloading of Derby's drivers by the DriverManager class.

Added:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/JDBCDriversAllTest.java
  (with props)
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/JDBCDriversClientTest.java
  (with props)
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/JDBCDriversEmbeddedTest.java
  (with props)
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/JDBCDriversPropertyTest.java
  (with props)

Added: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/JDBCDriversAllTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/JDBCDriversAllTest.java?view=auto&rev=495704
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/JDBCDriversAllTest.java
(added)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/JDBCDriversAllTest.java
Fri Jan 12 11:37:22 2007
@@ -0,0 +1,39 @@
+/*
+
+   Derby - Class org.apache.derbyTesting.functionTests.tests.jdbcapi.JDBCDriversAllTest
+
+   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 junit.framework.Test;
+
+/**
+ * Test autoloading with the both the embedded and
+ * client drivers in jdbc.drivers.
+ * Note this test is intended to be run in its own JVM, see
+ * the parent class for details.
+ *
+ */
+public class JDBCDriversAllTest extends JDBCDriversPropertyTest {
+    
+    public static Test suite() throws Exception
+    {
+        return getSuite(
+          "org.apache.derby.jdbc.EmbeddedDriver:org.apache.derby.jdbc.ClientDriver");
+    }
+}

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

Added: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/JDBCDriversClientTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/JDBCDriversClientTest.java?view=auto&rev=495704
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/JDBCDriversClientTest.java
(added)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/JDBCDriversClientTest.java
Fri Jan 12 11:37:22 2007
@@ -0,0 +1,37 @@
+/*
+
+   Derby - Class org.apache.derbyTesting.functionTests.tests.jdbcapi.JDBCDriversClientTest
+
+   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 junit.framework.Test;
+
+/**
+ * Test autoloading with the client driver in jdbc.drivers.
+ * Note this test is intended to be run in its own JVM, see
+ * the parent class for details.
+ *
+ */
+public class JDBCDriversClientTest extends JDBCDriversPropertyTest {
+    
+    public static Test suite() throws Exception
+    {
+        return getSuite("org.apache.derby.jdbc.ClientDriver");
+    }
+}

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

Added: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/JDBCDriversEmbeddedTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/JDBCDriversEmbeddedTest.java?view=auto&rev=495704
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/JDBCDriversEmbeddedTest.java
(added)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/JDBCDriversEmbeddedTest.java
Fri Jan 12 11:37:22 2007
@@ -0,0 +1,37 @@
+/*
+
+   Derby - Class org.apache.derbyTesting.functionTests.tests.jdbcapi.JDBCDriversEmbeddedTest
+
+   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 junit.framework.Test;
+
+/**
+ * Test autoloading with the embedded driver in jdbc.drivers.
+ * Note this test is intended to be run in its own JVM, see
+ * the parent class for details.
+ *
+ */
+public class JDBCDriversEmbeddedTest extends JDBCDriversPropertyTest {
+    
+    public static Test suite() throws Exception
+    {
+        return getSuite("org.apache.derby.jdbc.EmbeddedDriver");
+    }
+}

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

Added: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/JDBCDriversPropertyTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/JDBCDriversPropertyTest.java?view=auto&rev=495704
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/JDBCDriversPropertyTest.java
(added)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/JDBCDriversPropertyTest.java
Fri Jan 12 11:37:22 2007
@@ -0,0 +1,70 @@
+/*
+
+   Derby - Class org.apache.derbyTesting.functionTests.tests.jdbcapi.AutoloadTest
+
+   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 java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+/**
+ * Run an autoload test with the system property
+ * jdbc.drivers being set. This test is only intended
+ * to be run in its own vm as a single test run.
+ * It inherits from TestCase so as to not have any
+ * chance of loading DriverManager before setting
+ * jdbc.drivers. 
+ */
+abstract class JDBCDriversPropertyTest extends TestCase {
+    
+    final static Test getSuite(String jdbcDrivers) throws Exception {
+        
+        TestSuite suite = new TestSuite("jdbc.drivers="+jdbcDrivers);
+        
+        System.setProperty("jdbc.drivers", jdbcDrivers);
+        
+        suite.addTest(getAutoLoadSuite());
+            
+        return suite;
+    }
+    
+    /**
+     * Load the class and run its suite method through reflection
+     * so that DriverManger is not loaded indirectly before
+     * jdbc.drivers is set.
+     */
+    private static Test getAutoLoadSuite()
+       throws Exception
+    {
+        Class alt = Class.forName(
+           "org.apache.derbyTesting.functionTests.tests.jdbcapi.AutoloadTest");
+        
+        Method suiteMethod = alt.getMethod("suite", null);
+        
+        return (Test) suiteMethod.invoke(null, null);
+    }
+    
+    JDBCDriversPropertyTest() {
+        super();
+     }
+}

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



Mime
View raw message