db-derby-dev mailing list archives

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

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

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

In NetworkServerControlApiTest 

+    public void testPing() throws Exception
+    {
+        NetworkServerControl nsctrl = new NetworkServerControl();
+        nsctrl.ping();
+ 

This code has the problem that it assumes the default of localhost and 1527 matches the current
configuration of the test which may not be true.
Existing tests in NetworkServerControlApiTest have this problem, as Myrna points out the NetworkServerControl
should be pulled based on the configuration.

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

> 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: 10.4.0.0
>            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.


Mime
View raw message