@Test
  public void testSpecificTcpPort() throws Exception {
    Properties config = new Properties();
    config.put(LOCATORS, "localhost[" + getDUnitLocatorPort() + "]");
    config.setProperty(TCP_PORT, String.valueOf(tcpPort));

    InternalDistributedSystem system = getSystem(config);

    ClusterDistributionManager dm = (ClusterDistributionManager) system.getDistributionManager();
    Distribution mgr = dm.getDistribution();
    assertThat(mgr.getLocalMember().getDirectChannelPort()).isEqualTo(tcpPort);
  }
test the ability to set the port used to listen for tcp/ip connections
geode-core/src/distributedTest/java/org/apache/geode/distributed/DistributedSystemDUnitTest.java