RFR: 8262195: Harden tests that use the HostsFileNameService (jdk.net.hosts.file property) [v2]

Daniel Fuchs dfuchs at openjdk.java.net
Thu Feb 25 19:24:39 UTC 2021


On Thu, 25 Feb 2021 19:16:58 GMT, Conor Cleary <ccleary at openjdk.org> wrote:

>> test/jdk/java/net/InetAddress/InternalNameServiceWithNoHostsFileTest.java line 32:
>> 
>>> 30:  *          thrown
>>> 31:  * @run main/othervm -Djdk.net.hosts.file=TestHosts-II -Dsun.net.inetaddr.ttl=0
>>> 32:  *          InternalNameServiceWithNoHostsFileTest
>> 
>> shouldn't this be:
>> 
>> @run main/othervm -Djdk.net.hosts.file=${test.src}/TestHosts-II -Dsun.net.inetaddr.ttl=0
>
> TestHosts-II was never in the test.src directory, from what I could tell it was just a dummy file (as per the test name) to verify the reaction when a Hosts File is not found. So, to be consistent with the other changes in this PR where a Host File is not present, I gave just the Filename in the path. Are there possible issues stemming from this? One I can think of is that a Hosts FIle of that name happens to be present in the user.dir though that is probably not very likely.

Oh - OK - this is fine then

-------------

PR: https://git.openjdk.java.net/jdk/pull/2703


More information about the net-dev mailing list