db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject svn commit: r543206 - in /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi: AuthenticationTest.java DriverMgrAuthenticationTest.java PoolDSAuthenticationTest.java XADSAuthenticationTest.java
Date Thu, 31 May 2007 18:32:58 GMT
Author: djd
Date: Thu May 31 11:32:57 2007
New Revision: 543206

URL: http://svn.apache.org/viewvc?view=rev&rev=543206
Log:
Minor cleanup on jdbcapi.AuthenticationTest and its sub-classes.
Change static fields to be either final or remove their use where local
variable will suffice. Close several JDBC objects that remained open.
Use the utility method to set a system property in the parent class
instead of multiple privileged blocks. Setup connections to have
auto-commit off by default which is what the test seems to expect.

Modified:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/AuthenticationTest.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/DriverMgrAuthenticationTest.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/PoolDSAuthenticationTest.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/XADSAuthenticationTest.java

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/AuthenticationTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/AuthenticationTest.java?view=diff&rev=543206&r1=543205&r2=543206
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/AuthenticationTest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/AuthenticationTest.java
Thu May 31 11:32:57 2007
@@ -42,17 +42,18 @@
 import org.apache.derbyTesting.junit.SystemPropertyTestSetup;
 import org.apache.derbyTesting.junit.TestConfiguration;
 
+/**
+ * Tests authentication and connection level authorization.
+ *
+ */
 public class AuthenticationTest extends BaseJDBCTestCase {
 
-    protected static String PASSWORD_SUFFIX = "suf2ix";
-    protected static String USERS[] = 
+    private static final String PASSWORD_SUFFIX = "suf2ix";
+    private static final String USERS[] = 
         {"APP","dan","kreg","jeff","ames","jerry","francois","jamie","howardR"};
 
-    protected String zeus = "\u0396\u0395\u03A5\u03A3";
-    protected String apollo = "\u0391\u09A0\u039F\u039B\u039B\u039A\u0390";
-
-    protected static Properties sysprops = new Properties();
-    protected static Properties props = new Properties();
+    private static final String zeus = "\u0396\u0395\u03A5\u03A3";
+    private static final String apollo = "\u0391\u09A0\u039F\u039B\u039B\u039A\u0390";
     
     /** Creates a new instance of the Test */
     public AuthenticationTest(String name) {
@@ -60,10 +61,10 @@
     }
 
     /**
-     * Set up the conection to the database.
+     * Ensure all connections are not in auto commit mode.
      */
-    public void setUp() throws  Exception {
-        getConnection().setAutoCommit(false);
+    protected void initializeConnection(Connection conn) throws SQLException {
+        conn.setAutoCommit(false);
     }
 
     public static Test suite() {
@@ -116,8 +117,10 @@
         // Additionally use DatabasePropertyTestSetup to add some
         // possibly useful settings
         // Finally SystemPropertyTestSetup sets up system level users
+        Properties props = new Properties();
         props.setProperty("derby.infolog.append", "true");
         props.setProperty("derby.debug.true", "AuthenticationTrace");
+        Properties sysprops = new Properties();
         sysprops.put("derby.user.system", "admin");
         sysprops.put("derby.user.mickey", "mouse");
         test = DatabasePropertyTestSetup.builtinAuthentication(test,
@@ -133,8 +136,6 @@
                 public Object run(){
                     System.getProperties().remove(
                         "derby.connection.requireAuthentication");
-                    String apollo = 
-                        "\u0391\u09A0\u039F\u039B\u039B\u039A\u0390";
                     return 
                         System.getProperties().remove("derby.user." +apollo);
                 }
@@ -190,6 +191,7 @@
         setDatabaseProperty(
             "derby.database.defaultConnectionMode","NoAccess", conn1);
         conn1.commit();
+        conn1.close();
 
         // check the system wide user
         assertConnectionOK(dbName, "system", "admin"); 
@@ -247,16 +249,16 @@
         // we have not set require authentication at system level.
         // try system shutdown with wrong user - should work
         assertSystemShutdownOK("", "badUser", ("dan" + PASSWORD_SUFFIX));
-        openDefaultConnection("dan", ("dan" + PASSWORD_SUFFIX)); // revive
+        openDefaultConnection("dan", ("dan" + PASSWORD_SUFFIX)).close(); // revive
         // with 'allowed' user but bad pwd - will succeed
         assertSystemShutdownOK("", "dan", ("jeff" + PASSWORD_SUFFIX));
-        openDefaultConnection("dan", ("dan" + PASSWORD_SUFFIX)); // revive
+        openDefaultConnection("dan", ("dan" + PASSWORD_SUFFIX)).close(); // revive
         // dbo, but bad pwd - will succeed
         assertSystemShutdownOK("", "APP", ("POO"));
-        openDefaultConnection("dan", ("dan" + PASSWORD_SUFFIX)); // revive
+        openDefaultConnection("dan", ("dan" + PASSWORD_SUFFIX)).close(); // revive
         // allowed user but not dbo - will also succeed
         assertSystemShutdownOK("", "dan", ("dan" + PASSWORD_SUFFIX));
-        openDefaultConnection("dan", ("dan" + PASSWORD_SUFFIX)); // revive
+        openDefaultConnection("dan", ("dan" + PASSWORD_SUFFIX)).close(); // revive
         // expect Derby system shutdown, which gives XJ015 error.
         assertSystemShutdownOK("", "APP", ("APP" + PASSWORD_SUFFIX));
 
@@ -325,6 +327,7 @@
             assertSQLState("23513", sqle);
         }
         stmt.close();
+        conn1.rollback();
         conn1.close();
 
         // Note: there is not much point in attempting to write with an invalid
@@ -389,29 +392,19 @@
         setDatabaseProperty(
             "derby.database.propertiesOnly","false", conn1);
         conn1.commit();
+        conn1.close();
         assertConnectionOK(dbName, "system", "admin");
         
         // try changing system's pwd
-        AccessController.doPrivileged
-        (new java.security.PrivilegedAction(){
-                public Object run(){
-                    return java.lang.System.setProperty(
-                        "derby.user.system", "thrdSysPwd");
-                }
-        });
+        setSystemProperty("derby.user.system", "thrdSysPwd");
 
         // can we get in as system user with changed pwd
         assertConnectionOK(dbName, "system", "thrdSysPwd");
         
         // reset
         // first change system's pwd back
-        AccessController.doPrivileged
-        (new java.security.PrivilegedAction(){
-                public Object run(){
-                    return java.lang.System.setProperty(
-                        "derby.user.system", "admin");
-                }
-        });
+        setSystemProperty("derby.user.system", "admin");
+
         conn1 = openDefaultConnection("dan", ("dan" + PASSWORD_SUFFIX));
         setDatabaseProperty(
             "derby.database.defaultConnectionMode","fullAccess", conn1);
@@ -477,6 +470,7 @@
         stmt = conn1.createStatement();
         assertStatementError(
             "25502", stmt, "delete from APP.t1 where c1 = 'SYSTEM'");
+        conn1.rollback();
         conn1.close();
 
         // reset
@@ -495,17 +489,8 @@
     public void testGreekCharacters() throws SQLException {
         
         String dbName = TestConfiguration.getCurrent().getDefaultDatabaseName();
-
-        // add a system level user
-        AccessController.doPrivileged
-        (new java.security.PrivilegedAction(){
-                public Object run(){
-                    String zeus = "\u0396\u0395\u03A5\u03A3";
-                    String apollo = "\u0391\u09A0\u039F\u039B\u039B\u039A\u0390";
-                    return java.lang.System.setProperty(
-                        ("derby.user." + apollo), zeus);
-                }
-        });
+        
+        setSystemProperty("derby.user." + apollo, zeus);
 
         Connection conn1 = openDefaultConnection(
                 "dan", ("dan" + PASSWORD_SUFFIX));
@@ -539,9 +524,9 @@
             assertUpdateCount(stmt, 0, 
             "create table APP.t1(c1 varchar(30))");
             assertUpdateCount(stmt, 1, "insert into APP.t1 values USER");
+            conn1.commit();
             assertUserValue(new String[] {zeus}, zeus, apollo,
             "select * from APP.t1 where c1 like CURRENT_USER");
-            conn1.commit();
             stmt.close();
             conn1.close();
         }
@@ -574,13 +559,8 @@
         assertConnectionOK(dbName, "dan", ("dan" + PASSWORD_SUFFIX));
 
         // try ensuring system level is set for authentication
-        AccessController.doPrivileged
-        (new java.security.PrivilegedAction(){
-                public Object run(){
-                    return java.lang.System.setProperty(
-                        "derby.connection.requireAuthentication", "true");
-                }
-        });
+        setSystemProperty("derby.connection.requireAuthentication", "true");
+
         // bring down the database
         assertShutdownUsingSetShutdownOK(
             dbName, "APP", "APP" + PASSWORD_SUFFIX);
@@ -589,7 +569,7 @@
         assertConnectionOK(dbName, "dan", ("dan" + PASSWORD_SUFFIX));
         // bring down server to ensure settings take effect 
         assertSystemShutdownOK("", "badUser", ("dan" + PASSWORD_SUFFIX));
-        openDefaultConnection("dan", ("dan" + PASSWORD_SUFFIX)); // revive
+        openDefaultConnection("dan", ("dan" + PASSWORD_SUFFIX)).close(); // revive
 
         // try system shutdown with wrong user
         assertSystemShutdownFail("08004", "", "badUser", ("dan" + PASSWORD_SUFFIX));
@@ -607,20 +587,16 @@
             "derby.database.defaultConnectionMode","fullAccess", conn1);
         setDatabaseProperty(
             "derby.connection.requireAuthentication","false", conn1);
-        AccessController.doPrivileged
-        (new java.security.PrivilegedAction(){
-                public Object run(){
-                    return java.lang.System.setProperty(
-                        "derby.connection.requireAuthentication", "false");
-                }
-        });
+        
+        setSystemProperty("derby.connection.requireAuthentication", "false");
+
         conn1.commit();
         conn1.close();
-        openDefaultConnection("system", "admin");
+        openDefaultConnection("system", "admin").close();
         assertShutdownUsingSetShutdownOK(
             dbName, "APP", "APP" + PASSWORD_SUFFIX);
         assertSystemShutdownOK("", "system", "admin");
-        openDefaultConnection("system", "admin"); // just so teardown works.
+        openDefaultConnection("system", "admin").close(); // just so teardown works.
     }
     
     protected void assertFailSetDatabaseProperty(
@@ -632,6 +608,7 @@
         setDBP.setString(2, value);
         // user jamie cannot be both readOnly and fullAccess
         assertStatementError("4250C", setDBP);
+        setDBP.close();
     }
     
     protected void setDatabaseProperty(
@@ -642,6 +619,7 @@
         setDBP.setString(1, propertyName);
         setDBP.setString(2, value);
         setDBP.execute();
+        setDBP.close();
     }
     
     protected void useUserValue(int expectedUpdateCount, String user, String sql)
@@ -690,12 +668,9 @@
     throws SQLException
     {
         DataSource ds = JDBCDataSource.getDataSource(dbName);
-        try {
-            assertNotNull(ds.getConnection(user, password));
-        }
-        catch (SQLException e) {
-            throw e;
-        }
+        Connection conn = ds.getConnection(user, password);
+        assertNotNull(conn);
+        conn.close();
     }
     
     // get a connection, using setUser / setPassword, and ds.getConnection()
@@ -706,12 +681,9 @@
         DataSource ds = JDBCDataSource.getDataSource(dbName);
         JDBCDataSource.setBeanProperty(ds, "user", user);
         JDBCDataSource.setBeanProperty(ds, "password", password);
-        try {
-            assertNotNull(ds.getConnection());
-        }
-        catch (SQLException e) {
-            throw e;
-        }
+        Connection conn = ds.getConnection();
+        assertNotNull(conn);
+        conn.close();
     }
     
     protected void assertConnectionFail(

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/DriverMgrAuthenticationTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/DriverMgrAuthenticationTest.java?view=diff&rev=543206&r1=543205&r2=543206
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/DriverMgrAuthenticationTest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/DriverMgrAuthenticationTest.java
Thu May 31 11:32:57 2007
@@ -93,12 +93,7 @@
     throws SQLException
     {
         String url = TestConfiguration.getCurrent().getJDBCUrl(dbName);
-        try {
-            assertNotNull(DriverManager.getConnection(url, user, password));
-        }
-        catch (SQLException e) {
-                throw e;
-        }
+        DriverManager.getConnection(url, user, password).close();
     }
 
     // getConnection(), using url connection attributes
@@ -108,12 +103,7 @@
     {
         String url = TestConfiguration.getCurrent().getJDBCUrl(dbName);
         String url2 = url + ";user=" + user + ";password=" + password;
-        try {
-            assertNotNull(DriverManager.getConnection(url2));
-        }
-        catch (SQLException e) {
-                throw e;
-        }
+        DriverManager.getConnection(url2).close();
     }
 
     protected void assertConnectionFail(

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/PoolDSAuthenticationTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/PoolDSAuthenticationTest.java?view=diff&rev=543206&r1=543205&r2=543206
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/PoolDSAuthenticationTest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/PoolDSAuthenticationTest.java
Thu May 31 11:32:57 2007
@@ -38,7 +38,6 @@
 //This class implements the checks for ConnectionPoolDataSources
 public class PoolDSAuthenticationTest extends AuthenticationTest {
 
-    private static ConnectionPoolDataSource pds;
     /** Creates a new instance of the Test */
     public PoolDSAuthenticationTest(String name) {
         super(name);
@@ -94,37 +93,27 @@
         String dbName, String user, String password)
     throws SQLException
     {
-        pds = J2EEDataSource.getConnectionPoolDataSource();
+        ConnectionPoolDataSource pds = J2EEDataSource.getConnectionPoolDataSource();
         JDBCDataSource.setBeanProperty(pds, "databaseName", dbName);
-        try {
-            assertNotNull(pds.getPooledConnection(user, password));
-        }
-        catch (SQLException e) {
-                throw e;
-        }
+        pds.getPooledConnection(user, password).close();
     }
 
     protected void assertConnectionWOUPOK(
         String dbName, String user, String password)
     throws SQLException
     {
-        pds = J2EEDataSource.getConnectionPoolDataSource();
+        ConnectionPoolDataSource pds = J2EEDataSource.getConnectionPoolDataSource();
         JDBCDataSource.setBeanProperty(pds, "databaseName", dbName);
         JDBCDataSource.setBeanProperty(pds, "user", user);
         JDBCDataSource.setBeanProperty(pds, "password", password);
-        try {
-            assertNotNull(pds.getPooledConnection());
-        }
-        catch (SQLException e) {
-                throw e;
-        }
+        pds.getPooledConnection().close();
     }
 
     protected void assertConnectionFail(
         String expectedSqlState, String dbName, String user, String password)
     throws SQLException
     {
-        pds = J2EEDataSource.getConnectionPoolDataSource();
+        ConnectionPoolDataSource pds = J2EEDataSource.getConnectionPoolDataSource();
         JDBCDataSource.setBeanProperty(pds, "databaseName", dbName);
         try {
             pds.getPooledConnection(user, password);
@@ -139,7 +128,7 @@
         String expectedSqlState, String dbName, String user, String password)
     throws SQLException
     {
-        pds = J2EEDataSource.getConnectionPoolDataSource();
+        ConnectionPoolDataSource pds = J2EEDataSource.getConnectionPoolDataSource();
         JDBCDataSource.setBeanProperty(pds, "databaseName", dbName);
         JDBCDataSource.setBeanProperty(pds, "user", user);
         JDBCDataSource.setBeanProperty(pds, "password", password);
@@ -155,7 +144,7 @@
     protected void assertShutdownUsingSetShutdownOK(
         String dbName, String user, String password)
     throws SQLException {
-        pds = J2EEDataSource.getConnectionPoolDataSource();
+        ConnectionPoolDataSource pds = J2EEDataSource.getConnectionPoolDataSource();
         JDBCDataSource.setBeanProperty(pds, "databaseName", dbName);
         JDBCDataSource.setBeanProperty(pds, "shutdownDatabase", "shutdown");
         try {
@@ -169,7 +158,7 @@
     
     protected void assertShutdownUsingConnAttrsOK(
         String dbName, String user, String password) throws SQLException {
-        pds = J2EEDataSource.getConnectionPoolDataSource();
+        ConnectionPoolDataSource pds = J2EEDataSource.getConnectionPoolDataSource();
         JDBCDataSource.setBeanProperty(
             pds, "connectionAttributes", "shutdown=true");
         try {
@@ -184,7 +173,7 @@
     protected void assertShutdownWOUPOK(
         String dbName, String user, String password)
     throws SQLException {
-        pds = J2EEDataSource.getConnectionPoolDataSource();
+        ConnectionPoolDataSource pds = J2EEDataSource.getConnectionPoolDataSource();
         JDBCDataSource.setBeanProperty(pds, "databaseName", dbName);
         JDBCDataSource.setBeanProperty(pds, "user", user);
         JDBCDataSource.setBeanProperty(pds, "password", password);
@@ -202,7 +191,7 @@
         String expectedSqlState, String dbName, String user, String password) 
     throws SQLException
     {
-        pds = J2EEDataSource.getConnectionPoolDataSource();
+        ConnectionPoolDataSource pds = J2EEDataSource.getConnectionPoolDataSource();
         JDBCDataSource.setBeanProperty(pds, "shutdownDatabase", "shutdown");
         JDBCDataSource.setBeanProperty(pds, "databaseName", dbName);
         try {
@@ -217,7 +206,7 @@
         String expectedSqlState, String dbName, String user, String password) 
     throws SQLException
     {
-        pds = J2EEDataSource.getConnectionPoolDataSource();
+        ConnectionPoolDataSource pds = J2EEDataSource.getConnectionPoolDataSource();
         JDBCDataSource.setBeanProperty(pds, "shutdownDatabase", "shutdown");
         JDBCDataSource.setBeanProperty(pds, "user", user);
         JDBCDataSource.setBeanProperty(pds, "password", password);
@@ -234,7 +223,7 @@
     protected void assertSystemShutdownOK(
         String dbName, String user, String password)
     throws SQLException {
-        pds = J2EEDataSource.getConnectionPoolDataSource();
+        ConnectionPoolDataSource pds = J2EEDataSource.getConnectionPoolDataSource();
         JDBCDataSource.clearStringBeanProperty(pds, "databaseName");
         JDBCDataSource.setBeanProperty(pds, "shutdownDatabase", "shutdown");
         JDBCDataSource.setBeanProperty(pds, "databaseName", dbName);
@@ -252,7 +241,7 @@
     protected void assertSystemShutdownFail(
             String expectedError, String dbName, String user, String password)
     throws SQLException {
-        pds = J2EEDataSource.getConnectionPoolDataSource();
+        ConnectionPoolDataSource pds = J2EEDataSource.getConnectionPoolDataSource();
         JDBCDataSource.clearStringBeanProperty(pds, "databaseName");
         JDBCDataSource.setBeanProperty(pds, "databaseName", dbName);
         JDBCDataSource.setBeanProperty(pds, "shutdownDatabase", "shutdown");
@@ -267,7 +256,7 @@
     }
 
     public void assertConnectionFail(String dbName) throws SQLException {
-        pds = J2EEDataSource.getConnectionPoolDataSource();
+        ConnectionPoolDataSource pds = J2EEDataSource.getConnectionPoolDataSource();
         // Reset to no user/password though client requires
         // a valid name, so reset to the default
         if (usingDerbyNetClient())

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/XADSAuthenticationTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/XADSAuthenticationTest.java?view=diff&rev=543206&r1=543205&r2=543206
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/XADSAuthenticationTest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/XADSAuthenticationTest.java
Thu May 31 11:32:57 2007
@@ -38,8 +38,6 @@
 //This class implements the checks for XADataSources
 public class XADSAuthenticationTest extends AuthenticationTest {
     
-    private static XADataSource xads;
-    
     /** Creates a new instance of the Test */
     public XADSAuthenticationTest(String name) {
         super(name);
@@ -93,36 +91,28 @@
         String dbName, String user, String password)
     throws SQLException 
     {
-        xads = J2EEDataSource.getXADataSource();
+        XADataSource xads = J2EEDataSource.getXADataSource();
         JDBCDataSource.setBeanProperty(xads, "databaseName", dbName);
-        try {
-            assertNotNull(xads.getXAConnection(user, password));
-        } catch (SQLException sqle) {
-            throw sqle;
-        }
+        xads.getXAConnection(user, password).close();
+
     }
 
     protected void assertConnectionWOUPOK(
             String dbName, String user, String password)
     throws SQLException
     {
-        xads = J2EEDataSource.getXADataSource();
+        XADataSource xads = J2EEDataSource.getXADataSource();
         JDBCDataSource.setBeanProperty(xads, "databaseName", dbName);
         JDBCDataSource.setBeanProperty(xads, "user", user);
         JDBCDataSource.setBeanProperty(xads, "password", password);
-        try {
-            assertNotNull(xads.getXAConnection());
-        }
-        catch (SQLException e) {
-            throw e;
-        }
+        xads.getXAConnection().close();
     }
     
     protected void assertConnectionFail(
         String expectedSqlState, String dbName, String user, String password)
     throws SQLException
     {
-        xads = J2EEDataSource.getXADataSource();
+        XADataSource xads = J2EEDataSource.getXADataSource();
         JDBCDataSource.setBeanProperty(xads, "databaseName", dbName);
         try {
             xads.getXAConnection(user, password);
@@ -136,7 +126,7 @@
         String expectedSqlState, String dbName, String user, String password)
     throws SQLException
     {
-        xads = J2EEDataSource.getXADataSource();
+        XADataSource xads = J2EEDataSource.getXADataSource();
         JDBCDataSource.setBeanProperty(xads, "databaseName", dbName);
         JDBCDataSource.setBeanProperty(xads, "user", user);
         JDBCDataSource.setBeanProperty(xads, "password", password);
@@ -151,7 +141,7 @@
     
     protected void assertShutdownUsingSetShutdownOK(
             String dbName, String user, String password) throws SQLException {
-        xads = J2EEDataSource.getXADataSource();
+        XADataSource xads = J2EEDataSource.getXADataSource();
         JDBCDataSource.setBeanProperty(xads, "databaseName", dbName);
         JDBCDataSource.setBeanProperty(
             xads, "shutdownDatabase", "shutdown");
@@ -166,7 +156,7 @@
 
     protected void assertShutdownUsingConnAttrsOK(
         String dbName, String user, String password) throws SQLException {
-        xads = J2EEDataSource.getXADataSource();
+        XADataSource xads = J2EEDataSource.getXADataSource();
         JDBCDataSource.setBeanProperty(
             xads, "connectionAttributes", "shutdown=true");
         try {
@@ -181,7 +171,7 @@
     protected void assertShutdownWOUPOK(
         String dbName, String user, String password)
     throws SQLException {
-        xads = J2EEDataSource.getXADataSource();
+        XADataSource xads = J2EEDataSource.getXADataSource();
         JDBCDataSource.setBeanProperty(xads, "databaseName", dbName);
         JDBCDataSource.setBeanProperty(
                 xads, "shutdownDatabase", "shutdown");
@@ -200,7 +190,7 @@
         String expectedSqlState, String dbName, String user, String password) 
     throws SQLException
     {
-        xads = J2EEDataSource.getXADataSource();
+        XADataSource xads = J2EEDataSource.getXADataSource();
         JDBCDataSource.setBeanProperty(xads, "shutdownDatabase", "shutdown");
         JDBCDataSource.setBeanProperty(xads, "databaseName", dbName);
         try {
@@ -215,7 +205,7 @@
         String expectedSqlState, String dbName, String user, String password) 
     throws SQLException
     {
-        xads = J2EEDataSource.getXADataSource();
+        XADataSource xads = J2EEDataSource.getXADataSource();
         JDBCDataSource.setBeanProperty(xads, "shutdownDatabase", "shutdown");
         JDBCDataSource.setBeanProperty(xads, "databaseName", dbName);
         JDBCDataSource.setBeanProperty(xads, "user", user);
@@ -231,7 +221,7 @@
     protected void assertSystemShutdownOK(
         String dbName, String user, String password)
     throws SQLException {
-        xads = J2EEDataSource.getXADataSource();
+        XADataSource xads = J2EEDataSource.getXADataSource();
         JDBCDataSource.setBeanProperty(
                 xads, "shutdownDatabase", "shutdown");
         JDBCDataSource.setBeanProperty(xads, "databaseName", dbName);
@@ -249,7 +239,7 @@
     protected void assertSystemShutdownFail(
         String expectedError, String dbName, String user, String password)
     throws SQLException {
-        xads = J2EEDataSource.getXADataSource();
+        XADataSource xads = J2EEDataSource.getXADataSource();
         JDBCDataSource.setBeanProperty(
                 xads, "shutdownDatabase", "shutdown");
         JDBCDataSource.setBeanProperty(xads, "databaseName", dbName);
@@ -264,7 +254,7 @@
     }
 
     public void assertConnectionFail(String dbName) throws SQLException {
-        xads = J2EEDataSource.getXADataSource();
+        XADataSource xads = J2EEDataSource.getXADataSource();
         // Reset to no user/password though client requires
         // a valid name, so reset to the default
         if (usingDerbyNetClient())



Mime
View raw message