db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kahat...@apache.org
Subject svn commit: r410267 - in /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests: tests/jdbc4/ tests/jdbcapi/ util/
Date Tue, 30 May 2006 12:53:23 GMT
Author: kahatlen
Date: Tue May 30 05:53:22 2006
New Revision: 410267

URL: http://svn.apache.org/viewvc?rev=410267&view=rev
Log:
DERBY-1308: Tests jdbcapi/HoldabilityTest.junit,
jdbcapi/UpdateXXXTest.junit,jdbcapi/SURTest.junit fail on
wctme5.7_foundation

Attaching patch DERBY-1308_3_20060527.*. In this patch, I moved the
get*DataSource* methods from functionTests/util/BaseJDBCTestCase.java
to a new file, functionTests/util/TestDataSourceFactory.java, and the
method getDefaultSourceProperties into
functionTests/util/TestConfiguration.java.  I adjusted affected tests
that I could find, and verified the affected tests where applicable
with wctme5.7, wsdd5.6, wctme5.7_foundation, jdk142 and jdk16.

Patch contributed by Myrna van Lunteren.

Added:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/UpdateXXXTest_app.properties
  (with props)
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/TestDataSourceFactory.java
  (with props)
Modified:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/ClosedObjectTest.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/ConnectionTest.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/DataSourceTest.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/StatementEventsTest.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/UnsupportedVetter.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/VerifySignatures.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/XA40Test.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/BaseJDBCTestCase.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/TestConfiguration.java

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/ClosedObjectTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/ClosedObjectTest.java?rev=410267&r1=410266&r2=410267&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/ClosedObjectTest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/ClosedObjectTest.java
Tue May 30 05:53:22 2006
@@ -41,6 +41,7 @@
 import junit.framework.Test;
 import junit.framework.TestSuite;
 import org.apache.derbyTesting.functionTests.util.BaseJDBCTestCase;
+import org.apache.derbyTesting.functionTests.util.TestDataSourceFactory;
 
 /**
  * Test that all methods on <code>ResultSet</code>,
@@ -702,7 +703,7 @@
          * @exception SQLException if an error occurs
          */
         protected Connection newConnection_() throws SQLException {
-            DataSource ds = getDataSource();
+            DataSource ds = TestDataSourceFactory.getDataSource();
             return ds.getConnection(CONFIG.getUserName(),
                                     CONFIG.getUserPassword());
         }
@@ -730,7 +731,7 @@
          * @exception SQLException if an error occurs
          */
         protected Connection newConnection_() throws SQLException {
-            ConnectionPoolDataSource ds = getConnectionPoolDataSource();
+            ConnectionPoolDataSource ds = TestDataSourceFactory.getConnectionPoolDataSource();
             PooledConnection pc =
                 ds.getPooledConnection(CONFIG.getUserName(),
                                        CONFIG.getUserPassword());
@@ -759,7 +760,7 @@
          * @exception SQLException if an error occurs
          */
         protected Connection newConnection_() throws SQLException {
-            XADataSource ds = getXADataSource();
+            XADataSource ds = TestDataSourceFactory.getXADataSource();
             XAConnection xac = ds.getXAConnection(CONFIG.getUserName(),
                                                   CONFIG.getUserPassword());
             return xac.getConnection();

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/ConnectionTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/ConnectionTest.java?rev=410267&r1=410266&r2=410267&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/ConnectionTest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/ConnectionTest.java
Tue May 30 05:53:22 2006
@@ -22,6 +22,7 @@
 import junit.framework.*;
 
 import org.apache.derbyTesting.functionTests.util.BaseJDBCTestCase;
+import org.apache.derbyTesting.functionTests.util.TestDataSourceFactory;
 import org.apache.derbyTesting.functionTests.util.SQLStateConstants;
 
 import java.io.FileInputStream;
@@ -420,7 +421,7 @@
             throws SQLException {
             //The ConnectionPoolDataSource object
             //used to get a PooledConnection object
-            ConnectionPoolDataSource cpDataSource = getConnectionPoolDataSource();
+            ConnectionPoolDataSource cpDataSource = TestDataSourceFactory.getConnectionPoolDataSource();
             PooledConnection pConn = cpDataSource.getPooledConnection();
             //doing a getConnection() returns a Connection object
             //that internally contains a BrokeredConnection40 object
@@ -474,7 +475,7 @@
             throws SQLException {
             // Use a XADataSource to obtain a XAConnection object, and
             // finally a "real" connection.
-            con = getXADataSource().getXAConnection().getConnection();
+            con = TestDataSourceFactory.getXADataSource().getXAConnection().getConnection();
         }
         
     } // End class XAConnectionTest

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/DataSourceTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/DataSourceTest.java?rev=410267&r1=410266&r2=410267&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/DataSourceTest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/DataSourceTest.java
Tue May 30 05:53:22 2006
@@ -23,6 +23,7 @@
 import junit.framework.*;
 
 import org.apache.derbyTesting.functionTests.util.BaseJDBCTestCase;
+import org.apache.derbyTesting.functionTests.util.TestDataSourceFactory;
 import org.apache.derbyTesting.functionTests.util.SQLStateConstants;
 
 import java.sql.*;
@@ -52,7 +53,7 @@
      * Create a default DataSource
      */
     public void setUp() {
-        ds = getDataSource();
+        ds = TestDataSourceFactory.getDataSource();
     }
     
     /**

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/StatementEventsTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/StatementEventsTest.java?rev=410267&r1=410266&r2=410267&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/StatementEventsTest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/StatementEventsTest.java
Tue May 30 05:53:22 2006
@@ -25,6 +25,7 @@
 import junit.framework.*;
 
 import org.apache.derbyTesting.functionTests.util.BaseJDBCTestCase;
+import org.apache.derbyTesting.functionTests.util.TestDataSourceFactory;
 
 /*
     This class is used to test the JDBC4 statement event 
@@ -68,8 +69,8 @@
      *
      */
     public void setUp() throws SQLException {
-        XADataSource xadatasource = getXADataSource();
-        ConnectionPoolDataSource cpds = getConnectionPoolDataSource();
+        XADataSource xadatasource = TestDataSourceFactory.getXADataSource();
+        ConnectionPoolDataSource cpds = TestDataSourceFactory.getConnectionPoolDataSource();
         
         pooledConnection = cpds.getPooledConnection();
         xaconnection = xadatasource.getXAConnection();

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/UnsupportedVetter.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/UnsupportedVetter.java?rev=410267&r1=410266&r2=410267&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/UnsupportedVetter.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/UnsupportedVetter.java
Tue May 30 05:53:22 2006
@@ -32,6 +32,7 @@
 
 import org.apache.derbyTesting.functionTests.util.BaseJDBCTestCase;
 import org.apache.derbyTesting.functionTests.util.TestUtil;
+import org.apache.derbyTesting.functionTests.util.TestDataSourceFactory;
 
 /**
  * JUnit test which checks that only expected methods throw SQLFeatureNotSupporteException.
@@ -326,7 +327,7 @@
 		( HashSet<String> unsupportedList, HashSet<String> notUnderstoodList )
 		throws Exception
 	{
-		DataSource			ds = getDataSource();
+		DataSource			ds = TestDataSourceFactory.getDataSource();
 		Connection			conn = ds.getConnection();
 
 		vetObject( ds, unsupportedList, notUnderstoodList );
@@ -341,7 +342,7 @@
 		( HashSet<String> unsupportedList, HashSet<String> notUnderstoodList )
 		throws Exception
 	{
-		ConnectionPoolDataSource	ds = getConnectionPoolDataSource();
+		ConnectionPoolDataSource	ds = TestDataSourceFactory.getConnectionPoolDataSource();
 		PooledConnection			pc = ds.getPooledConnection
 			(CONFIG.getUserName(), CONFIG.getUserPassword());
 		Connection					conn = pc.getConnection();
@@ -359,7 +360,7 @@
 		( HashSet<String> unsupportedList, HashSet<String> notUnderstoodList )
 		throws Exception
 	{
-		XADataSource				ds = getXADataSource();
+		XADataSource				ds = TestDataSourceFactory.getXADataSource();
 		XAConnection				xaconn = ds.getXAConnection
 			(CONFIG.getUserName(), CONFIG.getUserPassword());
 		Connection					conn = xaconn.getConnection();

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/VerifySignatures.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/VerifySignatures.java?rev=410267&r1=410266&r2=410267&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/VerifySignatures.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/VerifySignatures.java
Tue May 30 05:53:22 2006
@@ -33,6 +33,7 @@
 import junit.framework.TestSuite;
 import org.apache.derbyTesting.functionTests.util.BaseJDBCTestCase;
 import org.apache.derbyTesting.functionTests.util.TestUtil;
+import org.apache.derbyTesting.functionTests.util.TestDataSourceFactory;
 
 /**
  * JUnit test which checks that all methods specified by the
@@ -147,7 +148,7 @@
     private static void collectClassesFromDataSource(Set<ClassInfo> classes)
         throws SQLException
     {
-        DataSource ds = getDataSource();
+        DataSource ds = TestDataSourceFactory.getDataSource();
         addClass(classes, ds.getClass(), javax.sql.DataSource.class);
         collectClassesFromConnection(ds.getConnection
                                      (CONFIG.getUserName(),
@@ -167,7 +168,7 @@
         collectClassesFromConnectionPoolDataSource(Set<ClassInfo> classes)
         throws SQLException
     {
-        ConnectionPoolDataSource cpds = getConnectionPoolDataSource();
+        ConnectionPoolDataSource cpds = TestDataSourceFactory.getConnectionPoolDataSource();
         addClass(classes,
                  cpds.getClass(), javax.sql.ConnectionPoolDataSource.class);
 
@@ -192,7 +193,7 @@
     private static void collectClassesFromXADataSource(Set<ClassInfo> classes)
         throws SQLException
     {
-        XADataSource xads = getXADataSource();
+        XADataSource xads = TestDataSourceFactory.getXADataSource();
         addClass(classes, xads.getClass(), javax.sql.XADataSource.class);
 
         XAConnection xaconn = xads.getXAConnection(CONFIG.getUserName(),

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/XA40Test.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/XA40Test.java?rev=410267&r1=410266&r2=410267&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/XA40Test.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/XA40Test.java
Tue May 30 05:53:22 2006
@@ -21,6 +21,7 @@
 package org.apache.derbyTesting.functionTests.tests.jdbc4;
 
 import org.apache.derbyTesting.functionTests.util.BaseJDBCTestCase;
+import org.apache.derbyTesting.functionTests.util.TestDataSourceFactory;
 
 import junit.framework.*;
 
@@ -69,7 +70,7 @@
      */
     public void setUp() 
         throws SQLException {
-        xads = getXADataSource();
+        xads = TestDataSourceFactory.getXADataSource();
         xac = xads.getXAConnection();
         xar = xac.getXAResource();
         con = xac.getConnection();

Added: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/UpdateXXXTest_app.properties
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/UpdateXXXTest_app.properties?rev=410267&view=auto
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/UpdateXXXTest_app.properties
(added)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/UpdateXXXTest_app.properties
Tue May 30 05:53:22 2006
@@ -0,0 +1,2 @@
+usedefaults=true
+runwithfoundation=false

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

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/BaseJDBCTestCase.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/BaseJDBCTestCase.java?rev=410267&r1=410266&r2=410267&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/BaseJDBCTestCase.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/BaseJDBCTestCase.java
Tue May 30 05:53:22 2006
@@ -20,10 +20,6 @@
 package org.apache.derbyTesting.functionTests.util;
 
 import java.sql.*;
-import java.util.Properties;
-import javax.sql.DataSource;
-import javax.sql.ConnectionPoolDataSource;
-import javax.sql.XADataSource;
 
 /**
  * Base class for JDBC JUnit tests.
@@ -79,113 +75,26 @@
                         CONFIG.getUserPassword());
             }
             else {
-                con = getXADataSource().getXAConnection (CONFIG.getUserName(),
+                con = TestDataSourceFactory.getXADataSource().getXAConnection (CONFIG.getUserName(),
                             CONFIG.getUserPassword()).getConnection();                
             }
         } else {
             //Use DataSource for JSR169
-            con = getDataSource().getConnection();
+            con = TestDataSourceFactory.getDataSource().getConnection();
         }
         return con;
     }
-
-    /**
-     * Generate properties which can be set on a
-     * <code>DataSource</code> in order to connect to the default
-     * database.
-     *
-     * @return a <code>Properties</code> object containing server
-     * name, port number, database name and other attributes needed to
-     * connect to the default database
-     */
-    private static Properties getDefaultDataSourceProperties() {
-        Properties attrs = new Properties();
-        if (!usingEmbedded()) {
-            attrs.setProperty("serverName", CONFIG.getHostName());
-            attrs.setProperty("portNumber", Integer.toString(CONFIG.getPort()));
-        }
-        attrs.setProperty("databaseName", CONFIG.getDatabaseName());
-        attrs.setProperty("connectionAttributes", "create=true");
-        return attrs;
-    }
-
-    /**
-     * Return a <code>DataSource</code> for the appropriate framework.
-     *
-     * @param attrs properties for the data source
-     * @return a <code>DataSource</code> object
-     * @see TestUtil#getDataSource(Properties)
-     */
-    public static DataSource getDataSource(Properties attrs) {
-        return TestUtil.getDataSource(attrs);
-    }
-
-    /**
-     * Return a <code>DataSource</code> which can establish a
-     * connection to the default database.
-     *
-     * @return a <code>DataSource</code> object
-     */
-    public static DataSource getDataSource() {
-        return getDataSource(getDefaultDataSourceProperties());
-    }
-
-    /**
-     * Return a <code>ConnectionPoolDataSource</code> for the
-     * appropriate framework.
-     *
-     * @param attrs properties for the data source
-     * @return a <code>ConnectionPoolDataSource</code> object
-     * @see TestUtil#getConnectionPoolDataSource(Properties)
-     */
-    public static ConnectionPoolDataSource
-        getConnectionPoolDataSource(Properties attrs)
-    {
-        return TestUtil.getConnectionPoolDataSource(attrs);
-    }
-
-    /**
-     * Return a <code>ConnectionPoolDataSource</code> which can
-     * establish a connection to the default database.
-     *
-     * @return a <code>ConnectionPoolDataSource</code> object
-     */
-    public static ConnectionPoolDataSource getConnectionPoolDataSource() {
-        return getConnectionPoolDataSource(getDefaultDataSourceProperties());
-    }
-
-    /**
-     * Return an <code>XADataSource</code> for the appropriate
-     * framework.
-     *
-     * @param attrs properties for the data source
-     * @return an <code>XADataSource</code> object
-     * @see TestUtil#getXADataSource(Properties)
-     */
-    public static XADataSource getXADataSource(Properties attrs) {
-        return TestUtil.getXADataSource(attrs);
-    }
-
+   
     /**
-     * Return an <code>XADataSource</code> which can establish a
-     * connection to the default database.
+     * Tell if the client is embedded.
      *
-     * @return an <code>XADataSource</code> object
+     * @return <code>true</code> if using the embedded client
+     *         <code>false</code> otherwise.
      */
-    public static XADataSource getXADataSource() {
-        return getXADataSource(getDefaultDataSourceProperties());
-    }
-
-   /**
-    * Tell if the client is embedded.
-    *
-    * @return <code>true</code> if using the embedded client
-    *         <code>false</code> otherwise.
-    */
-    public static boolean usingEmbedded() {
-        return (CONFIG.getJDBCClient() == JDBCClient.EMBEDDED);
-    }
-   
+     public static boolean usingEmbedded() {
+         return (CONFIG.getJDBCClient() == JDBCClient.EMBEDDED);
+     }
+    
     /**
     * Tell if the client is DerbyNetClient.
     *

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/TestConfiguration.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/TestConfiguration.java?rev=410267&r1=410266&r2=410267&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/TestConfiguration.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/TestConfiguration.java
Tue May 30 05:53:22 2006
@@ -279,4 +279,24 @@
      */
     private final static String UNUSED = "file://unused/";
 
+    /**
+     * Generate properties which can be set on a
+     * <code>DataSource</code> in order to connect to the default
+     * database.
+     *
+     * @return a <code>Properties</code> object containing server
+     * name, port number, database name and other attributes needed to
+     * connect to the default database
+     */
+    public static Properties getDefaultDataSourceProperties() {
+        Properties attrs = new Properties();
+        if (!(DERBY_TEST_CONFIG.getJDBCClient() == JDBCClient.EMBEDDED)) {
+            attrs.setProperty("serverName", DERBY_TEST_CONFIG.getHostName());
+            attrs.setProperty("portNumber", Integer.toString(DERBY_TEST_CONFIG.getPort()));
+        }
+        attrs.setProperty("databaseName", DERBY_TEST_CONFIG.getDatabaseName());
+        attrs.setProperty("connectionAttributes", "create=true");
+        return attrs;
+    }
+        
 }

Added: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/TestDataSourceFactory.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/TestDataSourceFactory.java?rev=410267&view=auto
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/TestDataSourceFactory.java
(added)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/TestDataSourceFactory.java
Tue May 30 05:53:22 2006
@@ -0,0 +1,104 @@
+/*
+
+   Derby - Class org.apache.derbyTesting.functionTests.util.TestUtil
+
+   Copyright 2006 The Apache Software Foundation or its licensors, as applicable.
+
+   Licensed 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.util;
+
+import java.util.Properties;
+import javax.sql.DataSource;
+import javax.sql.ConnectionPoolDataSource;
+import javax.sql.XADataSource;
+
+/**
+ * Utility class for JDBC JUnit tests.
+ * Contains methods to obtain the various datasources.
+ */
+
+public class TestDataSourceFactory {
+
+    /**
+     * Return a <code>DataSource</code> for the appropriate framework.
+     *
+     * @param attrs properties for the data source
+     * @return a <code>DataSource</code> object
+     * @see TestUtil#getDataSource(Properties)
+     */
+    public static DataSource getDataSource(Properties attrs) {
+        return TestUtil.getDataSource(attrs);
+    }
+
+    /**
+     * Return a <code>DataSource</code> which can establish a
+     * connection to the default database.
+     *
+     * @return a <code>DataSource</code> object
+     */
+    public static DataSource getDataSource() {
+        return getDataSource(TestConfiguration.getDefaultDataSourceProperties());
+    }
+
+    /**
+     * Return a <code>ConnectionPoolDataSource</code> for the
+     * appropriate framework.
+     *
+     * @param attrs properties for the data source
+     * @return a <code>ConnectionPoolDataSource</code> object
+     * @see TestUtil#getConnectionPoolDataSource(Properties)
+     */
+    public static ConnectionPoolDataSource
+        getConnectionPoolDataSource(Properties attrs)
+    {
+        return TestUtil.getConnectionPoolDataSource(attrs);
+    }
+
+    /**
+     * Return a <code>ConnectionPoolDataSource</code> which can
+     * establish a connection to the default database.
+     *
+     * @return a <code>ConnectionPoolDataSource</code> object
+     */
+    public static ConnectionPoolDataSource getConnectionPoolDataSource() {
+        return getConnectionPoolDataSource(TestConfiguration.getDefaultDataSourceProperties());
+    }
+
+    /**
+     * Return an <code>XADataSource</code> for the appropriate
+     * framework.
+     *
+     * @param attrs properties for the data source
+     * @return an <code>XADataSource</code> object
+     * @see TestUtil#getXADataSource(Properties)
+     */
+    public static XADataSource getXADataSource(Properties attrs) {
+        return TestUtil.getXADataSource(attrs);
+    }
+
+    /**
+     * Return an <code>XADataSource</code> which can establish a
+     * connection to the default database.
+     *
+     * @return an <code>XADataSource</code> object
+     */
+    public static XADataSource getXADataSource() {
+        return getXADataSource(TestConfiguration.getDefaultDataSourceProperties());
+    }	
+
+}
+

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



Mime
View raw message