public static int createServer(int locPort, int maximumTimeBetweenPings, Properties props) {
    WANTestBase test = new WANTestBase();
    props.setProperty(MCAST_PORT, "0");
    props.setProperty(LOCATORS, "localhost[" + locPort + "]");
    InternalDistributedSystem ds = test.getSystem(props);
    cache = CacheFactory.create(ds);

    CacheServer server = cache.addCacheServer();
    int port = getRandomAvailableTCPPort();
    server.setPort(port);
    server.setHostnameForClients("localhost");
    if (maximumTimeBetweenPings > 0) {
      server.setMaximumTimeBetweenPings(maximumTimeBetweenPings);
    }
    try {
      server.start();
    } catch (IOException e) {
      fail("Failed to start server ", e);
    }
    return port;
  }
Returns a Map that contains the count for number of cache server and number of Receivers.
geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/WANTestBase.java