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 2017/01/13 00:35:16 UTC

geode git commit: fixup

Repository: geode
Updated Branches:
  refs/heads/feature/GEODE-1930-2 0373d1a0a -> 3a89e06a2


fixup


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

Branch: refs/heads/feature/GEODE-1930-2
Commit: 3a89e06a22587bcc866caa17d2447027a87cd3a7
Parents: 0373d1a
Author: Kirk Lund <kl...@apache.org>
Authored: Thu Jan 12 16:35:03 2017 -0800
Committer: Kirk Lund <kl...@apache.org>
Committed: Thu Jan 12 16:35:03 2017 -0800

----------------------------------------------------------------------
 .../java/org/apache/geode/test/dunit/Wait.java  |  2 -
 .../dunit/rules/DistributedDisconnectRule.java  |  4 +-
 .../DistributedRestoreSystemProperties.java     |  4 +-
 .../geode/test/dunit/rules/DistributedRule.java | 66 --------------------
 .../DistributedUseJacksonForJsonPathRule.java   |  4 +-
 .../geode/test/dunit/rules/RemoteInvoker.java   |  8 ++-
 6 files changed, 13 insertions(+), 75 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/geode/blob/3a89e06a/geode-core/src/test/java/org/apache/geode/test/dunit/Wait.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/test/dunit/Wait.java b/geode-core/src/test/java/org/apache/geode/test/dunit/Wait.java
index 7d4e6d5..f25810e 100755
--- a/geode-core/src/test/java/org/apache/geode/test/dunit/Wait.java
+++ b/geode-core/src/test/java/org/apache/geode/test/dunit/Wait.java
@@ -17,8 +17,6 @@ package org.apache.geode.test.dunit;
 import static org.apache.geode.test.dunit.Jitter.*;
 import static org.junit.Assert.*;
 
-import java.io.Serializable;
-
 import org.apache.logging.log4j.Logger;
 
 import org.apache.geode.internal.cache.LocalRegion;

http://git-wip-us.apache.org/repos/asf/geode/blob/3a89e06a/geode-core/src/test/java/org/apache/geode/test/dunit/rules/DistributedDisconnectRule.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/test/dunit/rules/DistributedDisconnectRule.java b/geode-core/src/test/java/org/apache/geode/test/dunit/rules/DistributedDisconnectRule.java
index 9107d4d..8984884 100755
--- a/geode-core/src/test/java/org/apache/geode/test/dunit/rules/DistributedDisconnectRule.java
+++ b/geode-core/src/test/java/org/apache/geode/test/dunit/rules/DistributedDisconnectRule.java
@@ -43,14 +43,14 @@ public class DistributedDisconnectRule extends DistributedExternalResource {
   @Override
   protected void before() throws Throwable {
     if (this.disconnectBefore) {
-      invoker().invokeInEveryVMAndController(serializableRunnable());
+      invoker().invokeInEveryVM(serializableRunnable());
     }
   }
 
   @Override
   protected void after() {
     if (this.disconnectAfter) {
-      invoker().invokeInEveryVMAndController(serializableRunnable());
+      invoker().invokeInEveryVM(serializableRunnable());
     }
   }
 

http://git-wip-us.apache.org/repos/asf/geode/blob/3a89e06a/geode-core/src/test/java/org/apache/geode/test/dunit/rules/DistributedRestoreSystemProperties.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/test/dunit/rules/DistributedRestoreSystemProperties.java b/geode-core/src/test/java/org/apache/geode/test/dunit/rules/DistributedRestoreSystemProperties.java
index 21c2f45..7e6198e 100755
--- a/geode-core/src/test/java/org/apache/geode/test/dunit/rules/DistributedRestoreSystemProperties.java
+++ b/geode-core/src/test/java/org/apache/geode/test/dunit/rules/DistributedRestoreSystemProperties.java
@@ -46,7 +46,7 @@ public class DistributedRestoreSystemProperties extends RestoreSystemProperties
   @Override
   public void before() throws Throwable {
     super.before();
-    this.invoker.invokeInEveryVMAndController(new SerializableRunnable() {
+    this.invoker.invokeInEveryVM(new SerializableRunnable() {
       @Override
       public void run() {
         originalProperties = getProperties();
@@ -58,7 +58,7 @@ public class DistributedRestoreSystemProperties extends RestoreSystemProperties
   @Override
   public void after() {
     super.after();
-    this.invoker.invokeInEveryVMAndController(new SerializableRunnable() {
+    this.invoker.invokeInEveryVM(new SerializableRunnable() {
       @Override
       public void run() {
         setProperties(originalProperties);

http://git-wip-us.apache.org/repos/asf/geode/blob/3a89e06a/geode-core/src/test/java/org/apache/geode/test/dunit/rules/DistributedRule.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/test/dunit/rules/DistributedRule.java b/geode-core/src/test/java/org/apache/geode/test/dunit/rules/DistributedRule.java
deleted file mode 100644
index 8e89bdb..0000000
--- a/geode-core/src/test/java/org/apache/geode/test/dunit/rules/DistributedRule.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * 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
- *
- * 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.test.dunit.rules;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-import org.junit.Rule;
-
-/**
- * Annotates a field or method as a type of {@link Rule} that can be invoked across multiple VMs in
- * a {@code DistributedTest}.
- *
- * If there are multiple annotated {@code DistributedRule}s on a class, they will be applied in
- * order of fields first, then methods. Furthermore, if there are multiple fields (or methods) they
- * will be applied in an order that depends on your JVM's implementation of the reflection API,
- * which is undefined. Rules defined by fields will always be applied before Rules defined by
- * methods. You can use a {@link org.junit.rules.RuleChain} or
- * {@link org.apache.geode.test.junit.rules.RuleList} if you want to have control over the order in
- * which the Rules are applied.
- *
- * <p>
- * For example, here is a test class that makes a unique {@link org.junit.rules.TemporaryFolder}
- * available to each DUnit VM:
- * 
- * <pre>
- * {@literal @}Category(DistributedTest.class)
- * public class EachVMHasItsOwnTemporaryFolder {
- *
- *   {@literal @}DistributedRule
- *   public TemporaryFolder folder = new TemporaryFolder();
- *
- *   {@literal @}Rule
- *   public DistributedTestRule distributedTestRule = DistributedTestRule.builder().build();
- *
- *   {@literal @}Test
- *   public void eachVMHasItsOwnTemporaryFolder() throws Exception {
- *     Host.getHost(0).getVM(0).invoke(() -> {
- *       File gemfireProps = folder.newFile({@literal "}gemfire.properties{@literal "});
- *       File diskDirs = folder.newFolder({@literal "}diskDirs{@literal "});
- *       ...
- *     }
- *   }
- * }
- * </pre>
- *
- * @see org.apache.geode.test.junit.rules.serializable.SerializableTestRule
- */
-@Retention(RetentionPolicy.RUNTIME)
-@Target({ElementType.FIELD, ElementType.METHOD})
-public @interface DistributedRule {
-}

http://git-wip-us.apache.org/repos/asf/geode/blob/3a89e06a/geode-core/src/test/java/org/apache/geode/test/dunit/rules/DistributedUseJacksonForJsonPathRule.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/test/dunit/rules/DistributedUseJacksonForJsonPathRule.java b/geode-core/src/test/java/org/apache/geode/test/dunit/rules/DistributedUseJacksonForJsonPathRule.java
index 8c85775..6b646af 100644
--- a/geode-core/src/test/java/org/apache/geode/test/dunit/rules/DistributedUseJacksonForJsonPathRule.java
+++ b/geode-core/src/test/java/org/apache/geode/test/dunit/rules/DistributedUseJacksonForJsonPathRule.java
@@ -32,12 +32,12 @@ public class DistributedUseJacksonForJsonPathRule extends UseJacksonForJsonPathR
 
   @Override
   public void before() {
-    this.invoker.invokeInEveryVMAndController(DistributedUseJacksonForJsonPathRule::invokeBefore);
+    this.invoker.invokeInEveryVM(DistributedUseJacksonForJsonPathRule::invokeBefore);
   }
 
   @Override
   public void after() {
-    this.invoker.invokeInEveryVMAndController(DistributedUseJacksonForJsonPathRule::invokeAfter);
+    this.invoker.invokeInEveryVM(DistributedUseJacksonForJsonPathRule::invokeAfter);
   }
 
   private static void invokeBefore() {

http://git-wip-us.apache.org/repos/asf/geode/blob/3a89e06a/geode-core/src/test/java/org/apache/geode/test/dunit/rules/RemoteInvoker.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/test/dunit/rules/RemoteInvoker.java b/geode-core/src/test/java/org/apache/geode/test/dunit/rules/RemoteInvoker.java
index 866a0d5..e696809 100755
--- a/geode-core/src/test/java/org/apache/geode/test/dunit/rules/RemoteInvoker.java
+++ b/geode-core/src/test/java/org/apache/geode/test/dunit/rules/RemoteInvoker.java
@@ -33,7 +33,10 @@ class RemoteInvoker implements Serializable {
   // dunit VMs
   // locator VM
 
-  public void invokeInEveryVMAndController(final SerializableRunnableIF runnable) {
+  /**
+   * Invokes in these VMs: controller VM and dunit VMs but not the dunit locator VM
+   */
+  public void invokeInEveryVM(final SerializableRunnableIF runnable) {
     try {
       runnable.run();
     } catch (Exception e) {
@@ -42,6 +45,9 @@ class RemoteInvoker implements Serializable {
     Invoke.invokeInEveryVM(runnable);
   }
 
+  /**
+   * Invokes in all VMs: controller VM, dunit VMs, and the dunit locator VM
+   */
   public void invokeInEveryVMAndLocator(final SerializableRunnableIF runnable) {
     Invoke.invokeInEveryVM(runnable);
     invokeInLocator(runnable);