geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From u..@apache.org
Subject [38/69] [abbrv] geode git commit: GEODE-2836: CacheCallback now extends Declarable
Date Mon, 22 May 2017 18:29:34 GMT
GEODE-2836: CacheCallback now extends Declarable


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

Branch: refs/heads/feature/GEODE-2580
Commit: a2ddc61845cf8f47da82dd3c19f5b5a099ddd085
Parents: 3034ef6
Author: Jared Stewart <jstewart@pivotal.io>
Authored: Thu May 11 14:43:48 2017 -0700
Committer: Jared Stewart <jstewart@pivotal.io>
Committed: Tue May 16 16:13:27 2017 -0700

----------------------------------------------------------------------
 .../java/org/apache/geode/cache/CacheCallback.java |  2 +-
 .../java/org/apache/geode/cache/Declarable.java    |  4 ++--
 .../apache/geode/cache30/CacheXml66DUnitTest.java  | 17 +++--------------
 .../apache/geode/cache30/ReconnectDUnitTest.java   |  4 ++++
 4 files changed, 10 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/geode/blob/a2ddc618/geode-core/src/main/java/org/apache/geode/cache/CacheCallback.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/cache/CacheCallback.java b/geode-core/src/main/java/org/apache/geode/cache/CacheCallback.java
index a272afb..fdcdb26 100644
--- a/geode-core/src/main/java/org/apache/geode/cache/CacheCallback.java
+++ b/geode-core/src/main/java/org/apache/geode/cache/CacheCallback.java
@@ -21,7 +21,7 @@ package org.apache.geode.cache;
  *
  * @since GemFire 3.0
  */
-public interface CacheCallback {
+public interface CacheCallback extends Declarable {
   /**
    * Called when the region containing this callback is closed or destroyed, when the cache
is
    * closed, or when a callback is removed from a region using an <code>AttributesMutator</code>.

http://git-wip-us.apache.org/repos/asf/geode/blob/a2ddc618/geode-core/src/main/java/org/apache/geode/cache/Declarable.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/cache/Declarable.java b/geode-core/src/main/java/org/apache/geode/cache/Declarable.java
index 57e1e63..2b54461 100644
--- a/geode-core/src/main/java/org/apache/geode/cache/Declarable.java
+++ b/geode-core/src/main/java/org/apache/geode/cache/Declarable.java
@@ -50,7 +50,7 @@ import java.util.Properties;
  * See <a href="package-summary.html#declarative">package introduction</a>.
  *
  *
- * 
+ *
  * @since GemFire 2.0
  */
 public interface Declarable {
@@ -64,5 +64,5 @@ public interface Declarable {
    * @throws IllegalArgumentException If one of the configuration options in <code>props</code>
is
    *         illegal or malformed.
    */
-  public void init(Properties props);
+  public default void init(Properties props) {};
 }

http://git-wip-us.apache.org/repos/asf/geode/blob/a2ddc618/geode-core/src/test/java/org/apache/geode/cache30/CacheXml66DUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/cache30/CacheXml66DUnitTest.java b/geode-core/src/test/java/org/apache/geode/cache30/CacheXml66DUnitTest.java
index 1c772a2..38d345f 100644
--- a/geode-core/src/test/java/org/apache/geode/cache30/CacheXml66DUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/cache30/CacheXml66DUnitTest.java
@@ -4171,21 +4171,10 @@ public abstract class CacheXml66DUnitTest extends CacheXmlTestCase
{
    * Tests parsing an XML file that specifies a cache listener that is not {@link Declarable}.
    */
   @Test
-  public void testCallbackNotDeclarable() throws Exception {
+  public void testCallbackNotExplicitlyDeclarableIsStillOK() {
     setXmlFile(findFile("callbackNotDeclarable.xml"));
 
-    IgnoredException expectedException =
-        IgnoredException.addIgnoredException("While reading Cache XML file");
-    try {
-      getCache();
-      fail("Should have thrown a CacheXmlException");
-
-    } catch (CacheXmlException ex) {
-      Throwable cause = ex.getCause();
-      assertNull(cause);
-    } finally {
-      expectedException.remove();
-    }
+    getCache();
   }
 
   /**
@@ -4483,7 +4472,7 @@ public abstract class CacheXml66DUnitTest extends CacheXmlTestCase {
   /**
    * A cache listener that is not {@link Declarable}
    *
-   * @see #testCallbackNotDeclarable()
+   * @see #testCallbackNotExplicitlyDeclarableIsStillOK()
    */
   public static class NotDeclarableCacheListener extends TestCacheListener {
     // empty

http://git-wip-us.apache.org/repos/asf/geode/blob/a2ddc618/geode-core/src/test/java/org/apache/geode/cache30/ReconnectDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/cache30/ReconnectDUnitTest.java b/geode-core/src/test/java/org/apache/geode/cache30/ReconnectDUnitTest.java
index b3f39ee..8b30f02 100755
--- a/geode-core/src/test/java/org/apache/geode/cache30/ReconnectDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/cache30/ReconnectDUnitTest.java
@@ -1282,6 +1282,10 @@ public class ReconnectDUnitTest extends JUnit4CacheTestCase {
    * auto-reconnect to fail.
    */
   public static class NonDeclarableListener extends CacheListenerAdapter {
+    @Override
+    public void init(Properties props) {
+      throw new RuntimeException("Simulate non-declarable listener");
+    };
   }
 
   /**


Mime
View raw message