db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject svn commit: r472228 - in /db/derby/code/trunk/java/testing/org/apache/derbyTesting: functionTests/tests/jdbc4/ functionTests/tests/jdbcapi/ junit/
Date Tue, 07 Nov 2006 20:05:23 GMT
Author: djd
Date: Tue Nov  7 12:05:22 2006
New Revision: 472228

URL: http://svn.apache.org/viewvc?view=rev&rev=472228
Log:
DERBY-2023 DERBY-2047 Add JUnit utility class J2EEDataSource to return XA and ConnectionPooling
data source implementations. Split out from JDBCDataSource to ensure no class not found exceptions
when running in JSR169. Changed JUnit tests using the old harness class TestDataSourceFactory
to use the J2EEDataSource and/or JDBCDataSource.

Added:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/J2EEDataSource.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/tests/jdbcapi/DataSourcePropertiesTest.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?view=diff&rev=472228&r1=472227&r2=472228
==============================================================================
--- 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 Nov  7 12:05:22 2006
@@ -40,8 +40,9 @@
 import junit.extensions.TestSetup;
 import junit.framework.Test;
 import junit.framework.TestSuite;
-import org.apache.derbyTesting.functionTests.util.TestDataSourceFactory;
 import org.apache.derbyTesting.junit.BaseJDBCTestCase;
+import org.apache.derbyTesting.junit.J2EEDataSource;
+import org.apache.derbyTesting.junit.JDBCDataSource;
 import org.apache.derbyTesting.junit.TestConfiguration;
 
 /**
@@ -115,9 +116,8 @@
     public static Test suite() {
         TestSuite suite = new TestSuite("ClosedObjectTest suite");
         suite.addTest(baseSuite("ClosedObjectTest:embedded"));
-        // This test will fail in client/server mode until DERBY-2047 is fixed.
-        //suite.addTest(TestConfiguration.clientServerDecorator(
-        //    baseSuite("ClosedObjectTest:client")));
+        suite.addTest(TestConfiguration.clientServerDecorator(
+            baseSuite("ClosedObjectTest:client")));
         return suite;
     }
 
@@ -717,9 +717,8 @@
          * @exception SQLException if an error occurs
          */
         protected Connection newConnection_() throws SQLException {
-            DataSource ds = TestDataSourceFactory.getDataSource();
-            return ds.getConnection(TestConfiguration.getCurrent().getUserName(),
-                    TestConfiguration.getCurrent().getUserPassword());
+            DataSource ds = JDBCDataSource.getDataSource();
+            return ds.getConnection();
         }
     }
 
@@ -745,10 +744,9 @@
          * @exception SQLException if an error occurs
          */
         protected Connection newConnection_() throws SQLException {
-            ConnectionPoolDataSource ds = TestDataSourceFactory.getConnectionPoolDataSource();
+            ConnectionPoolDataSource ds = J2EEDataSource.getConnectionPoolDataSource();
             PooledConnection pc =
-                ds.getPooledConnection(TestConfiguration.getCurrent().getUserName(),
-                        TestConfiguration.getCurrent().getUserPassword());
+                ds.getPooledConnection();
             return pc.getConnection();
         }
     }
@@ -774,9 +772,8 @@
          * @exception SQLException if an error occurs
          */
         protected Connection newConnection_() throws SQLException {
-            XADataSource ds = TestDataSourceFactory.getXADataSource();
-            XAConnection xac = ds.getXAConnection(TestConfiguration.getCurrent().getUserName(),
-                    TestConfiguration.getCurrent().getUserPassword());
+            XADataSource ds = J2EEDataSource.getXADataSource();
+            XAConnection xac = ds.getXAConnection();
             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?view=diff&rev=472228&r1=472227&r2=472228
==============================================================================
--- 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 Nov  7 12:05:22 2006
@@ -22,7 +22,6 @@
 
 import junit.framework.*;
 
-import org.apache.derbyTesting.functionTests.util.TestDataSourceFactory;
 import org.apache.derbyTesting.functionTests.util.SQLStateConstants;
 import org.apache.derbyTesting.junit.BaseJDBCTestCase;
 import org.apache.derbyTesting.junit.TestConfiguration;

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?view=diff&rev=472228&r1=472227&r2=472228
==============================================================================
--- 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 Nov  7 12:05:22 2006
@@ -23,8 +23,8 @@
 
 import junit.framework.*;
 
-import org.apache.derbyTesting.functionTests.util.TestDataSourceFactory;
 import org.apache.derbyTesting.junit.BaseJDBCTestCase;
+import org.apache.derbyTesting.junit.JDBCDataSource;
 import org.apache.derbyTesting.junit.TestConfiguration;
 
 import java.sql.*;
@@ -54,7 +54,7 @@
      * Create a default DataSource
      */
     public void setUp() {
-        ds = TestDataSourceFactory.getDataSource();
+        ds = JDBCDataSource.getDataSource();
     }
     
     /**
@@ -119,9 +119,6 @@
      * Return suite with all tests of the class.
      */
     public static Test suite() {
-        // This test will fail in client/server mode until DERBY-2047 is fixed.
-        //return TestConfiguration.defaultSuite(DataSourceTest.class);
-        return (new TestSuite(DataSourceTest.class,
-                              "DataSourceTest suite"));
+        return TestConfiguration.defaultSuite(DataSourceTest.class);
     }
 }

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?view=diff&rev=472228&r1=472227&r2=472228
==============================================================================
--- 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 Nov  7 12:05:22 2006
@@ -25,8 +25,8 @@
 import javax.sql.*;
 import junit.framework.*;
 
-import org.apache.derbyTesting.functionTests.util.TestDataSourceFactory;
 import org.apache.derbyTesting.junit.BaseJDBCTestCase;
+import org.apache.derbyTesting.junit.J2EEDataSource;
 import org.apache.derbyTesting.junit.TestConfiguration;
 
 import java.util.Enumeration;
@@ -117,11 +117,11 @@
      */
     public void setUp() throws SQLException {
         if (xa) {
-            XADataSource ds = TestDataSourceFactory.getXADataSource();
+            XADataSource ds = J2EEDataSource.getXADataSource();
             pooledConnection = ds.getXAConnection();
         } else {
             ConnectionPoolDataSource ds =
-                TestDataSourceFactory.getConnectionPoolDataSource();
+                J2EEDataSource.getConnectionPoolDataSource();
             pooledConnection = ds.getPooledConnection();
         }
         StatementEventListener listener = new StatementEventListener() {
@@ -175,9 +175,8 @@
     public static Test suite() {
         TestSuite suite = new TestSuite("StatementEventsTest suite");
         suite.addTest(baseSuite("StatementEventsTest:embedded"));
-        // This test will fail in client/server mode until DERBY-2047 is fixed.
-        //suite.addTest(TestConfiguration.clientServerDecorator(
-        //    baseSuite("StatementEventsTest:client")));
+        suite.addTest(TestConfiguration.clientServerDecorator(
+              baseSuite("StatementEventsTest:client")));
         return suite;
     }
 

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?view=diff&rev=472228&r1=472227&r2=472228
==============================================================================
--- 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 Nov  7 12:05:22 2006
@@ -31,8 +31,9 @@
 import java.net.URL;
 
 import org.apache.derbyTesting.functionTests.util.TestUtil;
-import org.apache.derbyTesting.functionTests.util.TestDataSourceFactory;
 import org.apache.derbyTesting.junit.BaseJDBCTestCase;
+import org.apache.derbyTesting.junit.J2EEDataSource;
+import org.apache.derbyTesting.junit.JDBCDataSource;
 import org.apache.derbyTesting.junit.TestConfiguration;
 
 /**
@@ -402,7 +403,7 @@
 		( HashSet<String> unsupportedList, HashSet<String> notUnderstoodList )
 		throws Exception
 	{
-		DataSource			ds = TestDataSourceFactory.getDataSource();
+		DataSource			ds = JDBCDataSource.getDataSource();
 		Connection			conn = ds.getConnection();
 
 		vetObject( ds, unsupportedList, notUnderstoodList );
@@ -417,7 +418,7 @@
 		( HashSet<String> unsupportedList, HashSet<String> notUnderstoodList )
 		throws Exception
 	{
-		ConnectionPoolDataSource	ds = TestDataSourceFactory.getConnectionPoolDataSource();
+		ConnectionPoolDataSource	ds = J2EEDataSource.getConnectionPoolDataSource();
 		PooledConnection			pc = ds.getPooledConnection
 			(getTestConfiguration().getUserName(),
                     getTestConfiguration().getUserPassword());
@@ -436,7 +437,7 @@
 		( HashSet<String> unsupportedList, HashSet<String> notUnderstoodList )
 		throws Exception
 	{
-		XADataSource				ds = TestDataSourceFactory.getXADataSource();
+		XADataSource				ds = J2EEDataSource.getXADataSource();
 		XAConnection				xaconn = ds.getXAConnection
 			(getTestConfiguration().getUserName(),
                     getTestConfiguration().getUserPassword());
@@ -1075,9 +1076,7 @@
 	}
 	
     public static Test suite() {
-        // This test will fail in client/server mode until DERBY-2047 is fixed.
-        //return TestConfiguration.defaultSuite(UnsupportedVetter.class);
-        return new TestSuite(UnsupportedVetter.class, "UnsupportedVetter");
+        return TestConfiguration.defaultSuite(UnsupportedVetter.class);
     }
 }
 

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?view=diff&rev=472228&r1=472227&r2=472228
==============================================================================
--- 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 Nov  7 12:05:22 2006
@@ -32,8 +32,9 @@
 import junit.framework.TestCase;
 import junit.framework.TestSuite;
 import org.apache.derbyTesting.functionTests.util.TestUtil;
-import org.apache.derbyTesting.functionTests.util.TestDataSourceFactory;
 import org.apache.derbyTesting.junit.BaseJDBCTestCase;
+import org.apache.derbyTesting.junit.J2EEDataSource;
+import org.apache.derbyTesting.junit.JDBCDataSource;
 import org.apache.derbyTesting.junit.TestConfiguration;
 
 /**
@@ -144,7 +145,7 @@
     private static void collectClassesFromDataSource(Set<ClassInfo> classes)
         throws SQLException
     {
-        DataSource ds = TestDataSourceFactory.getDataSource();
+        DataSource ds = JDBCDataSource.getDataSource();
         addClass(classes, ds.getClass(), javax.sql.DataSource.class);
         collectClassesFromConnection(ds.getConnection
                                      (TestConfiguration.getCurrent().getUserName(),
@@ -164,7 +165,7 @@
         collectClassesFromConnectionPoolDataSource(Set<ClassInfo> classes)
         throws SQLException
     {
-        ConnectionPoolDataSource cpds = TestDataSourceFactory.getConnectionPoolDataSource();
+        ConnectionPoolDataSource cpds = J2EEDataSource.getConnectionPoolDataSource();
         addClass(classes,
                  cpds.getClass(), javax.sql.ConnectionPoolDataSource.class);
 
@@ -189,7 +190,7 @@
     private static void collectClassesFromXADataSource(Set<ClassInfo> classes)
         throws SQLException
     {
-        XADataSource xads = TestDataSourceFactory.getXADataSource();
+        XADataSource xads = J2EEDataSource.getXADataSource();
         addClass(classes, xads.getClass(), javax.sql.XADataSource.class);
 
         XAConnection xaconn = xads.getXAConnection(TestConfiguration.getCurrent().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?view=diff&rev=472228&r1=472227&r2=472228
==============================================================================
--- 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 Nov  7 12:05:22 2006
@@ -20,8 +20,8 @@
 
 package org.apache.derbyTesting.functionTests.tests.jdbc4;
 
-import org.apache.derbyTesting.functionTests.util.TestDataSourceFactory;
 import org.apache.derbyTesting.junit.BaseJDBCTestCase;
+import org.apache.derbyTesting.junit.J2EEDataSource;
 import org.apache.derbyTesting.junit.TestConfiguration;
 
 import junit.framework.*;
@@ -71,7 +71,7 @@
      */
     public void setUp() 
         throws SQLException {
-        xads = TestDataSourceFactory.getXADataSource();
+        xads = J2EEDataSource.getXADataSource();
         xac = xads.getXAConnection();
         xar = xac.getXAResource();
         con = xac.getConnection();
@@ -182,14 +182,7 @@
      * Create test suite for XA40Test.
      */
     public static Test suite() {
-        // This test will fail in client/server mode until DERBY-2047 is fixed.
-        //return TestConfiguration.defaultSuite(XA40Test.class);
-
-        TestSuite suite = new TestSuite("XA40Test suite");
-        // Decorate test suite with a TestSetup class.
-        suite.addTest(new TestSuite(XA40Test.class));
-
-        return suite;
+        return TestConfiguration.defaultSuite(XA40Test.class);
     }
     
 } // End class XA40Test

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/DataSourcePropertiesTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/DataSourcePropertiesTest.java?view=diff&rev=472228&r1=472227&r2=472228
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/DataSourcePropertiesTest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/DataSourcePropertiesTest.java
Tue Nov  7 12:05:22 2006
@@ -29,10 +29,11 @@
 import javax.sql.XADataSource;
 import junit.framework.Test;
 import junit.framework.TestSuite;
-import org.apache.derbyTesting.functionTests.util.TestDataSourceFactory;
 import org.apache.derbyTesting.functionTests.util.TestUtil;
 import org.apache.derbyTesting.junit.BaseJDBCTestCase;
+import org.apache.derbyTesting.junit.J2EEDataSource;
 import org.apache.derbyTesting.junit.JDBC;
+import org.apache.derbyTesting.junit.JDBCDataSource;
 
 /**
  * This class tests that properties of data sources are handled correctly.
@@ -124,7 +125,7 @@
     public void embeddedTestAttributesAsPasswordWithoutPassword_ds()
         throws Exception
     {
-        DataSource ds = TestDataSourceFactory.getDataSource();
+        DataSource ds = JDBCDataSource.getDataSource();
         setDataSourceProperty(ds, "password", "mypassword");
         setDataSourceProperty(ds, "attributesAsPassword", Boolean.TRUE,
                               Boolean.TYPE);
@@ -141,7 +142,7 @@
         throws Exception
     {
         ConnectionPoolDataSource ds =
-            TestDataSourceFactory.getConnectionPoolDataSource();
+            J2EEDataSource.getConnectionPoolDataSource();
         setDataSourceProperty(ds, "password", "mypassword");
         setDataSourceProperty(ds, "attributesAsPassword", Boolean.TRUE,
                               Boolean.TYPE);
@@ -159,7 +160,7 @@
     public void embeddedTestAttributesAsPasswordWithoutPassword_xa()
         throws Exception
     {
-        XADataSource ds = TestDataSourceFactory.getXADataSource();
+        XADataSource ds = J2EEDataSource.getXADataSource();
         setDataSourceProperty(ds, "password", "mypassword");
         setDataSourceProperty(ds, "attributesAsPassword", Boolean.TRUE,
                               Boolean.TYPE);
@@ -176,7 +177,7 @@
     public void embeddedTestAttributesAsPasswordWithPassword_ds()
         throws Exception
     {
-        DataSource ds = TestDataSourceFactory.getDataSource();
+        DataSource ds = JDBCDataSource.getDataSource();
         setDataSourceProperty(ds, "attributesAsPassword", Boolean.TRUE,
                               Boolean.TYPE);
         try {
@@ -197,7 +198,7 @@
         throws Exception
     {
         ConnectionPoolDataSource ds =
-            TestDataSourceFactory.getConnectionPoolDataSource();
+            J2EEDataSource.getConnectionPoolDataSource();
         setDataSourceProperty(ds, "attributesAsPassword", Boolean.TRUE,
                               Boolean.TYPE);
         try {
@@ -218,7 +219,7 @@
     public void embeddedTestAttributesAsPasswordWithPassword_xa()
         throws Exception
     {
-        XADataSource ds = TestDataSourceFactory.getXADataSource();
+        XADataSource ds = J2EEDataSource.getXADataSource();
         setDataSourceProperty(ds, "attributesAsPassword", Boolean.TRUE,
                               Boolean.TYPE);
         try {

Added: db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/J2EEDataSource.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/J2EEDataSource.java?view=auto&rev=472228
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/J2EEDataSource.java (added)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/J2EEDataSource.java Tue
Nov  7 12:05:22 2006
@@ -0,0 +1,87 @@
+/*
+ *
+ * Derby - Class org.apache.derbyTesting.junit.JDBCDataSource
+ *
+ * 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.junit;
+
+import java.util.HashMap;
+
+import javax.sql.ConnectionPoolDataSource;
+import javax.sql.XADataSource;
+
+/**
+ * Utility methods related to J2EE JDBC DataSource objects.
+ * Separated out from JDBCDataSource to ensure that no
+ * ClassNotFoundExceptions are thrown with JSR169.
+ *
+ */
+public class J2EEDataSource {
+    
+    /**
+     * Return a DataSource corresponding to the current
+     * configuration. The getPooledConnection() method is configured
+     * to use the user name and password from the configuration.
+     */
+    public static javax.sql.ConnectionPoolDataSource getConnectionPoolDataSource()
+    {
+        return getConnectionPoolDataSource(TestConfiguration.getCurrent(), (HashMap) null);
+    }
+    /**
+     * Create a new DataSource object setup from the passed in TestConfiguration.
+     * The getPooledConnection() method is configured
+     * to use the user name and password from the configuration.
+     */
+    static ConnectionPoolDataSource getConnectionPoolDataSource(
+            TestConfiguration config,
+            HashMap beanProperties)
+    {
+        if (beanProperties == null)
+             beanProperties = JDBCDataSource.getDataSourceProperties(config);
+        
+        String dataSourceClass = config.getJDBCClient().getConnectionPoolDataSourceClassName();
+        
+        return (ConnectionPoolDataSource) JDBCDataSource.getDataSourceObject(
+                dataSourceClass, beanProperties);
+    }
+    
+    /**
+     * Return an XA DataSource corresponding to the current
+     * configuration. The getXAConnection() method is configured
+     * to use the user name and password from the configuration.
+     */
+    public static XADataSource getXADataSource()
+    {
+        return getXADataSource(TestConfiguration.getCurrent(), (HashMap) null);
+    }
+    /**
+     * Create a new DataSource object setup from the passed in TestConfiguration.
+     * The getXAConnection() method is configured
+     * to use the user name and password from the configuration.
+     */
+    static XADataSource getXADataSource(TestConfiguration config,
+            HashMap beanProperties)
+    {
+        if (beanProperties == null)
+             beanProperties = JDBCDataSource.getDataSourceProperties(config);
+        
+        String dataSourceClass = config.getJDBCClient().getXADataSourceClassName();
+        
+        return (XADataSource) JDBCDataSource.getDataSourceObject(
+                dataSourceClass, beanProperties);
+    }
+}
\ No newline at end of file

Propchange: db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/J2EEDataSource.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message