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

    Properties config = new Properties();
    config.setProperty(LOCATORS, hostName + "[" + locatorPort + "]");
    config.setProperty(JMX_MANAGER, "true");

    createCache(managedNode2, config);
    createCache(managedNode3, config);

    validatePotentialManagers(locatorVM, 3);
  }
Tests a locator which is co-located with already existing cache
geode-core/src/distributedTest/java/org/apache/geode/management/LocatorManagementDUnitTest.java