@Test
  public void parametersOverrideCacheXml() throws IOException {
    Path logFile = rootFolder.resolve(SERVER_NAME + ".log");
    Path cacheXmlFile = rootFolder.resolve(SERVER_NAME + "Cache.xml");

    int[] ports = getRandomAvailableTCPPorts(2);
    int serverPortInXml = ports[0];
    int serverPortInGfsh = ports[1];

    CacheCreation creation = new CacheCreation();
    CacheServer server = creation.addCacheServer();
    server.setPort(serverPortInXml);
    server.setBindAddress(null);
    server.setHostnameForClients(null);
    server.setMaxConnections(800);
    server.setMaxThreads(0);
    server.setMaximumMessageCount(230000);
    server.setMessageTimeToLive(180);
    server.setSocketBufferSize(32768);

    try (PrintWriter pw = new PrintWriter(new FileWriter(cacheXmlFile.toFile()), true)) {
      CacheXmlGenerator.generate(creation, pw);
    }

    String startServerCommand = String.join(" ",
        "start server",
        "--max-threads=100",
        "--max-connections=1200",
        "--max-message-count=5000",
        "--message-time-to-live=360",
        "--socket-buffer-size=16384",
        "--server-port=" + serverPortInGfsh,
        "--name=" + SERVER_NAME,
        "--cache-xml-file=" + cacheXmlFile,
        "--J=-Dgemfire.log-file=" + logFile);

    GfshExecution execution = GfshScript
        .of(startServerCommand)
        .execute(gfshRule);
    assertThat(execution.getOutputText())
        .containsPattern("Server .* " + SERVER_NAME + " is currently online.");

    // Assert Server Properties.
    Boolean configurationLineFound = Boolean.FALSE;
    LineIterator lineIterator = FileUtils.lineIterator(logFile.toFile());
    while (lineIterator.hasNext()) {
      String line = lineIterator.nextLine();
      if (line.contains("CacheServer Configuration:")) {
        configurationLineFound = Boolean.TRUE;
        assertThat(line).contains("max-threads=100");
        assertThat(line).contains("port=" + serverPortInGfsh);
        assertThat(line).contains("max-connections=1200");
        assertThat(line).contains("message-time-to-live=360");
        assertThat(line).contains("socket-buffer-size=16384");
        assertThat(line).contains("maximum-message-count=5000");
      }
    }

    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