geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jinmeil...@apache.org
Subject geode git commit: GEODE-2876: reset isGfshVM flag to false when tearing down tests using CliCommandTestBase.
Date Mon, 15 May 2017 15:43:35 GMT
Repository: geode
Updated Branches:
  refs/heads/develop 2a272acc9 -> b72445bd7


GEODE-2876: reset isGfshVM flag to false when tearing down tests using CliCommandTestBase.

* tests using CliCommandTestBase will set this flag to true which messes up following test
vms.


Project: http://git-wip-us.apache.org/repos/asf/geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/b72445bd
Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/b72445bd
Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/b72445bd

Branch: refs/heads/develop
Commit: b72445bd77de43a64d036d452e48b39d2cc9b4ca
Parents: 2a272ac
Author: Jinmei Liao <jiliao@pivotal.io>
Authored: Fri May 12 15:09:09 2017 -0700
Committer: Jinmei Liao <jiliao@pivotal.io>
Committed: Mon May 15 08:40:17 2017 -0700

----------------------------------------------------------------------
 .../management/internal/cli/GfshParser.java     | 14 +++-----
 .../cli/commands/CliCommandTestBase.java        |  4 ++-
 .../cli/commands/MemberCommandsDUnitTest.java   | 35 +++++++++++++++-----
 .../cli/commands/ShowDeadlockDUnitTest.java     | 16 +++++----
 4 files changed, 45 insertions(+), 24 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/geode/blob/b72445bd/geode-core/src/main/java/org/apache/geode/management/internal/cli/GfshParser.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/GfshParser.java
b/geode-core/src/main/java/org/apache/geode/management/internal/cli/GfshParser.java
index 426b05b..f9adeb3 100755
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/GfshParser.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/GfshParser.java
@@ -15,8 +15,6 @@
 package org.apache.geode.management.internal.cli;
 
 import org.apache.commons.lang.StringUtils;
-import org.apache.geode.internal.logging.LogService;
-import org.apache.logging.log4j.Logger;
 import org.springframework.shell.converters.ArrayConverter;
 import org.springframework.shell.core.CommandMarker;
 import org.springframework.shell.core.Completion;
@@ -47,8 +45,6 @@ public class GfshParser extends SimpleParser {
   public static final String COMMAND_DELIMITER = ";";
   public static final String CONTINUATION_CHARACTER = "\\";
 
-  private static final Logger logger = LogService.getLogger();
-
   // pattern used to split the user input with whitespaces except those in quotes (single
or double)
   private static Pattern PATTERN =
       Pattern.compile("\\s*([^\\s']*)'([^']*)'\\s+|\\s*([^\\s\"]*)\"([^\"]*)\"\\s+|\\S+");
@@ -169,18 +165,18 @@ public class GfshParser extends SimpleParser {
 
   @Override
   public GfshParseResult parse(String userInput) {
-    logger.debug("parser user input: <" + userInput + ">");
     String rawInput = convertToSimpleParserInput(userInput);
 
     // User SimpleParser to parse the input
     ParseResult result = super.parse(rawInput);
 
-    if (result != null) {
-      return new GfshParseResult(result.getMethod(), result.getInstance(), result.getArguments(),
-          userInput);
+    if (result == null) {
+      return null;
     }
 
-    return null;
+    return new GfshParseResult(result.getMethod(), result.getInstance(), result.getArguments(),
+        userInput);
+
   }
 
   /**

http://git-wip-us.apache.org/repos/asf/geode/blob/b72445bd/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/CliCommandTestBase.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/CliCommandTestBase.java
b/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/CliCommandTestBase.java
index afdb706..f624ab4 100644
--- a/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/CliCommandTestBase.java
+++ b/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/CliCommandTestBase.java
@@ -29,6 +29,7 @@ import static org.apache.geode.test.dunit.LogWriterUtils.getLogWriter;
 import org.apache.geode.cache.Cache;
 import org.apache.geode.internal.AvailablePortHelper;
 import org.apache.geode.management.ManagementService;
+import org.apache.geode.management.internal.cli.CliUtil;
 import org.apache.geode.management.internal.cli.CommandManager;
 import org.apache.geode.management.internal.cli.HeadlessGfsh;
 import org.apache.geode.management.internal.cli.i18n.CliStrings;
@@ -48,8 +49,8 @@ import java.io.IOException;
 import java.io.PrintStream;
 import java.net.InetAddress;
 import java.net.UnknownHostException;
-import java.util.Map;
 import java.util.List;
+import java.util.Map;
 import java.util.Properties;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
@@ -113,6 +114,7 @@ public abstract class CliCommandTestBase extends JUnit4CacheTestCase {
   @Override
   public final void preTearDownCacheTestCase() throws Exception {
     preTearDownCliCommandTestBase();
+    CliUtil.isGfshVM = false;
     destroyDefaultSetup();
   }
 

http://git-wip-us.apache.org/repos/asf/geode/blob/b72445bd/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/MemberCommandsDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/MemberCommandsDUnitTest.java
b/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/MemberCommandsDUnitTest.java
index e411644..5bbfc5b 100644
--- a/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/MemberCommandsDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/MemberCommandsDUnitTest.java
@@ -14,7 +14,28 @@
  */
 package org.apache.geode.management.internal.cli.commands;
 
-import org.apache.geode.cache.*;
+import static org.apache.geode.distributed.ConfigurationProperties.ENABLE_NETWORK_PARTITION_DETECTION;
+import static org.apache.geode.distributed.ConfigurationProperties.ENABLE_TIME_STATISTICS;
+import static org.apache.geode.distributed.ConfigurationProperties.GROUPS;
+import static org.apache.geode.distributed.ConfigurationProperties.LOCATORS;
+import static org.apache.geode.distributed.ConfigurationProperties.LOG_LEVEL;
+import static org.apache.geode.distributed.ConfigurationProperties.MCAST_PORT;
+import static org.apache.geode.distributed.ConfigurationProperties.NAME;
+import static org.apache.geode.distributed.ConfigurationProperties.STATISTIC_SAMPLING_ENABLED;
+import static org.apache.geode.test.dunit.Assert.assertEquals;
+import static org.apache.geode.test.dunit.LogWriterUtils.getLogWriter;
+import static org.apache.geode.test.dunit.NetworkUtils.getServerHostName;
+
+import org.apache.geode.cache.Cache;
+import org.apache.geode.cache.CacheFactory;
+import org.apache.geode.cache.EvictionAction;
+import org.apache.geode.cache.EvictionAttributes;
+import org.apache.geode.cache.FixedPartitionAttributes;
+import org.apache.geode.cache.PartitionAttributes;
+import org.apache.geode.cache.PartitionAttributesFactory;
+import org.apache.geode.cache.Region;
+import org.apache.geode.cache.RegionFactory;
+import org.apache.geode.cache.RegionShortcut;
 import org.apache.geode.distributed.DistributedMember;
 import org.apache.geode.distributed.Locator;
 import org.apache.geode.internal.AvailablePortHelper;
@@ -35,12 +56,11 @@ import org.junit.experimental.categories.Category;
 
 import java.io.File;
 import java.io.IOException;
-import java.util.*;
-
-import static org.apache.geode.distributed.ConfigurationProperties.*;
-import static org.apache.geode.test.dunit.Assert.assertEquals;
-import static org.apache.geode.test.dunit.LogWriterUtils.getLogWriter;
-import static org.apache.geode.test.dunit.NetworkUtils.getServerHostName;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
 
 @Category(DistributedTest.class)
 public class MemberCommandsDUnitTest extends JUnit4CacheTestCase {
@@ -68,7 +88,6 @@ public class MemberCommandsDUnitTest extends JUnit4CacheTestCase {
   @Override
   public final void postTearDownCacheTestCase() throws Exception {
     disconnectFromDS();
-    CliUtil.isGfshVM = true;
   }
 
   private Properties createProperties(String name, String groups) {

http://git-wip-us.apache.org/repos/asf/geode/blob/b72445bd/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/ShowDeadlockDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/ShowDeadlockDUnitTest.java
b/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/ShowDeadlockDUnitTest.java
index a5293eb..5b90d0f 100644
--- a/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/ShowDeadlockDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/ShowDeadlockDUnitTest.java
@@ -14,6 +14,11 @@
  */
 package org.apache.geode.management.internal.cli.commands;
 
+import static org.apache.geode.test.dunit.Assert.assertEquals;
+import static org.apache.geode.test.dunit.Assert.assertTrue;
+import static org.apache.geode.test.dunit.Invoke.invokeInEveryVM;
+import static org.apache.geode.test.dunit.LogWriterUtils.getLogWriter;
+
 import org.apache.commons.io.FileUtils;
 import org.apache.geode.cache.execute.Function;
 import org.apache.geode.cache.execute.FunctionContext;
@@ -39,15 +44,15 @@ import org.junit.experimental.categories.Category;
 
 import java.io.File;
 import java.io.IOException;
-import java.util.*;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.locks.Lock;
 import java.util.concurrent.locks.ReentrantLock;
 
-import static org.apache.geode.test.dunit.Assert.*;
-import static org.apache.geode.test.dunit.Invoke.invokeInEveryVM;
-import static org.apache.geode.test.dunit.LogWriterUtils.getLogWriter;
-
 /**
  * This DUnit tests uses same code as GemFireDeadlockDetectorDUnitTest and uses the command
  * processor for executing the "show deadlock" command
@@ -79,7 +84,6 @@ public class ShowDeadlockDUnitTest extends JUnit4CacheTestCase {
         }
       }
     });
-    CliUtil.isGfshVM = true;
   }
 
   @Test


Mime
View raw message