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 "Knut Anders Hatlen (JIRA)" <ji...@apache.org> on 2007/12/17 13:30:44 UTC

[jira] Commented: (DERBY-3211) Convert derbynet/NSinSameJVM.java to junit

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

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

Hi Manjula, I think your approach basically looks good. Please see my comments below.

1) I think this code

+        NetworkServerControl serverControl = null;
+        int port = TestConfiguration.getCurrent().getPort();
+        String hostName = TestConfiguration.getCurrent().getHostName();
+        serverControl = new NetworkServerControl(InetAddress
+                .getByName(hostName), port);// initialized for the shutdown.

could be replaced by a call to NetworkServerTestSetup.getNetworkServerControl()

2)
+        try {
+            serverControl.shutdown();
+        } catch (Exception e) {
+            fail("Unexpected exception" + e.getMessage());
+            e.printStackTrace();
+        }

e.printStackTrace() won't ever be called, since it's placed right after a call to fail(). Anyway, I think it is better just to remove the try/catch/fail and let JUnit handle the exception itself.

3) I can't see that getNewPort() is used, so it's probably best to remove it.

4) It looks like most of the changes in TestConfiguration.java are reformatting/white-space changes. If you could post a new patch which only contained what's actually changed, it would be easier to review those changes.

> Convert derbynet/NSinSameJVM.java to junit
> ------------------------------------------
>
>                 Key: DERBY-3211
>                 URL: https://issues.apache.org/jira/browse/DERBY-3211
>             Project: Derby
>          Issue Type: Test
>          Components: Test
>            Reporter: Manjula Kutty
>            Assignee: Manjula Kutty
>            Priority: Minor
>             Fix For: 10.4.0.0
>
>         Attachments: DERBY-3211_diff_11_16.txt, DERBY-3211_diff_11_19.txt, DERBY-3211_diff_11_19_ver2.txt, DERBY-3211_stat_11_16.txt, DERBY-3211_stat_11_19.txt, DERBY-3211_stat_11_19_ver2.txt, DERBY_3211_diff_12_14.txt, DERBY_3211_stat_12_14.txt
>
>


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