michaelpearce-gain commented on a change in pull request #2689: NO-JIRA Test
Improvements
URL: https://github.com/apache/activemq-artemis/pull/2689#discussion_r289273996
##########
File path:
artemis-server/src/test/java/org/apache/activemq/artemis/tests/util/ActiveMQTestBase.java
##########
@@ -174,6 +175,9 @@
@Rule
public CleanupSystemPropertiesRule propertiesRule = new
CleanupSystemPropertiesRule();
+ @Rule
+ public PortCheckRule portCheckRule = new PortCheckRule(61616, 61617, 61618);
Review comment:
e.g. you could look at
https://docs.spring.io/spring/docs/4.0.5.RELEASE/javadoc-api/org/springframework/util/SocketUtils.html#findAvailableTcpPort--
or even more rough:
try (ServerSocket socket = new ServerSocket(0)) {
socket.setReuseAddress(true);
return socket.getLocalPort();
}
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services