This is an automated email from the ASF dual-hosted git repository. khowe pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/geode.git
The following commit(s) were added to refs/heads/develop by this push: new 522e70e GEODE-4101: Only check for specific command line arguments (#1278) 522e70e is described below commit 522e70e6fb3663e3d2775da58ad246a41be640bb Author: Kenneth Howe <kh...@pivotal.io> AuthorDate: Fri Jan 12 15:24:57 2018 -0800 GEODE-4101: Only check for specific command line arguments (#1278) StartServerCommandTest failed in CI build, but the assertion that failed didn't provide any useful debugging information Change the assertion to use assertj so more information will be lgged regarding mismatches between expected and actual command arguments. Also changed expectedCommandLineElements to only contain the command args that we really care about - those that are specific to the command. Other arguments maythat are dependant on the test environment may vary and ignored in these tests. --- .../internal/cli/commands/StartLocatorCommandTest.java | 17 ++--------------- .../internal/cli/commands/StartServerCommandTest.java | 18 ++---------------- 2 files changed, 4 insertions(+), 31 deletions(-) diff --git a/geode-assembly/src/test/java/org/apache/geode/management/internal/cli/commands/StartLocatorCommandTest.java b/geode-assembly/src/test/java/org/apache/geode/management/internal/cli/commands/StartLocatorCommandTest.java index 491334d..42ce6a6 100644 --- a/geode-assembly/src/test/java/org/apache/geode/management/internal/cli/commands/StartLocatorCommandTest.java +++ b/geode-assembly/src/test/java/org/apache/geode/management/internal/cli/commands/StartLocatorCommandTest.java @@ -17,6 +17,7 @@ package org.apache.geode.management.internal.cli.commands; import static org.apache.geode.distributed.ConfigurationProperties.HTTP_SERVICE_BIND_ADDRESS; import static org.apache.geode.distributed.ConfigurationProperties.HTTP_SERVICE_PORT; +import static org.assertj.core.api.Assertions.assertThat; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; @@ -226,15 +227,6 @@ public class StartLocatorCommandTest { expectedCommandLineElements.add("-Dgemfire.statistic-sample-rate=1500"); expectedCommandLineElements.add("-Dgemfire.disable-auto-reconnect=true"); expectedCommandLineElements.addAll(Arrays.asList(jvmArguments)); - expectedCommandLineElements.add("-Xms".concat(heapSize)); - expectedCommandLineElements.add("-Xmx".concat(heapSize)); - expectedCommandLineElements.add("-XX:+UseConcMarkSweepGC"); - expectedCommandLineElements.add("-XX:CMSInitiatingOccupancyFraction=" - .concat(String.valueOf(StartMemberUtils.CMS_INITIAL_OCCUPANCY_FRACTION))); - expectedCommandLineElements.add("-Dgemfire.launcher.registerSignalHandlers=true"); - expectedCommandLineElements.add("-Djava.awt.headless=true"); - expectedCommandLineElements.add("-Dsun.rmi.dgc.server.gcInterval=9223372036854775806"); - expectedCommandLineElements.add("-Dgemfire.OSProcess.DISABLE_REDIRECTION_CONFIGURATION=true"); expectedCommandLineElements.add("org.apache.geode.distributed.LocatorLauncher"); expectedCommandLineElements.add("start"); expectedCommandLineElements.add("customLocator"); @@ -247,11 +239,6 @@ public class StartLocatorCommandTest { assertNotNull(commandLineElements); assertTrue(commandLineElements.length > 0); - for (String commandLineElement : commandLineElements) { - expectedCommandLineElements.remove(commandLineElement); - } - - assertTrue(String.format("Expected ([]); but was (%1$s)", expectedCommandLineElements), - expectedCommandLineElements.isEmpty()); + assertThat(commandLineElements).containsAll(expectedCommandLineElements); } } diff --git a/geode-assembly/src/test/java/org/apache/geode/management/internal/cli/commands/StartServerCommandTest.java b/geode-assembly/src/test/java/org/apache/geode/management/internal/cli/commands/StartServerCommandTest.java index b996a13..a7b0649 100644 --- a/geode-assembly/src/test/java/org/apache/geode/management/internal/cli/commands/StartServerCommandTest.java +++ b/geode-assembly/src/test/java/org/apache/geode/management/internal/cli/commands/StartServerCommandTest.java @@ -18,6 +18,7 @@ package org.apache.geode.management.internal.cli.commands; import static org.apache.geode.distributed.ConfigurationProperties.HTTP_SERVICE_BIND_ADDRESS; import static org.apache.geode.distributed.ConfigurationProperties.HTTP_SERVICE_PORT; import static org.apache.geode.distributed.ConfigurationProperties.START_DEV_REST_API; +import static org.assertj.core.api.Assertions.assertThat; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; @@ -197,16 +198,6 @@ public class StartServerCommandTest { expectedCommandLineElements.add("-Dgemfire.statistic-sample-rate=1500"); expectedCommandLineElements.add("-Dgemfire.disable-auto-reconnect=true"); expectedCommandLineElements.addAll(Arrays.asList(jvmArguments)); - expectedCommandLineElements.add("-XX:OnOutOfMemoryError=kill -KILL %p"); - expectedCommandLineElements.add("-Xms".concat(heapSize)); - expectedCommandLineElements.add("-Xmx".concat(heapSize)); - expectedCommandLineElements.add("-XX:+UseConcMarkSweepGC"); - expectedCommandLineElements.add("-XX:CMSInitiatingOccupancyFraction=" - .concat(String.valueOf(StartMemberUtils.CMS_INITIAL_OCCUPANCY_FRACTION))); - expectedCommandLineElements.add("-Dgemfire.launcher.registerSignalHandlers=true"); - expectedCommandLineElements.add("-Djava.awt.headless=true"); - expectedCommandLineElements.add("-Dsun.rmi.dgc.server.gcInterval=9223372036854775806"); - expectedCommandLineElements.add("-Dgemfire.OSProcess.DISABLE_REDIRECTION_CONFIGURATION=true"); expectedCommandLineElements.add("org.apache.geode.distributed.ServerLauncher"); expectedCommandLineElements.add("start"); expectedCommandLineElements.add("fullServer"); @@ -232,11 +223,6 @@ public class StartServerCommandTest { assertNotNull(commandLineElements); assertTrue(commandLineElements.length > 0); - for (String commandLineElement : commandLineElements) { - expectedCommandLineElements.remove(commandLineElement); - } - - assertTrue(String.format("Expected ([]); but was (%1$s)", expectedCommandLineElements), - expectedCommandLineElements.isEmpty()); + assertThat(commandLineElements).containsAll(expectedCommandLineElements); } } -- To stop receiving notification emails like this one, please contact ['"commits@geode.apache.org" <commits@geode.apache.org>'].