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/02/28 23:37:50 UTC

[jira] Created: (DERBY-2382) Convert casting.java to Junit

Convert casting.java to Junit
-----------------------------

                 Key: DERBY-2382
                 URL: https://issues.apache.org/jira/browse/DERBY-2382
             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


Convert casting.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-2382) Convert casting.java to Junit

Posted by "Kathey Marsden (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-2382?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kathey Marsden resolved DERBY-2382.
-----------------------------------

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

Committed revision 514846

> Convert casting.java to Junit
> -----------------------------
>
>                 Key: DERBY-2382
>                 URL: https://issues.apache.org/jira/browse/DERBY-2382
>             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_2382.diff
>
>
> Convert casting.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-2382) Convert casting.java to Junit

Posted by "Kathey Marsden (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-2382?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kathey Marsden updated DERBY-2382:
----------------------------------

    Attachment: DERBY_2382.diff

DERBY_2382.diff has the new test CastingTest.java which will replace casting.java.
Currently the test checks only whether the casts succeed and that results can be drained or fails.  I would like opinions on whether checking the values returned for each cast  is required or whether it is ok just to verify the success of the cast.

> Convert casting.java to Junit
> -----------------------------
>
>                 Key: DERBY-2382
>                 URL: https://issues.apache.org/jira/browse/DERBY-2382
>             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_2382.diff
>
>
> Convert casting.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-2382) Convert casting.java to Junit

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-2382?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12478710 ] 

Knut Anders Hatlen commented on DERBY-2382:
-------------------------------------------

I moved the call to super.tearDown() to the end of tearDown() and added some calls to ResultSet.close(). Committed revision 515490.

> Convert casting.java to Junit
> -----------------------------
>
>                 Key: DERBY-2382
>                 URL: https://issues.apache.org/jira/browse/DERBY-2382
>             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_2382.diff
>
>
> Convert casting.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-2382) Convert casting.java to Junit

Posted by "Daniel John Debrunner (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-2382?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12509186 ] 

Daniel John Debrunner commented on DERBY-2382:
----------------------------------------------

Can casting.java be removed now the test is converted? I just thought it was a valid test and ran it, but it fails because there's no master file.

> Convert casting.java to Junit
> -----------------------------
>
>                 Key: DERBY-2382
>                 URL: https://issues.apache.org/jira/browse/DERBY-2382
>             Project: Derby
>          Issue Type: Task
>          Components: Test
>    Affects Versions: 10.3.0.0
>            Reporter: Kathey Marsden
>            Assignee: Kathey Marsden
>            Priority: Minor
>             Fix For: 10.3.0.0
>
>         Attachments: DERBY_2382.diff
>
>
> Convert casting.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-2382) Convert casting.java to Junit

Posted by "Kathey Marsden (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-2382?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kathey Marsden closed DERBY-2382.
---------------------------------


> Convert casting.java to Junit
> -----------------------------
>
>                 Key: DERBY-2382
>                 URL: https://issues.apache.org/jira/browse/DERBY-2382
>             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_2382.diff
>
>
> Convert casting.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-2382) Convert casting.java to Junit

Posted by "Kathey Marsden (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-2382?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kathey Marsden updated DERBY-2382:
----------------------------------

    Derby Info: [Patch Available]

> Convert casting.java to Junit
> -----------------------------
>
>                 Key: DERBY-2382
>                 URL: https://issues.apache.org/jira/browse/DERBY-2382
>             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_2382.diff
>
>
> Convert casting.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-2382) Convert casting.java to Junit

Posted by "Kathey Marsden (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-2382?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12477036 ] 

Kathey Marsden commented on DERBY-2382:
---------------------------------------

Thanks Knut for the review.  cast.sql covers most of the output, but likely doesn't have as many permutations.  I wrote the test originally to test what was a legal cast and what was not but I'll look at the test some more to see how I might best check the output. 

> Convert casting.java to Junit
> -----------------------------
>
>                 Key: DERBY-2382
>                 URL: https://issues.apache.org/jira/browse/DERBY-2382
>             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_2382.diff
>
>
> Convert casting.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-2382) Convert casting.java to Junit

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-2382?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12476885 ] 

Knut Anders Hatlen commented on DERBY-2382:
-------------------------------------------

Since the old test verifies that the values are correct, I think the new one should do that too, unless it's covered by other tests. It's kind of important that the returned value of a cast is correct... ;)

Some minor nits:
  - tearDown() should call super.tearDown()
  - in some cases fail() is used to report an unexpected exception. I think it's better just to (re-)throw the exception so that we preserve the stack trace.
  - some uses of fail, like
+            if (!isSupportedAssignment(sourceType,targetType))
+                fail(description + "should not succeed");
would perhaps be clearer if they were written as assertTrue(...)
  - the indentation is a bit inconsistent (some places 4 characters, but most places 8)
  - most of the "public static" methods could be "private static", I think
  - the test methods are declared as "throws SQLException, Throwable". I don't think the Throwable is needed (but I haven't checked, so I might be wrong)

> Convert casting.java to Junit
> -----------------------------
>
>                 Key: DERBY-2382
>                 URL: https://issues.apache.org/jira/browse/DERBY-2382
>             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_2382.diff
>
>
> Convert casting.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-2382) Convert casting.java to Junit

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-2382?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12477212 ] 

Knut Anders Hatlen commented on DERBY-2382:
-------------------------------------------

Thanks for addressing my comments. One more thing about tearDown(): The call to super.tearDown() needs to be moved to the end of the method. Since getConnection() is called after super.tearDown(), the connection is reinitialized and won't be garbage collected.

> Convert casting.java to Junit
> -----------------------------
>
>                 Key: DERBY-2382
>                 URL: https://issues.apache.org/jira/browse/DERBY-2382
>             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_2382.diff
>
>
> Convert casting.java to Junit

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