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 "Øystein Grøvlen (JIRA)" <ji...@apache.org> on 2006/11/20 14:24:04 UTC

[jira] Created: (DERBY-2102) JDBC.assertFullResultSet should handle byte arrays

JDBC.assertFullResultSet should handle byte arrays
--------------------------------------------------

                 Key: DERBY-2102
                 URL: http://issues.apache.org/jira/browse/DERBY-2102
             Project: Derby
          Issue Type: Improvement
          Components: Test
    Affects Versions: 10.3.0.0
            Reporter: Øystein Grøvlen
         Assigned To: Øystein Grøvlen
            Priority: Trivial
             Fix For: 10.3.0.0


Currently, JDBC.assertFullResultset() cannot be used for columns that maps to byte[] (e.g., CHAR FOR BIT DATA).
To support this, assertRowInResultSet need to be extended the case where the column object is a byte[].



-- 
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] Closed: (DERBY-2102) JDBC.assertFullResultSet should handle byte arrays

Posted by "Øystein Grøvlen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-2102?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Øystein Grøvlen closed DERBY-2102.
----------------------------------


> JDBC.assertFullResultSet should handle byte arrays
> --------------------------------------------------
>
>                 Key: DERBY-2102
>                 URL: https://issues.apache.org/jira/browse/DERBY-2102
>             Project: Derby
>          Issue Type: Improvement
>          Components: Test
>    Affects Versions: 10.3.0.0
>            Reporter: Øystein Grøvlen
>         Assigned To: Øystein Grøvlen
>            Priority: Trivial
>             Fix For: 10.3.0.0
>
>         Attachments: derby2102.diff, derby2102v2.diff
>
>
> Currently, JDBC.assertFullResultset() cannot be used for columns that maps to byte[] (e.g., CHAR FOR BIT DATA).
> To support this, assertRowInResultSet need to be extended the case where the column object is a byte[].

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


[jira] Updated: (DERBY-2102) JDBC.assertFullResultSet should handle byte arrays

Posted by "Øystein Grøvlen (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-2102?page=all ]

Øystein Grøvlen updated DERBY-2102:
-----------------------------------

    Attachment: derby2102.diff

derby2102.diff adds handling of byte arrays to the general object-based comparison in assertRowInResultSet().  I also added a method bytesToString() which converts the byte array to String for diagnostic output. (Since Arrays.toString is only available from Java SE 5.) 

The patch changes a single file:

M java/testing/org/apache/derbyTesting/junit/JDBC.java

I have run the Junit All suite with no errors.



> JDBC.assertFullResultSet should handle byte arrays
> --------------------------------------------------
>
>                 Key: DERBY-2102
>                 URL: http://issues.apache.org/jira/browse/DERBY-2102
>             Project: Derby
>          Issue Type: Improvement
>          Components: Test
>    Affects Versions: 10.3.0.0
>            Reporter: Øystein Grøvlen
>         Assigned To: Øystein Grøvlen
>            Priority: Trivial
>             Fix For: 10.3.0.0
>
>         Attachments: derby2102.diff
>
>
> Currently, JDBC.assertFullResultset() cannot be used for columns that maps to byte[] (e.g., CHAR FOR BIT DATA).
> To support this, assertRowInResultSet need to be extended the case where the column object is a byte[].

-- 
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] Updated: (DERBY-2102) JDBC.assertFullResultSet should handle byte arrays

Posted by "Øystein Grøvlen (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-2102?page=all ]

Øystein Grøvlen updated DERBY-2102:
-----------------------------------

    Attachment: derby2102v2.diff

Thanks for the review, Knut Anders.  I have attached a new patch, derby2102v2.diff, which fixes the null pointer issue.  I have also replaced String with StringBuffer in bytesToString() since you insist :-)  I also changed  the method to return null on null input, instead of emptry string.  That seems to be more accurate.

I have rerun the Junit All suite with no errors.

> JDBC.assertFullResultSet should handle byte arrays
> --------------------------------------------------
>
>                 Key: DERBY-2102
>                 URL: http://issues.apache.org/jira/browse/DERBY-2102
>             Project: Derby
>          Issue Type: Improvement
>          Components: Test
>    Affects Versions: 10.3.0.0
>            Reporter: Øystein Grøvlen
>         Assigned To: Øystein Grøvlen
>            Priority: Trivial
>             Fix For: 10.3.0.0
>
>         Attachments: derby2102.diff, derby2102v2.diff
>
>
> Currently, JDBC.assertFullResultset() cannot be used for columns that maps to byte[] (e.g., CHAR FOR BIT DATA).
> To support this, assertRowInResultSet need to be extended the case where the column object is a byte[].

-- 
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] Resolved: (DERBY-2102) JDBC.assertFullResultSet should handle byte arrays

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-2102?page=all ]

Knut Anders Hatlen resolved DERBY-2102.
---------------------------------------

    Resolution: Fixed
    Derby Info:   (was: [Patch Available])

Thank you, Øystein! Committed revision 477645.

> JDBC.assertFullResultSet should handle byte arrays
> --------------------------------------------------
>
>                 Key: DERBY-2102
>                 URL: http://issues.apache.org/jira/browse/DERBY-2102
>             Project: Derby
>          Issue Type: Improvement
>          Components: Test
>    Affects Versions: 10.3.0.0
>            Reporter: Øystein Grøvlen
>         Assigned To: Øystein Grøvlen
>            Priority: Trivial
>             Fix For: 10.3.0.0
>
>         Attachments: derby2102.diff, derby2102v2.diff
>
>
> Currently, JDBC.assertFullResultset() cannot be used for columns that maps to byte[] (e.g., CHAR FOR BIT DATA).
> To support this, assertRowInResultSet need to be extended the case where the column object is a byte[].

-- 
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] Updated: (DERBY-2102) JDBC.assertFullResultSet should handle byte arrays

Posted by "Øystein Grøvlen (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-2102?page=all ]

Øystein Grøvlen updated DERBY-2102:
-----------------------------------

    Derby Info: [Patch Available]

> JDBC.assertFullResultSet should handle byte arrays
> --------------------------------------------------
>
>                 Key: DERBY-2102
>                 URL: http://issues.apache.org/jira/browse/DERBY-2102
>             Project: Derby
>          Issue Type: Improvement
>          Components: Test
>    Affects Versions: 10.3.0.0
>            Reporter: Øystein Grøvlen
>         Assigned To: Øystein Grøvlen
>            Priority: Trivial
>             Fix For: 10.3.0.0
>
>         Attachments: derby2102.diff
>
>
> Currently, JDBC.assertFullResultset() cannot be used for columns that maps to byte[] (e.g., CHAR FOR BIT DATA).
> To support this, assertRowInResultSet need to be extended the case where the column object is a byte[].

-- 
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-2102) JDBC.assertFullResultSet should handle byte arrays

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-2102?page=comments#action_12451464 ] 
            
Knut Anders Hatlen commented on DERBY-2102:
-------------------------------------------

If either the expected or the actual value is null, and the assert fails, won't this part throw a NullPointerException?

+                } else {
+                    expected = expectedRow[i].toString();
+                    found = obj.toString();
+                }

Perhaps expected and found could be declared as Objects instead of Strings?

Minor nits: Please use StringBuffer instead of String in bytesToString(). :) And its javadoc comment lacks one '*' in order to be proper javadoc.

> JDBC.assertFullResultSet should handle byte arrays
> --------------------------------------------------
>
>                 Key: DERBY-2102
>                 URL: http://issues.apache.org/jira/browse/DERBY-2102
>             Project: Derby
>          Issue Type: Improvement
>          Components: Test
>    Affects Versions: 10.3.0.0
>            Reporter: Øystein Grøvlen
>         Assigned To: Øystein Grøvlen
>            Priority: Trivial
>             Fix For: 10.3.0.0
>
>         Attachments: derby2102.diff
>
>
> Currently, JDBC.assertFullResultset() cannot be used for columns that maps to byte[] (e.g., CHAR FOR BIT DATA).
> To support this, assertRowInResultSet need to be extended the case where the column object is a byte[].

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