geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kl...@apache.org
Subject [40/50] [abbrv] incubator-geode git commit: Fix formatting
Date Tue, 15 Nov 2016 20:49:27 GMT
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e0212110/geode-core/src/test/java/org/apache/geode/management/ManagementTestBase.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/management/ManagementTestBase.java b/geode-core/src/test/java/org/apache/geode/management/ManagementTestBase.java
index 6b86f45..ef1c4fa 100644
--- a/geode-core/src/test/java/org/apache/geode/management/ManagementTestBase.java
+++ b/geode-core/src/test/java/org/apache/geode/management/ManagementTestBase.java
@@ -60,9 +60,9 @@ public abstract class ManagementTestBase extends JUnit4CacheTestCase {
 
   private static final int MAX_WAIT = 70 * 1000;
 
-//  protected static DistributedSystem ds;
+  // protected static DistributedSystem ds;
   protected static ManagementService managementService;
-//  protected static Cache cache;
+  // protected static Cache cache;
 
   /**
    * List containing all the Managed Node VM
@@ -80,7 +80,8 @@ public abstract class ManagementTestBase extends JUnit4CacheTestCase {
   protected static VM locatorVM;
 
   @Rule
-  public DistributedRestoreSystemProperties restoreSystemProperties = new DistributedRestoreSystemProperties();
+  public DistributedRestoreSystemProperties restoreSystemProperties =
+      new DistributedRestoreSystemProperties();
 
   @Override
   public final void postSetUp() throws Exception {
@@ -208,8 +209,10 @@ public abstract class ManagementTestBase extends JUnit4CacheTestCase {
     Wait.waitForCriterion(new WaitCriterion() {
       @Override
       public String description() {
-        return "Waiting for the proxy of " + objectName.getCanonicalName() + " to get propagated to Manager";
+        return "Waiting for the proxy of " + objectName.getCanonicalName()
+            + " to get propagated to Manager";
       }
+
       @Override
       public boolean done() {
         SystemManagementService service = (SystemManagementService) managementService;
@@ -228,12 +231,12 @@ public abstract class ManagementTestBase extends JUnit4CacheTestCase {
   protected void startManagingNode(final VM vm1) {
     vm1.invoke("Start Being Managing Node", () -> {
       Cache existingCache = GemFireCacheImpl.getInstance();
-      //    if (existingCache != null && !existingCache.isClosed()) {
+      // if (existingCache != null && !existingCache.isClosed()) {
       managementService = ManagementService.getManagementService(existingCache);
       SystemManagementService service = (SystemManagementService) managementService;
       service.createManager();
       service.startManager();
-      //    }
+      // }
     });
   }
 
@@ -266,7 +269,8 @@ public abstract class ManagementTestBase extends JUnit4CacheTestCase {
   /**
    * Creates a Distributed region
    */
-  protected void createDistributedRegion(final VM vm, final String regionName) throws InterruptedException {
+  protected void createDistributedRegion(final VM vm, final String regionName)
+      throws InterruptedException {
     AsyncInvocation future = createDistributedRegionAsync(vm, regionName);
     future.join(MAX_WAIT);
     if (future.isAlive()) {
@@ -294,7 +298,8 @@ public abstract class ManagementTestBase extends JUnit4CacheTestCase {
   /**
    * Creates a Sub region
    */
-  protected void createSubRegion(final VM vm, final String parentRegionPath, final String subregionName) throws Exception {
+  protected void createSubRegion(final VM vm, final String parentRegionPath,
+      final String subregionName) throws Exception {
     vm.invoke("Create Sub region", () -> {
       GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
       SystemManagementService service = (SystemManagementService) getManagementService();
@@ -343,10 +348,12 @@ public abstract class ManagementTestBase extends JUnit4CacheTestCase {
       public String description() {
         return "Waiting All members to intimate DistributedSystemMBean";
       }
+
       @Override
       public boolean done() {
         if (bean.listMemberObjectNames() != null) {
-          LogWriterUtils.getLogWriter().info("Member Length " + bean.listMemberObjectNames().length);
+          LogWriterUtils.getLogWriter()
+              .info("Member Length " + bean.listMemberObjectNames().length);
         }
         if (bean.listMemberObjectNames().length >= expectedCount) {
           return true;
@@ -359,7 +366,8 @@ public abstract class ManagementTestBase extends JUnit4CacheTestCase {
     assertNotNull(bean.getManagerObjectName());
   }
 
-  protected static void waitForRefresh(final int expectedRefreshCount, final ObjectName objectName) {
+  protected static void waitForRefresh(final int expectedRefreshCount,
+      final ObjectName objectName) {
     final ManagementService service = getManagementService();
 
     Wait.waitForCriterion(new WaitCriterion() {
@@ -403,7 +411,8 @@ public abstract class ManagementTestBase extends JUnit4CacheTestCase {
   }
 
   protected <T> T getMBeanProxy(final ObjectName objectName, Class<T> interfaceClass) {
-    SystemManagementService service = (SystemManagementService)ManagementService.getManagementService(getCache());
+    SystemManagementService service =
+        (SystemManagementService) ManagementService.getManagementService(getCache());
     return service.getMBeanProxy(objectName, interfaceClass);
   }
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e0212110/geode-core/src/test/java/org/apache/geode/management/ManagementTestRule.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/management/ManagementTestRule.java b/geode-core/src/test/java/org/apache/geode/management/ManagementTestRule.java
index ac60d0c..e97a652 100644
--- a/geode-core/src/test/java/org/apache/geode/management/ManagementTestRule.java
+++ b/geode-core/src/test/java/org/apache/geode/management/ManagementTestRule.java
@@ -1,18 +1,16 @@
 /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one or more contributor license
+ * agreements. See the NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the License. You may obtain a
+ * copy of the License at
  *
- *      http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
  */
 package org.apache.geode.management;
 
@@ -69,8 +67,7 @@ public class ManagementTestRule implements MethodRule, Serializable {
   private VM[] members;
 
   protected ManagementTestRule(final Builder builder) {
-    this.helper = new JUnit4CacheTestCase() {
-    };
+    this.helper = new JUnit4CacheTestCase() {};
     this.managersCount = builder.managersCount;
     this.membersCount = builder.membersCount;
     this.start = builder.start;
@@ -166,10 +163,10 @@ public class ManagementTestRule implements MethodRule, Serializable {
   }
 
   public Cache getCache() {
-//    Cache cache = GemFireCacheImpl.getInstance();
-//    if (cache != null && !cache.isClosed()) {
-//      return cache;
-//    }
+    // Cache cache = GemFireCacheImpl.getInstance();
+    // if (cache != null && !cache.isClosed()) {
+    // return cache;
+    // }
     return this.helper.getCache();
   }
 
@@ -178,18 +175,18 @@ public class ManagementTestRule implements MethodRule, Serializable {
   }
 
   public boolean hasCache() {
-//    Cache cache = GemFireCacheImpl.getInstance();
-//    if (cache != null && !cache.isClosed()) {
-//      return true;
-//    }
+    // Cache cache = GemFireCacheImpl.getInstance();
+    // if (cache != null && !cache.isClosed()) {
+    // return true;
+    // }
     return this.helper.hasCache();
   }
 
   public Cache basicGetCache() {
-//    Cache cache = GemFireCacheImpl.getInstance();
-//    if (cache != null && !cache.isClosed()) {
-//      return cache;
-//    }
+    // Cache cache = GemFireCacheImpl.getInstance();
+    // if (cache != null && !cache.isClosed()) {
+    // return cache;
+    // }
     return this.helper.basicGetCache();
   }
 
@@ -239,7 +236,7 @@ public class ManagementTestRule implements MethodRule, Serializable {
   }
 
   private DM getDistributionManager() {
-    return ((GemFireCacheImpl)getCache()).getDistributionManager();
+    return ((GemFireCacheImpl) getCache()).getDistributionManager();
   }
 
   public void disconnectAllFromDS() {
@@ -249,7 +246,8 @@ public class ManagementTestRule implements MethodRule, Serializable {
     Invoke.invokeInEveryVM("disconnectFromDS", () -> JUnit4DistributedTestCase.disconnectFromDS());
   }
 
-  private void setPropertyIfNotSet(final Properties properties, final String key, final String value) {
+  private void setPropertyIfNotSet(final Properties properties, final String key,
+      final String value) {
     if (!properties.containsKey(key)) {
       properties.setProperty(key, value);
     }
@@ -349,11 +347,13 @@ public class ManagementTestRule implements MethodRule, Serializable {
 
   private void throwIfAlreadyAssigned(final Field field, final boolean alreadyAssigned) {
     if (alreadyAssigned) {
-      throw new IllegalStateException("Field " + field.getName() + " is already annotated with " + field.getAnnotations());
+      throw new IllegalStateException(
+          "Field " + field.getName() + " is already annotated with " + field.getAnnotations());
     }
   }
 
-  private void assignManagerField(final Object target, final Field field) throws IllegalAccessException {
+  private void assignManagerField(final Object target, final Field field)
+      throws IllegalAccessException {
     throwIfNotSameType(field, VM.class);
 
     field.setAccessible(true);
@@ -364,7 +364,8 @@ public class ManagementTestRule implements MethodRule, Serializable {
     }
   }
 
-  private void assignMemberField(final Object target, final Field field) throws IllegalAccessException {
+  private void assignMemberField(final Object target, final Field field)
+      throws IllegalAccessException {
     throwIfNotSameType(field, VM.class);
 
     field.setAccessible(true);
@@ -378,7 +379,8 @@ public class ManagementTestRule implements MethodRule, Serializable {
   private void throwIfNotSameType(final Field field, final Class clazz) {
     if (!field.getType().equals(clazz) && // non-array
         !field.getType().getComponentType().equals(clazz)) { // array
-      throw new IllegalArgumentException("Field " + field.getName() + " is not same type as " + clazz.getName());
+      throw new IllegalArgumentException(
+          "Field " + field.getName() + " is not same type as " + clazz.getName());
     }
   }
 
@@ -396,8 +398,7 @@ public class ManagementTestRule implements MethodRule, Serializable {
 
     private boolean managersFirst = true;
 
-    protected Builder() {
-    }
+    protected Builder() {}
 
     public Builder createManagers(final boolean value) {
       this.createManagers = value;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e0212110/geode-core/src/test/java/org/apache/geode/management/Manager.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/management/Manager.java b/geode-core/src/test/java/org/apache/geode/management/Manager.java
index 0de158e..ce6c6a6 100644
--- a/geode-core/src/test/java/org/apache/geode/management/Manager.java
+++ b/geode-core/src/test/java/org/apache/geode/management/Manager.java
@@ -1,18 +1,16 @@
 /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one or more contributor license
+ * agreements. See the NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the License. You may obtain a
+ * copy of the License at
  *
- *      http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
  */
 package org.apache.geode.management;
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e0212110/geode-core/src/test/java/org/apache/geode/management/Member.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/management/Member.java b/geode-core/src/test/java/org/apache/geode/management/Member.java
index e90d278..84a80e5 100644
--- a/geode-core/src/test/java/org/apache/geode/management/Member.java
+++ b/geode-core/src/test/java/org/apache/geode/management/Member.java
@@ -1,18 +1,16 @@
 /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one or more contributor license
+ * agreements. See the NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the License. You may obtain a
+ * copy of the License at
  *
- *      http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
  */
 package org.apache.geode.management;
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e0212110/geode-core/src/test/java/org/apache/geode/management/OffHeapManagementDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/management/OffHeapManagementDUnitTest.java b/geode-core/src/test/java/org/apache/geode/management/OffHeapManagementDUnitTest.java
index a38dd48..97fdab1 100644
--- a/geode-core/src/test/java/org/apache/geode/management/OffHeapManagementDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/management/OffHeapManagementDUnitTest.java
@@ -61,10 +61,7 @@ public class OffHeapManagementDUnitTest extends JUnit4CacheTestCase {
    * Specified assertion operations.
    */
   private enum ASSERT_OP {
-    EQUAL,
-    GREATER_THAN,
-    GREATER_THAN_OR_EQUAL,
-    LESS_THAN
+    EQUAL, GREATER_THAN, GREATER_THAN_OR_EQUAL, LESS_THAN
   }
 
   /**
@@ -120,8 +117,9 @@ public class OffHeapManagementDUnitTest extends JUnit4CacheTestCase {
   /**
    * A region entry value.
    */
-  private static final byte[] VALUE = "Proin lobortis enim vel sem congue ut condimentum leo rhoncus. In turpis lorem, rhoncus nec rutrum vel, sodales vitae lacus. Etiam nunc ligula, scelerisque id egestas vitae, gravida non enim. Donec ac ligula purus. Mauris gravida ligula sit amet mi ornare blandit. Aliquam at velit ac enim varius malesuada ut eu tortor. Quisque diam nisi, fermentum vel accumsan at, commodo et velit."
-    .getBytes();
+  private static final byte[] VALUE =
+      "Proin lobortis enim vel sem congue ut condimentum leo rhoncus. In turpis lorem, rhoncus nec rutrum vel, sodales vitae lacus. Etiam nunc ligula, scelerisque id egestas vitae, gravida non enim. Donec ac ligula purus. Mauris gravida ligula sit amet mi ornare blandit. Aliquam at velit ac enim varius malesuada ut eu tortor. Quisque diam nisi, fermentum vel accumsan at, commodo et velit."
+          .getBytes();
 
   /**
    * The expected size of the region entry value in off-heap memory.
@@ -131,7 +129,8 @@ public class OffHeapManagementDUnitTest extends JUnit4CacheTestCase {
   /**
    * Listens for off-heap JMX notifications.
    */
-  private static final OffHeapNotificationListener notificationListener = new OffHeapNotificationListener();
+  private static final OffHeapNotificationListener notificationListener =
+      new OffHeapNotificationListener();
 
   /**
    * Local MBeanServer.
@@ -227,7 +226,7 @@ public class OffHeapManagementDUnitTest extends JUnit4CacheTestCase {
       // Make sure our starting off heap stats are correct
       assertOffHeapMetricsOnVm(vm, TOTAL_MEMORY, 0, 0, 0);
 
-      // After allocating large chunk (equal to total memory) 
+      // After allocating large chunk (equal to total memory)
       // we should still have no fragmentation
       int largeChunk = (int) TOTAL_MEMORY - OffHeapStoredObject.HEADER_SIZE;
       doPutOnVm(vm, KEY, new byte[largeChunk], OFF_HEAP_REGION_NAME, false);
@@ -249,7 +248,7 @@ public class OffHeapManagementDUnitTest extends JUnit4CacheTestCase {
       doPutOnVm(vm, KEY + "1", new byte[halfChunk], OFF_HEAP_REGION_NAME, false);
       doDestroyOnVm(vm, KEY + "0", OFF_HEAP_REGION_NAME);
 
-      // Allocate largeChunk to trigger compaction and fragmentation should be zero 
+      // Allocate largeChunk to trigger compaction and fragmentation should be zero
       // as all free memory is available as one fragment
       doPutOnVm(vm, KEY + "1", new byte[largeChunk], OFF_HEAP_REGION_NAME, true);
       assertFragmentationStatOnVm(vm, 0, ASSERT_OP.EQUAL);
@@ -470,7 +469,8 @@ public class OffHeapManagementDUnitTest extends JUnit4CacheTestCase {
    * @param numAllocations the number of previous off-heap allocations
    * @param numDestroys the number of destroys to perform
    */
-  private void doFreeOffHeapMemoryOnVm(final VM vm, final int numAllocations, final int numDestroys) {
+  private void doFreeOffHeapMemoryOnVm(final VM vm, final int numAllocations,
+      final int numDestroys) {
     vm.invoke(new SerializableRunnable() {
       @Override
       public void run() {
@@ -547,7 +547,8 @@ public class OffHeapManagementDUnitTest extends JUnit4CacheTestCase {
    * @param compactionTime total off heap compaction time.
    * @param op an assert operation.
    */
-  private void assertCompactionTimeStatOnVm(final VM vm, final long compactionTime, final ASSERT_OP op) {
+  private void assertCompactionTimeStatOnVm(final VM vm, final long compactionTime,
+      final ASSERT_OP op) {
     vm.invoke(() -> assertCompactionTimeStat(compactionTime, op));
   }
 
@@ -589,7 +590,8 @@ public class OffHeapManagementDUnitTest extends JUnit4CacheTestCase {
    * @param fragmentation a fragmentation percentage
    * @param op an assertion operation
    */
-  private void assertFragmentationStatOnVm(final VM vm, final int fragmentation, final ASSERT_OP op) {
+  private void assertFragmentationStatOnVm(final VM vm, final int fragmentation,
+      final ASSERT_OP op) {
     vm.invoke(() -> assertFragmentationStat(fragmentation, op));
   }
 
@@ -695,11 +697,8 @@ public class OffHeapManagementDUnitTest extends JUnit4CacheTestCase {
    * @param objects number of objects stored in off-heap memory.
    * @param fragmentation the fragmentation percentage.
    */
-  private void assertOffHeapMetricsOnVm(final VM vm,
-                                        final long freeMemory,
-                                        final long allocatedMemory,
-                                        final long objects,
-                                        final int fragmentation) {
+  private void assertOffHeapMetricsOnVm(final VM vm, final long freeMemory,
+      final long allocatedMemory, final long objects, final int fragmentation) {
     vm.invoke(() -> assertOffHeapMetrics(freeMemory, allocatedMemory, objects, fragmentation));
   }
 
@@ -711,7 +710,8 @@ public class OffHeapManagementDUnitTest extends JUnit4CacheTestCase {
    * @param objects number of objects stored in off-heap memory.
    * @param fragmentation the fragmentation percentage.
    */
-  private void assertOffHeapMetrics(final long freeMemory, final long allocatedMemory, final long objects, final int fragmentation) {
+  private void assertOffHeapMetrics(final long freeMemory, final long allocatedMemory,
+      final long objects, final int fragmentation) {
     ManagementService service = ManagementService.getExistingManagementService(getCache());
     assertNotNull(service);
 
@@ -735,7 +735,8 @@ public class OffHeapManagementDUnitTest extends JUnit4CacheTestCase {
    *
    * @return true if successful.
    */
-  private boolean createOffHeapRegionOnVm(final VM vm, final String name, final DataPolicy dataPolicy) {
+  private boolean createOffHeapRegionOnVm(final VM vm, final String name,
+      final DataPolicy dataPolicy) {
     return vm.invoke(() -> null != createOffHeapRegion(name, dataPolicy));
   }
 
@@ -758,7 +759,8 @@ public class OffHeapManagementDUnitTest extends JUnit4CacheTestCase {
    * @param management starts the ManagementService when true.
    * @param props distributed system properties.
    */
-  private void setSystemPropertiesOnVm(final VM vm, final boolean management, final Properties props) {
+  private void setSystemPropertiesOnVm(final VM vm, final boolean management,
+      final Properties props) {
     vm.invoke(() -> setSystemProperties(management, props));
   }
 
@@ -811,11 +813,8 @@ public class OffHeapManagementDUnitTest extends JUnit4CacheTestCase {
    * @param value region entry value.
    * @param regionName a region name.
    */
-  private void doPutOnVm(final VM vm,
-                         final Object key,
-                         final Object value,
-                         final String regionName,
-                         final boolean expectException) {
+  private void doPutOnVm(final VM vm, final Object key, final Object value, final String regionName,
+      final boolean expectException) {
     vm.invoke(() -> doPut(key, value, regionName, expectException));
   }
 
@@ -826,7 +825,8 @@ public class OffHeapManagementDUnitTest extends JUnit4CacheTestCase {
    * @param value region entry value.
    * @param regionName a region name.
    */
-  private void doPut(final Object key, final Object value, final String regionName, final boolean expectException) {
+  private void doPut(final Object key, final Object value, final String regionName,
+      final boolean expectException) {
     Region region = getCache().getRegion(regionName);
     assertNotNull(region);
 
@@ -876,10 +876,8 @@ public class OffHeapManagementDUnitTest extends JUnit4CacheTestCase {
    * @param highThreshold the high threshold trigger.
    * @param lowThreshold the low threshold trigger.
    */
-  private void setupOffHeapMonitorOnVm(final VM vm,
-                                       final String attribute,
-                                       final long highThreshold,
-                                       final long lowThreshold) {
+  private void setupOffHeapMonitorOnVm(final VM vm, final String attribute,
+      final long highThreshold, final long lowThreshold) {
     vm.invoke(() -> setupOffHeapMonitor(attribute, highThreshold, lowThreshold));
   }
 
@@ -890,8 +888,10 @@ public class OffHeapManagementDUnitTest extends JUnit4CacheTestCase {
    * @param highThreshold the high threshold trigger.
    * @param lowThreshold the low threshold trigger.
    */
-  private void setupOffHeapMonitor(final String attribute, final long highThreshold, final long lowThreshold) throws JMException {
-    ObjectName memberMBeanObjectName = MBeanJMXAdapter.getMemberMBeanName(InternalDistributedSystem.getConnectedInstance().getDistributedMember());
+  private void setupOffHeapMonitor(final String attribute, final long highThreshold,
+      final long lowThreshold) throws JMException {
+    ObjectName memberMBeanObjectName = MBeanJMXAdapter.getMemberMBeanName(
+        InternalDistributedSystem.getConnectedInstance().getDistributedMember());
     assertNotNull(memberMBeanObjectName);
 
     ObjectName offHeapMonitorName = new ObjectName("monitors:type=Gauge,attr=" + attribute);
@@ -920,11 +920,10 @@ public class OffHeapManagementDUnitTest extends JUnit4CacheTestCase {
    * @param interval the polling interval to check for notifications.
    * @param throwOnTimeout throws an exception on timeout if true.
    */
-  private void waitForNotificationListenerOnVm(final VM vm,
-                                               final long wait,
-                                               final long interval,
-                                               final boolean throwOnTimeout) {
-    vm.invoke(() -> await("Awaiting Notification Listener").atMost(wait, TimeUnit.MILLISECONDS).until(() -> assertTrue(notificationListener.getNotificationSize() > 0)));
+  private void waitForNotificationListenerOnVm(final VM vm, final long wait, final long interval,
+      final boolean throwOnTimeout) {
+    vm.invoke(() -> await("Awaiting Notification Listener").atMost(wait, TimeUnit.MILLISECONDS)
+        .until(() -> assertTrue(notificationListener.getNotificationSize() > 0)));
   }
 
   /**
@@ -941,7 +940,8 @@ public class OffHeapManagementDUnitTest extends JUnit4CacheTestCase {
    */
   private static class OffHeapNotificationListener implements NotificationListener {
 
-    List<Notification> notificationList = Collections.synchronizedList(new ArrayList<Notification>());
+    List<Notification> notificationList =
+        Collections.synchronizedList(new ArrayList<Notification>());
 
     @Override
     public void handleNotification(final Notification notification, final Object handback) {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e0212110/geode-core/src/test/java/org/apache/geode/management/QueryDataDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/management/QueryDataDUnitTest.java b/geode-core/src/test/java/org/apache/geode/management/QueryDataDUnitTest.java
index e6f6361..6fd7b98 100644
--- a/geode-core/src/test/java/org/apache/geode/management/QueryDataDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/management/QueryDataDUnitTest.java
@@ -75,6 +75,7 @@ import org.apache.geode.test.junit.rules.serializable.SerializableTestName;
 /**
  * Distributed tests for {@link DistributedSystemMXBean#queryData(String, String, int)}.
  * <p>
+ * 
  * <pre>
  * Test Basic Json Strings for Partitioned Regions
  * Test Basic Json Strings for Replicated Regions
@@ -93,7 +94,7 @@ import org.apache.geode.test.junit.rules.serializable.SerializableTestName;
  * </pre>
  */
 @Category(DistributedTest.class)
-@SuppressWarnings({ "serial", "unused" })
+@SuppressWarnings({"serial", "unused"})
 public class QueryDataDUnitTest implements Serializable {
 
   private static final int NUM_OF_BUCKETS = 20;
@@ -115,24 +116,28 @@ public class QueryDataDUnitTest implements Serializable {
   private static final String BIG_COLLECTION_ELEMENT_ = "BIG_COLLECTION_ELEMENT_";
   private static final String BIG_COLLECTION_ = "BIG_COLLECTION_";
 
-  private static final String[] QUERIES = new String[] {
-    "SELECT * FROM /" + PARTITIONED_REGION_NAME1 + " WHERE ID >= 0",
-    "SELECT * FROM /" + PARTITIONED_REGION_NAME1 + " r1, /" + PARTITIONED_REGION_NAME2 + " r2 WHERE r1.ID = r2.ID",
-    "SELECT * FROM /" + PARTITIONED_REGION_NAME1 + " r1, /" + PARTITIONED_REGION_NAME2 + " r2 WHERE r1.ID = r2.ID AND r1.status = r2.status",
-    "SELECT * FROM /" + PARTITIONED_REGION_NAME1 + " r1, /" + PARTITIONED_REGION_NAME2 + " r2, /" + PARTITIONED_REGION_NAME3 + " r3 WHERE r1.ID = r2.ID AND r2.ID = r3.ID",
-    "SELECT * FROM /" + PARTITIONED_REGION_NAME1 + " r1, /" + PARTITIONED_REGION_NAME2 + " r2, /" + PARTITIONED_REGION_NAME3 + " r3, /" + REPLICATE_REGION_NAME1 + " r4 WHERE r1.ID = r2.ID AND r2.ID = r3.ID AND r3.ID = r4.ID",
-    "SELECT * FROM /" + PARTITIONED_REGION_NAME4 + " r4, /" + PARTITIONED_REGION_NAME5 + " r5 WHERE r4.ID = r5.ID"
-  };
-
-  private static final String[] QUERIES_FOR_REPLICATED = new String[] {
-    "<TRACE> SELECT * FROM /" + REPLICATE_REGION_NAME1 + " WHERE ID >= 0",
-    "SELECT * FROM /" + REPLICATE_REGION_NAME1 + " r1, /" + REPLICATE_REGION_NAME2 + " r2 WHERE r1.ID = r2.ID",
-    "SELECT * FROM /" + REPLICATE_REGION_NAME3 + " WHERE ID >= 0"
-  };
-
-  private static final String[] QUERIES_FOR_LIMIT = new String[] {
-    "SELECT * FROM /" + REPLICATE_REGION_NAME4
-  };
+  private static final String[] QUERIES =
+      new String[] {"SELECT * FROM /" + PARTITIONED_REGION_NAME1 + " WHERE ID >= 0",
+          "SELECT * FROM /" + PARTITIONED_REGION_NAME1 + " r1, /" + PARTITIONED_REGION_NAME2
+              + " r2 WHERE r1.ID = r2.ID",
+          "SELECT * FROM /" + PARTITIONED_REGION_NAME1 + " r1, /" + PARTITIONED_REGION_NAME2
+              + " r2 WHERE r1.ID = r2.ID AND r1.status = r2.status",
+          "SELECT * FROM /" + PARTITIONED_REGION_NAME1 + " r1, /" + PARTITIONED_REGION_NAME2
+              + " r2, /" + PARTITIONED_REGION_NAME3 + " r3 WHERE r1.ID = r2.ID AND r2.ID = r3.ID",
+          "SELECT * FROM /" + PARTITIONED_REGION_NAME1 + " r1, /" + PARTITIONED_REGION_NAME2
+              + " r2, /" + PARTITIONED_REGION_NAME3 + " r3, /" + REPLICATE_REGION_NAME1
+              + " r4 WHERE r1.ID = r2.ID AND r2.ID = r3.ID AND r3.ID = r4.ID",
+          "SELECT * FROM /" + PARTITIONED_REGION_NAME4 + " r4, /" + PARTITIONED_REGION_NAME5
+              + " r5 WHERE r4.ID = r5.ID"};
+
+  private static final String[] QUERIES_FOR_REPLICATED =
+      new String[] {"<TRACE> SELECT * FROM /" + REPLICATE_REGION_NAME1 + " WHERE ID >= 0",
+          "SELECT * FROM /" + REPLICATE_REGION_NAME1 + " r1, /" + REPLICATE_REGION_NAME2
+              + " r2 WHERE r1.ID = r2.ID",
+          "SELECT * FROM /" + REPLICATE_REGION_NAME3 + " WHERE ID >= 0"};
+
+  private static final String[] QUERIES_FOR_LIMIT =
+      new String[] {"SELECT * FROM /" + REPLICATE_REGION_NAME4};
 
   private DistributedMember member1;
   private DistributedMember member2;
@@ -145,10 +150,12 @@ public class QueryDataDUnitTest implements Serializable {
   private VM[] memberVMs;
 
   @Rule
-  public DistributedUseJacksonForJsonPathRule useJacksonForJsonPathRule = new DistributedUseJacksonForJsonPathRule();
+  public DistributedUseJacksonForJsonPathRule useJacksonForJsonPathRule =
+      new DistributedUseJacksonForJsonPathRule();
 
   @Rule
-  public ManagementTestRule managementTestRule = ManagementTestRule.builder().managersFirst(false).start(true).build();
+  public ManagementTestRule managementTestRule =
+      ManagementTestRule.builder().managersFirst(false).start(true).build();
 
   @Rule
   public SerializableTestName testName = new SerializableTestName();
@@ -166,7 +173,8 @@ public class QueryDataDUnitTest implements Serializable {
   @Test
   public void testQueryOnPartitionedRegion() throws Exception {
     this.managerVM.invoke(this.testName.getMethodName(), () -> {
-      DistributedSystemMXBean distributedSystemMXBean = this.managementTestRule.getSystemManagementService().getDistributedSystemMXBean();
+      DistributedSystemMXBean distributedSystemMXBean =
+          this.managementTestRule.getSystemManagementService().getDistributedSystemMXBean();
 
       String jsonString = distributedSystemMXBean.queryData(QUERIES[0], null, 10);
       assertThat(jsonString).contains("result").doesNotContain("No Data Found");
@@ -179,11 +187,11 @@ public class QueryDataDUnitTest implements Serializable {
 
         // TODO: better assertions
         // assertThat("QUERIES[" + i + "]", result,
-        //            isJson(withJsonPath("$..member",
-        //                                equalTo(JsonPath.compile(result)))));
-        //                                //equalTo(new JSONObject().put(String.class.getName(), member1.getId())))));
-        //System.out.println(JsonPath.read(jsonString, "$.result.*"));
-        //System.out.println(JsonPath.read(jsonString, "$['result']['member']"));
+        // isJson(withJsonPath("$..member",
+        // equalTo(JsonPath.compile(result)))));
+        // //equalTo(new JSONObject().put(String.class.getName(), member1.getId())))));
+        // System.out.println(JsonPath.read(jsonString, "$.result.*"));
+        // System.out.println(JsonPath.read(jsonString, "$['result']['member']"));
 
         verifyJsonIsValid(jsonString);
       }
@@ -193,7 +201,8 @@ public class QueryDataDUnitTest implements Serializable {
   @Test
   public void testQueryOnReplicatedRegion() throws Exception {
     this.managerVM.invoke(this.testName.getMethodName(), () -> {
-      DistributedSystemMXBean distributedSystemMXBean = this.managementTestRule.getSystemManagementService().getDistributedSystemMXBean();
+      DistributedSystemMXBean distributedSystemMXBean =
+          this.managementTestRule.getSystemManagementService().getDistributedSystemMXBean();
 
       String jsonString = distributedSystemMXBean.queryData(QUERIES_FOR_REPLICATED[0], null, 10);
       assertThat(jsonString).contains("result").doesNotContain("No Data Found");
@@ -208,9 +217,11 @@ public class QueryDataDUnitTest implements Serializable {
   @Test
   public void testMemberWise() throws Exception {
     this.managerVM.invoke(this.testName.getMethodName(), () -> {
-      DistributedSystemMXBean distributedSystemMXBean = this.managementTestRule.getSystemManagementService().getDistributedSystemMXBean();
+      DistributedSystemMXBean distributedSystemMXBean =
+          this.managementTestRule.getSystemManagementService().getDistributedSystemMXBean();
 
-      byte[] bytes = distributedSystemMXBean.queryDataForCompressedResult(QUERIES_FOR_REPLICATED[0], member1.getId() + "," + member2.getId(), 2);
+      byte[] bytes = distributedSystemMXBean.queryDataForCompressedResult(QUERIES_FOR_REPLICATED[0],
+          member1.getId() + "," + member2.getId(), 2);
       String jsonString = BeanUtilFuncs.decompress(bytes);
 
       verifyJsonIsValid(jsonString);
@@ -222,10 +233,12 @@ public class QueryDataDUnitTest implements Serializable {
     this.memberVMs[0].invoke("putBigInstances", () -> putBigInstances(REPLICATE_REGION_NAME4));
 
     this.managerVM.invoke(this.testName.getMethodName(), () -> {
-      DistributedSystemMXBean distributedSystemMXBean = this.managementTestRule.getSystemManagementService().getDistributedSystemMXBean();
+      DistributedSystemMXBean distributedSystemMXBean =
+          this.managementTestRule.getSystemManagementService().getDistributedSystemMXBean();
 
       // Query With Default values
-      assertThat(distributedSystemMXBean.getQueryCollectionsDepth()).isEqualTo(TypedJson.DEFAULT_COLLECTION_ELEMENT_LIMIT);
+      assertThat(distributedSystemMXBean.getQueryCollectionsDepth())
+          .isEqualTo(TypedJson.DEFAULT_COLLECTION_ELEMENT_LIMIT);
       assertThat(distributedSystemMXBean.getQueryResultSetLimit()).isEqualTo(DEFAULT_QUERY_LIMIT);
 
       String jsonString = distributedSystemMXBean.queryData(QUERIES_FOR_LIMIT[0], null, 0);
@@ -252,8 +265,10 @@ public class QueryDataDUnitTest implements Serializable {
       distributedSystemMXBean.setQueryCollectionsDepth(newQueryCollectionDepth);
       distributedSystemMXBean.setQueryResultSetLimit(newQueryResultSetLimit);
 
-      assertThat(distributedSystemMXBean.getQueryCollectionsDepth()).isEqualTo(newQueryCollectionDepth);
-      assertThat(distributedSystemMXBean.getQueryResultSetLimit()).isEqualTo(newQueryResultSetLimit);
+      assertThat(distributedSystemMXBean.getQueryCollectionsDepth())
+          .isEqualTo(newQueryCollectionDepth);
+      assertThat(distributedSystemMXBean.getQueryResultSetLimit())
+          .isEqualTo(newQueryResultSetLimit);
 
       jsonString = distributedSystemMXBean.queryData(QUERIES_FOR_LIMIT[0], null, 0);
 
@@ -278,41 +293,61 @@ public class QueryDataDUnitTest implements Serializable {
   @Test
   public void testErrors() throws Exception {
     this.managerVM.invoke(this.testName.getMethodName(), () -> {
-      DistributedSystemMXBean distributedSystemMXBean = this.managementTestRule.getSystemManagementService().getDistributedSystemMXBean();
+      DistributedSystemMXBean distributedSystemMXBean =
+          this.managementTestRule.getSystemManagementService().getDistributedSystemMXBean();
 
       String invalidQuery = "SELECT * FROM " + PARTITIONED_REGION_NAME1;
       String invalidQueryResult = distributedSystemMXBean.queryData(invalidQuery, null, 2);
-      assertThat(invalidQueryResult, isJson(withJsonPath("$.message", equalTo(QUERY__MSG__INVALID_QUERY.toLocalizedString("Region mentioned in query probably missing /")))));
+      assertThat(invalidQueryResult,
+          isJson(withJsonPath("$.message", equalTo(QUERY__MSG__INVALID_QUERY
+              .toLocalizedString("Region mentioned in query probably missing /")))));
 
       String nonexistentRegionName = this.testName.getMethodName() + "_NONEXISTENT_REGION";
-      String regionsNotFoundQuery = "SELECT * FROM /" + nonexistentRegionName + " r1, PARTITIONED_REGION_NAME2 r2 WHERE r1.ID = r2.ID";
-      String regionsNotFoundResult = distributedSystemMXBean.queryData(regionsNotFoundQuery, null, 2);
-      assertThat(regionsNotFoundResult, isJson(withJsonPath("$.message", equalTo(QUERY__MSG__REGIONS_NOT_FOUND.toLocalizedString("/" + nonexistentRegionName)))));
+      String regionsNotFoundQuery = "SELECT * FROM /" + nonexistentRegionName
+          + " r1, PARTITIONED_REGION_NAME2 r2 WHERE r1.ID = r2.ID";
+      String regionsNotFoundResult =
+          distributedSystemMXBean.queryData(regionsNotFoundQuery, null, 2);
+      assertThat(regionsNotFoundResult, isJson(withJsonPath("$.message",
+          equalTo(QUERY__MSG__REGIONS_NOT_FOUND.toLocalizedString("/" + nonexistentRegionName)))));
 
       String regionName = this.testName.getMethodName() + "_REGION";
       String regionsNotFoundOnMembersQuery = "SELECT * FROM /" + regionName;
 
-      RegionFactory regionFactory = this.managementTestRule.getCache().createRegionFactory(RegionShortcut.REPLICATE);
+      RegionFactory regionFactory =
+          this.managementTestRule.getCache().createRegionFactory(RegionShortcut.REPLICATE);
       regionFactory.create(regionName);
 
-      String regionsNotFoundOnMembersResult = distributedSystemMXBean.queryData(regionsNotFoundOnMembersQuery, member1.getId(), 2);
-      assertThat(regionsNotFoundOnMembersResult, isJson(withJsonPath("$.message", equalTo(QUERY__MSG__REGIONS_NOT_FOUND_ON_MEMBERS.toLocalizedString("/" + regionName)))));
+      String regionsNotFoundOnMembersResult =
+          distributedSystemMXBean.queryData(regionsNotFoundOnMembersQuery, member1.getId(), 2);
+      assertThat(regionsNotFoundOnMembersResult, isJson(withJsonPath("$.message",
+          equalTo(QUERY__MSG__REGIONS_NOT_FOUND_ON_MEMBERS.toLocalizedString("/" + regionName)))));
 
       String joinMissingMembersQuery = QUERIES[1];
-      String joinMissingMembersResult = distributedSystemMXBean.queryData(joinMissingMembersQuery, null, 2);
-      assertThat(joinMissingMembersResult, isJson(withJsonPath("$.message", equalTo(QUERY__MSG__JOIN_OP_EX.toLocalizedString()))));
+      String joinMissingMembersResult =
+          distributedSystemMXBean.queryData(joinMissingMembersQuery, null, 2);
+      assertThat(joinMissingMembersResult,
+          isJson(withJsonPath("$.message", equalTo(QUERY__MSG__JOIN_OP_EX.toLocalizedString()))));
     });
   }
 
   @Test
   public void testNormalRegions() throws Exception {
     this.managerVM.invoke(this.testName.getMethodName(), () -> {
-      DistributedSystemMXBean distributedSystemMXBean = this.managementTestRule.getSystemManagementService().getDistributedSystemMXBean();
+      DistributedSystemMXBean distributedSystemMXBean =
+          this.managementTestRule.getSystemManagementService().getDistributedSystemMXBean();
 
       String normalRegionName1 = this.testName.getMethodName() + "_NORMAL_REGION_1";
       String tempRegionName1 = this.testName.getMethodName() + "_TEMP_REGION_1";
 
-      String normalRegionName2 = this.testName.getMethodName() + "_NORMAL_REGION_2"; // to Reverse order of regions while getting Random region in QueryDataFunction [?]
+      String normalRegionName2 = this.testName.getMethodName() + "_NORMAL_REGION_2"; // to Reverse
+                                                                                     // order of
+                                                                                     // regions
+                                                                                     // while
+                                                                                     // getting
+                                                                                     // Random
+                                                                                     // region in
+                                                                                     // QueryDataFunction
+                                                                                     // [?]
       String tempRegionName2 = this.testName.getMethodName() + "_TEMP_REGION_2";
 
       Cache cache = this.managementTestRule.getCache();
@@ -328,8 +363,10 @@ public class QueryDataDUnitTest implements Serializable {
       regionFactory1.create(tempRegionName1);
       regionFactory1.create(tempRegionName2);
 
-      String query1 = "SELECT * FROM /" + tempRegionName1 + " r1, /" + normalRegionName1 + " r2 WHERE r1.ID = r2.ID";
-      String query2 = "SELECT * FROM /" + normalRegionName2 + " r1, /" + tempRegionName2 + " r2 WHERE r1.ID = r2.ID";
+      String query1 = "SELECT * FROM /" + tempRegionName1 + " r1, /" + normalRegionName1
+          + " r2 WHERE r1.ID = r2.ID";
+      String query2 = "SELECT * FROM /" + normalRegionName2 + " r1, /" + tempRegionName2
+          + " r2 WHERE r1.ID = r2.ID";
       String query3 = "SELECT * FROM /" + normalRegionName2;
 
       distributedSystemMXBean.queryDataForCompressedResult(query1, null, 2);
@@ -344,8 +381,8 @@ public class QueryDataDUnitTest implements Serializable {
   public void testRegionsLocalDataSet() throws Exception {
     String partitionedRegionName = this.testName.getMethodName() + "_PARTITIONED_REGION";
 
-    String[] values1 = new String[] { "val1", "val2", "val3" };
-    String[] values2 = new String[] { "val4", "val5", "val6" };
+    String[] values1 = new String[] {"val1", "val2", "val3"};
+    String[] values2 = new String[] {"val4", "val5", "val6"};
 
     this.memberVMs[0].invoke(this.testName.getMethodName() + " Create Region", () -> {
       PartitionAttributesFactory partitionAttributesFactory = new PartitionAttributesFactory();
@@ -357,7 +394,9 @@ public class QueryDataDUnitTest implements Serializable {
       }
       partitionAttributesFactory.setPartitionResolver(new SingleHopQuarterPartitionResolver());
 
-      RegionFactory regionFactory = this.managementTestRule.getCache().createRegionFactory(RegionShortcut.PARTITION).setPartitionAttributes(partitionAttributesFactory.create());
+      RegionFactory regionFactory =
+          this.managementTestRule.getCache().createRegionFactory(RegionShortcut.PARTITION)
+              .setPartitionAttributes(partitionAttributesFactory.create());
       Region region = regionFactory.create(partitionedRegionName);
 
       for (int i = 0; i < values1.length; i++) {
@@ -375,7 +414,9 @@ public class QueryDataDUnitTest implements Serializable {
       }
       partitionAttributesFactory.setPartitionResolver(new SingleHopQuarterPartitionResolver());
 
-      RegionFactory regionFactory = this.managementTestRule.getCache().createRegionFactory(RegionShortcut.PARTITION).setPartitionAttributes(partitionAttributesFactory.create());
+      RegionFactory regionFactory =
+          this.managementTestRule.getCache().createRegionFactory(RegionShortcut.PARTITION)
+              .setPartitionAttributes(partitionAttributesFactory.create());
       Region region = regionFactory.create(partitionedRegionName);
 
       for (int i = 0; i < values2.length; i++) {
@@ -393,21 +434,29 @@ public class QueryDataDUnitTest implements Serializable {
       }
       partitionAttributesFactory.setPartitionResolver(new SingleHopQuarterPartitionResolver());
 
-      RegionFactory regionFactory = this.managementTestRule.getCache().createRegionFactory(RegionShortcut.PARTITION).setPartitionAttributes(partitionAttributesFactory.create());
+      RegionFactory regionFactory =
+          this.managementTestRule.getCache().createRegionFactory(RegionShortcut.PARTITION)
+              .setPartitionAttributes(partitionAttributesFactory.create());
       regionFactory.create(partitionedRegionName);
     });
 
-    final List<String> member1RealData = this.memberVMs[0].invoke(() -> getLocalDataSet(partitionedRegionName));
-    final List<String> member2RealData = this.memberVMs[1].invoke(() -> getLocalDataSet(partitionedRegionName));
-    final List<String> member3RealData = this.memberVMs[2].invoke(() -> getLocalDataSet(partitionedRegionName));
+    final List<String> member1RealData =
+        this.memberVMs[0].invoke(() -> getLocalDataSet(partitionedRegionName));
+    final List<String> member2RealData =
+        this.memberVMs[1].invoke(() -> getLocalDataSet(partitionedRegionName));
+    final List<String> member3RealData =
+        this.memberVMs[2].invoke(() -> getLocalDataSet(partitionedRegionName));
 
     this.managerVM.invoke(this.testName.getMethodName(), () -> {
-      DistributedSystemMXBean distributedSystemMXBean = this.managementTestRule.getSystemManagementService().getDistributedSystemMXBean();
-      DistributedRegionMXBean distributedRegionMXBean = awaitDistributedRegionMXBean("/" + partitionedRegionName, 3);
+      DistributedSystemMXBean distributedSystemMXBean =
+          this.managementTestRule.getSystemManagementService().getDistributedSystemMXBean();
+      DistributedRegionMXBean distributedRegionMXBean =
+          awaitDistributedRegionMXBean("/" + partitionedRegionName, 3);
 
       String alias = "Waiting for all entries to get reflected at managing node";
       int expectedEntryCount = values1.length + values2.length;
-      await(alias).until(() -> assertThat(distributedRegionMXBean.getSystemRegionEntryCount()).isEqualTo(expectedEntryCount));
+      await(alias).until(() -> assertThat(distributedRegionMXBean.getSystemRegionEntryCount())
+          .isEqualTo(expectedEntryCount));
 
       String query = "Select * from /" + partitionedRegionName;
 
@@ -444,7 +493,8 @@ public class QueryDataDUnitTest implements Serializable {
     assertThat(new JSONObject(jsonString)).isNotNull();
   }
 
-  private void putDataInRegion(final String regionName, final Object[] portfolio, final int from, final int to) {
+  private void putDataInRegion(final String regionName, final Object[] portfolio, final int from,
+      final int to) {
     Region region = this.managementTestRule.getCache().getRegion(regionName);
     for (int i = from; i < to; i++) {
       region.put(new Integer(i), portfolio[i]);
@@ -459,18 +509,26 @@ public class QueryDataDUnitTest implements Serializable {
     final Portfolio[] portfolio = createPortfoliosAndPositions(COUNT_DESTINATION);
 
     // Fill local region
-    this.memberVMs[0].invoke(() -> putDataInRegion(LOCAL_REGION_NAME, portfolio, COUNT_FROM, COUNT_DESTINATION));
+    this.memberVMs[0]
+        .invoke(() -> putDataInRegion(LOCAL_REGION_NAME, portfolio, COUNT_FROM, COUNT_DESTINATION));
 
     // Fill replicated region
-    this.memberVMs[0].invoke(() -> putDataInRegion(REPLICATE_REGION_NAME1, portfolio, COUNT_FROM, COUNT_DESTINATION));
-    this.memberVMs[1].invoke(() -> putDataInRegion(REPLICATE_REGION_NAME2, portfolio, COUNT_FROM, COUNT_DESTINATION));
+    this.memberVMs[0].invoke(
+        () -> putDataInRegion(REPLICATE_REGION_NAME1, portfolio, COUNT_FROM, COUNT_DESTINATION));
+    this.memberVMs[1].invoke(
+        () -> putDataInRegion(REPLICATE_REGION_NAME2, portfolio, COUNT_FROM, COUNT_DESTINATION));
 
     // Fill Partition Region
-    this.memberVMs[0].invoke(() -> putDataInRegion(PARTITIONED_REGION_NAME1, portfolio, COUNT_FROM, COUNT_DESTINATION));
-    this.memberVMs[0].invoke(() -> putDataInRegion(PARTITIONED_REGION_NAME2, portfolio, COUNT_FROM, COUNT_DESTINATION));
-    this.memberVMs[0].invoke(() -> putDataInRegion(PARTITIONED_REGION_NAME3, portfolio, COUNT_FROM, COUNT_DESTINATION));
-    this.memberVMs[0].invoke(() -> putDataInRegion(PARTITIONED_REGION_NAME4, portfolio, COUNT_FROM, COUNT_DESTINATION));
-    this.memberVMs[0].invoke(() -> putDataInRegion(PARTITIONED_REGION_NAME5, portfolio, COUNT_FROM, COUNT_DESTINATION));
+    this.memberVMs[0].invoke(
+        () -> putDataInRegion(PARTITIONED_REGION_NAME1, portfolio, COUNT_FROM, COUNT_DESTINATION));
+    this.memberVMs[0].invoke(
+        () -> putDataInRegion(PARTITIONED_REGION_NAME2, portfolio, COUNT_FROM, COUNT_DESTINATION));
+    this.memberVMs[0].invoke(
+        () -> putDataInRegion(PARTITIONED_REGION_NAME3, portfolio, COUNT_FROM, COUNT_DESTINATION));
+    this.memberVMs[0].invoke(
+        () -> putDataInRegion(PARTITIONED_REGION_NAME4, portfolio, COUNT_FROM, COUNT_DESTINATION));
+    this.memberVMs[0].invoke(
+        () -> putDataInRegion(PARTITIONED_REGION_NAME5, portfolio, COUNT_FROM, COUNT_DESTINATION));
 
     this.memberVMs[0].invoke(() -> putPdxInstances(REPLICATE_REGION_NAME3));
   }
@@ -520,27 +578,49 @@ public class QueryDataDUnitTest implements Serializable {
   }
 
   private void createLocalRegion() {
-    this.managementTestRule.getCache().createRegionFactory(RegionShortcut.LOCAL).create(LOCAL_REGION_NAME);
+    this.managementTestRule.getCache().createRegionFactory(RegionShortcut.LOCAL)
+        .create(LOCAL_REGION_NAME);
   }
 
   private void createReplicatedRegion() {
-    this.managementTestRule.getCache().createRegionFactory(RegionShortcut.REPLICATE).create(REPLICATE_REGION_NAME1);
+    this.managementTestRule.getCache().createRegionFactory(RegionShortcut.REPLICATE)
+        .create(REPLICATE_REGION_NAME1);
   }
 
   private void createColocatedPR() {
     PartitionResolver testKeyBasedResolver = new TestPartitionResolver();
-    this.managementTestRule.getCache().createRegionFactory(RegionShortcut.PARTITION).setPartitionAttributes(new PartitionAttributesFactory().setTotalNumBuckets(NUM_OF_BUCKETS).setPartitionResolver(testKeyBasedResolver).create()).create(PARTITIONED_REGION_NAME1);
-    this.managementTestRule.getCache().createRegionFactory(RegionShortcut.PARTITION).setPartitionAttributes(new PartitionAttributesFactory().setTotalNumBuckets(NUM_OF_BUCKETS).setPartitionResolver(testKeyBasedResolver).setColocatedWith(PARTITIONED_REGION_NAME1).create()).create(PARTITIONED_REGION_NAME2);
-    this.managementTestRule.getCache().createRegionFactory(RegionShortcut.PARTITION).setPartitionAttributes(new PartitionAttributesFactory().setTotalNumBuckets(NUM_OF_BUCKETS).setPartitionResolver(testKeyBasedResolver).setColocatedWith(PARTITIONED_REGION_NAME2).create()).create(PARTITIONED_REGION_NAME3);
-    this.managementTestRule.getCache().createRegionFactory(RegionShortcut.PARTITION).setPartitionAttributes(new PartitionAttributesFactory().setTotalNumBuckets(NUM_OF_BUCKETS).setPartitionResolver(testKeyBasedResolver).create()).create(PARTITIONED_REGION_NAME4); // not collocated
-    this.managementTestRule.getCache().createRegionFactory(RegionShortcut.PARTITION).setPartitionAttributes(new PartitionAttributesFactory().setTotalNumBuckets(NUM_OF_BUCKETS).setPartitionResolver(testKeyBasedResolver).setColocatedWith(PARTITIONED_REGION_NAME4).create()).create(PARTITIONED_REGION_NAME5); // collocated with 4
+    this.managementTestRule.getCache().createRegionFactory(RegionShortcut.PARTITION)
+        .setPartitionAttributes(new PartitionAttributesFactory().setTotalNumBuckets(NUM_OF_BUCKETS)
+            .setPartitionResolver(testKeyBasedResolver).create())
+        .create(PARTITIONED_REGION_NAME1);
+    this.managementTestRule.getCache().createRegionFactory(RegionShortcut.PARTITION)
+        .setPartitionAttributes(new PartitionAttributesFactory().setTotalNumBuckets(NUM_OF_BUCKETS)
+            .setPartitionResolver(testKeyBasedResolver).setColocatedWith(PARTITIONED_REGION_NAME1)
+            .create())
+        .create(PARTITIONED_REGION_NAME2);
+    this.managementTestRule.getCache().createRegionFactory(RegionShortcut.PARTITION)
+        .setPartitionAttributes(new PartitionAttributesFactory().setTotalNumBuckets(NUM_OF_BUCKETS)
+            .setPartitionResolver(testKeyBasedResolver).setColocatedWith(PARTITIONED_REGION_NAME2)
+            .create())
+        .create(PARTITIONED_REGION_NAME3);
+    this.managementTestRule.getCache().createRegionFactory(RegionShortcut.PARTITION)
+        .setPartitionAttributes(new PartitionAttributesFactory().setTotalNumBuckets(NUM_OF_BUCKETS)
+            .setPartitionResolver(testKeyBasedResolver).create())
+        .create(PARTITIONED_REGION_NAME4); // not collocated
+    this.managementTestRule.getCache().createRegionFactory(RegionShortcut.PARTITION)
+        .setPartitionAttributes(new PartitionAttributesFactory().setTotalNumBuckets(NUM_OF_BUCKETS)
+            .setPartitionResolver(testKeyBasedResolver).setColocatedWith(PARTITIONED_REGION_NAME4)
+            .create())
+        .create(PARTITIONED_REGION_NAME5); // collocated with 4
   }
 
   private void createDistributedRegion(final String regionName) {
-    this.managementTestRule.getCache().createRegionFactory(RegionShortcut.REPLICATE).create(regionName);
+    this.managementTestRule.getCache().createRegionFactory(RegionShortcut.REPLICATE)
+        .create(regionName);
   }
 
-  private void createRegionsInNodes() throws InterruptedException, TimeoutException, ExecutionException {
+  private void createRegionsInNodes()
+      throws InterruptedException, TimeoutException, ExecutionException {
     // Create local Region on servers
     this.memberVMs[0].invoke(() -> createLocalRegion());
 
@@ -572,8 +652,10 @@ public class QueryDataDUnitTest implements Serializable {
   }
 
   private List<String> getLocalDataSet(final String region) {
-    PartitionedRegion partitionedRegion = PartitionedRegionHelper.getPartitionedRegion(region, this.managementTestRule.getCache());
-    Set<BucketRegion> localPrimaryBucketRegions = partitionedRegion.getDataStore().getAllLocalPrimaryBucketRegions();
+    PartitionedRegion partitionedRegion =
+        PartitionedRegionHelper.getPartitionedRegion(region, this.managementTestRule.getCache());
+    Set<BucketRegion> localPrimaryBucketRegions =
+        partitionedRegion.getDataStore().getAllLocalPrimaryBucketRegions();
 
     List<String> allPrimaryValues = new ArrayList<>();
 
@@ -611,7 +693,8 @@ public class QueryDataDUnitTest implements Serializable {
     ObjectName objectName = service.getMemberMBeanName(member);
     String alias = "awaiting MemberMXBean proxy for " + member;
 
-    await(alias).until(() -> assertThat(service.getMBeanProxy(objectName, MemberMXBean.class)).isNotNull());
+    await(alias)
+        .until(() -> assertThat(service.getMBeanProxy(objectName, MemberMXBean.class)).isNotNull());
 
     return service.getMBeanProxy(objectName, MemberMXBean.class);
   }
@@ -632,11 +715,13 @@ public class QueryDataDUnitTest implements Serializable {
     return service.getDistributedRegionMXBean(name);
   }
 
-  private DistributedRegionMXBean awaitDistributedRegionMXBean(final String name, final int memberCount) {
+  private DistributedRegionMXBean awaitDistributedRegionMXBean(final String name,
+      final int memberCount) {
     SystemManagementService service = this.managementTestRule.getSystemManagementService();
 
     await().until(() -> assertThat(service.getDistributedRegionMXBean(name)).isNotNull());
-    await().until(() -> assertThat(service.getDistributedRegionMXBean(name).getMemberCount()).isEqualTo(memberCount));
+    await().until(() -> assertThat(service.getDistributedRegionMXBean(name).getMemberCount())
+        .isEqualTo(memberCount));
 
     return service.getDistributedRegionMXBean(name);
   }
@@ -652,12 +737,11 @@ public class QueryDataDUnitTest implements Serializable {
   private static class TestPartitionResolver implements PartitionResolver {
 
     @Override
-    public void close() {
-    }
+    public void close() {}
 
     @Override
     public Serializable getRoutingObject(EntryOperation opDetails) {
-      return (((Integer)opDetails.getKey()).intValue() % NUM_OF_BUCKETS);
+      return (((Integer) opDetails.getKey()).intValue() % NUM_OF_BUCKETS);
     }
 
     @Override


Mime
View raw message