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 "Kathey Marsden (JIRA)" <ji...@apache.org> on 2007/03/07 00:53:24 UTC
[jira] Created: (DERBY-2411) convert scrollCursors2.java to junit
convert scrollCursors2.java to junit
-------------------------------------
Key: DERBY-2411
URL: https://issues.apache.org/jira/browse/DERBY-2411
Project: Derby
Issue Type: Task
Components: Test
Affects Versions: 10.3.0.0
Reporter: Kathey Marsden
Assigned To: Kathey Marsden
Priority: Minor
convert scrollCursors2.java to junit
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (DERBY-2411) convert scrollCursors2.java to
junit
Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DERBY-2411?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12479525 ]
Knut Anders Hatlen commented on DERBY-2411:
-------------------------------------------
Thank you for addressing my comments, Kathey. I noticed that ScrollCursors2Test.java didn't have the svn:eol-style property. Please check that you have configured subversion to set it to native automatically for java files. I fixed the eol-style in revision 516322. I also removed the javadoc for the deleted method in revision 516323.
> convert scrollCursors2.java to junit
> -------------------------------------
>
> Key: DERBY-2411
> URL: https://issues.apache.org/jira/browse/DERBY-2411
> Project: Derby
> Issue Type: Task
> Components: Test
> Affects Versions: 10.3.0.0
> Reporter: Kathey Marsden
> Assigned To: Kathey Marsden
> Priority: Minor
> Fix For: 10.3.0.0
>
> Attachments: derby-2411.diff
>
>
> convert scrollCursors2.java to junit
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
Re: [jira] Commented: (DERBY-2411) convert scrollCursors2.java to
junit
Posted by Kathey Marsden <km...@sbcglobal.net>.
Knut Anders Hatlen (JIRA) wrote:
> [ https://issues.apache.org/jira/browse/DERBY-2411?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12479268 ]
>
> Knut Anders Hatlen commented on DERBY-2411:
> -------------------------------------------
>
> I have read through the patch. It generally looks good. Please see my comments below.
>
>
[snip good comments]
Thanks Knut for the careful review. I checked in changes with revision
516116
Kathey
[jira] Commented: (DERBY-2411) convert scrollCursors2.java to
junit
Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DERBY-2411?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12479268 ]
Knut Anders Hatlen commented on DERBY-2411:
-------------------------------------------
I have read through the patch. It generally looks good. Please see my comments below.
What about assertEquals() in these two cases?
+ rs.setFetchSize(5);
+ if (rs.getFetchSize() != 5) {
+ fail("getFetchSize() expected to return 5");
+ }
+
+ if (rs.getFetchDirection() != ResultSet.FETCH_FORWARD) {
+ fail("getFetchDirection() expected to return FETCH_FORWARD, not "
+ + rs.getFetchDirection());
+ }
assertNull(conn.getWarnings()) instead of the println loop?
+ // We should have gotten no warnings and a read only forward only cursor
+ warning = conn.getWarnings();
+ while (warning != null) {
+ System.out.println("warning = " + warning);
+ warning = warning.getNextWarning();
+ }
assert instead of println here?
+ // Verify that result set from statement is
+ // scroll insensitive and read only
+ rs = ps_f_r.executeQuery();
+ if (rs.getType() != ResultSet.TYPE_FORWARD_ONLY) {
+ System.out.println("cursor type = " + rs.getType() + ", not "
+ + ResultSet.TYPE_FORWARD_ONLY);
+ }
+ if (rs.getConcurrency() != ResultSet.CONCUR_READ_ONLY) {
+ System.out.println("concurrency = " + rs.getConcurrency()
+ + ", not " + ResultSet.CONCUR_READ_ONLY);
+ }
assertNotNull? Actually, testing that the result set is not null could probably be removed since the subsequent use of it would fail anyway.
+ rs = s_f_r.executeQuery("values 1, 2, 3, 4, 5, 6");
+ if (rs == null) {
+ fail("rs expected to be non-null.");
+ }
This could be replaced with a single call to JDBC.assertDrainResults(rs, 5):
+ if (rs == null) {
+ fail("rs expected to be non-null.");
+ }
+ // Iterate straight thru RS, expect only 5 rows.
+ for (int index = 1; index < 6; index++) {
+ if (!rs.next()) {
+ fail("rs.next() failed, index = " + index);
+ break;
+ }
+ }
+ // We should not see another row (only 5, not 6)
+ if (rs.next()) {
+ fail("rs.next() failed, should not have seen 6th row.");
+ passed = false;
+ }
+ rs.close();
scrollInsensitivePositive() and scrollInsensitiveNegative() should start with "test".
The last ResultSets in scrollInsensitiveNegative() and testScrollInsensitiveNegative() are not closed.
scrollVerifyMaxRowWithFetchSize() could be private to clearly indicate that it's not a top-level test method.
Class lacks copyright header.
> convert scrollCursors2.java to junit
> -------------------------------------
>
> Key: DERBY-2411
> URL: https://issues.apache.org/jira/browse/DERBY-2411
> Project: Derby
> Issue Type: Task
> Components: Test
> Affects Versions: 10.3.0.0
> Reporter: Kathey Marsden
> Assigned To: Kathey Marsden
> Priority: Minor
> Attachments: derby-2411.diff
>
>
> convert scrollCursors2.java to junit
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Closed: (DERBY-2411) convert scrollCursors2.java to junit
Posted by "Kathey Marsden (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DERBY-2411?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Kathey Marsden closed DERBY-2411.
---------------------------------
> convert scrollCursors2.java to junit
> -------------------------------------
>
> Key: DERBY-2411
> URL: https://issues.apache.org/jira/browse/DERBY-2411
> Project: Derby
> Issue Type: Task
> Components: Test
> Affects Versions: 10.3.0.0
> Reporter: Kathey Marsden
> Assigned To: Kathey Marsden
> Priority: Minor
> Fix For: 10.3.0.0
>
> Attachments: derby-2411.diff
>
>
> convert scrollCursors2.java to junit
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (DERBY-2411) convert scrollCursors2.java to junit
Posted by "Kathey Marsden (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DERBY-2411?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Kathey Marsden resolved DERBY-2411.
-----------------------------------
Resolution: Fixed
Fix Version/s: 10.3.0.0
Commited test and made changes from Knut's review
> convert scrollCursors2.java to junit
> -------------------------------------
>
> Key: DERBY-2411
> URL: https://issues.apache.org/jira/browse/DERBY-2411
> Project: Derby
> Issue Type: Task
> Components: Test
> Affects Versions: 10.3.0.0
> Reporter: Kathey Marsden
> Assigned To: Kathey Marsden
> Priority: Minor
> Fix For: 10.3.0.0
>
> Attachments: derby-2411.diff
>
>
> convert scrollCursors2.java to junit
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (DERBY-2411) convert scrollCursors2.java to junit
Posted by "Kathey Marsden (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DERBY-2411?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Kathey Marsden updated DERBY-2411:
----------------------------------
Attachment: derby-2411.diff
Attached is a patch to make a new junit test ScrollCursors2Test.java to replace scrollCursors2.java. The test had an assertion style so this is just a line by line translation to junit.
> convert scrollCursors2.java to junit
> -------------------------------------
>
> Key: DERBY-2411
> URL: https://issues.apache.org/jira/browse/DERBY-2411
> Project: Derby
> Issue Type: Task
> Components: Test
> Affects Versions: 10.3.0.0
> Reporter: Kathey Marsden
> Assigned To: Kathey Marsden
> Priority: Minor
> Attachments: derby-2411.diff
>
>
> convert scrollCursors2.java to junit
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.