@Test
  public void usesClusterConfigurationIfEnabled() throws IOException {
    int serverPort = getRandomAvailableTCPPort();
    Path logFile = rootFolder.resolve(SERVER_NAME + ".log");

    String startServerCommand = String.join(" ",
        "start server",
        "--max-threads=50",
        "--max-connections=200",
        "--max-message-count=500",
        "--message-time-to-live=120",
        "--socket-buffer-size=8192",
        "--server-port=" + serverPort,
        "--use-cluster-configuration=true",
        "--name=" + SERVER_NAME,
        "--J=-Dgemfire.log-file=" + logFile);

    // Start Locator, configure PDX (just to have a non-empty cluster-configuration) and start
    // server.
    GfshExecution startClusterExecution = GfshScript
        .of("start locator --name=locator --connect=true --enable-cluster-configuration=true",
            "configure pdx --read-serialized=true",
            startServerCommand)
        .execute(gfshRule);

    assertThat(startClusterExecution.getOutputText())
        .contains("Successfully connected to: JMX Manager")
        .contains("Cluster configuration for group 'cluster' is updated")
        .containsPattern("Server .* " + SERVER_NAME + " is currently online.");

    // Assert Server Properties.
    boolean configurationLineFound = false;
    LineIterator lineIterator = FileUtils.lineIterator(logFile.toFile());
    while (lineIterator.hasNext()) {
      String line = lineIterator.nextLine();
      if (line.contains("CacheServer Configuration:")) {
        configurationLineFound = true;
        assertThat(line).contains("max-threads=50");
        assertThat(line).contains("port=" + serverPort);
        assertThat(line).contains("max-connections=200");
        assertThat(line).contains("message-time-to-live=120");
        assertThat(line).contains("socket-buffer-size=8192");
        assertThat(line).contains("maximum-message-count=500");
      }
    }

    assertThat(configurationLineFound).isTrue();
  }
Start server parameters should take precedence over cache.xml file and cluster configuration
service. See GEODE-5256.
geode-assembly/src/acceptanceTest/java/org/apache/geode/management/internal/cli/commands/StartServerCommandAcceptanceTest.java