protected void startLocator(String name, String classPath, int port) throws IOException {
    File locatorFile = new File("locator_dir_" + this.getClass().getSimpleName() + "_"
        + testName.getMethodName().replace("[", "").replace("]", ""));
    boolean success = locatorFile.mkdir();
    if (!success) {
      throw new IOException("Cannot mkdir for file " + locatorFile);
    }
    locatorDir = locatorFile.getAbsolutePath();
    CommandStringBuilder locStarter = new CommandStringBuilder(CliStrings.START_LOCATOR);
    locStarter.addOption(CliStrings.START_LOCATOR__MEMBER_NAME, name);
    locStarter.addOption(CliStrings.START_LOCATOR__CLASSPATH, classPath);
    locStarter.addOption(CliStrings.START_LOCATOR__PORT, Integer.toString(port));
    locStarter.addOption(CliStrings.START_LOCATOR__DIR, locatorDir);
    gfsh.executeAndAssertThat(locStarter.toString()).statusIsSuccess();
  }
This test iterates through the versions of Geode and executes session client compatibility with
the current version of Geode.
geode-assembly/src/upgradeTest/java/org/apache/geode/session/tests/TomcatSessionBackwardsCompatibilityTestBase.java