RFR [9] 8078568 java/net/URLPermission/URLTest.java fails intermittently with BindException

Chris Hegarty chris.hegarty at oracle.com
Wed Jul 20 14:41:56 UTC 2016


The test uses hardcoded port numbers for its listening HTTP and HTTPS severs.
These hardcoded port numbers are problematic as the ports may not necessarily
be available. The reason for the hardcoded port numbers is that the test uses a
number of static, checked in, policy files, to grant ( and restrict ) permission
required for various explicit test scenarios. 

A better solution, which avoids the need for hardcoded port numbers, is for the
test to configure the security policy dynamically. This also has the advantage of
improving the readability of the test, since the code that grants the permissions
is along side the test code that makes assertions based on these permissions.

The individual test scenarios have not changed.

http://cr.openjdk.java.net/~chegar/8078568/
https://bugs.openjdk.java.net/browse/JDK-8078568

-Chris.


More information about the net-dev mailing list