db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel John Debrunner (JIRA)" <j...@apache.org>
Subject [jira] Commented: (DERBY-2087) Clean up of a database server directory after running junit tests.
Date Mon, 05 Feb 2007 15:27:06 GMT

    [ 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
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:
>            Reporter: Julius Stroffek
>         Assigned To: Julius Stroffek
>            Priority: Minor
>             Fix For:
>         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.

View raw message