db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kmars...@apache.org
Subject svn commit: r374282 - in /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests: master/ master/DerbyNet/ master/DerbyNetClient/ master/DerbyNetClient/jdk14/ master/j9_foundation/ suites/ tests/jdbcapi/ tests/lang/ util/
Date Thu, 02 Feb 2006 06:20:40 GMT
Author: kmarsden
Date: Wed Feb  1 22:20:27 2006
New Revision: 374282

URL: http://svn.apache.org/viewcvs?rev=374282&view=rev
Log:
DERBY-398   J2ME Testing
 
* Removes four j9_foundation masters. Instead of printing the url returned by call to DatabaseMetaData.getURL,
the tests now compare the output and print pass/fail to the master.
* Added a method compareURL to TestUtil which compares with expected URL based on framework.
* Modified master file for LOBTest
* Modified properties files for network server suites to add runwithfoundation=false. Unlike
test properties, they only had runwithj9=false.

Contributed by Deepa Remesh 


Removed:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/j9_foundation/metadata.out
Modified:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/dbMetaDataJdbc30.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/metadata.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/odbc_metadata.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/dbMetaDataJdbc30.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/jdk14/metadata.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/metadata.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/odbc_metadata.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/closed.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/dbMetaDataJdbc30.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/j9_foundation/LOBTest.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/metadata.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/odbc_metadata.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/derbynetclientmats.properties
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/derbynetmats.properties
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/dbMetaDataJdbc30.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/metadata_test.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/closed.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/grantRevoke_app.properties
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/TestUtil.java

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/dbMetaDataJdbc30.out
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/dbMetaDataJdbc30.out?rev=374282&r1=374281&r2=374282&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/dbMetaDataJdbc30.out
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/dbMetaDataJdbc30.out
Wed Feb  1 22:20:27 2006
@@ -1,6 +1,6 @@
 Test dbMetaDataJdbc30 starting
 JDBC Driver 'IBM DB2 JDBC Universal Driver Architecture', version (EXPECTED VERSION)
-The URL is: jdbc:derby:net://xxxFILTERED_HOSTNAMExxx:1527/wombat;create=true
+DatabaseMetaData.getURL test passed
 supportsSavepoints() : true
 supportsNamedParameters() : false
 supportsMultipleOpenResults() : true

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/metadata.out
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/metadata.out?rev=374282&r1=374281&r2=374282&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/metadata.out
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/metadata.out
Wed Feb  1 22:20:27 2006
@@ -14,7 +14,7 @@
 dc / 2 = 5.55000000000000000000000
 dc / 2 = 5.55500000000000000000000
 JDBC Driver 'IBM DB2 JDBC Universal Driver Architecture', version (EXPECTED VERSION)
-The URL is: jdbc:derby:net://xxxFILTERED_HOSTNAMExxx:1527/wombat;create=true
+DatabaseMetaData.getURL test passed
 allTablesAreSelectable(): true
 maxColumnNameLength(): 128
 getSchemas():

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/odbc_metadata.out
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/odbc_metadata.out?rev=374282&r1=374281&r2=374282&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/odbc_metadata.out
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/odbc_metadata.out
Wed Feb  1 22:20:27 2006
@@ -44,7 +44,7 @@
 dc / 2 = 5.55000000000000000000000
 dc / 2 = 5.55500000000000000000000
 JDBC Driver 'IBM DB2 JDBC Universal Driver Architecture', version (EXPECTED VERSION)
-The URL is: jdbc:derby:net://xxxFILTERED_HOSTNAMExxx:1527/wombat;create=true
+DatabaseMetaData.getURL test passed
 allTablesAreSelectable(): true
 maxColumnNameLength(): 128
 getSchemas():

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/dbMetaDataJdbc30.out
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/dbMetaDataJdbc30.out?rev=374282&r1=374281&r2=374282&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/dbMetaDataJdbc30.out
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/dbMetaDataJdbc30.out
Wed Feb  1 22:20:27 2006
@@ -1,6 +1,6 @@
 Test dbMetaDataJdbc30 starting
 JDBC Driver 'Apache Derby Network Client JDBC Driver', version 10.2 (10.2.0.0 alpha)
-The URL is: jdbc:derby://xxxFILTERED_HOSTNAMExxx:1527/wombat;create=true
+DatabaseMetaData.getURL test passed
 supportsSavepoints() : true
 supportsNamedParameters() : false
 supportsMultipleOpenResults() : true

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/jdk14/metadata.out
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/jdk14/metadata.out?rev=374282&r1=374281&r2=374282&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/jdk14/metadata.out
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/jdk14/metadata.out
Wed Feb  1 22:20:27 2006
@@ -14,7 +14,7 @@
 dc / 2 = 5.55000000000000000000000
 dc / 2 = 5.55500000000000000000000
 JDBC Driver 'Apache Derby Network Client JDBC Driver', version 10.2 (10.2.0.0 alpha)
-The URL is: jdbc:derby://xxxFILTERED_HOSTNAMExxx:1527/wombat;create=true
+DatabaseMetaData.getURL test passed
 allTablesAreSelectable(): true
 maxColumnNameLength(): 128
 getSchemas():

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/metadata.out
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/metadata.out?rev=374282&r1=374281&r2=374282&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/metadata.out
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/metadata.out
Wed Feb  1 22:20:27 2006
@@ -14,7 +14,7 @@
 dc / 2 = 5.55000000000000000000000
 dc / 2 = 5.55500000000000000000000
 JDBC Driver 'Apache Derby Network Client JDBC Driver', version 10.2 (10.2.0.0 alpha)
-The URL is: jdbc:derby://xxxFILTERED_HOSTNAMExxx:1527/wombat;create=true
+DatabaseMetaData.getURL test passed
 allTablesAreSelectable(): true
 maxColumnNameLength(): 128
 getSchemas():

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/odbc_metadata.out
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/odbc_metadata.out?rev=374282&r1=374281&r2=374282&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/odbc_metadata.out
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/odbc_metadata.out
Wed Feb  1 22:20:27 2006
@@ -44,7 +44,7 @@
 dc / 2 = 5.55000000000000000000000
 dc / 2 = 5.55500000000000000000000
 JDBC Driver 'Apache Derby Network Client JDBC Driver', version 10.2 (10.2.0.0 alpha)
-The URL is: jdbc:derby://xxxFILTERED_HOSTNAMExxx:1527/wombat;create=true
+DatabaseMetaData.getURL test passed
 allTablesAreSelectable(): true
 maxColumnNameLength(): 128
 getSchemas():

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/closed.out
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/closed.out?rev=374282&r1=374281&r2=374282&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/closed.out
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/closed.out
Wed Feb  1 22:20:27 2006
@@ -11,15 +11,17 @@
 ERROR 08003: No current connection.
 ERROR 08003: No current connection.
 ERROR 08003: No current connection.
+Test database shutdown ...
 ERROR 08006: Database 'wombat' shutdown.
 CALL sleep(10000) - 38000, 38000 -- InterruptedException, XJ001 -- InterruptedException
 LOCK TABLE CLOSED.LOCKME IN EXCLUSIVE MODE - 08006, 08006 -- Database 'wombat' shutdown.
 ERROR 08006: Database 'wombat' shutdown.
-Shutdown test completed jdbc:derby:wombat;shutdown=true
+Shutdown test completed.
+Test system shutdown ...
 ERROR 08006: Database 'wombat' shutdown.
 CALL sleep(10000) - 38000, 38000 -- InterruptedException, XJ001 -- InterruptedException
 LOCK TABLE CLOSED.LOCKME IN EXCLUSIVE MODE - 08006, 08006 -- Database 'wombat' shutdown.
 ERROR XJ015: Derby system shutdown.
-Shutdown test completed jdbc:derby:;shutdown=true
+Shutdown test completed.
 PASS
 Test closed finished

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/dbMetaDataJdbc30.out
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/dbMetaDataJdbc30.out?rev=374282&r1=374281&r2=374282&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/dbMetaDataJdbc30.out
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/dbMetaDataJdbc30.out
Wed Feb  1 22:20:27 2006
@@ -1,6 +1,6 @@
 Test dbMetaDataJdbc30 starting
 JDBC Driver 'Apache Derby Embedded JDBC Driver', version 10.2 (10.2.0.0 alpha)
-The URL is: jdbc:derby:wombat
+DatabaseMetaData.getURL test passed
 supportsSavepoints() : true
 supportsNamedParameters() : false
 supportsMultipleOpenResults() : true

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/j9_foundation/LOBTest.out
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/j9_foundation/LOBTest.out?rev=374282&r1=374281&r2=374282&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/j9_foundation/LOBTest.out
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/j9_foundation/LOBTest.out
Wed Feb  1 22:20:27 2006
@@ -3703,3 +3703,4 @@
 insert into blobCheck (bl ) values ( X'a78a' )
 	ERROR 42821: Columns of type 'BLOB' cannot hold values of type 'CHAR () FOR BIT DATA'. 
 insert into blobCheck (bl ) values (cast (X'a78a' as blob(80)) )
+drop table blobCheck

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/metadata.out
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/metadata.out?rev=374282&r1=374281&r2=374282&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/metadata.out
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/metadata.out
Wed Feb  1 22:20:27 2006
@@ -14,7 +14,7 @@
 dc / 2 = 5.55000000000000000000000
 dc / 2 = 5.55500000000000000000000
 JDBC Driver 'Apache Derby Embedded JDBC Driver', version 10.2 (10.2.0.0 alpha)
-The URL is: jdbc:derby:wombat
+DatabaseMetaData.getURL test passed
 allTablesAreSelectable(): true
 maxColumnNameLength(): 128
 getSchemas():

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/odbc_metadata.out
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/odbc_metadata.out?rev=374282&r1=374281&r2=374282&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/odbc_metadata.out
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/odbc_metadata.out
Wed Feb  1 22:20:27 2006
@@ -44,7 +44,7 @@
 dc / 2 = 5.55000000000000000000000
 dc / 2 = 5.55500000000000000000000
 JDBC Driver 'Apache Derby Embedded JDBC Driver', version 10.2 (10.2.0.0 alpha)
-The URL is: jdbc:derby:wombat
+DatabaseMetaData.getURL test passed
 allTablesAreSelectable(): true
 maxColumnNameLength(): 128
 getSchemas():

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/derbynetclientmats.properties
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/derbynetclientmats.properties?rev=374282&r1=374281&r2=374282&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/derbynetclientmats.properties
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/derbynetclientmats.properties
Wed Feb  1 22:20:27 2006
@@ -2,4 +2,6 @@
 suites= derbynetclientmats derbynetmats
 jdk12test=true
 runwithj9=false
+#Exclude for J2ME/Foundation - Network Server not supported
+runwithfoundation=false
 timeout=60

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/derbynetmats.properties
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/derbynetmats.properties?rev=374282&r1=374281&r2=374282&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/derbynetmats.properties
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/derbynetmats.properties
Wed Feb  1 22:20:27 2006
@@ -2,5 +2,7 @@
 suites=derbynetmats jdbcapi jdbc20 multi jdk14
 jdk12test=true
 runwithj9=false
+#Exclude for J2ME/Foundation - Network Server not supported
+runwithfoundation=false
 timeout=60
 excludeJCC=at-or-before:2.3,when-at-or-before:jdk1.3.1

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/dbMetaDataJdbc30.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/dbMetaDataJdbc30.java?rev=374282&r1=374281&r2=374282&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/dbMetaDataJdbc30.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/dbMetaDataJdbc30.java
Wed Feb  1 22:20:27 2006
@@ -30,6 +30,7 @@
 import org.apache.derby.iapi.reference.JDBC30Translation;
 
 import org.apache.derby.tools.ij;
+import org.apache.derbyTesting.functionTests.util.TestUtil;
 
 /**
  * Test of database meta-data for new methods in jdbc 30. This program simply calls
@@ -66,12 +67,21 @@
 							   "." + met.getDriverMinorVersion() +
 							   " (" + met.getDriverVersion() + ")");
 
+			boolean pass = false;
 			try {
-				System.out.println("The URL is: " + met.getURL());
-			} catch (NoSuchMethodError msme)
-			{
-				System.out.println("DatabaseMetaData.getURL not present - correct for JSR169");
+				pass = TestUtil.compareURL(met.getURL());				 
+			}catch (NoSuchMethodError msme) {
+				// DatabaseMetaData.getURL not present - correct for JSR169
+				if(!TestUtil.HAVE_DRIVER_CLASS)
+					pass = true;
+			} catch (Throwable err) {
+			    System.out.println("%%getURL() gave the exception: " + err);
 			}
+			
+			if(pass)
+				System.out.println("DatabaseMetaData.getURL test passed");
+			else
+				System.out.println("FAIL: DatabaseMetaData.getURL test failed");
 			
 			System.out.println();
 			System.out.println("supportsSavepoints() : " + met.supportsSavepoints());

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/metadata_test.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/metadata_test.java?rev=374282&r1=374281&r2=374282&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/metadata_test.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/metadata_test.java
Wed Feb  1 22:20:27 2006
@@ -354,14 +354,21 @@
 							   "." + met.getDriverMinorVersion() +
 							   " (" + met.getDriverVersion() + ")");
 
+			boolean pass = false;
 			try {
-			    System.out.println("The URL is: " + met.getURL());
-			}catch (NoSuchMethodError msme)
-			{
-				System.out.println("DatabaseMetaData.getURL not present - correct for JSR169");
+				pass = TestUtil.compareURL(met.getURL());				 
+			}catch (NoSuchMethodError msme) {
+				// DatabaseMetaData.getURL not present - correct for JSR169
+				if(!TestUtil.HAVE_DRIVER_CLASS)
+					pass = true;
 			} catch (Throwable err) {
 			    System.out.println("%%getURL() gave the exception: " + err);
 			}
+			
+			if(pass)
+				System.out.println("DatabaseMetaData.getURL test passed");
+			else
+				System.out.println("FAIL: DatabaseMetaData.getURL test failed");
 
 			System.out.println("allTablesAreSelectable(): " +
 							   met.allTablesAreSelectable());

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/closed.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/closed.java?rev=374282&r1=374281&r2=374282&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/closed.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/closed.java
Wed Feb  1 22:20:27 2006
@@ -29,9 +29,11 @@
 import java.sql.DatabaseMetaData;
 import java.sql.SQLException;
 import java.sql.SQLWarning;
+import java.util.Properties;
 
 import org.apache.derby.tools.ij;
 import org.apache.derby.tools.JDBCDisplayUtil;
+import org.apache.derbyTesting.functionTests.util.TestUtil;
 
 /**
 	Test execution of closed JDBC objects. Executing or accessing a closed
@@ -46,6 +48,7 @@
  */
 public class closed implements Runnable {
 
+	private static boolean jsr169_test = false;
 
 	public static void main(String[] args) {
 		System.out.println("Test closed starting");
@@ -59,15 +62,19 @@
 			ij.getPropertyArg(args);
 			conn = ij.startJBMS();
 			
-			boolean jsr169_test = false;
+			
 			String url = new String();
 			try{
 				url = conn.getMetaData().getURL();
 			}
 			catch (NoSuchMethodError msme)
 			{
-				jsr169_test = true;
-				System.out.println("DatabaseMetaData.getURL not present - correct for JSR169");
+				// DatabaseMetaData.getURL not present - correct for JSR169
+				if(!TestUtil.HAVE_DRIVER_CLASS)
+					jsr169_test = true;
+				else
+					passed = false;
+				
 			} catch (Throwable err) {
 			    System.out.println("%%getURL() gave the exception: " + err);
 			}
@@ -91,13 +98,14 @@
 				conn.close();
 			}
 
-			if(!jsr169_test){
-				// shutdown the database
-				passed = shutdownTest(url, url + ";shutdown=true");
-
-				// shutdown the system
-				passed = shutdownTest(url, "jdbc:derby:;shutdown=true");
-			}
+			// shutdown the database
+			System.out.println("Test database shutdown ...");
+			passed = shutdownTest(url, url + ";shutdown=true", "wombat");
+
+			// shutdown the system
+			System.out.println("Test system shutdown ...");
+			passed = shutdownTest(url, "jdbc:derby:;shutdown=true", "");
+			
 
 
 		} catch (Throwable e) {
@@ -111,15 +119,29 @@
 		System.out.println("Test closed finished");
 	}
 
-	static boolean shutdownTest(String url, String shutdownUrl) throws SQLException {
+	static boolean shutdownTest(String url, String shutdownUrl, String databaseName) throws
SQLException {
 
 		boolean passed = true;
 
-		Connection c1 = DriverManager.getConnection(url);
-		Connection c2 = DriverManager.getConnection(url);
-		Connection c3a = DriverManager.getConnection(url);
-		Connection c3b = DriverManager.getConnection(url);
-
+		Connection c1;
+		Connection c2;
+		Connection c3a;
+		Connection c3b;
+		
+		if(!jsr169_test) {
+			c1 = DriverManager.getConnection(url);
+			c2 = DriverManager.getConnection(url);
+			c3a = DriverManager.getConnection(url);
+			c3b = DriverManager.getConnection(url);
+		} else {
+			Properties prop = new Properties();
+			prop.setProperty("databaseName", "wombat");
+			c1 = TestUtil.getDataSourceConnection(prop);
+			c2 = TestUtil.getDataSourceConnection(prop);
+			c3a = TestUtil.getDataSourceConnection(prop);
+			c3b = TestUtil.getDataSourceConnection(prop);
+		}
+		
 		try {
 			c3a.createStatement().execute("DROP TABLE CLOSED.LOCKME");
 		} catch (SQLException sqle) {
@@ -151,7 +173,10 @@
 
 		SQLException s = null;
 		try {
-			DriverManager.getConnection(shutdownUrl);
+			if(!jsr169_test) 
+				DriverManager.getConnection(shutdownUrl);
+			else 
+				TestUtil.shutdownUsingDataSource(databaseName);
 		} catch (SQLException sqle) {
 			s = sqle;
 		}
@@ -184,7 +209,7 @@
 			c2.close();
 		}
 
-		System.out.println("Shutdown test completed " + shutdownUrl);
+		System.out.println("Shutdown test completed.");
 		return passed;
 	}
 

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/grantRevoke_app.properties
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/grantRevoke_app.properties?rev=374282&r1=374281&r2=374282&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/grantRevoke_app.properties
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/grantRevoke_app.properties
Wed Feb  1 22:20:27 2006
@@ -2,3 +2,7 @@
 ij.showNoConnectionsAtStart=true
 
 derby.database.defaultConnectionMode=sqlStandard
+
+# DataSource properties, only used if ij.dataSource is set
+ij.dataSource.databaseName=wombat
+ij.dataSource.createDatabase=create

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/TestUtil.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/TestUtil.java?rev=374282&r1=374281&r2=374282&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/TestUtil.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/TestUtil.java
Wed Feb  1 22:20:27 2006
@@ -28,6 +28,8 @@
 import java.util.Hashtable;
 import java.util.Locale;
 import java.util.Properties;
+import java.util.StringTokenizer;
+import java.util.NoSuchElementException;
 
 import javax.sql.DataSource;
 
@@ -715,6 +717,37 @@
 		catch (SQLException e) {
 			throw e;
 		}
+	}
+	
+	//Used by metadata tests for DatabaseMetadata.getURL
+	public static boolean compareURL(String url) {
+			
+		if(isEmbeddedFramework()) {
+			if(url.compareTo("jdbc:derby:wombat") == 0)
+				return true;
+		} else if(isNetFramework()) {
+			try {
+				StringTokenizer urlTokenizer = new StringTokenizer(url, "/");
+				String urlStart = urlTokenizer.nextToken();
+				urlTokenizer.nextToken();
+				String urlEnd = urlTokenizer.nextToken();
+				
+				if(urlEnd.compareTo("wombat;create=true") != 0)
+					return false;
+				
+				if(isJCCFramework() && (urlStart.compareTo("jdbc:derby:net:") == 0))
+					return true;
+				
+				if(isDerbyNetClientFramework() && (urlStart.compareTo("jdbc:derby:") == 0))
+					return true;
+				
+			} catch (NoSuchElementException nsee) {
+				//Should not reach here.
+				return false;
+			}
+		}
+		
+		return false;
 	}
 
 }



Mime
View raw message