You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Julius Stroffek (JIRA)" <ji...@apache.org> on 2006/11/15 13:27:37 UTC

[jira] Created: (DERBY-2087) Clean up of a database server directory after running junit tests.

Clean up of a database server directory after running junit tests.
------------------------------------------------------------------

                 Key: DERBY-2087
                 URL: http://issues.apache.org/jira/browse/DERBY-2087
             Project: Derby
          Issue Type: Improvement
          Components: Test
    Affects Versions: 10.3.0.0
            Reporter: Julius Stroffek
            Priority: Minor
             Fix For: 10.3.0.0


If I create a test using multiple connections using code like this 

	DataSource ds1 = JDBCDataSource.getDataSource("FIRSTDB1");
	JDBCDataSource.setBeanProperty(ds1, "connectionAttributes", "create=true");
	Connection conn1 = ds1.getConnection();

the files created on a server does not get cleaned.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (DERBY-2087) Clean up of a database server directory after running junit tests.

Posted by "Daniel John Debrunner (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-2087?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12466777 ] 

Daniel John Debrunner commented on DERBY-2087:
----------------------------------------------

Is there a good usage case for a test passing true to the singleUseDecorator to indicate the new database is the default database? Isn't this handled by the existing singleUseDecorator method that just takes a test?

If not, a clearer api may be to make the three argument singleUseDecorator private to TestConfiguration and have a two argument version, possibly with a changed name:

 additionalDatabaseDecorator(Test test, String dbName)

> Clean up of a database server directory after running junit tests.
> ------------------------------------------------------------------
>
>                 Key: DERBY-2087
>                 URL: https://issues.apache.org/jira/browse/DERBY-2087
>             Project: Derby
>          Issue Type: Improvement
>          Components: Test
>    Affects Versions: 10.3.0.0
>            Reporter: Julius Stroffek
>         Assigned To: Julius Stroffek
>            Priority: Minor
>             Fix For: 10.3.0.0
>
>         Attachments: d2087.diff, d2087.stat, d2087_try2.diff, d2087_try2.stat
>
>
> If I create a test using multiple connections using code like this 
> 	DataSource ds1 = JDBCDataSource.getDataSource("FIRSTDB1");
> 	JDBCDataSource.setBeanProperty(ds1, "connectionAttributes", "create=true");
> 	Connection conn1 = ds1.getConnection();
> the files created on a server does not get cleaned.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DERBY-2087) Clean up of a database server directory after running junit tests.

Posted by "Julius Stroffek (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-2087?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Julius Stroffek updated DERBY-2087:
-----------------------------------

    Derby Info: [Patch Available]

> Clean up of a database server directory after running junit tests.
> ------------------------------------------------------------------
>
>                 Key: DERBY-2087
>                 URL: https://issues.apache.org/jira/browse/DERBY-2087
>             Project: Derby
>          Issue Type: Improvement
>          Components: Test
>    Affects Versions: 10.3.0.0
>            Reporter: Julius Stroffek
>         Assigned To: Julius Stroffek
>            Priority: Minor
>             Fix For: 10.3.0.0
>
>         Attachments: d2087.diff, d2087.stat, d2087_round2.diff, d2087_round2.stat, d2087_round2_try2.diff, d2087_round2_try2.stat, d2087_round2_try3.diff, d2087_round2_try3.stat, d2087_try2.diff, d2087_try2.stat
>
>
> If I create a test using multiple connections using code like this 
> 	DataSource ds1 = JDBCDataSource.getDataSource("FIRSTDB1");
> 	JDBCDataSource.setBeanProperty(ds1, "connectionAttributes", "create=true");
> 	Connection conn1 = ds1.getConnection();
> the files created on a server does not get cleaned.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (DERBY-2087) Clean up of a database server directory after running junit tests.

Posted by "Julius Stroffek (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-2087?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Julius Stroffek resolved DERBY-2087.
------------------------------------

    Resolution: Fixed

> Clean up of a database server directory after running junit tests.
> ------------------------------------------------------------------
>
>                 Key: DERBY-2087
>                 URL: https://issues.apache.org/jira/browse/DERBY-2087
>             Project: Derby
>          Issue Type: Improvement
>          Components: Test
>    Affects Versions: 10.3.0.0
>            Reporter: Julius Stroffek
>         Assigned To: Julius Stroffek
>            Priority: Minor
>             Fix For: 10.3.0.0
>
>         Attachments: d2087.diff, d2087.stat, d2087_round2.diff, d2087_round2.stat, d2087_round2_try2.diff, d2087_round2_try2.stat, d2087_round2_try3.diff, d2087_round2_try3.stat, d2087_try2.diff, d2087_try2.stat
>
>
> If I create a test using multiple connections using code like this 
> 	DataSource ds1 = JDBCDataSource.getDataSource("FIRSTDB1");
> 	JDBCDataSource.setBeanProperty(ds1, "connectionAttributes", "create=true");
> 	Connection conn1 = ds1.getConnection();
> the files created on a server does not get cleaned.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DERBY-2087) Clean up of a database server directory after running junit tests.

Posted by "Julius Stroffek (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-2087?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Julius Stroffek updated DERBY-2087:
-----------------------------------

    Attachment: d2087_round2_try2.stat
                d2087_round2_try2.diff

I created an additional patch which uses logical database names in additionalDatabaseDecorator function (which replaces singleUseDatabaseDecorator with database name). I added also a openConnection method where one can specify a connection attributes as a string.

Since the prototype of new method openConnection(String dbName, String connectionAttributes) added to Connector interface conflicts
with the openConnection(String user, String password) and this method is not used I commented it and have a plan to remove it since it is possible to specify user name and password in connection attributes. Is ok to do it this way or it is better to define connection properties in Properties object instead of string? I think that using String for connection attributes is simpler to use.

I ran derbyall and suites.All without failures. Please, give me any comments or suggestions.


> Clean up of a database server directory after running junit tests.
> ------------------------------------------------------------------
>
>                 Key: DERBY-2087
>                 URL: https://issues.apache.org/jira/browse/DERBY-2087
>             Project: Derby
>          Issue Type: Improvement
>          Components: Test
>    Affects Versions: 10.3.0.0
>            Reporter: Julius Stroffek
>         Assigned To: Julius Stroffek
>            Priority: Minor
>             Fix For: 10.3.0.0
>
>         Attachments: d2087.diff, d2087.stat, d2087_round2.diff, d2087_round2.stat, d2087_round2_try2.diff, d2087_round2_try2.stat, d2087_try2.diff, d2087_try2.stat
>
>
> If I create a test using multiple connections using code like this 
> 	DataSource ds1 = JDBCDataSource.getDataSource("FIRSTDB1");
> 	JDBCDataSource.setBeanProperty(ds1, "connectionAttributes", "create=true");
> 	Connection conn1 = ds1.getConnection();
> the files created on a server does not get cleaned.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DERBY-2087) Clean up of a database server directory after running junit tests.

Posted by "Julius Stroffek (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-2087?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Julius Stroffek updated DERBY-2087:
-----------------------------------

    Attachment: d2087_round2.stat
                d2087_round2.diff

> Clean up of a database server directory after running junit tests.
> ------------------------------------------------------------------
>
>                 Key: DERBY-2087
>                 URL: https://issues.apache.org/jira/browse/DERBY-2087
>             Project: Derby
>          Issue Type: Improvement
>          Components: Test
>    Affects Versions: 10.3.0.0
>            Reporter: Julius Stroffek
>         Assigned To: Julius Stroffek
>            Priority: Minor
>             Fix For: 10.3.0.0
>
>         Attachments: d2087.diff, d2087.stat, d2087_round2.diff, d2087_round2.stat, d2087_try2.diff, d2087_try2.stat
>
>
> If I create a test using multiple connections using code like this 
> 	DataSource ds1 = JDBCDataSource.getDataSource("FIRSTDB1");
> 	JDBCDataSource.setBeanProperty(ds1, "connectionAttributes", "create=true");
> 	Connection conn1 = ds1.getConnection();
> the files created on a server does not get cleaned.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DERBY-2087) Clean up of a database server directory after running junit tests.

Posted by "Daniel John Debrunner (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-2087?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12469634 ] 

Daniel John Debrunner commented on DERBY-2087:
----------------------------------------------

Dumb question, but how do you see an open method with connection attributes being used by a test?

> Clean up of a database server directory after running junit tests.
> ------------------------------------------------------------------
>
>                 Key: DERBY-2087
>                 URL: https://issues.apache.org/jira/browse/DERBY-2087
>             Project: Derby
>          Issue Type: Improvement
>          Components: Test
>    Affects Versions: 10.3.0.0
>            Reporter: Julius Stroffek
>         Assigned To: Julius Stroffek
>            Priority: Minor
>             Fix For: 10.3.0.0
>
>         Attachments: d2087.diff, d2087.stat, d2087_round2.diff, d2087_round2.stat, d2087_round2_try2.diff, d2087_round2_try2.stat, d2087_try2.diff, d2087_try2.stat
>
>
> If I create a test using multiple connections using code like this 
> 	DataSource ds1 = JDBCDataSource.getDataSource("FIRSTDB1");
> 	JDBCDataSource.setBeanProperty(ds1, "connectionAttributes", "create=true");
> 	Connection conn1 = ds1.getConnection();
> the files created on a server does not get cleaned.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DERBY-2087) Clean up of a database server directory after running junit tests.

Posted by "Julius Stroffek (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-2087?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Julius Stroffek updated DERBY-2087:
-----------------------------------

    Attachment: d2087.stat
                d2087.diff

> Clean up of a database server directory after running junit tests.
> ------------------------------------------------------------------
>
>                 Key: DERBY-2087
>                 URL: https://issues.apache.org/jira/browse/DERBY-2087
>             Project: Derby
>          Issue Type: Improvement
>          Components: Test
>    Affects Versions: 10.3.0.0
>            Reporter: Julius Stroffek
>         Assigned To: Julius Stroffek
>            Priority: Minor
>             Fix For: 10.3.0.0
>
>         Attachments: d2087.diff, d2087.stat
>
>
> If I create a test using multiple connections using code like this 
> 	DataSource ds1 = JDBCDataSource.getDataSource("FIRSTDB1");
> 	JDBCDataSource.setBeanProperty(ds1, "connectionAttributes", "create=true");
> 	Connection conn1 = ds1.getConnection();
> the files created on a server does not get cleaned.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (DERBY-2087) Clean up of a database server directory after running junit tests.

Posted by "Julius Stroffek (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-2087?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Julius Stroffek updated DERBY-2087:
-----------------------------------

    Attachment: d2087_try2.stat
                d2087_try2.diff

> Clean up of a database server directory after running junit tests.
> ------------------------------------------------------------------
>
>                 Key: DERBY-2087
>                 URL: https://issues.apache.org/jira/browse/DERBY-2087
>             Project: Derby
>          Issue Type: Improvement
>          Components: Test
>    Affects Versions: 10.3.0.0
>            Reporter: Julius Stroffek
>         Assigned To: Julius Stroffek
>            Priority: Minor
>             Fix For: 10.3.0.0
>
>         Attachments: d2087.diff, d2087.stat, d2087_try2.diff, d2087_try2.stat
>
>
> If I create a test using multiple connections using code like this 
> 	DataSource ds1 = JDBCDataSource.getDataSource("FIRSTDB1");
> 	JDBCDataSource.setBeanProperty(ds1, "connectionAttributes", "create=true");
> 	Connection conn1 = ds1.getConnection();
> the files created on a server does not get cleaned.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DERBY-2087) Clean up of a database server directory after running junit tests.

Posted by "Daniel John Debrunner (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-2087?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12466137 ] 

Daniel John Debrunner commented on DERBY-2087:
----------------------------------------------

I think the patch is generally fine but some of the comments in the TestConfiguration methods confuse me and I'm not sure exactly what the model is you are following. By model I mean how databases are handled, is there stil only a single default database or does the configuration now handle & track multple databases. I think the latter is the case but I'm not sure.

singleUseDatabaseDecorator(Test test, String dbName)
Its javadoc is copied from 'singleUseDatabaseDecorator(Test test)' but I don't think it's doing the same thing. The original method is setting the default database to a new single use database. I think the method being added is making a new single use database available but is not making it the default. However this is not clear from the javadoc. If the new method is making the new database the default then I'm not sure of the benefit over the old one.

How does this database name relate to the singleUse folder?

Diff (from TestConfiguration) 
      * Obtain a new configuration identical to the passed in
-     * one except for the database name.
+     * one except for the database name (change/removal).

The words '(change/removal)' have been added but I don't understand what they are meant to imply in this context.

> Clean up of a database server directory after running junit tests.
> ------------------------------------------------------------------
>
>                 Key: DERBY-2087
>                 URL: https://issues.apache.org/jira/browse/DERBY-2087
>             Project: Derby
>          Issue Type: Improvement
>          Components: Test
>    Affects Versions: 10.3.0.0
>            Reporter: Julius Stroffek
>         Assigned To: Julius Stroffek
>            Priority: Minor
>             Fix For: 10.3.0.0
>
>         Attachments: d2087.diff, d2087.stat
>
>
> If I create a test using multiple connections using code like this 
> 	DataSource ds1 = JDBCDataSource.getDataSource("FIRSTDB1");
> 	JDBCDataSource.setBeanProperty(ds1, "connectionAttributes", "create=true");
> 	Connection conn1 = ds1.getConnection();
> the files created on a server does not get cleaned.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (DERBY-2087) Clean up of a database server directory after running junit tests.

Posted by "Julius Stroffek (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-2087?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Julius Stroffek updated DERBY-2087:
-----------------------------------

    Derby Info:   (was: [Patch Available])

I agree not having a proposed method. It is only I shortcut and does not bring any new functionality. However, I thought it might be useful.

I do not understand your question about more patches to review. Actually, there is no another new patch, but would like to create the similar one as the last one except it will not contain the discussed method. I also unchecked the 'Patch Available' check-box.

> Clean up of a database server directory after running junit tests.
> ------------------------------------------------------------------
>
>                 Key: DERBY-2087
>                 URL: https://issues.apache.org/jira/browse/DERBY-2087
>             Project: Derby
>          Issue Type: Improvement
>          Components: Test
>    Affects Versions: 10.3.0.0
>            Reporter: Julius Stroffek
>         Assigned To: Julius Stroffek
>            Priority: Minor
>             Fix For: 10.3.0.0
>
>         Attachments: d2087.diff, d2087.stat, d2087_round2.diff, d2087_round2.stat, d2087_round2_try2.diff, d2087_round2_try2.stat, d2087_try2.diff, d2087_try2.stat
>
>
> If I create a test using multiple connections using code like this 
> 	DataSource ds1 = JDBCDataSource.getDataSource("FIRSTDB1");
> 	JDBCDataSource.setBeanProperty(ds1, "connectionAttributes", "create=true");
> 	Connection conn1 = ds1.getConnection();
> the files created on a server does not get cleaned.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DERBY-2087) Clean up of a database server directory after running junit tests.

Posted by "Julius Stroffek (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-2087?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Julius Stroffek updated DERBY-2087:
-----------------------------------

    Derby Info: [Patch Available]

> Clean up of a database server directory after running junit tests.
> ------------------------------------------------------------------
>
>                 Key: DERBY-2087
>                 URL: https://issues.apache.org/jira/browse/DERBY-2087
>             Project: Derby
>          Issue Type: Improvement
>          Components: Test
>    Affects Versions: 10.3.0.0
>            Reporter: Julius Stroffek
>         Assigned To: Julius Stroffek
>            Priority: Minor
>             Fix For: 10.3.0.0
>
>         Attachments: d2087.diff, d2087.stat
>
>
> If I create a test using multiple connections using code like this 
> 	DataSource ds1 = JDBCDataSource.getDataSource("FIRSTDB1");
> 	JDBCDataSource.setBeanProperty(ds1, "connectionAttributes", "create=true");
> 	Connection conn1 = ds1.getConnection();
> the files created on a server does not get cleaned.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Assigned: (DERBY-2087) Clean up of a database server directory after running junit tests.

Posted by "Julius Stroffek (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-2087?page=all ]

Julius Stroffek reassigned DERBY-2087:
--------------------------------------

    Assignee: Julius Stroffek

> Clean up of a database server directory after running junit tests.
> ------------------------------------------------------------------
>
>                 Key: DERBY-2087
>                 URL: http://issues.apache.org/jira/browse/DERBY-2087
>             Project: Derby
>          Issue Type: Improvement
>          Components: Test
>    Affects Versions: 10.3.0.0
>            Reporter: Julius Stroffek
>         Assigned To: Julius Stroffek
>            Priority: Minor
>             Fix For: 10.3.0.0
>
>
> If I create a test using multiple connections using code like this 
> 	DataSource ds1 = JDBCDataSource.getDataSource("FIRSTDB1");
> 	JDBCDataSource.setBeanProperty(ds1, "connectionAttributes", "create=true");
> 	Connection conn1 = ds1.getConnection();
> the files created on a server does not get cleaned.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (DERBY-2087) Clean up of a database server directory after running junit tests.

Posted by "Daniel John Debrunner (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-2087?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12470248 ] 

Daniel John Debrunner commented on DERBY-2087:
----------------------------------------------

dan> how do you see an open method with connection attributes being used by a test?
kristian> ...a strong focus on the inputs specified by the user as connection attributes? 

In this case the focus of the test would be setting JDBC connection attributes or JDBC DataSource properties.
I think in this case it's clearer code if the test directly goes aganst the Derby api, ie. manufactures JDBC URLs,
Properties for DriverManager.getConnection(), or Java bean properties for a DataSource.

I think the utility methods in the infrastructure are there to reduce the amount of code in a test class/fixture so that the focus of the code is the item being tested. This means in some cases the utility methods are not the best approach, e.g. in this case the openConnection() methods are probably not the best, in a test of CallableStatement the prepareCall() utility method is probably not the best approach.

Such an open method would have (at least) two underlying mechanisms to open a connection, one through JDBC URLs and one through DataSource properties. This leads (I think) to two issues:
  A) code in the test harness to decode the connection attributes as a different breakout might be needed for DataSource properties. Thus how would negative tests be handled, which piece of code is catching the error, the harness or the driver?
  B) tests being written against the test api and not Derby's api.



> Clean up of a database server directory after running junit tests.
> ------------------------------------------------------------------
>
>                 Key: DERBY-2087
>                 URL: https://issues.apache.org/jira/browse/DERBY-2087
>             Project: Derby
>          Issue Type: Improvement
>          Components: Test
>    Affects Versions: 10.3.0.0
>            Reporter: Julius Stroffek
>         Assigned To: Julius Stroffek
>            Priority: Minor
>             Fix For: 10.3.0.0
>
>         Attachments: d2087.diff, d2087.stat, d2087_round2.diff, d2087_round2.stat, d2087_round2_try2.diff, d2087_round2_try2.stat, d2087_try2.diff, d2087_try2.stat
>
>
> If I create a test using multiple connections using code like this 
> 	DataSource ds1 = JDBCDataSource.getDataSource("FIRSTDB1");
> 	JDBCDataSource.setBeanProperty(ds1, "connectionAttributes", "create=true");
> 	Connection conn1 = ds1.getConnection();
> the files created on a server does not get cleaned.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (DERBY-2087) Clean up of a database server directory after running junit tests.

Posted by "Julius Stroffek (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-2087?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Julius Stroffek closed DERBY-2087.
----------------------------------


> Clean up of a database server directory after running junit tests.
> ------------------------------------------------------------------
>
>                 Key: DERBY-2087
>                 URL: https://issues.apache.org/jira/browse/DERBY-2087
>             Project: Derby
>          Issue Type: Improvement
>          Components: Test
>    Affects Versions: 10.3.0.0
>            Reporter: Julius Stroffek
>         Assigned To: Julius Stroffek
>            Priority: Minor
>             Fix For: 10.3.0.0
>
>         Attachments: d2087.diff, d2087.stat, d2087_round2.diff, d2087_round2.stat, d2087_round2_try2.diff, d2087_round2_try2.stat, d2087_round2_try3.diff, d2087_round2_try3.stat, d2087_try2.diff, d2087_try2.stat
>
>
> If I create a test using multiple connections using code like this 
> 	DataSource ds1 = JDBCDataSource.getDataSource("FIRSTDB1");
> 	JDBCDataSource.setBeanProperty(ds1, "connectionAttributes", "create=true");
> 	Connection conn1 = ds1.getConnection();
> the files created on a server does not get cleaned.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DERBY-2087) Clean up of a database server directory after running junit tests.

Posted by "Julius Stroffek (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-2087?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12466966 ] 

Julius Stroffek commented on DERBY-2087:
----------------------------------------

Dan, Thank You very much for your comments and for providing some cleanup.

> Clean up of a database server directory after running junit tests.
> ------------------------------------------------------------------
>
>                 Key: DERBY-2087
>                 URL: https://issues.apache.org/jira/browse/DERBY-2087
>             Project: Derby
>          Issue Type: Improvement
>          Components: Test
>    Affects Versions: 10.3.0.0
>            Reporter: Julius Stroffek
>         Assigned To: Julius Stroffek
>            Priority: Minor
>             Fix For: 10.3.0.0
>
>         Attachments: d2087.diff, d2087.stat, d2087_try2.diff, d2087_try2.stat
>
>
> If I create a test using multiple connections using code like this 
> 	DataSource ds1 = JDBCDataSource.getDataSource("FIRSTDB1");
> 	JDBCDataSource.setBeanProperty(ds1, "connectionAttributes", "create=true");
> 	Connection conn1 = ds1.getConnection();
> the files created on a server does not get cleaned.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DERBY-2087) Clean up of a database server directory after running junit tests.

Posted by "Daniel John Debrunner (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-2087?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Daniel John Debrunner updated DERBY-2087:
-----------------------------------------

    Derby Info:   (was: [Patch Available])

Patch d2087_round2_try3.diff Committed revision 509258 Thanks Julius.

> Clean up of a database server directory after running junit tests.
> ------------------------------------------------------------------
>
>                 Key: DERBY-2087
>                 URL: https://issues.apache.org/jira/browse/DERBY-2087
>             Project: Derby
>          Issue Type: Improvement
>          Components: Test
>    Affects Versions: 10.3.0.0
>            Reporter: Julius Stroffek
>         Assigned To: Julius Stroffek
>            Priority: Minor
>             Fix For: 10.3.0.0
>
>         Attachments: d2087.diff, d2087.stat, d2087_round2.diff, d2087_round2.stat, d2087_round2_try2.diff, d2087_round2_try2.stat, d2087_round2_try3.diff, d2087_round2_try3.stat, d2087_try2.diff, d2087_try2.stat
>
>
> If I create a test using multiple connections using code like this 
> 	DataSource ds1 = JDBCDataSource.getDataSource("FIRSTDB1");
> 	JDBCDataSource.setBeanProperty(ds1, "connectionAttributes", "create=true");
> 	Connection conn1 = ds1.getConnection();
> the files created on a server does not get cleaned.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DERBY-2087) Clean up of a database server directory after running junit tests.

Posted by "Julius Stroffek (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-2087?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Julius Stroffek updated DERBY-2087:
-----------------------------------

    Attachment: d2087_round2_try3.stat
                d2087_round2_try3.diff

I created the same patch as the previous one except it does not contain the function openConnection(String dbName, String connectionAttributes). I ran derbyall and Suites.All with two failures in Suites.All. Both of these failures appear to me also on trunk without any modifications.

The failing tests are:
org.apache.derbyTesting.functionTests.tests.jdbcapi.JDBCHarnessJavaTest
org.apache.derbyTesting.functionTests.tests.jdbcapi.DatabaseMetaDataTest



> Clean up of a database server directory after running junit tests.
> ------------------------------------------------------------------
>
>                 Key: DERBY-2087
>                 URL: https://issues.apache.org/jira/browse/DERBY-2087
>             Project: Derby
>          Issue Type: Improvement
>          Components: Test
>    Affects Versions: 10.3.0.0
>            Reporter: Julius Stroffek
>         Assigned To: Julius Stroffek
>            Priority: Minor
>             Fix For: 10.3.0.0
>
>         Attachments: d2087.diff, d2087.stat, d2087_round2.diff, d2087_round2.stat, d2087_round2_try2.diff, d2087_round2_try2.stat, d2087_round2_try3.diff, d2087_round2_try3.stat, d2087_try2.diff, d2087_try2.stat
>
>
> If I create a test using multiple connections using code like this 
> 	DataSource ds1 = JDBCDataSource.getDataSource("FIRSTDB1");
> 	JDBCDataSource.setBeanProperty(ds1, "connectionAttributes", "create=true");
> 	Connection conn1 = ds1.getConnection();
> the files created on a server does not get cleaned.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DERBY-2087) Clean up of a database server directory after running junit tests.

Posted by "Julius Stroffek (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-2087?page=comments#action_12450426 ] 
            
Julius Stroffek commented on DERBY-2087:
----------------------------------------

Will the org.apache.derbyTesting.junit package be used for other tests like performance, stress, long running, etc.? If yes I think it might be possible that someone would like to create connections to many databases. Even the number of databases might be configurable.

However all the database resources should be cleaned just after the test finishes. If I will use JDBCDataSource.getDataSource to get a connection, it is not possible to automatically remove the directory on a server. What about modifying the DropDatabaseSetup where it will be possible to register database for removal?

> Clean up of a database server directory after running junit tests.
> ------------------------------------------------------------------
>
>                 Key: DERBY-2087
>                 URL: http://issues.apache.org/jira/browse/DERBY-2087
>             Project: Derby
>          Issue Type: Improvement
>          Components: Test
>    Affects Versions: 10.3.0.0
>            Reporter: Julius Stroffek
>            Priority: Minor
>             Fix For: 10.3.0.0
>
>
> If I create a test using multiple connections using code like this 
> 	DataSource ds1 = JDBCDataSource.getDataSource("FIRSTDB1");
> 	JDBCDataSource.setBeanProperty(ds1, "connectionAttributes", "create=true");
> 	Connection conn1 = ds1.getConnection();
> the files created on a server does not get cleaned.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (DERBY-2087) Clean up of a database server directory after running junit tests.

Posted by "Kristian Waagan (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-2087?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12470225 ] 

Kristian Waagan commented on DERBY-2087:
----------------------------------------

For instance when you are testing creation of encrypted databases, with a strong focus on the inputs specified by the user as connection attributes?

I need to do this somehow in the EncryptionKey test that I said I would convert to JUnit a long time ago. It might be that it doesn't fit too well with the current state of the JUnit harness, but it is definitely useful to me for rewriting that test.

If the usage of such a method  goes against "best practice", we should try to communicate that. You can always do the work yourself in the test, but maybe it's good have a "single point of entry"?

I'm on thin ice here, as I haven't studied the code, but I think the method with username and password should be available to the tester. I don't see it as a requirement that it is available in an internal class.

> Clean up of a database server directory after running junit tests.
> ------------------------------------------------------------------
>
>                 Key: DERBY-2087
>                 URL: https://issues.apache.org/jira/browse/DERBY-2087
>             Project: Derby
>          Issue Type: Improvement
>          Components: Test
>    Affects Versions: 10.3.0.0
>            Reporter: Julius Stroffek
>         Assigned To: Julius Stroffek
>            Priority: Minor
>             Fix For: 10.3.0.0
>
>         Attachments: d2087.diff, d2087.stat, d2087_round2.diff, d2087_round2.stat, d2087_round2_try2.diff, d2087_round2_try2.stat, d2087_try2.diff, d2087_try2.stat
>
>
> If I create a test using multiple connections using code like this 
> 	DataSource ds1 = JDBCDataSource.getDataSource("FIRSTDB1");
> 	JDBCDataSource.setBeanProperty(ds1, "connectionAttributes", "create=true");
> 	Connection conn1 = ds1.getConnection();
> the files created on a server does not get cleaned.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DERBY-2087) Clean up of a database server directory after running junit tests.

Posted by "Daniel John Debrunner (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-2087?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12466806 ] 

Daniel John Debrunner commented on DERBY-2087:
----------------------------------------------

Patch d2087_try2.diff  Committed revision 499100 - Thanks Julius

> Clean up of a database server directory after running junit tests.
> ------------------------------------------------------------------
>
>                 Key: DERBY-2087
>                 URL: https://issues.apache.org/jira/browse/DERBY-2087
>             Project: Derby
>          Issue Type: Improvement
>          Components: Test
>    Affects Versions: 10.3.0.0
>            Reporter: Julius Stroffek
>         Assigned To: Julius Stroffek
>            Priority: Minor
>             Fix For: 10.3.0.0
>
>         Attachments: d2087.diff, d2087.stat, d2087_try2.diff, d2087_try2.stat
>
>
> If I create a test using multiple connections using code like this 
> 	DataSource ds1 = JDBCDataSource.getDataSource("FIRSTDB1");
> 	JDBCDataSource.setBeanProperty(ds1, "connectionAttributes", "create=true");
> 	Connection conn1 = ds1.getConnection();
> the files created on a server does not get cleaned.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DERBY-2087) Clean up of a database server directory after running junit tests.

Posted by "Daniel John Debrunner (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-2087?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12466772 ] 

Daniel John Debrunner commented on DERBY-2087:
----------------------------------------------

I'm planning on committing this today. The comments in TestConfiguration.openDatabase(String databaseName) need a little cleanup.
  1) It opens the specified database not the default database
  2) Some comment about requiring a singleUseDatabase decorator should be added
 
I'll add these in the commit.

Putting the single use databases in the singleUse folder could be a follow on patch. It seems like it would make the usage consistent with the default case and with the folder usage described in

http://wiki.apache.org/db-derby/DerbyJunitTestConfiguration#head-af5a240fccda5c96f104776dfbd20a8cabde55e0

It would also allow the database names to be unique thus allowing the potential for tests to be run in parallel rather than limited to being single thread by a fixed database name.

Of course the api would need some thinking out in terms of how TestConfiguration.openDatabase(String databaseName) works, but it could be TestConfiguration automatically provides a mapping between the logical name "DB1" and the actual name in use  "singleUse/oneUse42".

> Clean up of a database server directory after running junit tests.
> ------------------------------------------------------------------
>
>                 Key: DERBY-2087
>                 URL: https://issues.apache.org/jira/browse/DERBY-2087
>             Project: Derby
>          Issue Type: Improvement
>          Components: Test
>    Affects Versions: 10.3.0.0
>            Reporter: Julius Stroffek
>         Assigned To: Julius Stroffek
>            Priority: Minor
>             Fix For: 10.3.0.0
>
>         Attachments: d2087.diff, d2087.stat, d2087_try2.diff, d2087_try2.stat
>
>
> If I create a test using multiple connections using code like this 
> 	DataSource ds1 = JDBCDataSource.getDataSource("FIRSTDB1");
> 	JDBCDataSource.setBeanProperty(ds1, "connectionAttributes", "create=true");
> 	Connection conn1 = ds1.getConnection();
> the files created on a server does not get cleaned.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DERBY-2087) Clean up of a database server directory after running junit tests.

Posted by "Julius Stroffek (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-2087?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12466973 ] 

Julius Stroffek commented on DERBY-2087:
----------------------------------------

I'll create and additional patch. It will contain the mapping between logical names and "singleUse/oneUseXX" and required corresponding changes.

> Clean up of a database server directory after running junit tests.
> ------------------------------------------------------------------
>
>                 Key: DERBY-2087
>                 URL: https://issues.apache.org/jira/browse/DERBY-2087
>             Project: Derby
>          Issue Type: Improvement
>          Components: Test
>    Affects Versions: 10.3.0.0
>            Reporter: Julius Stroffek
>         Assigned To: Julius Stroffek
>            Priority: Minor
>             Fix For: 10.3.0.0
>
>         Attachments: d2087.diff, d2087.stat, d2087_try2.diff, d2087_try2.stat
>
>
> If I create a test using multiple connections using code like this 
> 	DataSource ds1 = JDBCDataSource.getDataSource("FIRSTDB1");
> 	JDBCDataSource.setBeanProperty(ds1, "connectionAttributes", "create=true");
> 	Connection conn1 = ds1.getConnection();
> the files created on a server does not get cleaned.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DERBY-2087) Clean up of a database server directory after running junit tests.

Posted by "Julius Stroffek (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-2087?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12466738 ] 

Julius Stroffek commented on DERBY-2087:
----------------------------------------

I extended some off the comments and added one more parameter to singleUseDatabaseDecorator(Test test, String dbName, boolean defaultDb) indicating whether the passed dbName should be a default database.

Currently, the TestConfiguration manages a list of databases in use in a usedDbNames property. The singleUseDatabaseDecorator creates a new configuration and appends a passed (or generated) database name at the end of the old database list. Optionally, if specified, the default database might be also changed.

The DropDatabaseSetup will delete only the last database in the list at tearDown.

The added singleUseDatabaseDecorator has nothing common with a singleUse folder. Shall I change it to create databases in that folder?

I ran all junit and harness tests again. lang/subquery.sql test failed in derbyall, when I ran it again multiple times it succeeded every time.

I also added a check to TestConfiguration.openConnection method. The passed database name have to exist in the list of used databases otherwise an exception is thrown.

If there is still something to do please let me now.

> Clean up of a database server directory after running junit tests.
> ------------------------------------------------------------------
>
>                 Key: DERBY-2087
>                 URL: https://issues.apache.org/jira/browse/DERBY-2087
>             Project: Derby
>          Issue Type: Improvement
>          Components: Test
>    Affects Versions: 10.3.0.0
>            Reporter: Julius Stroffek
>         Assigned To: Julius Stroffek
>            Priority: Minor
>             Fix For: 10.3.0.0
>
>         Attachments: d2087.diff, d2087.stat, d2087_try2.diff, d2087_try2.stat
>
>
> If I create a test using multiple connections using code like this 
> 	DataSource ds1 = JDBCDataSource.getDataSource("FIRSTDB1");
> 	JDBCDataSource.setBeanProperty(ds1, "connectionAttributes", "create=true");
> 	Connection conn1 = ds1.getConnection();
> the files created on a server does not get cleaned.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DERBY-2087) Clean up of a database server directory after running junit tests.

Posted by "Julius Stroffek (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-2087?page=comments#action_12450422 ] 
            
Julius Stroffek commented on DERBY-2087:
----------------------------------------

Will the org.apache.derbyTesting.junit package be used for other tests like performance, stress, long running, etc.? In that case I think it might be possible that someone would like to create connections to many databases. Even the number of databases might be configurable.

However all the database resources should be cleaned just after the test finishes. If I will use JDBCDataSource.getDataSource to get a connection, it is not possible to automatically remove the directory on a server. What about modifying the DropDatabaseSetup where it will be possible to register databases for removal?

> Clean up of a database server directory after running junit tests.
> ------------------------------------------------------------------
>
>                 Key: DERBY-2087
>                 URL: http://issues.apache.org/jira/browse/DERBY-2087
>             Project: Derby
>          Issue Type: Improvement
>          Components: Test
>    Affects Versions: 10.3.0.0
>            Reporter: Julius Stroffek
>            Priority: Minor
>             Fix For: 10.3.0.0
>
>
> If I create a test using multiple connections using code like this 
> 	DataSource ds1 = JDBCDataSource.getDataSource("FIRSTDB1");
> 	JDBCDataSource.setBeanProperty(ds1, "connectionAttributes", "create=true");
> 	Connection conn1 = ds1.getConnection();
> the files created on a server does not get cleaned.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (DERBY-2087) Clean up of a database server directory after running junit tests.

Posted by "Kristian Waagan (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-2087?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12472761 ] 

Kristian Waagan commented on DERBY-2087:
----------------------------------------

In my opinion, Dans issues are valid.
Thus I will have to write my own connection-handling for my test, but that might in deed be the best approach.

Unless there is still a strong wish to add the new method(s), what else remains to wrap up this Jira issue?
I'm a bit unsure if there are any more patches requiring review (the first follow-up patch?).

> Clean up of a database server directory after running junit tests.
> ------------------------------------------------------------------
>
>                 Key: DERBY-2087
>                 URL: https://issues.apache.org/jira/browse/DERBY-2087
>             Project: Derby
>          Issue Type: Improvement
>          Components: Test
>    Affects Versions: 10.3.0.0
>            Reporter: Julius Stroffek
>         Assigned To: Julius Stroffek
>            Priority: Minor
>             Fix For: 10.3.0.0
>
>         Attachments: d2087.diff, d2087.stat, d2087_round2.diff, d2087_round2.stat, d2087_round2_try2.diff, d2087_round2_try2.stat, d2087_try2.diff, d2087_try2.stat
>
>
> If I create a test using multiple connections using code like this 
> 	DataSource ds1 = JDBCDataSource.getDataSource("FIRSTDB1");
> 	JDBCDataSource.setBeanProperty(ds1, "connectionAttributes", "create=true");
> 	Connection conn1 = ds1.getConnection();
> the files created on a server does not get cleaned.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DERBY-2087) Clean up of a database server directory after running junit tests.

Posted by "Julius Stroffek (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-2087?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12466059 ] 

Julius Stroffek commented on DERBY-2087:
----------------------------------------

I thought about this again anf I found out that my previous comment was a bit out. ;-) I had not undertood the test configurations enough before.

I created a TestConfiguration.singleUseDatabaseDecorator(String dbName) as Dan suggested and also the methods openConnection(databaseName) to BaseJDBCTestCase and all the required infrustructure below. I renamed the TestConfiguration.getDatabaseName to getDefaultDatabaseName, since it is more accurate now.

I ran derbyall and suites.All suites without failures.

Any further comments are welcomed.

> Clean up of a database server directory after running junit tests.
> ------------------------------------------------------------------
>
>                 Key: DERBY-2087
>                 URL: https://issues.apache.org/jira/browse/DERBY-2087
>             Project: Derby
>          Issue Type: Improvement
>          Components: Test
>    Affects Versions: 10.3.0.0
>            Reporter: Julius Stroffek
>         Assigned To: Julius Stroffek
>            Priority: Minor
>             Fix For: 10.3.0.0
>
>         Attachments: d2087.diff, d2087.stat
>
>
> If I create a test using multiple connections using code like this 
> 	DataSource ds1 = JDBCDataSource.getDataSource("FIRSTDB1");
> 	JDBCDataSource.setBeanProperty(ds1, "connectionAttributes", "create=true");
> 	Connection conn1 = ds1.getConnection();
> the files created on a server does not get cleaned.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (DERBY-2087) Clean up of a database server directory after running junit tests.

Posted by "Daniel John Debrunner (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-2087?page=comments#action_12450100 ] 
            
Daniel John Debrunner commented on DERBY-2087:
----------------------------------------------

One alternative is to provide a variant of TestConfiguration.singleUseDatabaseDecorator that creates a database but does not set it as the default database. Maybe the name could be passed in:

  TestConfiguration.singleUseDatabaseDecorator(String dbName)

Another alternative is to for tests to always have access to a small number of databases, e.g. a method of BaseJJDBCTestCase like
  DataSource getDataSource(int dbnum)

where num >=2 and <= 4




> Clean up of a database server directory after running junit tests.
> ------------------------------------------------------------------
>
>                 Key: DERBY-2087
>                 URL: http://issues.apache.org/jira/browse/DERBY-2087
>             Project: Derby
>          Issue Type: Improvement
>          Components: Test
>    Affects Versions: 10.3.0.0
>            Reporter: Julius Stroffek
>            Priority: Minor
>             Fix For: 10.3.0.0
>
>
> If I create a test using multiple connections using code like this 
> 	DataSource ds1 = JDBCDataSource.getDataSource("FIRSTDB1");
> 	JDBCDataSource.setBeanProperty(ds1, "connectionAttributes", "create=true");
> 	Connection conn1 = ds1.getConnection();
> the files created on a server does not get cleaned.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira