ARTEMIS-4174: test is verifying hostname detail, so use floating ports to avoid sporadic bind failures that are happening
This commit is contained in:
parent
aa4e4409bf
commit
9864e005d2
|
@ -63,7 +63,7 @@ public class RmiRegistryFactory {
|
||||||
* Create a server socket for testing purposes.
|
* Create a server socket for testing purposes.
|
||||||
*/
|
*/
|
||||||
ServerSocket createTestSocket() throws IOException {
|
ServerSocket createTestSocket() throws IOException {
|
||||||
return socketFactory.createServerSocket(1100);
|
return socketFactory.createServerSocket(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Object getObject() throws Exception {
|
public Object getObject() throws Exception {
|
||||||
|
|
|
@ -31,7 +31,7 @@ public class JMXRMIRegistryPortTest extends ActiveMQTestBase {
|
||||||
public void explicitLocalhostRegistry() throws IOException {
|
public void explicitLocalhostRegistry() throws IOException {
|
||||||
RmiRegistryFactory registryFactory = new RmiRegistryFactory();
|
RmiRegistryFactory registryFactory = new RmiRegistryFactory();
|
||||||
registryFactory.setHost("localhost");
|
registryFactory.setHost("localhost");
|
||||||
registryFactory.setPort(1099);
|
registryFactory.setPort(0);
|
||||||
registryFactory.init();
|
registryFactory.init();
|
||||||
runAfter(registryFactory::destroy);
|
runAfter(registryFactory::destroy);
|
||||||
try (ServerSocket testSocket = registryFactory.createTestSocket()) {
|
try (ServerSocket testSocket = registryFactory.createTestSocket()) {
|
||||||
|
@ -43,7 +43,7 @@ public class JMXRMIRegistryPortTest extends ActiveMQTestBase {
|
||||||
public void unlimitedHostRegistry() throws IOException {
|
public void unlimitedHostRegistry() throws IOException {
|
||||||
RmiRegistryFactory registryFactory = new RmiRegistryFactory();
|
RmiRegistryFactory registryFactory = new RmiRegistryFactory();
|
||||||
registryFactory.setHost(null);
|
registryFactory.setHost(null);
|
||||||
registryFactory.setPort(1099);
|
registryFactory.setPort(0);
|
||||||
registryFactory.init();
|
registryFactory.init();
|
||||||
runAfter(registryFactory::destroy);
|
runAfter(registryFactory::destroy);
|
||||||
try (ServerSocket testSocket = registryFactory.createTestSocket()) {
|
try (ServerSocket testSocket = registryFactory.createTestSocket()) {
|
||||||
|
|
Loading…
Reference in New Issue