mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Matthew Swift
04.49.2016 a18241e1d91b5212dc8e4fb9d41d9a2d6c0baa40
refs
author Matthew Swift <matthew.swift@forgerock.com>
Wednesday, May 4, 2016 16:49 +0200
committer Matthew Swift <matthew.swift@forgerock.com>
Wednesday, May 4, 2016 16:49 +0200
commita18241e1d91b5212dc8e4fb9d41d9a2d6c0baa40
tree 2779148f62462def1488862a475355719ba700fa tree | zip | gz
parent 2d1ec373572251fa589b9552ed573f68c1e18557 view | diff
Fix unit test failures due to ports already in use

3 changes:

* avoid using ephemeral ports when allocating ports for listeners since
they may be immediately used as the local port in subsequent uses of
client tools. For example, in the following test code there is a risk
that dsconfig will re-use the replicationServerPort as its local port:

// Allocate random port and release it
replicationServerPort = TestCaseUtils.findFreePort();

// configure replication server to listen on replicationServerPort
TestCaseUtils.dsconfig(...);

* during server startup ensure that the LDAP, LDAPS, JMX, and admin
ports are unique

* avoid starting the server during TestNG initialization by moving
the startServer() call in the monitor test case constructor to
a @BeforeClass method.
2 files modified
60 ■■■■■ changed files
opendj-server-legacy/src/test/java/org/opends/server/TestCaseUtils.java 33 ●●●● diff | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/monitors/GenericMonitorTestCase.java 27 ●●●●● diff | view | raw | blame | history