[ 
https://issues.apache.org/jira/browse/DERBY-2419?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Kristian Waagan updated DERBY-2419:
-----------------------------------

    Attachment: derby-2419-2a-alternative2.stat
                derby-2419-2a-alternative2.diff
                derby-2419-1a-alternative1.diff

I have attached two draft alternatives for this issue. A brief description of 
them both:
 (1) Make non-network configurations (embedded) return valid values for host 
and port.
 (2) Create client/server configurations through a static methods, which has 
some logic to check the host name and the port of the current configuration. If 
they are not valid (hostname null or "", port < 1), which will be the case if 
the current configuration is embedded, use defaults.

I have also thought a bit about limiting the possibility for test writers to 
choose which host/port they can use, i.e. in (2) you don't ever specify 
host/port though a public API.
My intention was that either the default Derby port (1527) and 'localhost' are 
used, or the user specify values somehow when she starts the test runner. Is 
this too little flexibility?

I have not addressed the functionality for running multiple servers in a single 
test (different ports).

Feedback is appreciated, as this issue kind of blocks a few other issues.

I ran suites.All without failures for patch 2a, but did not run derbyall.
These patches are not ready for commit.

> Tighten encapsulation of state in TestConfiguration
> ---------------------------------------------------
>
>                 Key: DERBY-2419
>                 URL: https://issues.apache.org/jira/browse/DERBY-2419
>             Project: Derby
>          Issue Type: Improvement
>          Components: Test
>    Affects Versions: 10.3.0.0
>            Reporter: Kristian Waagan
>         Assigned To: Kristian Waagan
>            Priority: Minor
>         Attachments: derby-2419-1a-alternative1.diff, 
> derby-2419-2a-alternative2.diff, derby-2419-2a-alternative2.stat
>
>
> Parts of the state of TestConfiguration has been made public, which they 
> should not be; DEFAULT_PORT and DEFAULT_HOSTNAME.
> Using these directly from the outside can cause settings overridden by the 
> user to be ignored by tests. Further, a test should not care if the host/port 
> it uses is the Derby default or the values set by the user running the test.
> To obtain a hostname and  a port number, use the methods getPort and 
> getHostName in TestConfiguration.

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