db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject svn commit: r434192 - in /db/derby/code/trunk/java/testing/org/apache/derbyTesting: functionTests/tests/derbynet/ functionTests/tests/jdbc4/ functionTests/tests/jdbcapi/ functionTests/tests/lang/ functionTests/tests/tools/ functionTests/util/ junit/
Date Wed, 23 Aug 2006 21:31:56 GMT
Author: djd
Date: Wed Aug 23 14:31:54 2006
New Revision: 434192

URL: http://svn.apache.org/viewvc?rev=434192&view=rev
Log:
DERBY-1555 Change BaseJDBCTestCase.getXConnection() to getConnection and provide consistent initialization
of all connections returned by instance methods of BaseJDBCTestCase.

Modified:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/ShutDownDBWhenNSShutsDownTest.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/BlobTest.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/CallableStatementTest.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/ClobTest.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/RowIdNotImplementedTest.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/StatementTest.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/BLOBTest.java
    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/HoldabilityTest.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/ResultSetCloseTest.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/SURBaseTest.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/SURQueryMixTest.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/URCoveringIndexTest.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/UpdateXXXTest.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/PrepareExecuteDDL.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/largeCodeGen.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/IJRunScriptTest.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/sysinfo_api.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/ScriptTestCase.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/BaseJDBCTestCase.java

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/ShutDownDBWhenNSShutsDownTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/ShutDownDBWhenNSShutsDownTest.java?rev=434192&r1=434191&r2=434192&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/ShutDownDBWhenNSShutsDownTest.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/ShutDownDBWhenNSShutsDownTest.java Wed Aug 23 14:31:54 2006
@@ -144,7 +144,7 @@
     }
 
     private void createDatabase() throws SQLException {
-        Connection conn = getXConnection();
+        Connection conn = getConnection();
         conn.setAutoCommit(false);
         Statement st = conn.createStatement();
         st.execute("CREATE TABLE T1 (a int)");

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/BlobTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/BlobTest.java?rev=434192&r1=434191&r2=434192&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/BlobTest.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/BlobTest.java Wed Aug 23 14:31:54 2006
@@ -155,7 +155,7 @@
     public void setUp() 
         throws SQLException {
 
-        blob = BlobClobTestSetup.getSampleBlob(getXConnection());
+        blob = BlobClobTestSetup.getSampleBlob(getConnection());
         
         //call the buildHashSetMethod to initialize the 
         //HashSet with the method signatures that are exempted 

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/CallableStatementTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/CallableStatementTest.java?rev=434192&r1=434191&r2=434192&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/CallableStatementTest.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/CallableStatementTest.java Wed Aug 23 14:31:54 2006
@@ -79,7 +79,7 @@
    
     public void testNamedParametersAreNotSupported()
         throws SQLException {
-        DatabaseMetaData met = getXConnection().getMetaData();
+        DatabaseMetaData met = getConnection().getMetaData();
         assertFalse("Named parameters are not supported, but the metadata " +
                     "says they are", met.supportsNamedParameters());
         met = null;
@@ -185,7 +185,7 @@
      */
     public void testGetCharacterStreamIntOnInParameterOfValidType()
         throws SQLException {
-        cStmt = CallableStatementTestSetup.getBinaryDirectProcedure(getXConnection());
+        cStmt = CallableStatementTestSetup.getBinaryDirectProcedure(getConnection());
         cStmt.setString(1, "A string");
         cStmt.execute();
         try {
@@ -209,7 +209,7 @@
      */
     public void testGetCharacterStreamIntVARCHAR()
         throws IOException, SQLException {
-        cStmt = CallableStatementTestSetup.getIntToStringFunction(getXConnection());
+        cStmt = CallableStatementTestSetup.getIntToStringFunction(getConnection());
         cStmt.setInt(2, 4509);
         assertFalse("No resultsets should be returned", cStmt.execute());
         assertEquals("Incorrect updatecount", -1, cStmt.getUpdateCount());
@@ -240,7 +240,7 @@
     public void testGetCharacterStreamIntVARBINARYDirect()
         throws IOException, SQLException {
         String data = "This is the test string.";
-        cStmt = CallableStatementTestSetup.getBinaryDirectProcedure(getXConnection());
+        cStmt = CallableStatementTestSetup.getBinaryDirectProcedure(getConnection());
         cStmt.setString(1, data);
         assertFalse("No resultsets should be returned", cStmt.execute());
         // Note that getUpdateCount behaves differently on client and embedded.
@@ -279,7 +279,7 @@
      */
     public void testGetCharacterStreamIntVARBINARYFromDb()
         throws IOException, SQLException {
-        cStmt = CallableStatementTestSetup.getBinaryFromDbFunction(getXConnection());
+        cStmt = CallableStatementTestSetup.getBinaryFromDbFunction(getConnection());
         cStmt.setInt(2, CallableStatementTestSetup.STRING_BYTES_ID);
         assertFalse("No resultsets should be returned", cStmt.execute());
         assertEquals("Incorrect updatecount", -1, cStmt.getUpdateCount());
@@ -310,7 +310,7 @@
      */
     public void testGetCharacterStreamIntOnVARBINARYWithNull()
         throws SQLException {
-        cStmt = CallableStatementTestSetup.getBinaryFromDbFunction(getXConnection());
+        cStmt = CallableStatementTestSetup.getBinaryFromDbFunction(getConnection());
         cStmt.setInt(2, CallableStatementTestSetup.SQL_NULL_ID);
         assertFalse("No resultsets should be returned", cStmt.execute());
         assertEquals("Incorrect updatecount", -1, cStmt.getUpdateCount());
@@ -325,7 +325,7 @@
      */
     public void testGetCharacterStreamIntOnVARCHARWithNull()
         throws SQLException {
-        cStmt = CallableStatementTestSetup.getVarcharFromDbFunction(getXConnection());
+        cStmt = CallableStatementTestSetup.getVarcharFromDbFunction(getConnection());
         cStmt.setInt(2, CallableStatementTestSetup.SQL_NULL_ID);
         assertFalse("No resultsets should be returned", cStmt.execute());
         assertEquals("Incorrect updatecount", -1, cStmt.getUpdateCount());

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/ClobTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/ClobTest.java?rev=434192&r1=434191&r2=434192&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/ClobTest.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/ClobTest.java Wed Aug 23 14:31:54 2006
@@ -153,7 +153,7 @@
     
     public void setUp() 
         throws SQLException {
-        clob = BlobClobTestSetup.getSampleClob(getXConnection());
+        clob = BlobClobTestSetup.getSampleClob(getConnection());
         
         //call the buildHashSetMethod to initialize the 
         //HashSet with the method signatures that are exempted 

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=434192&r1=434191&r2=434192&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 Wed Aug 23 14:31:54 2006
@@ -72,7 +72,7 @@
      */
     public void embeddedCreateBlob()
         throws SQLException {
-            Blob blob = getXConnection().createBlob();
+            Blob blob = getConnection().createBlob();
             //Check if the blob is empty
             if(blob.length() > 0)
                 fail("The new Blob should not have more than zero bytes " +
@@ -93,7 +93,7 @@
      */
     public void embeddedCreateClob()
         throws SQLException {
-            Clob clob = getXConnection().createClob();
+            Clob clob = getConnection().createClob();
             //check if the Clob is empty
             if(clob.length() > 0)
                 fail("The new Clob should not have a length of greater than " +
@@ -103,7 +103,7 @@
     public void testCreateArrayNotImplemented()
         throws SQLException {
         try {
-            getXConnection().createArrayOf(null, null);
+            getConnection().createArrayOf(null, null);
             fail("createArrayOf(String,Object[]) should not be implemented");
         } catch (SQLFeatureNotSupportedException sfnse) {
             // Do nothing, we are fine
@@ -113,7 +113,7 @@
     public void testCreateNClobNotImplemented()
         throws SQLException {
         try {
-            getXConnection().createNClob();
+            getConnection().createNClob();
             fail("createNClob() should not be implemented");
         } catch (SQLFeatureNotSupportedException sfnse) {
             // Do nothing, we are fine
@@ -129,14 +129,14 @@
      */
     public void testCreateQueryObjectIsImplemented()
         throws SQLException {
-        getXConnection().createQueryObject(TestQuery.class);
-        getXConnection().createQueryObject(TestQuery.class, getXConnection());
+        getConnection().createQueryObject(TestQuery.class);
+        getConnection().createQueryObject(TestQuery.class, getConnection());
     }
 
     public void testCreateSQLXMLNotImplemented()
         throws SQLException {
         try {
-            getXConnection().createSQLXML();
+            getConnection().createSQLXML();
             fail("createSQLXML() should not be implemented");
         } catch (SQLFeatureNotSupportedException sfnse) {
             // Do nothing, we are fine
@@ -146,7 +146,7 @@
     public void testCreateStructNotImplemented()
         throws SQLException {
         try {
-            getXConnection().createStruct(null, null);
+            getConnection().createStruct(null, null);
             fail("createStruct(String,Object[]) should not be implemented");
         } catch (SQLFeatureNotSupportedException sfnse) {
             // Do nothing, we are fine
@@ -156,15 +156,15 @@
     public void testGetClientInfo()
         throws SQLException {
         assertTrue("getClientInfo() must return an empty Properties object", 
-                   getXConnection().getClientInfo().isEmpty());
+                   getConnection().getClientInfo().isEmpty());
     }
     
     public void testGetClientInfoString()
         throws SQLException {
         assertNull("getClientInfo(null) must return null",
-                   getXConnection().getClientInfo(null));
+                   getConnection().getClientInfo(null));
         assertNull("getClientInfo(\"someProperty\") must return null",
-                   getXConnection().getClientInfo("someProperty"));
+                   getConnection().getClientInfo("someProperty"));
     }
 
     /**
@@ -176,14 +176,14 @@
      */
     public void testIsValidImplemented() throws SQLException {
         // Test with an infinite (0) timeout
-        assertTrue(getXConnection().isValid(0));
+        assertTrue(getConnection().isValid(0));
 
         // Test with a 1 second timeout
-        assertTrue(getXConnection().isValid(1));
+        assertTrue(getConnection().isValid(1));
 
         // Test with an illegal timeout
         try {
-            getXConnection().isValid(-1);
+            getConnection().isValid(-1);
         } catch (SQLException sqle) {
             assertSQLState("Incorrect SQL state when calling isValid(-1)",
                            "XJ081", sqle);
@@ -196,29 +196,29 @@
      * @exception SQLException if an error occurs
      */
     public void testGetTypeMapReturnsEmptyMap() throws SQLException {
-        assertTrue(getXConnection().getTypeMap().isEmpty());
+        assertTrue(getConnection().getTypeMap().isEmpty());
     }
 
     public void testIsWrapperReturnsFalse()
         throws SQLException {
-        assertFalse(getXConnection().isWrapperFor(ResultSet.class));
+        assertFalse(getConnection().isWrapperFor(ResultSet.class));
     }
 
     public void testIsWrapperReturnsTrue()
         throws SQLException {
-        assertTrue(getXConnection().isWrapperFor(Connection.class));
+        assertTrue(getConnection().isWrapperFor(Connection.class));
     }
 
     public void testSetClientInfoProperties()
         throws SQLException {
-        getXConnection().setClientInfo(null);
+        getConnection().setClientInfo(null);
         Properties p = new Properties();
-        getXConnection().setClientInfo(p);
+        getConnection().setClientInfo(p);
 
         p.setProperty("prop1", "val1");
         p.setProperty("prop2", "val2");
         try {
-            getXConnection().setClientInfo(p);
+            getConnection().setClientInfo(p);
             fail("setClientInfo(String,String) should throw "+
                  "SQLClientInfoException");
         } catch (SQLClientInfoException cie) {
@@ -238,16 +238,16 @@
 
     public void testSetClientInfoString()
         throws SQLException {
-        getXConnection().setClientInfo(null, null);
+        getConnection().setClientInfo(null, null);
 
         try {
-            getXConnection().setClientInfo("foo", null);
+            getConnection().setClientInfo("foo", null);
             fail("setClientInfo(String, null) should throw "+
                  "NullPointerException");
         } catch (NullPointerException npe) {}
 
         try {
-            getXConnection().setClientInfo("name", "value");
+            getConnection().setClientInfo("name", "value");
             fail("setClientInfo(String,String) should throw "+
                  "SQLClientInfoException");
         } catch (SQLClientInfoException cie) {
@@ -263,14 +263,14 @@
     
     public void testUnwrapValid()
         throws SQLException {
-        Connection unwrappedCon = getXConnection().unwrap(Connection.class);
-        assertSame("Unwrap returned wrong object.", getXConnection(), unwrappedCon);
+        Connection unwrappedCon = getConnection().unwrap(Connection.class);
+        assertSame("Unwrap returned wrong object.", getConnection(), unwrappedCon);
     }
 
     public void testUnwrapInvalid()
         throws SQLException {
         try {
-            ResultSet unwrappedRs = getXConnection().unwrap(ResultSet.class);
+            ResultSet unwrappedRs = getConnection().unwrap(ResultSet.class);
             fail("unwrap should have thrown an exception");
         } catch (SQLException sqle) {
             assertSQLState("Incorrect SQL state when unable to unwrap",

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/RowIdNotImplementedTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/RowIdNotImplementedTest.java?rev=434192&r1=434191&r2=434192&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/RowIdNotImplementedTest.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/RowIdNotImplementedTest.java Wed Aug 23 14:31:54 2006
@@ -145,7 +145,7 @@
 
     public void testRowIdInDatabaseMetaDataRowIdLifeTime() 
         throws SQLException {
-        DatabaseMetaData meta = getXConnection().getMetaData();
+        DatabaseMetaData meta = getConnection().getMetaData();
         RowIdLifetime rowIdLifetime = meta.getRowIdLifetime();
         assertEquals("RowIdLifetime should be ROWID_UNSUPPORTED",
             RowIdLifetime.ROWID_UNSUPPORTED,

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/StatementTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/StatementTest.java?rev=434192&r1=434191&r2=434192&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/StatementTest.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/StatementTest.java Wed Aug 23 14:31:54 2006
@@ -53,7 +53,7 @@
      */
     protected void setUp() 
         throws SQLException {
-        getXConnection().setAutoCommit(false);
+        getConnection().setAutoCommit(false);
         // Create a default statement.
         stmt = createStatement();
         assertFalse("First statement must be open initially", 
@@ -132,7 +132,7 @@
         // Close the connection. We must commit/rollback first, or else a
         // "Invalid transaction state" exception is raised.
         rollback();
-        Connection con = getXConnection();
+        Connection con = getConnection();
         con.close();
         assertTrue("Connection should be closed after close()", 
                 con.isClosed());

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/BLOBTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/BLOBTest.java?rev=434192&r1=434191&r2=434192&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/BLOBTest.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/BLOBTest.java Wed Aug 23 14:31:54 2006
@@ -332,7 +332,7 @@
                                                     final int newSize) 
         throws SQLException, IOException
     {
-        final PreparedStatement preparedStatement = getXConnection().prepareStatement
+        final PreparedStatement preparedStatement = getConnection().prepareStatement
             ("UPDATE " + BLOBDataModelSetup.getBlobTableName() +
              " SET val=?, length = ?, data = ? WHERE CURRENT OF " +
              rs.getCursorName());
@@ -439,6 +439,6 @@
         throws Exception
     {
         println("Setup of: " + getName());
-        getXConnection().setAutoCommit(false);
+        getConnection().setAutoCommit(false);
     }
 }

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=434192&r1=434191&r2=434192&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 Wed Aug 23 14:31:54 2006
@@ -45,7 +45,7 @@
         // For the concurrency tests, we recreate the model
         // for each testcase (since we do commits)
         SURDataModelSetup.createDataModel
-            (SURDataModelSetup.SURDataModel.MODEL_WITH_PK, getXConnection());
+            (SURDataModelSetup.SURDataModel.MODEL_WITH_PK, getConnection());
         commit();
     }
     
@@ -79,7 +79,7 @@
         while (rs.next());
         
         // Now open up a connection
-        Connection con2 = getNewConnection();
+        Connection con2 = openDefaultConnection();
         Statement s2 = con2.createStatement(ResultSet.TYPE_FORWARD_ONLY, 
                                             ResultSet.CONCUR_UPDATABLE);
         
@@ -116,7 +116,7 @@
         while (rs.next());
         
         // Now open up a connection
-        Connection con2 = getNewConnection();
+        Connection con2 = openDefaultConnection();
         Statement s2 = con2.createStatement(ResultSet.TYPE_FORWARD_ONLY, 
                                             ResultSet.CONCUR_UPDATABLE);
         
@@ -143,7 +143,7 @@
                                           ResultSet.CONCUR_READ_ONLY);
         final ResultSet rs = s.executeQuery("select * from t1");
         scrollForward(rs);
-        Connection con2 = getNewConnection();
+        Connection con2 = openDefaultConnection();
         Statement s2 = con2.createStatement(ResultSet.TYPE_FORWARD_ONLY, 
                                             ResultSet.CONCUR_READ_ONLY);
         try {
@@ -168,7 +168,7 @@
         Statement s = createStatement();
         ResultSet rs = s.executeQuery("select * from t1");
         scrollForward(rs);
-        Connection con2 = getNewConnection();
+        Connection con2 = openDefaultConnection();
         Statement s2 = con2.createStatement();
         try {
             final ResultSet rs2 = s2.executeQuery("select * from t1");
@@ -192,7 +192,7 @@
         
         ResultSet rs = s.executeQuery("select * from t1");
         scrollForward(rs);
-        Connection con2 = getNewConnection();
+        Connection con2 = openDefaultConnection();
         Statement s2 = con2.createStatement(ResultSet.TYPE_FORWARD_ONLY, 
                                             ResultSet.CONCUR_READ_ONLY);
         try {
@@ -218,7 +218,7 @@
                                           ResultSet.CONCUR_UPDATABLE);
         ResultSet rs = s.executeQuery("select * from t1 for update");
         scrollForward(rs);
-        Connection con2 = getNewConnection();
+        Connection con2 = openDefaultConnection();
         Statement s2 = con2.createStatement(ResultSet.TYPE_FORWARD_ONLY, 
                                             ResultSet.CONCUR_READ_ONLY);
         try {
@@ -241,7 +241,7 @@
     public void testUpdatePurgedTuple1()
         throws SQLException
     {
-        getXConnection().setTransactionIsolation(Connection.TRANSACTION_READ_UNCOMMITTED);
+        getConnection().setTransactionIsolation(Connection.TRANSACTION_READ_UNCOMMITTED);
         Statement s = createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, 
                                           ResultSet.CONCUR_UPDATABLE);
         ResultSet rs = s.executeQuery("select * from t1");
@@ -258,7 +258,7 @@
                     rs.getInt(3) + ")");
         }
         
-        Connection con2 = getNewConnection();
+        Connection con2 = openDefaultConnection();
         con2.setTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED);
         try {
             PreparedStatement ps2 = con2.prepareStatement
@@ -325,7 +325,7 @@
     public void testUpdatePurgedTuple2()
         throws SQLException 
     {
-        getXConnection().setTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED);
+        getConnection().setTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED);
         Statement s = createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, 
                                           ResultSet.CONCUR_UPDATABLE);
         ResultSet rs = s.executeQuery("select * from t1");
@@ -338,7 +338,7 @@
         println("T1: Read next Tuple:(" + rs.getInt(1) + "," +
                 rs.getInt(2) + "," +
                 rs.getInt(3) + ")");
-        Connection con2 = getNewConnection();
+        Connection con2 = openDefaultConnection();
         con2.setTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED);
         try {
             PreparedStatement ps2 = con2.prepareStatement
@@ -384,7 +384,7 @@
     public void testUpdatePurgedTuple3()
         throws SQLException 
     {
-        getXConnection().setTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED);
+        getConnection().setTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED);
         Statement s = createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, 
                                           ResultSet.CONCUR_UPDATABLE);
         ResultSet rs = s.executeQuery("select * from t1");
@@ -393,7 +393,7 @@
         println("T1: read tuple with key " + firstKey);
         rs.next(); // Go to next
         println("T1: read next tuple");
-        Connection con2 = getNewConnection();
+        Connection con2 = openDefaultConnection();
         con2.setTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED);
         try {
             PreparedStatement ps2 = con2.prepareStatement
@@ -459,7 +459,7 @@
     public void testUpdatePurgedTuple4()
         throws SQLException 
     {
-        getXConnection().setTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED);
+        getConnection().setTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED);
         Statement s = createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, 
                                           ResultSet.CONCUR_UPDATABLE);
         ResultSet rs = s.executeQuery("select * from t1");
@@ -476,7 +476,7 @@
         println("T1: Read next Tuple:(" + rs.getInt(1) + "," +
                 rs.getInt(2) + "," +
                 rs.getInt(3) + ")");
-        Connection con2 = getNewConnection();
+        Connection con2 = openDefaultConnection();
         con2.setTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED);
         try {
             PreparedStatement ps2 = con2.prepareStatement
@@ -544,7 +544,7 @@
     public void testUpdateModifiedTuple1()
         throws SQLException 
     {
-        getXConnection().setTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED);
+        getConnection().setTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED);
         Statement s = createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, 
                                           ResultSet.CONCUR_UPDATABLE);
         ResultSet rs = s.executeQuery("select * from t1");
@@ -557,7 +557,7 @@
         println("T1: Read next Tuple:(" + rs.getInt(1) + "," +
                 rs.getInt(2) + "," +
                 rs.getInt(3) + ")");
-        Connection con2 = getNewConnection();
+        Connection con2 = openDefaultConnection();
         con2.setTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED);
         try {
             PreparedStatement ps2 = con2.prepareStatement
@@ -598,7 +598,7 @@
     public void testUpdateModifiedTuple2()
         throws SQLException 
     {
-        getXConnection().setTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED);
+        getConnection().setTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED);
         Statement s = createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, 
                                           ResultSet.CONCUR_UPDATABLE);
         ResultSet rs = s.executeQuery("select * from t1");
@@ -611,7 +611,7 @@
         println("T1: Read next Tuple:(" + rs.getInt(1) + "," +
                 rs.getInt(2) + "," +
                 rs.getInt(3) + ")");
-        Connection con2 = getNewConnection();
+        Connection con2 = openDefaultConnection();
         con2.setTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED);
         try {
             PreparedStatement ps2 = con2.prepareStatement
@@ -653,7 +653,7 @@
     public void testTableIntentLock1()
         throws SQLException 
     {
-        getXConnection().setTransactionIsolation(Connection.TRANSACTION_READ_UNCOMMITTED);
+        getConnection().setTransactionIsolation(Connection.TRANSACTION_READ_UNCOMMITTED);
         Statement s = createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, 
                                           ResultSet.CONCUR_UPDATABLE);
         println("T1: select * from t1");
@@ -665,7 +665,7 @@
         } // Now the cursor does not point to any tuples
         
         // Compressing the table in another transaction:
-        Connection con2 = getNewConnection();
+        Connection con2 = openDefaultConnection();
         try {
             con2.setTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED);
             PreparedStatement ps2 = con2.prepareStatement
@@ -694,7 +694,7 @@
     public void testUpdateLockInReadUncommitted()
         throws SQLException 
     {
-        getXConnection().setTransactionIsolation(Connection.TRANSACTION_READ_UNCOMMITTED);
+        getConnection().setTransactionIsolation(Connection.TRANSACTION_READ_UNCOMMITTED);
         Statement s = createStatement(ResultSet.TYPE_FORWARD_ONLY, 
                                           ResultSet.CONCUR_UPDATABLE);
         ResultSet rs = s.executeQuery("select * from t1");
@@ -703,7 +703,7 @@
         println("T1: Read next Tuple:(" + rs.getInt(1) + "," +
                 rs.getInt(2) + "," +
                 rs.getInt(3) + ")");
-        Connection con2 = getNewConnection();
+        Connection con2 = openDefaultConnection();
         con2.setTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED);
         try {
             PreparedStatement ps2 = con2.prepareStatement
@@ -749,7 +749,7 @@
                                         boolean testTruncate)
         throws SQLException 
     {
-        getXConnection().setTransactionIsolation(Connection.TRANSACTION_READ_UNCOMMITTED);
+        getConnection().setTransactionIsolation(Connection.TRANSACTION_READ_UNCOMMITTED);
         Statement delStatement = createStatement();
         // First delete all records except the last and first
         int deleted = delStatement.executeUpdate
@@ -777,7 +777,7 @@
                     rs.getInt(3) + ")");
         }
         
-        final Connection con2 = getNewConnection();
+        final Connection con2 = openDefaultConnection();
         con2.setTransactionIsolation(Connection.TRANSACTION_READ_UNCOMMITTED);
         final PreparedStatement ps2 = con2.prepareStatement
             ("call SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE(?,?,?,?,?)");

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/HoldabilityTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/HoldabilityTest.java?rev=434192&r1=434191&r2=434192&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/HoldabilityTest.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/HoldabilityTest.java Wed Aug 23 14:31:54 2006
@@ -58,7 +58,7 @@
         // We also use more records to ensure that the disk
         // is being used.
         SURDataModelSetup.createDataModel
-            (SURDataModelSetup.SURDataModel.MODEL_WITH_PK, getXConnection(),
+            (SURDataModelSetup.SURDataModel.MODEL_WITH_PK, getConnection(),
              recordCount);
         commit();
     }
@@ -613,7 +613,7 @@
         throws SQLException
     {
                // Use a new connection to compress the table        
-        final Connection con2 = getNewConnection();
+        final Connection con2 = openDefaultConnection();
         final String connId = con2.toString();
         con2.setTransactionIsolation(Connection.TRANSACTION_READ_UNCOMMITTED);
         

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=434192&r1=434191&r2=434192&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 Wed Aug 23 14:31:54 2006
@@ -109,7 +109,7 @@
     public void xtestExecuteUpdateWithNoDynamicResultSets()
         throws SQLException
     {
-        Statement stmt = getXConnection().createStatement();
+        Statement stmt = getConnection().createStatement();
         int count = stmt.executeUpdate("CALL RETRIEVE_DYNAMIC_RESULTS(0)");
         assertEquals("Wrong update count.", 0, count);
         stmt.close();
@@ -140,7 +140,7 @@
         throws SQLException
     {
         PreparedStatement ps =
-            getXConnection().prepareStatement("CALL RETRIEVE_DYNAMIC_RESULTS(?)");
+            getConnection().prepareStatement("CALL RETRIEVE_DYNAMIC_RESULTS(?)");
         ps.setInt(1, 0);
         try {
             ps.executeQuery();
@@ -161,7 +161,7 @@
         throws SQLException
     {
         PreparedStatement ps =
-            getXConnection().prepareStatement("CALL RETRIEVE_DYNAMIC_RESULTS(?)");
+            getConnection().prepareStatement("CALL RETRIEVE_DYNAMIC_RESULTS(?)");
         ps.setInt(1, 1);
         ResultSet rs = ps.executeQuery();
         assertNotNull("executeQuery() returned null.", rs);
@@ -179,7 +179,7 @@
         throws SQLException
     {
         PreparedStatement ps =
-            getXConnection().prepareStatement("CALL RETRIEVE_DYNAMIC_RESULTS(?)");
+            getConnection().prepareStatement("CALL RETRIEVE_DYNAMIC_RESULTS(?)");
         ps.setInt(1, 2);
         try {
             ps.executeQuery();
@@ -202,7 +202,7 @@
         throws SQLException
     {
         PreparedStatement ps =
-            getXConnection().prepareStatement("CALL RETRIEVE_DYNAMIC_RESULTS(?)");
+            getConnection().prepareStatement("CALL RETRIEVE_DYNAMIC_RESULTS(?)");
         ps.setInt(1, 0);
         int count = ps.executeUpdate();
         assertEquals("Wrong update count.", 0, count);
@@ -224,7 +224,7 @@
         throws SQLException
     {
         PreparedStatement ps =
-            getXConnection().prepareStatement("CALL RETRIEVE_DYNAMIC_RESULTS(?)");
+            getConnection().prepareStatement("CALL RETRIEVE_DYNAMIC_RESULTS(?)");
         ps.setInt(1, 1);
         try {
             ps.executeUpdate();
@@ -244,7 +244,7 @@
         throws SQLException
     {
         CallableStatement cs =
-            getXConnection().prepareCall("CALL RETRIEVE_DYNAMIC_RESULTS(?)");
+            getConnection().prepareCall("CALL RETRIEVE_DYNAMIC_RESULTS(?)");
         cs.setInt(1, 0);
         try {
             cs.executeQuery();
@@ -264,7 +264,7 @@
         throws SQLException
     {
         CallableStatement cs =
-            getXConnection().prepareCall("CALL RETRIEVE_DYNAMIC_RESULTS(?)");
+            getConnection().prepareCall("CALL RETRIEVE_DYNAMIC_RESULTS(?)");
         cs.setInt(1, 1);
         ResultSet rs = cs.executeQuery();
         assertNotNull("executeQuery() returned null.", rs);
@@ -282,7 +282,7 @@
         throws SQLException
     {
         CallableStatement cs =
-            getXConnection().prepareCall("CALL RETRIEVE_DYNAMIC_RESULTS(?)");
+            getConnection().prepareCall("CALL RETRIEVE_DYNAMIC_RESULTS(?)");
         cs.setInt(1, 2);
         try {
             cs.executeQuery();
@@ -304,7 +304,7 @@
         throws SQLException
     {
         CallableStatement cs =
-            getXConnection().prepareCall("CALL RETRIEVE_DYNAMIC_RESULTS(?)");
+            getConnection().prepareCall("CALL RETRIEVE_DYNAMIC_RESULTS(?)");
         cs.setInt(1, 0);
         int count = cs.executeUpdate();
         assertEquals("Wrong update count.", 0, count);
@@ -320,7 +320,7 @@
         throws SQLException
     {
         CallableStatement cs =
-            getXConnection().prepareCall("CALL RETRIEVE_DYNAMIC_RESULTS(?)");
+            getConnection().prepareCall("CALL RETRIEVE_DYNAMIC_RESULTS(?)");
         cs.setInt(1, 1);
         try {
             cs.executeUpdate();
@@ -381,7 +381,7 @@
     public void xtestRollbackStoredProcWhenExecuteQueryReturnsNothing()
         throws SQLException
     {
-        Connection conn = getXConnection();
+        Connection conn = getConnection();
         conn.setAutoCommit(true);
         Statement stmt = conn.createStatement();
         try {
@@ -410,7 +410,7 @@
     public void xtestRollbackStoredProcWhenExecuteQueryReturnsTooMuch()
         throws SQLException
     {
-        Connection conn = getXConnection();
+        Connection conn = getConnection();
         conn.setAutoCommit(true);
         Statement stmt = conn.createStatement();
         try {
@@ -438,7 +438,7 @@
     public void xtestRollbackStoredProcWhenExecuteUpdateReturnsResults()
         throws SQLException
     {
-        Connection conn = getXConnection();
+        Connection conn = getConnection();
         conn.setAutoCommit(true);
         Statement stmt = conn.createStatement();
         try {
@@ -466,7 +466,7 @@
     public void xtestRollbackStoredProcWhenExecuteQueryReturnsNothing_prepared()
         throws SQLException
     {
-        Connection conn = getXConnection();
+        Connection conn = getConnection();
         conn.setAutoCommit(true);
         PreparedStatement ps =
             conn.prepareStatement("CALL PROC_WITH_SIDE_EFFECTS(?)");
@@ -499,7 +499,7 @@
     public void xtestRollbackStoredProcWhenExecuteQueryReturnsTooMuch_prepared()
         throws SQLException
     {
-        Connection conn = getXConnection();
+        Connection conn = getConnection();
         conn.setAutoCommit(true);
         PreparedStatement ps =
             conn.prepareStatement("CALL PROC_WITH_SIDE_EFFECTS(?)");
@@ -532,7 +532,7 @@
         xtestRollbackStoredProcWhenExecuteUpdateReturnsResults_prepared()
         throws SQLException
     {
-        Connection conn = getXConnection();
+        Connection conn = getConnection();
         conn.setAutoCommit(true);
         PreparedStatement ps =
             conn.prepareStatement("CALL PROC_WITH_SIDE_EFFECTS(?)");
@@ -592,7 +592,7 @@
         throws SQLException
     {
         PreparedStatement ps =
-            getXConnection().prepareStatement("CALL RETRIEVE_EXTERNAL_RESULT(?,?,?)");
+            getConnection().prepareStatement("CALL RETRIEVE_EXTERNAL_RESULT(?,?,?)");
         
         ps.setString(1, getTestConfiguration().getDatabaseName());
         ps.setString(2, getTestConfiguration().getUserName());
@@ -615,7 +615,7 @@
         throws SQLException
     {
         PreparedStatement ps =
-            getXConnection().prepareStatement("CALL RETRIEVE_EXTERNAL_RESULT(?,?,?)");
+            getConnection().prepareStatement("CALL RETRIEVE_EXTERNAL_RESULT(?,?,?)");
         
         ps.setString(1, getTestConfiguration().getDatabaseName());
         ps.setString(2, getTestConfiguration().getUserName());
@@ -772,7 +772,7 @@
      * @exception SQLException if a database error occurs
      */
     public void setUp() throws SQLException {
-        Connection conn = getXConnection();
+        Connection conn = getConnection();
         conn.setAutoCommit(false);
         Statement s = conn.createStatement();
         for (int i = 0; i < TABLES.length; i++) {

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ResultSetCloseTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ResultSetCloseTest.java?rev=434192&r1=434191&r2=434192&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ResultSetCloseTest.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ResultSetCloseTest.java Wed Aug 23 14:31:54 2006
@@ -51,7 +51,7 @@
      */
     public void setUp()
     throws SQLException {
-        Connection con = getXConnection();
+        Connection con = getConnection();
         con.setAutoCommit(false);
         
         Statement s = con.createStatement();

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/SURBaseTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/SURBaseTest.java?rev=434192&r1=434191&r2=434192&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/SURBaseTest.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/SURBaseTest.java Wed Aug 23 14:31:54 2006
@@ -48,7 +48,7 @@
     }
     
     /**
-     * Override the default connection's to ensure it
+     * Override a connection's  default state to ensure it
      * is always in autocommit false and repeatable
      * read as a starting point.
      */
@@ -56,19 +56,6 @@
         conn.setAutoCommit(false);
         conn.setTransactionIsolation(Connection.TRANSACTION_REPEATABLE_READ);   
     }
-    
-    /**
-     * Get a JDBC Connection to the Derby database.
-     * The autocommit flag is set to false, and the isolation level
-     * for the transactions is set to repeatable read.
-     */
-    protected Connection getNewConnection() 
-        throws SQLException
-    {
-        final Connection rcon = openDefaultConnection();
-        initializeConnection(rcon);
-       return rcon;
-    }
 
     /**
      * Set up the connection to the database.
@@ -77,7 +64,7 @@
         println("SetUp");
         // temp save the connection in this class as con
         // as well as the default connection in the parent
-        con = getXConnection();
+        con = getConnection();
     }
     
     /**

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/SURQueryMixTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/SURQueryMixTest.java?rev=434192&r1=434191&r2=434192&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/SURQueryMixTest.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/SURQueryMixTest.java Wed Aug 23 14:31:54 2006
@@ -73,7 +73,7 @@
         throws SQLException
     {
         println(query);
-        DatabaseMetaData dbMeta = getXConnection().getMetaData();
+        DatabaseMetaData dbMeta = getConnection().getMetaData();
                 
         if (dbMeta.ownDeletesAreVisible(ResultSet.TYPE_SCROLL_INSENSITIVE)) {
             checkRowDeleted = true;

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=434192&r1=434191&r2=434192&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 Wed Aug 23 14:31:54 2006
@@ -65,7 +65,7 @@
      * Set up the connection to the database.
      */
     public void setUp() throws  Exception {       
-        Connection con = getXConnection();
+        Connection con = getConnection();
         con.setAutoCommit(true);
 
         String createTableWithPK = "CREATE TABLE tableWithPK (" +
@@ -85,7 +85,7 @@
      */
     public void tearDown() throws Exception {
         println("TearDown");
-        Statement s = getXConnection().createStatement();
+        Statement s = getConnection().createStatement();
         try { 
             
             s.executeUpdate("DROP TABLE tableWithPK");
@@ -103,7 +103,7 @@
      */
     public void testNextOnLastRowForwardOnly()  throws SQLException{
 
-        Connection con = getXConnection();
+        Connection con = getConnection();
         con.setAutoCommit(true);
         con.setHoldability(ResultSet.CLOSE_CURSORS_AT_COMMIT);
         Statement roStmt = con.createStatement(
@@ -136,7 +136,7 @@
      */
     public void testNextOnLastRowScrollable()  throws SQLException{
 
-        Connection con = getXConnection();
+        Connection con = getConnection();
         con.setAutoCommit(true);
         con.setHoldability(ResultSet.CLOSE_CURSORS_AT_COMMIT);
         Statement roStmt = con.createStatement(

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/URCoveringIndexTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/URCoveringIndexTest.java?rev=434192&r1=434191&r2=434192&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/URCoveringIndexTest.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/URCoveringIndexTest.java Wed Aug 23 14:31:54 2006
@@ -44,7 +44,7 @@
      * Set up the connection to the database.
      */
     public void setUp() throws  Exception {       
-        Connection con = getXConnection();
+        Connection con = getConnection();
         con.setAutoCommit(false);
 
         String createTableWithPK = "CREATE TABLE tableWithPK (" +
@@ -67,7 +67,7 @@
         int resultsetType = scroll ? ResultSet.TYPE_SCROLL_INSENSITIVE :
                 ResultSet.TYPE_FORWARD_ONLY;
         
-        Connection con = getXConnection();
+        Connection con = getConnection();
         
         if (!(con.getMetaData().supportsResultSetConcurrency(resultsetType,
                 ResultSet.CONCUR_UPDATABLE))) {

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/UpdateXXXTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/UpdateXXXTest.java?rev=434192&r1=434191&r2=434192&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/UpdateXXXTest.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/UpdateXXXTest.java Wed Aug 23 14:31:54 2006
@@ -76,7 +76,7 @@
     public void setUp()
         throws Exception
     {
-        Connection con = getXConnection();
+        Connection con = getConnection();
         try {
             
             con.setAutoCommit(false);

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/PrepareExecuteDDL.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/PrepareExecuteDDL.java?rev=434192&r1=434191&r2=434192&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/PrepareExecuteDDL.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/PrepareExecuteDDL.java Wed Aug 23 14:31:54 2006
@@ -37,6 +37,13 @@
  */
 public class PrepareExecuteDDL extends BaseJDBCTestCase {
 	
+    /**
+     * Connection to execute the DDL on. Needs
+     * to be different to the single connection
+     * provided by the super-class. This connection
+     * is used to execute DDL while the other connection
+     * has open objcts dependent on the objct changed by the DDL.
+     */
 	private Connection connDDL;
 	
 	/**
@@ -95,7 +102,7 @@
 	
 	public void testPrepareExcute() throws SQLException
 	{
-        Connection conn = getXConnection();
+        Connection conn = getConnection();
         
 		PreparedStatement[] psa= new PreparedStatement[STMTS.length];
 		for (int i = 0; i < STMTS.length; i++)

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/largeCodeGen.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/largeCodeGen.java?rev=434192&r1=434191&r2=434192&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/largeCodeGen.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/largeCodeGen.java Wed Aug 23 14:31:54 2006
@@ -60,7 +60,7 @@
        
     protected void setUp() throws SQLException
     {
-        getXConnection().setAutoCommit(false);
+        getConnection().setAutoCommit(false);
     	Statement stmt = createStatement();
 		
 		String createSQL = 	"create table t0 " +

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/IJRunScriptTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/IJRunScriptTest.java?rev=434192&r1=434191&r2=434192&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/IJRunScriptTest.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/IJRunScriptTest.java Wed Aug 23 14:31:54 2006
@@ -95,7 +95,7 @@
     public void testAutoCommitCommand()
         throws SQLException, UnsupportedEncodingException
     {      
-        Connection conn = getXConnection();
+        Connection conn = getConnection();
         assertTrue(conn.getAutoCommit());
         runTestingScript("AUTOCOMMIT OFF;", 0);
         

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/sysinfo_api.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/sysinfo_api.java?rev=434192&r1=434191&r2=434192&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/sysinfo_api.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/sysinfo_api.java Wed Aug 23 14:31:54 2006
@@ -138,7 +138,7 @@
      *              with sysinfo
      */
     public void setUp() throws SQLException {
-        dm = getXConnection().getMetaData();
+        dm = getConnection().getMetaData();
     }
 
 

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/ScriptTestCase.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/ScriptTestCase.java?rev=434192&r1=434191&r2=434192&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/ScriptTestCase.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/ScriptTestCase.java Wed Aug 23 14:31:54 2006
@@ -113,7 +113,7 @@
 		ByteArrayOutputStream rawBytes =
 			new ByteArrayOutputStream(20 * 1024);
 			
-		Connection conn = getXConnection();
+		Connection conn = getConnection();
 		org.apache.derby.tools.ij.runScript(
 				conn,
 				sqlIn,

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/BaseJDBCTestCase.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/BaseJDBCTestCase.java?rev=434192&r1=434191&r2=434192&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/BaseJDBCTestCase.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/BaseJDBCTestCase.java Wed Aug 23 14:31:54 2006
@@ -70,7 +70,7 @@
      */
     // TEMP NAME - WILL BE getConnection() once all uses of the
     // static getConnection() have been converted to openDefaultConnection
-    public Connection getXConnection() throws SQLException
+    public Connection getConnection() throws SQLException
     {
         if (conn != null)
         {
@@ -78,14 +78,18 @@
                 return conn;
             conn = null;
         }
-        conn = getTestConfiguration().openDefaultConnection();
-        initializeConnection(conn);
-        return conn;
+        return conn = openDefaultConnection();
     }
     
     /**
      * Allow a sub-class to initialize a connection to provide
-     * consistent connection state for its tests. Called only
+     * consistent connection state for its tests. Called once
+     * for each time these method calls open a connection:
+     * <UL>
+     * <LI> getConnection()
+     * <LI> openDefaultConnection()
+     * <LI> openConnection(database)
+     * </UL>
      * when getConnection() opens a new connection. Default
      * action is to not modify the connection's state from
      * the initialization provided by the data source.
@@ -104,7 +108,7 @@
      */
     public Statement createStatement() throws SQLException
     {
-        return getXConnection().createStatement();
+        return getConnection().createStatement();
     }
 
     /**
@@ -117,7 +121,7 @@
     public Statement createStatement(int resultSetType,
             int resultSetConcurrency) throws SQLException
     {
-        return getXConnection().createStatement(resultSetType, resultSetConcurrency);
+        return getConnection().createStatement(resultSetType, resultSetConcurrency);
     }
     /**
      * Utility method to create a PreparedStatement using the connection
@@ -128,7 +132,7 @@
      */
     public PreparedStatement prepareStatement(String sql) throws SQLException
     {
-        return getXConnection().prepareStatement(sql);
+        return getConnection().prepareStatement(sql);
     }    
 
     /**
@@ -140,7 +144,7 @@
      */
     public CallableStatement prepareCall(String sql) throws SQLException
     {
-        return getXConnection().prepareCall(sql);
+        return getConnection().prepareCall(sql);
     }
     
     /**
@@ -150,7 +154,7 @@
      */
     public void commit() throws SQLException
     {
-        getXConnection().commit();
+        getConnection().commit();
     }  
     /**
      * Utility method to rollback using the connection
@@ -159,7 +163,7 @@
      */
     public void rollback() throws SQLException
     {
-        getXConnection().rollback();
+        getConnection().rollback();
     } 
     /**
      * Tear down this fixture, sub-classes should call
@@ -181,14 +185,18 @@
      * @return connection to default database.
      * @see TestConfiguration#openDefaultConnection()
      */
-    public static Connection openDefaultConnection()
+    public Connection openDefaultConnection()
         throws SQLException {
-        return CONFIG.openDefaultConnection();
+        Connection conn =  getTestConfiguration().openDefaultConnection();
+        initializeConnection(conn);
+        return conn;
     }
     
     public Connection openConnection(String databaseName) throws SQLException
     {
-        return getTestConfiguration().openConnection(databaseName);
+        Connection conn = getTestConfiguration().openConnection(databaseName);
+        initializeConnection(conn);
+        return conn;        
     }
     
     /**
@@ -208,7 +216,7 @@
         };
         
         // Use the same encoding as the input for the output.    
-        return ij.runScript(getXConnection(), script, encoding,
+        return ij.runScript(getConnection(), script, encoding,
                 sink, encoding);       
     }
     



Mime
View raw message