db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Knut Anders Hatlen (Commented) (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DERBY-5521) JDBCMBeanTest#testAttributeDriverLevel uses Java assert in lieu of JUnit assert: no real testing happens
Date Mon, 05 Dec 2011 22:34:40 GMT

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

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

The patch looks good. One small nit: assertEquals() should have the expected value as the
first argument. Perhaps we should also pass driverLevelString as message argument to the two
asserts, so we can see what's wrong if they ever fail?
                
> JDBCMBeanTest#testAttributeDriverLevel uses Java assert in lieu of JUnit assert: no real
testing happens
> --------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-5521
>                 URL: https://issues.apache.org/jira/browse/DERBY-5521
>             Project: Derby
>          Issue Type: Bug
>          Components: Test
>            Reporter: Dag H. Wanvik
>            Assignee: Dag H. Wanvik
>            Priority: Minor
>         Attachments: derby-5521.diff
>
>
> Cf these lines:
> assert(driverLevelString.indexOf('?') == -1);
> assert(driverLevelString.matches("^JRE - JDBC: " + JDBCVersion + ".*"));
> The "assert" is a Java built-in rather than the JUnit assertTrue we need.
> The string driverLevelString is also wrong, since it is a mere toString of the bean name.
We need to use getAttribute on it to get the driver level
> for asserting.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message