The attached patch 'derby-1826-v1.diff' adds methods to get connection by specifying connection attributes. These can be used to shutdown databases/system.
Changes in the patch:
- Adds following methods to TestConfiguration and corresponding wrapper methods to BaseJDBCTestCase:
getConnection (String databaseName, String connAttrs)
These methods can be used to get connection using specific connection attributes. By passing shutdown attribute, these can be used to shutdown database/system.
Without this patch, this was possible using BaseJDBCTestCase.openConnection(String databaseName) method and passing in databaseName+";<connection attributes>". To shutdown default database, we would need to explicitly pass in the default database name. I think the new methods in the patch improve the usage.
- Changes methods used to set DataSource properties to take in connection attributes.
- Changes lang/SQLAuthorizationProp test to use the new method to shutdown the database.
With the patch, I successfully ran the JUnit Embedded suite standalone. I tried to run "All" suite standalone but getting OutOfMemoryError in client suite. I am getting the memory errors even without this patch. I will open a separate issue for it. I am currently running derbyall to check the changes in the helper methods have not affected any other tests.
Please provide feedback on the patch. I would appreciate if anyone can also check if the changes fit into the current JUnit infrastructure.