@Before
  public void setup() throws IOException {
    port = getRandomAvailableTCPPort();

    Properties properties = new Properties();
    properties.put(NAME, testName.getMethodName());
    properties.put(JMX_MANAGER, "true");
    properties.put(JMX_MANAGER_START, "true");
    properties.put(JMX_MANAGER_PORT, String.valueOf(port));
    properties.put(HTTP_SERVICE_PORT, "0");
    properties.put(MCAST_PORT, "0");

    legacyConnect(properties);

    gfsh = new HeadlessGfsh("Test", 25,
        temporaryFolder.newFolder("gfsh_files").getCanonicalPath());
  }
TODO : Add more tests for error-catch, different type of results etc
geode-gfsh/src/integrationTest/java/org/apache/geode/management/internal/cli/HeadlessGfshIntegrationTest.java