db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kathey Marsden (JIRA)" <j...@apache.org>
Subject [jira] Commented: (DERBY-3273) convert derbynet/testconnection.java to junit
Date Thu, 13 Dec 2007 18:12:43 GMT

    [ https://issues.apache.org/jira/browse/DERBY-3273?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12551567

Kathey Marsden commented on DERBY-3273:

Dan said...
>+ try {
>+ nsctrl = new >NetworkServerControl(InetAddress.getByName("notthere"), 1527);
>+ nsctrl.ping();
>+ fail("Should not have been able to ping host >\"notthere\"");

>I think this is a dangerous coding style for tests, which >method call are you expecting
to fail? Only the method >expected to fail should be in the try catch block

In fact the failure was happening in the InetAddress.getByName("notthere"), call, so we never
got to the ping. It was a security exception, but when I added the permissions and privilege
block, it failed with an UnknownHost exception, so the test itself does not make much sense
for ping with the API.  I'll take the unknown host test out of testPing.

> convert derbynet/testconnection.java to junit
> ---------------------------------------------
>                 Key: DERBY-3273
>                 URL: https://issues.apache.org/jira/browse/DERBY-3273
>             Project: Derby
>          Issue Type: Test
>          Components: Test
>    Affects Versions:
>            Reporter: Kathey Marsden
>            Assignee: Kathey Marsden
>            Priority: Minor
>         Attachments: derby-3273_diff.txt
> convert derbynet/testconnection.java to junit.

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

View raw message