geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kl...@apache.org
Subject [15/16] 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.
Date Thu, 08 Dec 2016 17:12:28 GMT
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/ef741814
Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/ef741814
Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/ef741814

Branch: refs/heads/feature/GEODE-1027
Commit: ef7418140b903e73bc3a38d3a86c01349924bd09
Parents: 28efd90
Author: Amey Barve <abarve@apache.org>
Authored: Mon Dec 5 18:24:18 2016 +0530
Committer: Kirk Lund <klund@apache.org>
Committed: Thu Dec 8 08:46:38 2016 -0800

----------------------------------------------------------------------
 .../ClusterConfigurationDUnitTest.java             | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/geode/blob/ef741814/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 {


Mime
View raw message