[
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.