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/05/03 23:51:59 UTC

[10/50] [abbrv] incubator-geode git commit: Merge branch 'develop' into feature/GEODE-17-2

Merge branch 'develop' into feature/GEODE-17-2

# Conflicts:
#	geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/CliCommandTestBase.java
#	geode-core/src/test/java/com/gemstone/gemfire/security/ClientAuthorizationTestCase.java
#	geode-cq/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/ClientCommandsDUnitTest.java


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

Branch: refs/heads/feature/GEODE-1255
Commit: da0bbfec00395062886137a6550fa2ec7e7a0e30
Parents: 183c48a
Author: Jinmei Liao <ji...@pivotal.io>
Authored: Fri Apr 22 10:26:10 2016 -0700
Committer: Jinmei Liao <ji...@pivotal.io>
Committed: Fri Apr 22 10:26:10 2016 -0700

----------------------------------------------------------------------
 .../cli/commands/CliCommandTestBase.java        | 34 ++++---------
 .../security/ClientAuthorizationTestCase.java   |  2 +-
 .../cli/commands/ClientCommandsDUnitTest.java   | 53 ++++++++++++--------
 3 files changed, 44 insertions(+), 45 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/da0bbfec/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/CliCommandTestBase.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/CliCommandTestBase.java b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/CliCommandTestBase.java
index 1c6b6b1..9ddfbbb 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/CliCommandTestBase.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/CliCommandTestBase.java
@@ -21,13 +21,12 @@ import static com.gemstone.gemfire.test.dunit.LogWriterUtils.*;
 
 import java.io.IOException;
 import java.io.PrintStream;
-import java.io.PrintWriter;
-import java.io.StringWriter;
 import java.net.InetAddress;
 import java.net.UnknownHostException;
+import java.util.Arrays;
+import java.util.Collection;
 import java.util.Map;
 import java.util.Properties;
-import java.util.Set;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
@@ -44,22 +43,9 @@ import com.gemstone.gemfire.management.internal.cli.shell.Gfsh;
 import com.gemstone.gemfire.management.internal.cli.util.CommandStringBuilder;
 import com.gemstone.gemfire.management.internal.security.JSONAuthorization;
 import com.gemstone.gemfire.test.dunit.Host;
-import com.gemstone.gemfire.test.dunit.SerializableCallable;
-import com.gemstone.gemfire.test.dunit.SerializableRunnable;
 import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
-import org.junit.runners.Parameterized;
-
-import java.io.IOException;
-import java.io.PrintStream;
-import java.net.InetAddress;
-import java.net.UnknownHostException;
-import java.util.Map;
-import java.util.Properties;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
 
-import static com.gemstone.gemfire.test.dunit.Assert.*;
-import static com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter;
+import org.junit.runners.Parameterized;
 
 /**
  * Base class for all the CLI/gfsh command dunit tests.
@@ -127,14 +113,15 @@ public abstract class CliCommandTestBase extends JUnit4CacheTestCase {
     return shell;
   }
 
-  protected void setUpJMXManagerOnVM(int vm, final Properties props){
-    Object[] result = (Object[]) Host.getHost(0).getVM(vm).invoke( "setUpJmxManagerOnVm0ThenConnect", () -> {
+  protected void setUpJMXManagerOnVM(int vm, final Properties props) {
+    Object[] result = (Object[]) Host.getHost(0).getVM(vm).invoke("setUpJmxManagerOnVm0ThenConnect", () -> {
       final Object[] results = new Object[3];
       final Properties localProps = (props != null ? props : new Properties());
 
       try {
         jmxHost = InetAddress.getLocalHost().getHostName();
-      } catch (UnknownHostException ignore) {
+      }
+      catch (UnknownHostException ignore) {
         jmxHost = "localhost";
       }
 
@@ -153,7 +140,7 @@ public abstract class CliCommandTestBase extends JUnit4CacheTestCase {
       localProps.setProperty(DistributionConfig.JMX_MANAGER_PORT_NAME, String.valueOf(jmxPort));
       localProps.setProperty(DistributionConfig.HTTP_SERVICE_PORT_NAME, String.valueOf(httpPort));
 
-      if(enableAuth){
+      if (enableAuth) {
         localProps.put(DistributionConfig.SECURITY_CLIENT_AUTHENTICATOR_NAME,
           JSONAuthorization.class.getName() + ".create");
         localProps.put(DistributionConfig.SECURITY_CLIENT_ACCESSOR_NAME, JSONAuthorization.class.getName() + ".create");
@@ -170,11 +157,12 @@ public abstract class CliCommandTestBase extends JUnit4CacheTestCase {
 
       return results;
     });
+  }
+
   /**
    * Destroy all of the components created for the default setup.
    */
-  @SuppressWarnings("serial")
-  protected final void destroyDefaultSetup() {
+    protected final void destroyDefaultSetup() {
     if (this.shell != null) {
       executeCommand(shell, "exit");
       this.shell.terminate();

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/da0bbfec/geode-core/src/test/java/com/gemstone/gemfire/security/ClientAuthorizationTestCase.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/security/ClientAuthorizationTestCase.java b/geode-core/src/test/java/com/gemstone/gemfire/security/ClientAuthorizationTestCase.java
index a41f677..58d3442 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/security/ClientAuthorizationTestCase.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/security/ClientAuthorizationTestCase.java
@@ -776,7 +776,7 @@ public abstract class ClientAuthorizationTestCase extends JUnit4DistributedTestC
       } else {
         int[] indices = currentOp.getIndices();
         clientVM.invoke("ClientAuthorizationTestCase.doOp",
-            () -> ClientAuthorizationTestCase.doOp( new Byte(ordinal), indices, new Integer(opFlags), new Integer(expectedResult) ));
+            () -> ClientAuthorizationTestCase.doOp( opCode, indices, new Integer(opFlags), new Integer(expectedResult) ));
       }
     }
   }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/da0bbfec/geode-cq/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/ClientCommandsDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-cq/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/ClientCommandsDUnitTest.java b/geode-cq/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/ClientCommandsDUnitTest.java
index e551dce..a277162 100644
--- a/geode-cq/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/ClientCommandsDUnitTest.java
+++ b/geode-cq/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/ClientCommandsDUnitTest.java
@@ -16,8 +16,31 @@
  */
 package com.gemstone.gemfire.management.internal.cli.commands;
 
-import com.gemstone.gemfire.cache.*;
-import com.gemstone.gemfire.cache.client.*;
+import static com.gemstone.gemfire.test.dunit.Assert.*;
+import static com.gemstone.gemfire.test.dunit.DistributedTestUtils.*;
+import static com.gemstone.gemfire.test.dunit.LogWriterUtils.*;
+import static com.gemstone.gemfire.test.dunit.NetworkUtils.*;
+
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Properties;
+import java.util.concurrent.TimeUnit;
+import javax.management.ObjectName;
+
+import com.gemstone.gemfire.cache.AttributesFactory;
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.PartitionAttributesFactory;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.Scope;
+import com.gemstone.gemfire.cache.client.ClientCache;
+import com.gemstone.gemfire.cache.client.ClientCacheFactory;
+import com.gemstone.gemfire.cache.client.ClientRegionFactory;
+import com.gemstone.gemfire.cache.client.ClientRegionShortcut;
+import com.gemstone.gemfire.cache.client.PoolManager;
 import com.gemstone.gemfire.cache.client.internal.PoolImpl;
 import com.gemstone.gemfire.cache.query.CqAttributesFactory;
 import com.gemstone.gemfire.cache.query.QueryService;
@@ -47,23 +70,11 @@ import com.gemstone.gemfire.test.dunit.VM;
 import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 import com.gemstone.gemfire.test.junit.categories.FlakyTest;
 import com.jayway.awaitility.Awaitility;
+
 import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
-import javax.management.ObjectName;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Properties;
-import java.util.concurrent.TimeUnit;
-
-import static com.gemstone.gemfire.test.dunit.Assert.*;
-import static com.gemstone.gemfire.test.dunit.DistributedTestUtils.getDUnitLocatorPort;
-import static com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter;
-import static com.gemstone.gemfire.test.dunit.NetworkUtils.getServerHostName;
-
 /**
  * Dunit class for testing gemfire Client commands : list client , describe client
  *
@@ -577,7 +588,7 @@ public class ClientCommandsDUnitTest extends CliCommandTestBase {
 
   private void setupSystemForListClient() throws Exception {
     disconnectAllFromDS();
-    createDefaultSetup(getServerProperties());
+    setUpJmxManagerOnVm0ThenConnect(getServerProperties());
 
     final VM server1 = Host.getHost(0).getVM(1);
     final VM client1 = Host.getHost(0).getVM(2);
@@ -590,7 +601,7 @@ public class ClientCommandsDUnitTest extends CliCommandTestBase {
 
   private void setupSystem() throws Exception {
     disconnectAllFromDS();
-    createDefaultSetup(getServerProperties());
+    setUpJmxManagerOnVm0ThenConnect(getServerProperties());
 
     final VM manager = Host.getHost(0).getVM(0);
     final VM server1 = Host.getHost(0).getVM(1);
@@ -616,7 +627,7 @@ public class ClientCommandsDUnitTest extends CliCommandTestBase {
 
   private void setupSystem2() throws Exception {
     disconnectAllFromDS();
-    createDefaultSetup(getServerProperties());
+    setUpJmxManagerOnVm0ThenConnect(getServerProperties());
 
     final VM manager = Host.getHost(0).getVM(0);
     final VM server1 = Host.getHost(0).getVM(1);
@@ -644,7 +655,7 @@ public class ClientCommandsDUnitTest extends CliCommandTestBase {
 
   private void setupSystem3() throws Exception {
     disconnectAllFromDS();
-    createDefaultSetup(getServerProperties());
+    setUpJmxManagerOnVm0ThenConnect(getServerProperties());
 
     final VM manager = Host.getHost(0).getVM(0);
     final VM server1 = Host.getHost(0).getVM(1);
@@ -1001,7 +1012,7 @@ public class ClientCommandsDUnitTest extends CliCommandTestBase {
 
   private void setUpNonSubscribedClient() throws Exception {
     disconnectAllFromDS();
-    createDefaultSetup(getServerProperties());
+    setUpJmxManagerOnVm0ThenConnect(getServerProperties());
 
     final VM manager = Host.getHost(0).getVM(0);
     final VM server1 = Host.getHost(0).getVM(1);
@@ -1030,7 +1041,7 @@ public class ClientCommandsDUnitTest extends CliCommandTestBase {
 
   private String[] setupSystemWithSubAndNonSubClient() throws Exception {
     disconnectAllFromDS();
-    createDefaultSetup(getServerProperties());
+    setUpJmxManagerOnVm0ThenConnect(getServerProperties());
 
     final VM manager = Host.getHost(0).getVM(0);
     final VM server1 = Host.getHost(0).getVM(1);