You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by su...@apache.org on 2006/09/13 19:25:56 UTC

svn commit: r443038 - in /db/derby/code/trunk/java: engine/org/apache/derby/impl/io/ testing/org/apache/derbyTesting/functionTests/master/ testing/org/apache/derbyTesting/functionTests/tests/lang/

Author: suresht
Date: Wed Sep 13 10:25:56 2006
New Revision: 443038

URL: http://svn.apache.org/viewvc?view=rev&rev=443038
Log:

DERBY-1618: (store/BootAllTest.junit fails on with jdk13 based jvms)

Patch Contributed by Myrna van Lunteren.

On jdk131, in the situation invoked by the testSettingBootAllPropertyWithHomePropertySet() 
test in BootAllTest.java, when the DriverPropertyInfo.choices were accessed.
the problem was because in BaseMonitor.java there were no elements found resulting from
provider.getBootTimeServices(). 

underlying real issue was  database directory was not getting set to the
correct path in the storage factory (DirStorageFactory.java), when all the 
database are loaded (derby.system.bootAll=true) and system home is set. 

This patch correctly sets the database directory in the storage factory, in the
above mentioed scenario.  

Modified the test lang/GetPropertyInfoTest.java to access the choices,
description, and required fields, but it didn't actually duplicate the problem
in BootAllTest.java. But as that's in that test I thought it was unnecessary to
add more.




Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/impl/io/DirStorageFactory.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/io/DirStorageFactory4.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/GetPropertyInfoTest.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/GetPropertyInfoTest.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/io/DirStorageFactory.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/io/DirStorageFactory.java?view=diff&rev=443038&r1=443037&r2=443038
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/io/DirStorageFactory.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/io/DirStorageFactory.java Wed Sep 13 10:25:56 2006
@@ -187,7 +187,11 @@
             else if( home != null && dataDirectory.startsWith( home))
                 databaseRoot = dataDirectoryFile;
             else
+            {
                 databaseRoot = new File( home, dataDirectory);
+                if (home != null)
+                    dataDirectory = home + getSeparator() +  dataDirectory;
+            }
             canonicalName = databaseRoot.getCanonicalPath();
             createTempDir();
             separatedDataDirectory = dataDirectory + getSeparator();

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/io/DirStorageFactory4.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/io/DirStorageFactory4.java?view=diff&rev=443038&r1=443037&r2=443038
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/io/DirStorageFactory4.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/io/DirStorageFactory4.java Wed Sep 13 10:25:56 2006
@@ -53,14 +53,9 @@
      */
     StorageFile newPersistentFile( String path)
     {
-        String dir = dataDirectory;
-        if (canonicalName != null && path != null && home != null && 
-                !path.startsWith(home)) {
-            dir = canonicalName;
-        }
         if( path == null)
-            return new DirFile4(dir, rwsOK);
-        return new DirFile4(dir, path, rwsOK);
+            return new DirFile4(dataDirectory, rwsOK);
+        return new DirFile4(dataDirectory, path, rwsOK);
     }
 
     /**

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/GetPropertyInfoTest.out
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/GetPropertyInfoTest.out?view=diff&rev=443038&r1=443037&r2=443038
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/GetPropertyInfoTest.out (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/GetPropertyInfoTest.out Wed Sep 13 10:25:56 2006
@@ -1,36 +1,36 @@
 Test GetPropertyInfoTest starting
-databaseName: EncryptedDB
-encryptionProvider: null
-encryptionAlgorithm: null
-encryptionKeyLength: null
-encryptionKey: null
-territory: null
-user: null
-logDevice: null
-rollForwardRecoveryFrom: null
-createFrom: null
-restoreFrom: null
-bootPassword: 
-password: 
-shutdown: false
-create: true
-dataEncryption: true
-upgrade: false
-databaseName: 
-encryptionProvider: null
-encryptionAlgorithm: null
-encryptionKeyLength: null
-encryptionKey: null
-territory: null
-user: null
-logDevice: null
-rollForwardRecoveryFrom: null
-createFrom: null
-restoreFrom: null
-bootPassword: ****
-password: 
-shutdown: false
-create: true
-dataEncryption: true
-upgrade: false
+databaseName - value: EncryptedDB - description: database identity - required false
+encryptionProvider - value: null - description: cryptographic service provider - required false - choices null 
+encryptionAlgorithm - value: null - description: cryptographic algorithm - required false - choices null 
+encryptionKeyLength - value: null - description: cryptographic key length - required false - choices null 
+encryptionKey - value: null - description: external cryptographic key - required false - choices null 
+territory - value: null - description: territory for the database - required false - choices null 
+user - value: null - description: user name - required false - choices null 
+logDevice - value: null - description: log directory path - required false - choices null 
+rollForwardRecoveryFrom - value: null - description: backup path for rollforward recovery - required false - choices null 
+createFrom - value: null - description: J029 :  - required false - choices null 
+restoreFrom - value: null - description: J030 :  - required false - choices null 
+bootPassword - value:  - description: secret cryptographic key - required false - choices null 
+password - value:  - description: user password - required false - choices null 
+shutdown - value: false - description: shut down Derby - required false     - choices [0] : false     - choices [1] : true
+create - value: true - description: create database - required false     - choices [0] : false     - choices [1] : true
+dataEncryption - value: true - description: encrypt database on disk - required false     - choices [0] : false     - choices [1] : true
+upgrade - value: false - description: upgrade database - required false     - choices [0] : false     - choices [1] : true
+databaseName - value:  - description: database identity - required false     - choices [0] : EncryptedDB
+encryptionProvider - value: null - description: cryptographic service provider - required false - choices null 
+encryptionAlgorithm - value: null - description: cryptographic algorithm - required false - choices null 
+encryptionKeyLength - value: null - description: cryptographic key length - required false - choices null 
+encryptionKey - value: null - description: external cryptographic key - required false - choices null 
+territory - value: null - description: territory for the database - required false - choices null 
+user - value: null - description: user name - required false - choices null 
+logDevice - value: null - description: log directory path - required false - choices null 
+rollForwardRecoveryFrom - value: null - description: backup path for rollforward recovery - required false - choices null 
+createFrom - value: null - description: J029 :  - required false - choices null 
+restoreFrom - value: null - description: J030 :  - required false - choices null 
+bootPassword - value: **** - description: secret cryptographic key - required false - choices null 
+password - value:  - description: user password - required false - choices null 
+shutdown - value: false - description: shut down Derby - required false     - choices [0] : false     - choices [1] : true
+create - value: true - description: create database - required false     - choices [0] : false     - choices [1] : true
+dataEncryption - value: true - description: encrypt database on disk - required false     - choices [0] : false     - choices [1] : true
+upgrade - value: false - description: upgrade database - required false     - choices [0] : false     - choices [1] : true
 Test GetPropertyInfoTest finished

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/GetPropertyInfoTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/GetPropertyInfoTest.java?view=diff&rev=443038&r1=443037&r2=443038
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/GetPropertyInfoTest.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/GetPropertyInfoTest.java Wed Sep 13 10:25:56 2006
@@ -73,7 +73,22 @@
 
 				for (int j = 0; j < attributes.length; j++)
 				{
-					System.out.println(attributes[j].name + ": " + attributes[j].value);
+					System.out.print(attributes[j].name + " - value: " + attributes[j].value);
+					// Also check on the other PropertyInfo fields
+					String[] choices = attributes[j].choices;
+					System.out.print(" - description: " 
+						+ attributes[j].description +
+						" - required " + attributes[j].required);
+					if (choices != null)
+					{
+						for (int k = 0; k < choices.length; k++)
+						{
+							System.out.print("     - choices [" + k + "] : " + choices[k]);
+						}
+						System.out.print("\n");
+					}
+					else
+						System.out.print(" - choices null \n");
 				}
 
 				// Now set bootPassword and call getPropertyInfo again.  
@@ -121,8 +136,24 @@
 
 				for (int j = 0; j < attributes.length; j++)
 				{
-					System.out.println(attributes[j].name + ": " + attributes[j].value);
+					System.out.print(attributes[j].name + " - value: " + attributes[j].value);
+					// Also check on the other PropertyInfo fields
+					String[] choices = attributes[j].choices;
+					System.out.print(" - description: " 
+						+ attributes[j].description +
+						" - required " + attributes[j].required);
+					if (choices != null)
+					{
+						for (int k = 0; k < choices.length; k++)
+						{
+							System.out.print("     - choices [" + k + "] : " + choices[k]);
+						}
+						System.out.print("\n");
+					}
+					else
+						System.out.print(" - choices null \n");
 				}
+
 				// Now set database name and call getPropertyInfo again.  
 				// This time attribute length should be zero, sice we pass all
 				// minimum required properties.