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

Julius Stroffek commented on DERBY-2418:
----------------------------------------

Dag, thanks for the comments.

The reason why I decided to create a new constructor with a port number and not 
to place TestConfiguration.getCurrent().getPort() is that TestProto class is 
not in a testing package and I  do not find it good to import a class from the 
testing package. The constructor of TestProto without a port number is only 
used in TestFile.java, which is not used by any tests and looks only like a 
command line utility to run DRDA test on any file. I would do one of these

1.) use NetworkServerControl.DEFAULT_PORTNUMBER instead of TestConfiguration's 
2.) remove the TestFile.java since it is only a command line utility

I do not know which of those is better but I would say 2.)


> TestProto.java used by testProtocol.java hardcodes port 1527
> ------------------------------------------------------------
>
>                 Key: DERBY-2418
>                 URL: https://issues.apache.org/jira/browse/DERBY-2418
>             Project: Derby
>          Issue Type: Improvement
>          Components: Test
>            Reporter: Dag H. Wanvik
>         Assigned To: Julius Stroffek
>            Priority: Minor
>         Attachments: d2418.diff, d2418.stat
>
>
> NetHarnessJavaTest reuses the old framework test 'testProtocol' via
> old framework adapter HarnessJavaTest.
> testProtocol uses the class TestProto which hardcodes use of port 1527.
> It would be nice to pass the port used in the current TestConfiguration
> to testProtocol/TestProto so the JUnit suites can move towards being runnable
> with another port than the default. 
> Currently, using another port than 1527 for TestConfiguration.DEFAULT_PORT,
>  the test fails and crashes JUnit's TestRunner with the console message:
> Couldn't get I/O for the connection to: localhost

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

Reply via email to