You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by kl...@apache.org on 2016/12/08 00:04:45 UTC
[2/2] geode git commit: GEODE-1835 : unit test to verify a warning
message by the configure pdx command only when there are members in the
distributed system.
GEODE-1835 : unit test to verify a warning message by the configure pdx
command only when there are members in the distributed system.
This closes #304
Project: http://git-wip-us.apache.org/repos/asf/geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/61637b99
Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/61637b99
Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/61637b99
Branch: refs/heads/feature/GEODE-1835
Commit: 61637b996bad2eb049a41100e7288ec61425d3d5
Parents: 07d168e
Author: Amey Barve <ab...@apache.org>
Authored: Mon Dec 5 18:24:18 2016 +0530
Committer: Kirk Lund <kl...@apache.org>
Committed: Wed Dec 7 15:53:04 2016 -0800
----------------------------------------------------------------------
.../ClusterConfigurationDUnitTest.java | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/geode/blob/61637b99/geode-wan/src/test/java/org/apache/geode/management/internal/configuration/ClusterConfigurationDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-wan/src/test/java/org/apache/geode/management/internal/configuration/ClusterConfigurationDUnitTest.java b/geode-wan/src/test/java/org/apache/geode/management/internal/configuration/ClusterConfigurationDUnitTest.java
index 3f7b073..2677900 100644
--- a/geode-wan/src/test/java/org/apache/geode/management/internal/configuration/ClusterConfigurationDUnitTest.java
+++ b/geode-wan/src/test/java/org/apache/geode/management/internal/configuration/ClusterConfigurationDUnitTest.java
@@ -614,6 +614,15 @@ public class ClusterConfigurationDUnitTest extends CliCommandTestBase {
});
}
+ @Test
+ public void testConfigurePDXForWarning() throws Exception {
+ setup();
+ CommandResult commandResult = configurePDX("com.foo.*", "true", "true", null, "true");
+ String result = (String) commandResult.getResultData().getGfJsonObject()
+ .getJSONObject("content").getJSONArray("message").get(0);
+ assertEquals(CliStrings.CONFIGURE_PDX__NORMAL__MEMBERS__WARNING, result);
+ }
+
private Object[] setup() throws IOException {
final int[] ports = getRandomAvailableTCPPorts(3);
final int locator1Port = ports[0];
@@ -800,13 +809,14 @@ public class ClusterConfigurationDUnitTest extends CliCommandTestBase {
executeAndVerifyCommand(csb.getCommandString());
}
- private void executeAndVerifyCommand(String commandString) {
+ private CommandResult executeAndVerifyCommand(String commandString) {
CommandResult cmdResult = executeCommand(commandString);
org.apache.geode.test.dunit.LogWriterUtils.getLogWriter().info("Command : " + commandString);
org.apache.geode.test.dunit.LogWriterUtils.getLogWriter()
.info("Command Result : " + commandResultToString(cmdResult));
assertEquals(Status.OK, cmdResult.getStatus());
assertFalse(cmdResult.failedToPersist());
+ return cmdResult;
}
private void createIndex(String indexName, String expression, String regionName, String group) {
@@ -939,7 +949,7 @@ public class ClusterConfigurationDUnitTest extends CliCommandTestBase {
}
}
- private void configurePDX(String autoSerializerClasses, String ignoreUnreadFields,
+ private CommandResult configurePDX(String autoSerializerClasses, String ignoreUnreadFields,
String persistent, String portableAutoSerializerClasses, String readSerialized) {
CommandStringBuilder csb = new CommandStringBuilder(CliStrings.CONFIGURE_PDX);
csb.addOptionWithValueCheck(CliStrings.CONFIGURE_PDX__AUTO__SERIALIZER__CLASSES,
@@ -950,7 +960,8 @@ public class ClusterConfigurationDUnitTest extends CliCommandTestBase {
csb.addOptionWithValueCheck(CliStrings.CONFIGURE_PDX__PORTABLE__AUTO__SERIALIZER__CLASSES,
portableAutoSerializerClasses);
csb.addOptionWithValueCheck(CliStrings.CONFIGURE_PDX__READ__SERIALIZED, readSerialized);
- executeAndVerifyCommand(csb.getCommandString());
+
+ return executeAndVerifyCommand(csb.getCommandString());
}
private void createAndDeployJar(String jarName, String group) throws IOException {