From 7217a27b2881c261606d59419af0560afa583026 Mon Sep 17 00:00:00 2001 From: Dominic Fox Date: Fri, 20 Jul 2018 11:38:33 +0100 Subject: [PATCH] Allocate ports in a non-deprecated way --- .../kotlin/net/corda/node/amqp/SocksTests.kt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/node/src/integration-test/kotlin/net/corda/node/amqp/SocksTests.kt b/node/src/integration-test/kotlin/net/corda/node/amqp/SocksTests.kt index 8c1d0b0da5..9b452acfa7 100644 --- a/node/src/integration-test/kotlin/net/corda/node/amqp/SocksTests.kt +++ b/node/src/integration-test/kotlin/net/corda/node/amqp/SocksTests.kt @@ -34,6 +34,7 @@ import net.corda.nodeapi.internal.ArtemisMessagingComponent.Companion.P2P_PREFIX import net.corda.nodeapi.internal.protonwrapper.messages.MessageStatus import net.corda.nodeapi.internal.protonwrapper.netty.* import net.corda.testing.core.* +import net.corda.testing.driver.PortAllocation import net.corda.testing.internal.rigorousMock import org.apache.activemq.artemis.api.core.RoutingType import org.junit.After @@ -50,10 +51,11 @@ class SocksTests { @JvmField val temporaryFolder = TemporaryFolder() - private val socksPort = freePort() - private val serverPort = freePort() - private val serverPort2 = freePort() - private val artemisPort = freePort() + private val portAllocator = PortAllocation.Incremental(10000) + private val socksPort = portAllocator.nextPort() + private val serverPort = portAllocator.nextPort() + private val serverPort2 = portAllocator.nextPort() + private val artemisPort = portAllocator.nextPort() private abstract class AbstractNodeConfiguration : NodeConfiguration