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-3568) Convert jdbcapi/savepointJdbc30_JSR169.java and jdbcapi/savepointJdbc30_XA.java to JUnit
Date Fri, 28 Mar 2008 19:02:24 GMT

    [ https://issues.apache.org/jira/browse/DERBY-3568?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12583145#action_12583145

Daniel John Debrunner commented on DERBY-3568:

I don't think there's any need for the fields in the class, namely:

+    Connection con, con2;
+    ResultSet rs1, rs2, rs1WithHold, rs2WithHold;
+    Savepoint savepoint1, savepoint2, savepoint3, savepoint4;
+    Statement s,s2; 

A test fixture always corresponds to a new instance of the class, so while it appears the
setup maybe sharing these objects across multiple fixtures, it's not. Each fixture will be
in its own object and run its own setup and teardown methods.

Local variables are more natural for a fixture since they are indeed locally scoped to be
used only in that fixture.

Also, the utility methods and parent class already handle a single connection being shared
across the setup, fixture and teardown method, so this is not required:

+        con = getConnection();

Each getConnection() call (or the utility methods such as createStatement(), prepareStatement()
etc.) already use a single connection, so there's no need for a field to store it, it's already
handled by the parent class.

> Convert jdbcapi/savepointJdbc30_JSR169.java and jdbcapi/savepointJdbc30_XA.java to JUnit
> ----------------------------------------------------------------------------------------
>                 Key: DERBY-3568
>                 URL: https://issues.apache.org/jira/browse/DERBY-3568
>             Project: Derby
>          Issue Type: Test
>          Components: Newcomer, Test
>            Reporter: Kathey Marsden
>            Assignee: Erlend Birkenes
>            Priority: Minor
>         Attachments: DERBY-3568.diff
> These are the last two in the jdk14 suite and might be a good beginner task.  

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

View raw message