GEODE-1198 Now test make sure ports are available for port range
Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/8c85ef95 Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/8c85ef95 Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/8c85ef95 Branch: refs/heads/feature/GEODE-1817 Commit: 8c85ef959458aaa91a925132a68e3ce06ec95f89 Parents: 7454c3f Author: Hitesh Khamesra <[email protected]> Authored: Wed Aug 24 10:24:44 2016 -0700 Committer: Hitesh Khamesra <[email protected]> Committed: Wed Aug 24 10:26:51 2016 -0700 ---------------------------------------------------------------------- .../gemfire/distributed/DistributedSystemDUnitTest.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8c85ef95/geode-core/src/test/java/com/gemstone/gemfire/distributed/DistributedSystemDUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/distributed/DistributedSystemDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/distributed/DistributedSystemDUnitTest.java index 1be3b9f..c6fa5a2 100644 --- a/geode-core/src/test/java/com/gemstone/gemfire/distributed/DistributedSystemDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/distributed/DistributedSystemDUnitTest.java @@ -361,10 +361,10 @@ public class DistributedSystemDUnitTest extends JUnit4DistributedTestCase { public void testConflictingUDPPort() throws Exception { final Properties config = new Properties(); final int mcastPort = AvailablePort.getRandomAvailablePort(AvailablePort.MULTICAST); - final int[] socketPorts = AvailablePortHelper.getRandomAvailableTCPPorts(2, true); - final int unicastPort = socketPorts[0]; + final int[] socketPorts = AvailablePortHelper.getRandomAvailableTCPPorts(1, true); + final int unicastPort = getPortRange(3); config.setProperty(MCAST_PORT, String.valueOf(mcastPort)); - config.setProperty(START_LOCATOR, "localhost[" + socketPorts[1] + "]"); + config.setProperty(START_LOCATOR, "localhost[" + socketPorts[0] + "]"); config.setProperty(MEMBERSHIP_PORT_RANGE, ""+unicastPort+"-"+(unicastPort+2)); InternalDistributedSystem system = (InternalDistributedSystem)DistributedSystem.connect(config);
