@Test
  public void testPeerLocationWithPortZero() throws Exception {
    locatorPort = startLocator(locatorVM, 0);

    validateLocatorMXBean(locatorVM, locatorPort);

    Properties config = new Properties();
    config.setProperty(LOCATORS, hostName + "[" + locatorPort + "]");
    config.setProperty(JMX_MANAGER, "true");
    config.setProperty(JMX_MANAGER_START, "false");
    config.setProperty(JMX_MANAGER_PORT, "0");
    config.setProperty(JMX_MANAGER_HTTP_PORT, "0");

    createCache(managerVM, config);
    startManagingNode(managerVM);
    DistributedMember locatorMember = getMember(locatorVM);

    validateLocatorMXBean(managerVM, locatorMember);
  }
When plan is to start Distributed System later so that the system can use this locator
geode-core/src/distributedTest/java/org/apache/geode/management/LocatorManagementDUnitTest.java