db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kmars...@apache.org
Subject svn commit: r374420 - in /db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests: master/DerbyNetClient/dataSourcePermissions_net.out tests/derbynet/dataSourcePermissions_net.java tests/jdbcapi/dataSourcePermissions.java
Date Thu, 02 Feb 2006 16:14:17 GMT
Author: kmarsden
Date: Thu Feb  2 08:14:14 2006
New Revision: 374420

URL: http://svn.apache.org/viewcvs?rev=374420&view=rev
Log:
Enable some client xa tests in dataSourcePermissions_net


Modified:
    db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/dataSourcePermissions_net.out
    db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/dataSourcePermissions_net.java
    db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/dataSourcePermissions.java

Modified: db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/dataSourcePermissions_net.out
URL: http://svn.apache.org/viewcvs/db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/dataSourcePermissions_net.out?rev=374420&r1=374419&r2=374420&view=diff
==============================================================================
--- db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/dataSourcePermissions_net.out
(original)
+++ db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/dataSourcePermissions_net.out
Thu Feb  2 08:14:14 2006
@@ -35,6 +35,21 @@
 CP connected as EDWARD
 CP connected as FRANCES
 EXPECTED SHUTDOWN DERBY SQL error: SQLCODE: -1, SQLSTATE: 08006, SQLERRMC: Database 'wombat'
shutdown.
+Checking connections with XADataSource
+XADataSource with no default user
+EXPECTED CONNFAIL Connection refused : Invalid authentication.
+EXPECTED CONNFAIL Connection refused : Invalid authentication.
+XA connected as EDWARD
+XA connected as FRANCES
+EXPECTED SHUTDOWN DERBY SQL error: SQLCODE: -1, SQLSTATE: 08006, SQLERRMC: Database 'wombat'
shutdown.
+XADataSource with invalid default user
+EXPECTED CONNFAIL Connection refused : Invalid authentication.
+XA connected as FRANCES
+EXPECTED SHUTDOWN DERBY SQL error: SQLCODE: -1, SQLSTATE: 08006, SQLERRMC: Database 'wombat'
shutdown.
+XADataSource with valid default user
+XA connected as EDWARD
+XA connected as FRANCES
+EXPECTED SHUTDOWN DERBY SQL error: SQLCODE: -1, SQLSTATE: 08006, SQLERRMC: Database 'wombat'
shutdown.
 ** checkMessageText() with retrieveMessageText= false
 PASS: Message text not retrieved
 ** checkMessageText() with retrieveMessageText= true

Modified: db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/dataSourcePermissions_net.java
URL: http://svn.apache.org/viewcvs/db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/dataSourcePermissions_net.java?rev=374420&r1=374419&r2=374420&view=diff
==============================================================================
--- db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/dataSourcePermissions_net.java
(original)
+++ db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/dataSourcePermissions_net.java
Thu Feb  2 08:14:14 2006
@@ -20,41 +20,19 @@
 
 package org.apache.derbyTesting.functionTests.tests.derbynet;
 
-import org.apache.derby.jdbc.EmbeddedDataSource;
-import org.apache.derby.jdbc.EmbeddedConnectionPoolDataSource;
-import org.apache.derby.jdbc.EmbeddedXADataSource;
-
-import java.sql.Connection;
-import java.sql.ResultSet;
-import java.sql.PreparedStatement;
+import java.lang.reflect.Method;
+import java.net.InetAddress;
 import java.sql.CallableStatement;
-import java.sql.Statement;
-import java.sql.SQLException;
+import java.sql.Connection;
 import java.sql.DriverManager;
+import java.sql.SQLException;
+import java.util.Properties;
 
 import javax.sql.DataSource;
-import javax.sql.XADataSource;
-import javax.sql.PooledConnection;
-import javax.sql.XAConnection;
-import javax.sql.ConnectionPoolDataSource;
-import javax.transaction.xa.XAResource;
-import javax.transaction.xa.XAException;
-import javax.transaction.xa.Xid;
-import javax.sql.ConnectionEventListener;
-import javax.sql.ConnectionEvent;
-import org.apache.derby.tools.JDBCDisplayUtil;
-import org.apache.derby.tools.ij;
+
 import org.apache.derby.drda.NetworkServerControl;
+import org.apache.derby.tools.ij;
 import org.apache.derbyTesting.functionTests.util.TestUtil;
-import java.io.*;
-import java.net.InetAddress;
-import java.util.Hashtable;
-import java.util.Properties;
-
-import javax.naming.*;
-import javax.naming.directory.*;
-
-import java.lang.reflect.*;
 
 public class dataSourcePermissions_net extends org.apache.derbyTesting.functionTests.tests.jdbcapi.dataSourcePermissions
 {
@@ -205,8 +183,12 @@
 	public boolean supportsPooling() {
 		return true;
 	}
+	
 	public boolean supportsXA() {
-		return false;
+	    if (TestUtil.isDerbyNetClientFramework())
+	    	return true; 
+	    // No XA for JCC
+	    return false;
 	}
 
 	public void start() {

Modified: db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/dataSourcePermissions.java
URL: http://svn.apache.org/viewcvs/db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/dataSourcePermissions.java?rev=374420&r1=374419&r2=374420&view=diff
==============================================================================
--- db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/dataSourcePermissions.java
(original)
+++ db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/dataSourcePermissions.java
Thu Feb  2 08:14:14 2006
@@ -231,8 +231,8 @@
 		System.out.println("Checking connections with XADataSource");
 
 		System.out.println("XADataSource with no default user");
-		EmbeddedXADataSource ds = new EmbeddedXADataSource();
-		ds.setDatabaseName("wombat");
+		XADataSource ds = getXADS("wombat",null,null);
+		
 
 		try {
 			ds.getXAConnection().close();
@@ -257,10 +257,9 @@
 		shutdown();
 
 		System.out.println("XADataSource with invalid default user");
-		ds = new EmbeddedXADataSource();
-		ds.setDatabaseName("wombat");
-		ds.setUser("edward");
-		ds.setPassword("sara");
+		ds = getXADS("wombat","edward","sara");
+
+		
 		try {
 			ds.getXAConnection().close();
 			System.out.println("FAIL - get XADataSource connection with no user and invalid defaults");
@@ -271,10 +270,7 @@
 		shutdown();
 
 		System.out.println("XADataSource with valid default user");
-		ds = new EmbeddedXADataSource();
-		ds.setDatabaseName("wombat");
-		ds.setUser("EDWARD");
-		ds.setPassword("noodle");
+		ds = getXADS("wombat","EDWARD","noodle");
 
 		checkConnection(ds.getXAConnection());
 		checkConnection(ds.getXAConnection("FRANCES", "isabella"));
@@ -283,7 +279,22 @@
 		}
 	}
 
-	private static void checkConnection(Connection conn) throws SQLException {
+	/**
+     * @return
+     */
+    private javax.sql.XADataSource getXADS(String database, String user, String password)
{
+        EmbeddedXADataSource ds = new EmbeddedXADataSource();
+        ds.setDatabaseName(database);
+        if (user != null) {
+			ds.setUser(user);
+			ds.setPassword(password);
+		}
+        return ds;
+        
+    }
+
+
+    private static void checkConnection(Connection conn) throws SQLException {
 		checkConnection("DS", conn);
 	}
 



Mime
View raw message