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/03/22 19:21:23 UTC

incubator-geode git commit: Eliminate public variables and statics

Repository: incubator-geode
Updated Branches:
  refs/heads/feature/GEODE-693 5fb123001 -> 62b19e173


Eliminate public variables and statics


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

Branch: refs/heads/feature/GEODE-693
Commit: 62b19e173dfd50ba5071125cd89dfc64b06658be
Parents: 5fb1230
Author: Kirk Lund <kl...@apache.org>
Authored: Tue Mar 22 11:11:58 2016 -0700
Committer: Kirk Lund <kl...@apache.org>
Committed: Tue Mar 22 11:11:58 2016 -0700

----------------------------------------------------------------------
 .../security/ClientAuthorizationTestBase.java   |  1 -
 .../DeltaClientAuthorizationDUnitTest.java      | 19 +++--
 .../DeltaClientPostAuthorizationDUnitTest.java  | 76 +++++++++++++++---
 .../ClientCQPostAuthorizationDUnitTest.java     | 78 +++++++++---------
 .../MultiuserDurableCQAuthzDUnitTest.java       | 84 ++++++++++----------
 5 files changed, 154 insertions(+), 104 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/62b19e17/geode-core/src/test/java/com/gemstone/gemfire/security/ClientAuthorizationTestBase.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/security/ClientAuthorizationTestBase.java b/geode-core/src/test/java/com/gemstone/gemfire/security/ClientAuthorizationTestBase.java
index 96c25bc..67f98aa 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/security/ClientAuthorizationTestBase.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/security/ClientAuthorizationTestBase.java
@@ -69,7 +69,6 @@ import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
  * Base class for tests for authorization from client to server. It contains
  * utility functions for the authorization tests from client to server.
  * 
- * @author sumedh
  * @since 5.5
  */
 public class ClientAuthorizationTestBase extends JUnit4DistributedTestCase {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/62b19e17/geode-core/src/test/java/com/gemstone/gemfire/security/DeltaClientAuthorizationDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/security/DeltaClientAuthorizationDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/security/DeltaClientAuthorizationDUnitTest.java
index 3168a21..a2ed3fd 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/security/DeltaClientAuthorizationDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/security/DeltaClientAuthorizationDUnitTest.java
@@ -44,9 +44,9 @@ import org.junit.experimental.categories.Category;
 public class DeltaClientAuthorizationDUnitTest extends
     ClientAuthorizationTestBase {
 
-  protected static final DeltaTestImpl[] deltas = new DeltaTestImpl[8];
+  private DeltaTestImpl[] deltas = new DeltaTestImpl[8];
 
-  private static final void setUpDeltas() {
+  private final void setUpDeltas() {
     for (int i = 0; i < 8; i++) {
       deltas[i] = new DeltaTestImpl(0, "0", new Double(0), new byte[0],
           new TestObject1("0", 0));
@@ -96,6 +96,11 @@ public class DeltaClientAuthorizationDUnitTest extends
   }
 
   @Override
+  public final void preSetUp() throws Exception {
+    setUpDeltas();
+  }
+
+  @Override
   public final void postSetUp() throws Exception {
     final Host host = Host.getHost(0);
     server1 = host.getVM(0);
@@ -107,8 +112,6 @@ public class DeltaClientAuthorizationDUnitTest extends
     server2.invoke(() -> SecurityTestUtil.registerExpectedExceptions( serverExpectedExceptions ));
     client2.invoke(() -> SecurityTestUtil.registerExpectedExceptions( clientExpectedExceptions ));
     SecurityTestUtil.registerExpectedExceptions(clientExpectedExceptions);
-
-    setUpDeltas();
   }
 
   @Override
@@ -166,13 +169,13 @@ public class DeltaClientAuthorizationDUnitTest extends
       createClient2(javaProps, authInit, port1, port2, getCredentials);
 
       // Perform some put operations from client1
-      client1.invoke(() -> DeltaClientAuthorizationDUnitTest.doPuts(
+      client1.invoke(() -> doPuts(
           new Integer(2), new Integer(SecurityTestUtil.NO_EXCEPTION), Boolean.FALSE ));
       Thread.sleep(5000);
       assertTrue("Delta feature NOT used", (Boolean)client1.invoke(() -> DeltaTestImpl.toDeltaFeatureUsed()));
 
       // Verify that the gets succeed
-      client2.invoke(() -> DeltaClientAuthorizationDUnitTest.doGets(
+      client2.invoke(() -> doGets(
           new Integer(2), new Integer(SecurityTestUtil.NO_EXCEPTION), Boolean.FALSE  ));
   }
 
@@ -202,7 +205,7 @@ public class DeltaClientAuthorizationDUnitTest extends
     return port1;
   }
 
-  public static void doPuts(Integer num, Integer expectedResult,
+  public void doPuts(Integer num, Integer expectedResult,
       boolean newVals) {
 
     assertTrue(num.intValue() <= SecurityTestUtil.keys.length);
@@ -280,7 +283,7 @@ public class DeltaClientAuthorizationDUnitTest extends
     }
   }
 
-  public static void doGets(Integer num, Integer expectedResult,
+  public void doGets(Integer num, Integer expectedResult,
       boolean newVals) {
 
     assertTrue(num.intValue() <= SecurityTestUtil.keys.length);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/62b19e17/geode-core/src/test/java/com/gemstone/gemfire/security/DeltaClientPostAuthorizationDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/security/DeltaClientPostAuthorizationDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/security/DeltaClientPostAuthorizationDUnitTest.java
index d5dfe89..56e5e2d 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/security/DeltaClientPostAuthorizationDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/security/DeltaClientPostAuthorizationDUnitTest.java
@@ -35,6 +35,7 @@ import com.gemstone.gemfire.cache.operations.OperationContext.OperationCode;
 import com.gemstone.gemfire.cache.query.CqException;
 import com.gemstone.gemfire.cache.query.QueryInvocationTargetException;
 import com.gemstone.gemfire.internal.AvailablePort;
+import com.gemstone.gemfire.internal.cache.PartitionedRegionLocalMaxMemoryDUnitTest;
 import com.gemstone.gemfire.internal.util.Callable;
 import com.gemstone.gemfire.security.generator.AuthzCredentialGenerator;
 import com.gemstone.gemfire.security.generator.CredentialGenerator;
@@ -56,6 +57,61 @@ public class DeltaClientPostAuthorizationDUnitTest extends
 
   private static final int PAUSE = 5 * 1000; // TODO: replace with Awaitility
 
+  private DeltaTestImpl[] deltas = new DeltaTestImpl[8];
+
+  private final void setUpDeltas() {
+    for (int i = 0; i < 8; i++) {
+      deltas[i] = new DeltaTestImpl(0, "0", new Double(0), new byte[0],
+              new PartitionedRegionLocalMaxMemoryDUnitTest.TestObject1("0", 0));
+    }
+    deltas[1].setIntVar(5);
+    deltas[2].setIntVar(5);
+    deltas[3].setIntVar(5);
+    deltas[4].setIntVar(5);
+    deltas[5].setIntVar(5);
+    deltas[6].setIntVar(5);
+    deltas[7].setIntVar(5);
+
+    deltas[2].resetDeltaStatus();
+    deltas[2].setByteArr(new byte[] { 1, 2, 3, 4, 5 });
+    deltas[3].setByteArr(new byte[] { 1, 2, 3, 4, 5 });
+    deltas[4].setByteArr(new byte[] { 1, 2, 3, 4, 5 });
+    deltas[5].setByteArr(new byte[] { 1, 2, 3, 4, 5 });
+    //deltas[6].setByteArr(new byte[] { 1, 2, 3, 4, 5 });
+    //deltas[7].setByteArr(new byte[] { 1, 2, 3, 4, 5 });
+
+    deltas[3].resetDeltaStatus();
+    deltas[3].setDoubleVar(new Double(5));
+    deltas[4].setDoubleVar(new Double(5));
+    deltas[5].setDoubleVar(new Double(5));
+    deltas[6].setDoubleVar(new Double(5));
+    deltas[7].setDoubleVar(new Double(5));
+
+    deltas[4].resetDeltaStatus();
+    deltas[4].setStr("str changed");
+    deltas[5].setStr("str changed");
+    deltas[6].setStr("str changed");
+    //deltas[7].setStr("str changed");
+
+    deltas[5].resetDeltaStatus();
+    deltas[5].setIntVar(100);
+    deltas[5].setTestObj(new PartitionedRegionLocalMaxMemoryDUnitTest.TestObject1("CHANGED", 100));
+    deltas[6].setTestObj(new PartitionedRegionLocalMaxMemoryDUnitTest.TestObject1("CHANGED", 100));
+    deltas[7].setTestObj(new PartitionedRegionLocalMaxMemoryDUnitTest.TestObject1("CHANGED", 100));
+
+    deltas[6].resetDeltaStatus();
+    deltas[6].setByteArr(new byte[] { 1, 2, 3 });
+    deltas[7].setByteArr(new byte[] { 1, 2, 3 });
+
+    deltas[7].resetDeltaStatus();
+    deltas[7].setStr("delta string");
+  }
+
+  @Override
+  public final void preSetUp() throws Exception {
+    setUpDeltas();
+  }
+
   @Override
   public final void postSetUp() throws Exception {
     final Host host = Host.getHost(0);
@@ -290,7 +346,7 @@ public class DeltaClientPostAuthorizationDUnitTest extends
     }
   }
 
-  private static Region createSubregion(Region region) {
+  private Region createSubregion(Region region) {
 
     Region subregion = getSubregion();
     if (subregion == null) {
@@ -299,12 +355,12 @@ public class DeltaClientPostAuthorizationDUnitTest extends
     return subregion;
   }
 
-  public static void doOp(Byte opCode, int[] indices, Integer flagsI,
-      Integer expectedResult) {
+  public void doOp(Byte opCode, int[] indices, int flagsI,
+      int expectedResult) {
 
     OperationCode op = OperationCode.fromOrdinal(opCode.byteValue());
     boolean operationOmitted = false;
-    final int flags = flagsI.intValue();
+    final int flags = flagsI;
     Region region = getRegion();
 //    for (int i = 0; i < indices.length; i++) {
 //      region.put(SecurityTestUtil.keys[i],
@@ -359,10 +415,10 @@ public class DeltaClientPostAuthorizationDUnitTest extends
     final String[] keys = SecurityTestUtil.keys;
     final DeltaTestImpl[] vals;
     if ((flags & OpFlags.USE_NEWVAL) > 0) {
-      vals = DeltaClientAuthorizationDUnitTest.deltas;
+      vals = deltas;
     }
     else {
-      vals = DeltaClientAuthorizationDUnitTest.deltas;
+      vals = deltas;
     }
     InterestResultPolicy policy = InterestResultPolicy.KEYS_VALUES;
     if ((flags & OpFlags.REGISTER_POLICY_NONE) > 0) {
@@ -494,7 +550,7 @@ public class DeltaClientPostAuthorizationDUnitTest extends
         else {
           fail("doOp: Unhandled operation " + op);
         }
-        if (expectedResult.intValue() != SecurityTestUtil.NO_EXCEPTION) {
+        if (expectedResult != SecurityTestUtil.NO_EXCEPTION) {
           if (!operationOmitted && !op.isUnregisterInterest()) {
             fail("Expected an exception while performing operation op =" + op +
                 "flags = " + OpFlags.description(flags));
@@ -505,7 +561,7 @@ public class DeltaClientPostAuthorizationDUnitTest extends
         exceptionOccured = true;
         if ((ex instanceof ServerConnectivityException
             || ex instanceof QueryInvocationTargetException || ex instanceof CqException)
-            && (expectedResult.intValue() == SecurityTestUtil.NOTAUTHZ_EXCEPTION)
+            && (expectedResult == SecurityTestUtil.NOTAUTHZ_EXCEPTION)
             && (ex.getCause() instanceof NotAuthorizedException)) {
           LogWriterUtils.getLogWriter().info(
               "doOp: Got expected NotAuthorizedException when doing operation ["
@@ -513,7 +569,7 @@ public class DeltaClientPostAuthorizationDUnitTest extends
                   + ": " + ex.getCause());
           continue;
         }
-        else if (expectedResult.intValue() == SecurityTestUtil.OTHER_EXCEPTION) {
+        else if (expectedResult == SecurityTestUtil.OTHER_EXCEPTION) {
           LogWriterUtils.getLogWriter().info(
               "doOp: Got expected exception when doing operation: "
                   + ex.toString());
@@ -526,7 +582,7 @@ public class DeltaClientPostAuthorizationDUnitTest extends
       }
     }
     if (!exceptionOccured && !operationOmitted
-        && expectedResult.intValue() != SecurityTestUtil.NO_EXCEPTION) {
+        && expectedResult != SecurityTestUtil.NO_EXCEPTION) {
       fail("Expected an exception while performing operation: " + op + 
           " flags = " + OpFlags.description(flags));
     }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/62b19e17/geode-cq/src/test/java/com/gemstone/gemfire/security/ClientCQPostAuthorizationDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-cq/src/test/java/com/gemstone/gemfire/security/ClientCQPostAuthorizationDUnitTest.java b/geode-cq/src/test/java/com/gemstone/gemfire/security/ClientCQPostAuthorizationDUnitTest.java
index 45599bf..fa032ed 100644
--- a/geode-cq/src/test/java/com/gemstone/gemfire/security/ClientCQPostAuthorizationDUnitTest.java
+++ b/geode-cq/src/test/java/com/gemstone/gemfire/security/ClientCQPostAuthorizationDUnitTest.java
@@ -55,15 +55,12 @@ import org.junit.experimental.categories.Category;
 
 /**
  * This is for multiuser-authentication
- * 
- * @author ashetkar
- *
  */
 @Category(DistributedTest.class)
 public class ClientCQPostAuthorizationDUnitTest extends
     ClientAuthorizationTestBase {
 
-  public static final Map<String, String> cqNameToQueryStrings = new HashMap<String, String>();
+  private Map<String, String> cqNameToQueryStrings = new HashMap<String, String>();
 
   @Override
   public final void postSetUp() throws Exception {
@@ -85,8 +82,8 @@ public class ClientCQPostAuthorizationDUnitTest extends
     client2.invoke(() -> SecurityTestUtil.registerExpectedExceptions( clientExpectedExceptions ));
     SecurityTestUtil.registerExpectedExceptions(clientExpectedExceptions);
 
-    cqNameToQueryStrings.put("CQ_0", "SELECT * FROM ");
-    cqNameToQueryStrings.put("CQ_1", "SELECT * FROM ");
+    this.cqNameToQueryStrings.put("CQ_0", "SELECT * FROM ");
+    this.cqNameToQueryStrings.put("CQ_1", "SELECT * FROM ");
   }
 
   @Override
@@ -95,7 +92,7 @@ public class ClientCQPostAuthorizationDUnitTest extends
     client2.invoke(() -> SecurityTestUtil.closeCache());
     server1.invoke(() -> SecurityTestUtil.closeCache());
     server2.invoke(() -> SecurityTestUtil.closeCache());
-    cqNameToQueryStrings.clear();
+    this.cqNameToQueryStrings.clear();
   }
 
   @Test
@@ -154,12 +151,12 @@ public class ClientCQPostAuthorizationDUnitTest extends
       true}, Boolean.TRUE);
   }
 
-  public void doStartUp(Integer numOfUsers, Integer numOfPuts,
+  private void doStartUp(Integer numOfUsers, Integer numOfPuts,
       Boolean[] postAuthzAllowed) throws Exception {
     doStartUp(numOfUsers, numOfPuts, postAuthzAllowed, Boolean.FALSE /* failover */);
   }
 
-  public void doStartUp(Integer numOfUsers, Integer numOfPuts,
+  private void doStartUp(Integer numOfUsers, Integer numOfPuts,
       Boolean[] postAuthzAllowed, Boolean failover) throws Exception {
       AuthzCredentialGenerator gen = this.getXmlAuthzGenerator();
       CredentialGenerator cGen = gen.getCredentialGenerator();
@@ -176,9 +173,11 @@ public class ClientCQPostAuthorizationDUnitTest extends
 
       Properties opCredentials;
       cGen = tgen.getCredentialGenerator();
-      Properties javaProps2 = null;
+      final Properties javaProps2;
       if (cGen != null) {
         javaProps2 = cGen.getJavaProperties();
+      } else {
+        javaProps2 = null;
       }
 
       int[] indices = new int[numOfPuts];
@@ -220,47 +219,44 @@ public class ClientCQPostAuthorizationDUnitTest extends
       server1.invoke(() -> SecurityTestUtil.closeCache());
       server2.invoke(() -> SecurityTestUtil.closeCache());
 
-      server1.invoke(() -> ClientCQPostAuthorizationDUnitTest.createServerCache(serverProps, javaProps, locatorPort, port1));
-      client1.invoke(ClientCQPostAuthorizationDUnitTest.class,
-          "createClientCache", new Object[] {javaProps2, authInit, authProps,
-              new Integer[] {port1, port2}, numOfUsers, postAuthzAllowed});
-      client2.invoke(ClientCQPostAuthorizationDUnitTest.class,
-          "createClientCache", new Object[] {javaProps2, authInit, authProps,
-              new Integer[] {port1, port2}, numOfUsers, postAuthzAllowed});
+      server1.invoke(() -> createServerCache(serverProps, javaProps, locatorPort, port1));
+      client1.invoke(() -> createClientCache(javaProps2, authInit, authProps,
+              new Integer[] {port1, port2}, numOfUsers, postAuthzAllowed));
+      client2.invoke(() -> createClientCache(javaProps2, authInit, authProps,
+              new Integer[] {port1, port2}, numOfUsers, postAuthzAllowed));
 
-      client1.invoke(() -> ClientCQPostAuthorizationDUnitTest.createCQ(numOfUsers));
-      client1.invoke(ClientCQPostAuthorizationDUnitTest.class, "executeCQ",
-          new Object[] {numOfUsers, new Boolean[] {false, false}, numOfPuts,
-              new String[numOfUsers], postAuthzAllowed});
+      client1.invoke(() -> createCQ(numOfUsers));
+      client1.invoke(() -> executeCQ(numOfUsers, new Boolean[] {false, false}, numOfPuts,
+              new String[numOfUsers], postAuthzAllowed));
 
-      client2.invoke(() -> ClientCQPostAuthorizationDUnitTest.doPuts(numOfPuts, Boolean.TRUE/* put last key */));
+      client2.invoke(() -> doPuts(numOfPuts, Boolean.TRUE/* put last key */));
       if (!postAuthzAllowed[0]) {
         // There is no point waiting as no user is authorized to receive cq events.
         try {Thread.sleep(1000);} catch (InterruptedException ie) {}
       } else {
-        client1.invoke(() -> ClientCQPostAuthorizationDUnitTest.waitForLastKey(Integer.valueOf(0)));
+        client1.invoke(() -> waitForLastKey(Integer.valueOf(0)));
         if (postAuthzAllowed[1]) {
-          client1.invoke(() -> ClientCQPostAuthorizationDUnitTest.waitForLastKey(Integer.valueOf(1)));
+          client1.invoke(() -> waitForLastKey(Integer.valueOf(1)));
         }
       }
-      client1.invoke(() -> ClientCQPostAuthorizationDUnitTest.checkCQListeners(numOfUsers, postAuthzAllowed,
+      client1.invoke(() -> checkCQListeners(numOfUsers, postAuthzAllowed,
               numOfPuts + 1/* last key */, 0, !failover));
       if (failover) {
-        server2.invoke(() -> ClientCQPostAuthorizationDUnitTest.createServerCache(serverProps, javaProps, locatorPort, port2));
+        server2.invoke(() -> createServerCache(serverProps, javaProps, locatorPort, port2));
         server1.invoke(() -> SecurityTestUtil.closeCache());
 
         // Allow time for client1 to register its CQs on server2
-        server2.invoke(() -> ClientCQPostAuthorizationDUnitTest.allowCQsToRegister(Integer.valueOf(2)));
+        server2.invoke(() -> allowCQsToRegister(Integer.valueOf(2)));
 
-        client2.invoke(() -> ClientCQPostAuthorizationDUnitTest.doPuts(numOfPuts, Boolean.TRUE/* put last key */));
-        client1.invoke(() -> ClientCQPostAuthorizationDUnitTest.waitForLastKeyUpdate(Integer.valueOf(0)));
-        client1.invoke(() -> ClientCQPostAuthorizationDUnitTest.checkCQListeners(numOfUsers, postAuthzAllowed,
+        client2.invoke(() -> doPuts(numOfPuts, Boolean.TRUE/* put last key */));
+        client1.invoke(() -> waitForLastKeyUpdate(Integer.valueOf(0)));
+        client1.invoke(() -> checkCQListeners(numOfUsers, postAuthzAllowed,
                 numOfPuts + 1/* last key */, numOfPuts + 1/* last key */,
                 Boolean.TRUE));
       }
   }
 
-  public static void createServerCache(Properties serverProps,
+  private void createServerCache(Properties serverProps,
       Properties javaProps, Integer serverPort) {
     Integer locatorPort = Integer.valueOf(AvailablePort
         .getRandomAvailablePort(AvailablePort.SOCKET));
@@ -269,14 +265,14 @@ public class ClientCQPostAuthorizationDUnitTest extends
             SecurityTestUtil.NO_EXCEPTION));
   }
 
-  public static void createServerCache(Properties serverProps,
+  private void createServerCache(Properties serverProps,
         Properties javaProps, Integer locatorPort, Integer serverPort) {
     SecurityTestUtil.createCacheServer((Properties)serverProps, javaProps,
         locatorPort, null, serverPort, Boolean.TRUE, Integer.valueOf(
             SecurityTestUtil.NO_EXCEPTION));
   }
 
-  public static void createClientCache(Properties javaProps, String authInit,
+  private void createClientCache(Properties javaProps, String authInit,
       Properties[] authProps, Integer ports[], Integer numOfUsers,
       Boolean[] postAuthzAllowed) {
     SecurityTestUtil.createCacheClientForMultiUserMode(numOfUsers, authInit,
@@ -284,7 +280,7 @@ public class ClientCQPostAuthorizationDUnitTest extends
         SecurityTestUtil.NO_EXCEPTION);
   }
 
-  public static void createCQ(Integer num) {
+  private void createCQ(Integer num) {
     for (int i = 0; i < num; i++) {
       QueryService cqService = SecurityTestUtil.proxyCaches[i].getQueryService();
       String cqName = "CQ_" + i;
@@ -312,7 +308,7 @@ public class ClientCQPostAuthorizationDUnitTest extends
     }
   }
 
-  public static void executeCQ(Integer num, Boolean[] initialResults,
+  private void executeCQ(Integer num, Boolean[] initialResults,
       Integer expectedResultsSize, String[] expectedErr, Boolean[] postAuthzAllowed) {
     InternalLogWriter logWriter = InternalDistributedSystem.getStaticInternalLogWriter();
     for (int i = 0; i < num; i++) {
@@ -416,7 +412,7 @@ public class ClientCQPostAuthorizationDUnitTest extends
     }
   }
 
-  public static void doPuts(Integer num, Boolean putLastKey) {
+  private void doPuts(Integer num, Boolean putLastKey) {
 //    Region region = GemFireCache.getInstance().getRegion(regionName);
     Region region = SecurityTestUtil.proxyCaches[0].getRegion(regionName);
     for (int i = 0; i < num; i++) {
@@ -427,12 +423,12 @@ public class ClientCQPostAuthorizationDUnitTest extends
     }
   }
 
-  public static void putLastKey() {
+  private void putLastKey() {
     Region region = GemFireCacheImpl.getInstance().getRegion(regionName);
     region.put("LAST_KEY", "LAST_KEY");
   }
 
-  public static void waitForLastKey(Integer cqIndex) {
+  private void waitForLastKey(Integer cqIndex) {
     String cqName = "CQ_" + cqIndex;
     QueryService qService = SecurityTestUtil.proxyCaches[cqIndex].getQueryService();
     ClientCQImpl cqQuery = (ClientCQImpl)qService.getCq(cqName);
@@ -456,7 +452,7 @@ public class ClientCQPostAuthorizationDUnitTest extends
 //    DistributedTestCase.waitForCriterion(wc, 60 * 1000, 100, false);
   }
 
-  public static void waitForLastKeyUpdate(Integer cqIndex) {
+  private void waitForLastKeyUpdate(Integer cqIndex) {
     String cqName = "CQ_" + cqIndex;
     QueryService qService = SecurityTestUtil.proxyCaches[cqIndex].getQueryService();
     ClientCQImpl cqQuery = (ClientCQImpl)qService.getCq(cqName);
@@ -464,7 +460,7 @@ public class ClientCQPostAuthorizationDUnitTest extends
         .waitForUpdated("LAST_KEY");
   }
 
-  public static void allowCQsToRegister(Integer number) {
+  private void allowCQsToRegister(Integer number) {
     final int num = number;
     WaitCriterion wc = new WaitCriterion() {
       public boolean done() {
@@ -486,7 +482,7 @@ public class ClientCQPostAuthorizationDUnitTest extends
     Wait.waitForCriterion(wc, 60 * 1000, 100, false);
   }
 
-  public static void checkCQListeners(Integer numOfUsers,
+  private void checkCQListeners(Integer numOfUsers,
       Boolean[] expectedListenerInvocation, Integer createEventsSize,
       Integer updateEventsSize, Boolean closeCache) {
     for (int i = 0; i < numOfUsers; i++) {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/62b19e17/geode-cq/src/test/java/com/gemstone/gemfire/security/MultiuserDurableCQAuthzDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-cq/src/test/java/com/gemstone/gemfire/security/MultiuserDurableCQAuthzDUnitTest.java b/geode-cq/src/test/java/com/gemstone/gemfire/security/MultiuserDurableCQAuthzDUnitTest.java
index e605765..551400a 100644
--- a/geode-cq/src/test/java/com/gemstone/gemfire/security/MultiuserDurableCQAuthzDUnitTest.java
+++ b/geode-cq/src/test/java/com/gemstone/gemfire/security/MultiuserDurableCQAuthzDUnitTest.java
@@ -51,7 +51,7 @@ import org.junit.experimental.categories.Category;
 public class MultiuserDurableCQAuthzDUnitTest extends
     ClientAuthorizationTestBase {
   
-  public static final Map<String, String> cqNameToQueryStrings = new HashMap<String, String>();
+  private Map<String, String> cqNameToQueryStrings = new HashMap<String, String>();
 
   @Override
   public final void postSetUp() throws Exception {
@@ -159,9 +159,11 @@ public class MultiuserDurableCQAuthzDUnitTest extends
 
     Properties opCredentials;
     cGen = tgen.getCredentialGenerator();
-    Properties javaProps2 = null;
+    final Properties javaProps2;
     if (cGen != null) {
       javaProps2 = cGen.getJavaProperties();
+    } else {
+      javaProps2 = null;
     }
 
     int[] indices = new int[numOfPuts];
@@ -205,20 +207,18 @@ public class MultiuserDurableCQAuthzDUnitTest extends
     server1.invoke(() -> SecurityTestUtil.closeCache());
     server2.invoke(() -> SecurityTestUtil.closeCache());
 
-    server1.invoke(() -> MultiuserDurableCQAuthzDUnitTest.createServerCache(serverProps, javaProps, locatorPort, port1));
-    client1.invoke(MultiuserDurableCQAuthzDUnitTest.class,
-        "createClientCache", new Object[] {javaProps2, authInit, authProps,
-            new Integer[] {port1, port2}, numOfUsers, durableClientId, postAuthzAllowed});
+    server1.invoke(() -> createServerCache(serverProps, javaProps, locatorPort, port1));
+    client1.invoke(() -> createClientCache(javaProps2, authInit, authProps,
+            new Integer[] {port1, port2}, numOfUsers, durableClientId, postAuthzAllowed));
 
 //    client2.invoke(SecurityTestUtil.class, "createCacheClient",
 //        new Object[] {authInit, client2Credentials, javaProps2,
 //            new Integer[] {port1, port2}, null, SecurityTestUtil.NO_EXCEPTION});
 
-    client1.invoke(() -> MultiuserDurableCQAuthzDUnitTest.createCQ(numOfUsers, Boolean.TRUE));
-    client1.invoke(MultiuserDurableCQAuthzDUnitTest.class, "executeCQ",
-        new Object[] {numOfUsers, new Boolean[] {false, false}, numOfPuts,
-            new String[numOfUsers]});
-    client1.invoke(() -> MultiuserDurableCQAuthzDUnitTest.readyForEvents());
+    client1.invoke(() -> createCQ(numOfUsers, Boolean.TRUE));
+    client1.invoke(() -> executeCQ(numOfUsers, new Boolean[] {false, false}, numOfPuts,
+            new String[numOfUsers]));
+    client1.invoke(() -> readyForEvents());
 
     if (keepAlive == null) {
       client1.invoke(() -> SecurityTestUtil.closeCache());
@@ -226,58 +226,54 @@ public class MultiuserDurableCQAuthzDUnitTest extends
       client1.invoke(() -> SecurityTestUtil.closeCache(keepAlive));
     }
 
-    server1.invoke(() -> MultiuserDurableCQAuthzDUnitTest.doPuts(numOfPuts, Boolean.TRUE/* put last key */));
+    server1.invoke(() -> doPuts(numOfPuts, Boolean.TRUE/* put last key */));
 
-    client1.invoke(MultiuserDurableCQAuthzDUnitTest.class,
-        "createClientCache", new Object[] {javaProps2, authInit, authProps,
-            new Integer[] {port1, port2}, numOfUsers, durableClientId, postAuthzAllowed});
-    client1.invoke(() -> MultiuserDurableCQAuthzDUnitTest.createCQ(numOfUsers, Boolean.TRUE));
-    client1.invoke(MultiuserDurableCQAuthzDUnitTest.class, "executeCQ",
-        new Object[] {numOfUsers, new Boolean[] {false, false}, numOfPuts,
-            new String[numOfUsers]});
-    client1.invoke(() -> MultiuserDurableCQAuthzDUnitTest.readyForEvents());
+    client1.invoke(() -> createClientCache(javaProps2, authInit, authProps,
+            new Integer[] {port1, port2}, numOfUsers, durableClientId, postAuthzAllowed));
+    client1.invoke(() -> createCQ(numOfUsers, Boolean.TRUE));
+    client1.invoke(() ->executeCQ(numOfUsers, new Boolean[] {false, false}, numOfPuts,
+            new String[numOfUsers]));
+    client1.invoke(() -> readyForEvents());
 
     if (!postAuthzAllowed[0] || keepAlive == null || !keepAlive) {
       // Don't wait as no user is authorized to receive cq events.
       Thread.sleep(1000);
     } else {
-      client1.invoke(() -> MultiuserDurableCQAuthzDUnitTest.waitForLastKey(Integer.valueOf(0), Boolean.TRUE));
+      client1.invoke(() -> waitForLastKey(Integer.valueOf(0), Boolean.TRUE));
     }
     Integer numOfCreates = (keepAlive == null) ? 0
         : (keepAlive) ? (numOfPuts + 1/* last key */) : 0;
-    client1.invoke(() -> MultiuserDurableCQAuthzDUnitTest.checkCQListeners(numOfUsers, postAuthzAllowed, numOfCreates, 0));
+    client1.invoke(() -> checkCQListeners(numOfUsers, postAuthzAllowed, numOfCreates, 0));
 
-    client1.invoke(MultiuserDurableCQAuthzDUnitTest.class, "proxyCacheClose",
-        new Object[] {new Integer[] {0, 1}, keepAlive});
+    client1.invoke(() -> proxyCacheClose(new Integer[] {0, 1}, keepAlive));
 
     client1.invoke(SecurityTestUtil.class, "createProxyCache",
         new Object[] {new Integer[] {0, 1}, authProps});
 
-    client1.invoke(() -> MultiuserDurableCQAuthzDUnitTest.createCQ(numOfUsers, Boolean.TRUE));
-    client1.invoke(MultiuserDurableCQAuthzDUnitTest.class, "executeCQ",
-        new Object[] {numOfUsers, new Boolean[] {false, false}, numOfPuts,
-            new String[numOfUsers]});
+    client1.invoke(() -> createCQ(numOfUsers, Boolean.TRUE));
+    client1.invoke(() -> executeCQ(numOfUsers, new Boolean[] {false, false}, numOfPuts,
+            new String[numOfUsers]));
 
-    server1.invoke(() -> MultiuserDurableCQAuthzDUnitTest.doPuts(numOfPuts, Boolean.TRUE/* put last key */));
+    server1.invoke(() -> doPuts(numOfPuts, Boolean.TRUE/* put last key */));
 
     if (!postAuthzAllowed[0] || keepAlive == null || !keepAlive) {
       // Don't wait as no user is authorized to receive cq events.
       Thread.sleep(1000);
     } else {
-      client1.invoke(() -> MultiuserDurableCQAuthzDUnitTest.waitForLastKey(Integer.valueOf(0), Boolean.FALSE));
+      client1.invoke(() -> waitForLastKey(Integer.valueOf(0), Boolean.FALSE));
     }
     Integer numOfUpdates = numOfPuts + 1;
-    client1.invoke(() -> MultiuserDurableCQAuthzDUnitTest.checkCQListeners(numOfUsers, postAuthzAllowed, 0, numOfUpdates));
+    client1.invoke(() -> checkCQListeners(numOfUsers, postAuthzAllowed, 0, numOfUpdates));
   }
 
-  public static void createServerCache(Properties serverProps,
+  private void createServerCache(Properties serverProps,
       Properties javaProps, Integer locatorPort, Integer serverPort) {
     SecurityTestUtil.createCacheServer((Properties)serverProps, javaProps,
         locatorPort, null, serverPort, Boolean.TRUE, new Integer(
             SecurityTestUtil.NO_EXCEPTION));
   }
 
-  public static void createClientCache(Properties javaProps,
+  private void createClientCache(Properties javaProps,
       String authInit, Properties[] authProps, Integer ports[],
       Integer numOfUsers, Boolean[] postAuthzAllowed) {
     SecurityTestUtil.createCacheClientForMultiUserMode(numOfUsers, authInit,
@@ -285,11 +281,11 @@ public class MultiuserDurableCQAuthzDUnitTest extends
         SecurityTestUtil.NO_EXCEPTION);
   }
 
-  public static void readyForEvents() {
+  private void readyForEvents() {
     GemFireCacheImpl.getInstance().readyForEvents();
   }
 
-  public static void createClientCache(Properties javaProps,
+  private void createClientCache(Properties javaProps,
       String authInit, Properties[] authProps, Integer ports[],
       Integer numOfUsers, String durableId, Boolean[] postAuthzAllowed) {
     SecurityTestUtil.createCacheClientForMultiUserMode(numOfUsers, authInit,
@@ -297,11 +293,11 @@ public class MultiuserDurableCQAuthzDUnitTest extends
         SecurityTestUtil.NO_EXCEPTION);
   }
 
-  public static void createCQ(Integer num) {
+  private void createCQ(Integer num) {
     createCQ(num, false);
   }
 
-  public static void createCQ(Integer num, Boolean isDurable) {
+  private void createCQ(Integer num, Boolean isDurable) {
     for (int i = 0; i < num; i++) {
       QueryService cqService = SecurityTestUtil.proxyCaches[i].getQueryService();
       String cqName = "CQ_" + i;
@@ -329,7 +325,7 @@ public class MultiuserDurableCQAuthzDUnitTest extends
     }
   }
 
-  public static void executeCQ(Integer num, Boolean[] initialResults,
+  private void executeCQ(Integer num, Boolean[] initialResults,
       Integer expectedResultsSize, String[] expectedErr) {
     InternalLogWriter logWriter = InternalDistributedSystem.getStaticInternalLogWriter();
     for (int i = 0; i < num; i++) {
@@ -411,7 +407,7 @@ public class MultiuserDurableCQAuthzDUnitTest extends
     }
   }
 
-  public static void doPuts(Integer num, Boolean putLastKey) {
+  private void doPuts(Integer num, Boolean putLastKey) {
     Region region = GemFireCacheImpl.getInstance().getRegion(regionName);
     for (int i = 0; i < num; i++) {
       region.put("CQ_key"+i, "CQ_value"+i);
@@ -421,12 +417,12 @@ public class MultiuserDurableCQAuthzDUnitTest extends
     }
   }
 
-  public static void putLastKey() {
+  private void putLastKey() {
     Region region = GemFireCacheImpl.getInstance().getRegion(regionName);
     region.put("LAST_KEY", "LAST_KEY");
   }
 
-  public static void waitForLastKey(Integer cqIndex, Boolean isCreate) {
+  private void waitForLastKey(Integer cqIndex, Boolean isCreate) {
     String cqName = "CQ_" + cqIndex;
     QueryService qService = SecurityTestUtil.proxyCaches[cqIndex].getQueryService();
     ClientCQImpl cqQuery = (ClientCQImpl)qService.getCq(cqName);
@@ -439,7 +435,7 @@ public class MultiuserDurableCQAuthzDUnitTest extends
     }
   }
 
-  public static void checkCQListeners(Integer numOfUsers,
+  private void checkCQListeners(Integer numOfUsers,
       Boolean[] expectedListenerInvocation, Integer createEventsSize,
       Integer updateEventsSize) {
     for (int i = 0; i < numOfUsers; i++) {
@@ -461,11 +457,11 @@ public class MultiuserDurableCQAuthzDUnitTest extends
     }
   }
 
-  public static void proxyCacheClose(Integer[] userIndices) {
+  private void proxyCacheClose(Integer[] userIndices) {
     proxyCacheClose(userIndices, null);
   }
 
-  public static void proxyCacheClose(Integer[] userIndices, Boolean keepAliveFlags) {
+  private void proxyCacheClose(Integer[] userIndices, Boolean keepAliveFlags) {
     if (keepAliveFlags != null) {
       for (int i : userIndices) {
         SecurityTestUtil.proxyCaches[i].close(keepAliveFlags);