geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kl...@apache.org
Subject [31/50] [abbrv] geode git commit: GEODE-231: Remove deprecated AttributesMutator.setCacheListener
Date Tue, 01 Aug 2017 21:03:25 GMT
GEODE-231: Remove deprecated AttributesMutator.setCacheListener

Removed setCacheListener method from AttributesMutator and AbstractRegion.
Changed tests to use either initCacheListeners or addCacheListener methods from AttributesMutator.

This closes #507


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

Branch: refs/heads/feature/GEODE-3299
Commit: e24438b946b00414a744af07df323de894c8a46e
Parents: 7dc15b2
Author: Shankar <shankar@ampool.io>
Authored: Tue May 9 23:50:39 2017 +0530
Committer: Darrel Schneider <dschneider@pivotal.io>
Committed: Thu Jul 27 16:50:16 2017 -0700

----------------------------------------------------------------------
 .../apache/geode/cache/AttributesMutator.java   | 13 -------
 .../apache/geode/cache/RegionRoleListener.java  |  2 +-
 .../geode/internal/cache/AbstractRegion.java    | 36 --------------------
 .../test/java/org/apache/geode/TXJUnitTest.java |  6 ++--
 .../java/org/apache/geode/TXWriterTestCase.java |  2 +-
 .../geode/cache/CacheListenerJUnitTest.java     |  6 +---
 .../geode/cache/ConnectionPoolDUnitTest.java    |  6 ++--
 .../geode/cache30/CacheLoaderTestCase.java      |  2 +-
 .../geode/cache30/DiskRegionDUnitTest.java      |  4 +--
 .../geode/cache30/RegionAttributesTestCase.java |  5 +--
 .../internal/cache/DiskRegCbkChkJUnitTest.java  |  6 ++--
 .../internal/cache/DiskRegionJUnitTest.java     |  2 +-
 .../internal/cache/MapInterface2JUnitTest.java  |  2 +-
 .../tier/sockets/InterestListDUnitTest.java     |  2 +-
 .../cache/query/cq/dunit/CqDataDUnitTest.java   |  2 +-
 .../cq/dunit/CqDataUsingPoolDUnitTest.java      |  2 +-
 .../cache/query/cq/dunit/CqQueryDUnitTest.java  |  2 +-
 .../cq/dunit/CqQueryUsingPoolDUnitTest.java     |  2 +-
 .../dunit/QueryIndexUpdateRIDUnitTest.java      |  6 ++--
 .../internal/cache/ha/CQListGIIDUnitTest.java   |  2 +-
 20 files changed, 29 insertions(+), 81 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/geode/blob/e24438b9/geode-core/src/main/java/org/apache/geode/cache/AttributesMutator.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/cache/AttributesMutator.java b/geode-core/src/main/java/org/apache/geode/cache/AttributesMutator.java
index 51301bc..579a4e8 100644
--- a/geode-core/src/main/java/org/apache/geode/cache/AttributesMutator.java
+++ b/geode-core/src/main/java/org/apache/geode/cache/AttributesMutator.java
@@ -107,19 +107,6 @@ public interface AttributesMutator<K, V> {
   public CustomExpiry<K, V> setCustomEntryIdleTimeout(CustomExpiry<K, V> custom);
 
   /**
-   * Changes the CacheListener for the region. Removes listeners already added and calls
-   * {@link CacheCallback#close} on each of them.
-   * 
-   * @param aListener a user defined cache listener
-   * @return the previous CacheListener if a single one exists; otherwise null.
-   * @throws IllegalStateException if more than one cache listener has already been added
-   * @deprecated as of GemFire 5.0, use {@link #addCacheListener} or {@link #initCacheListeners}
-   *             instead.
-   */
-  @Deprecated
-  public CacheListener<K, V> setCacheListener(CacheListener<K, V> aListener);
-
-  /**
    * Adds a cache listener to the end of the list of cache listeners on this region.
    * 
    * @param aListener the user defined cache listener to add to the region.

http://git-wip-us.apache.org/repos/asf/geode/blob/e24438b9/geode-core/src/main/java/org/apache/geode/cache/RegionRoleListener.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/cache/RegionRoleListener.java b/geode-core/src/main/java/org/apache/geode/cache/RegionRoleListener.java
index 0a666cc..1dff76a 100755
--- a/geode-core/src/main/java/org/apache/geode/cache/RegionRoleListener.java
+++ b/geode-core/src/main/java/org/apache/geode/cache/RegionRoleListener.java
@@ -25,7 +25,7 @@ package org.apache.geode.cache;
  * 
  * @see AttributesFactory#setCacheListener
  * @see RegionAttributes#getCacheListener
- * @see AttributesMutator#setCacheListener
+ * @see AttributesMutator#addCacheListener
  * @deprecated this feature is scheduled to be removed
  */
 public interface RegionRoleListener<K, V> extends CacheListener<K, V> {

http://git-wip-us.apache.org/repos/asf/geode/blob/e24438b9/geode-core/src/main/java/org/apache/geode/internal/cache/AbstractRegion.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/AbstractRegion.java
b/geode-core/src/main/java/org/apache/geode/internal/cache/AbstractRegion.java
index b7cd199..db9674e 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/AbstractRegion.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/AbstractRegion.java
@@ -856,42 +856,6 @@ public abstract class AbstractRegion implements Region, RegionAttributes,
Attrib
   }
 
   @Override
-  public CacheListener setCacheListener(CacheListener aListener) {
-    checkReadiness();
-    CacheListener[] oldListeners;
-    synchronized (this.clSync) {
-      oldListeners = this.cacheListeners;
-      if (oldListeners != null && oldListeners.length > 1) {
-        throw new IllegalStateException(
-            LocalizedStrings.AbstractRegion_MORE_THAN_ONE_CACHE_LISTENER_EXISTS
-                .toLocalizedString());
-      }
-      this.cacheListeners = new CacheListener[] {aListener};
-    }
-    // moved the following out of the sync for bug 34512
-    CacheListener result = null;
-    if (oldListeners != null && oldListeners.length > 0) {
-      if (oldListeners.length == 1) {
-        result = oldListeners[0];
-      }
-      for (CacheListener oldListener : oldListeners) {
-        if (aListener != oldListener) {
-          closeCacheCallback(oldListener);
-        }
-      }
-      if (aListener == null) {
-        cacheListenersChanged(false);
-      }
-    } else { // we have no old listeners
-      if (aListener != null) {
-        // we have added a new listener
-        cacheListenersChanged(true);
-      }
-    }
-    return result;
-  }
-
-  @Override
   public void addGatewaySenderId(String gatewaySenderId) {
     getGatewaySenderIds().add(gatewaySenderId);
     setAllGatewaySenderIds();

http://git-wip-us.apache.org/repos/asf/geode/blob/e24438b9/geode-core/src/test/java/org/apache/geode/TXJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/TXJUnitTest.java b/geode-core/src/test/java/org/apache/geode/TXJUnitTest.java
index 733b31c..cf1281d 100644
--- a/geode-core/src/test/java/org/apache/geode/TXJUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/TXJUnitTest.java
@@ -1061,7 +1061,7 @@ public class TXJUnitTest {
         return fetchLocal ? this.aLocalDestroyCalls : this.aDestroyCalls;
       }
     };
-    mutator.setCacheListener(cntListener);
+    mutator.addCacheListener(cntListener);
     CountingCacheWriter cntWriter = new CountingCacheWriter() {
       int bCreateCalls, bUpdateCalls, bDestroyCalls, bLocalDestroyCalls;
 
@@ -2928,7 +2928,7 @@ public class TXJUnitTest {
   public void testNoCallbacksOnRollback() throws CacheException {
     // install listeners
     AttributesMutator<String, String> mutator = this.region.getAttributesMutator();
-    mutator.setCacheListener(new CacheListenerAdapter<String, String>() {
+    mutator.addCacheListener(new CacheListenerAdapter<String, String>() {
       @Override
       public void close() {
         cbCount++;
@@ -3396,7 +3396,7 @@ public class TXJUnitTest {
     };
 
     vCl.setValidator(cbv);
-    mutator.setCacheListener(vCl);
+    mutator.addCacheListener(vCl);
 
     // CacheWriter
     ValidatableCacheWriter vCw = new ValidatableCacheWriter() {

http://git-wip-us.apache.org/repos/asf/geode/blob/e24438b9/geode-core/src/test/java/org/apache/geode/TXWriterTestCase.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/TXWriterTestCase.java b/geode-core/src/test/java/org/apache/geode/TXWriterTestCase.java
index a75e167..8242299 100644
--- a/geode-core/src/test/java/org/apache/geode/TXWriterTestCase.java
+++ b/geode-core/src/test/java/org/apache/geode/TXWriterTestCase.java
@@ -113,7 +113,7 @@ public class TXWriterTestCase {
 
   void installCacheListenerAndWriter() {
     AttributesMutator<String, String> mutator = this.region.getAttributesMutator();
-    mutator.setCacheListener(new CacheListenerAdapter<String, String>() {
+    mutator.addCacheListener(new CacheListenerAdapter<String, String>() {
       @Override
       public void close() {
         cbCount++;

http://git-wip-us.apache.org/repos/asf/geode/blob/e24438b9/geode-core/src/test/java/org/apache/geode/cache/CacheListenerJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/cache/CacheListenerJUnitTest.java b/geode-core/src/test/java/org/apache/geode/cache/CacheListenerJUnitTest.java
index 9353141..1273c43 100644
--- a/geode-core/src/test/java/org/apache/geode/cache/CacheListenerJUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/cache/CacheListenerJUnitTest.java
@@ -155,11 +155,7 @@ public class CacheListenerJUnitTest {
       fail("expected IllegalStateException");
     } catch (IllegalStateException expected) {
     }
-    try {
-      am.setCacheListener(cl1);
-      fail("expected IllegalStateException");
-    } catch (IllegalStateException expected) {
-    }
+
     am.removeCacheListener(cl1);
     assertEquals(Arrays.asList(new CacheListener[] {cl2}), Arrays.asList(ra.getCacheListeners()));
     am.removeCacheListener(cl1);

http://git-wip-us.apache.org/repos/asf/geode/blob/e24438b9/geode-core/src/test/java/org/apache/geode/cache/ConnectionPoolDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/cache/ConnectionPoolDUnitTest.java
b/geode-core/src/test/java/org/apache/geode/cache/ConnectionPoolDUnitTest.java
index c3e756b..376f145 100755
--- a/geode-core/src/test/java/org/apache/geode/cache/ConnectionPoolDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/cache/ConnectionPoolDUnitTest.java
@@ -3462,7 +3462,7 @@ public class ConnectionPoolDUnitTest extends JUnit4CacheTestCase {
             null);
 
         region1 = createRegion(regionName1, regionFactory.create());
-        region1.getAttributesMutator().setCacheListener(new CertifiableTestCacheListener(
+        region1.getAttributesMutator().addCacheListener(new CertifiableTestCacheListener(
             org.apache.geode.test.dunit.LogWriterUtils.getLogWriter()));
       }
     };
@@ -5310,7 +5310,7 @@ public class ConnectionPoolDUnitTest extends JUnit4CacheTestCase {
                 .info("vm2 numberOfAfterInvalidates: " + numberOfAfterInvalidates);
           }
         };
-        region.getAttributesMutator().setCacheListener(listener);
+        region.getAttributesMutator().addCacheListener(listener);
         region.registerInterestRegex(".*", false, false);
       }
     });
@@ -5334,7 +5334,7 @@ public class ConnectionPoolDUnitTest extends JUnit4CacheTestCase {
             // getLogWriter().info("vm3 numberOfAfterInvalidates: " + numberOfAfterInvalidates);
           }
         };
-        region.getAttributesMutator().setCacheListener(listener);
+        region.getAttributesMutator().addCacheListener(listener);
         region.registerInterestRegex(".*", false, false);
       }
     });

http://git-wip-us.apache.org/repos/asf/geode/blob/e24438b9/geode-core/src/test/java/org/apache/geode/cache30/CacheLoaderTestCase.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/cache30/CacheLoaderTestCase.java b/geode-core/src/test/java/org/apache/geode/cache30/CacheLoaderTestCase.java
index e596b95..9509c06 100644
--- a/geode-core/src/test/java/org/apache/geode/cache30/CacheLoaderTestCase.java
+++ b/geode-core/src/test/java/org/apache/geode/cache30/CacheLoaderTestCase.java
@@ -310,7 +310,7 @@ public abstract class CacheLoaderTestCase extends CacheWriterTestCase
{
       }
     };
 
-    region.getAttributesMutator().setCacheListener(listener);
+    region.getAttributesMutator().addCacheListener(listener);
 
     region.put(key, newValue);
     Wait.pause(500);

http://git-wip-us.apache.org/repos/asf/geode/blob/e24438b9/geode-core/src/test/java/org/apache/geode/cache30/DiskRegionDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/cache30/DiskRegionDUnitTest.java b/geode-core/src/test/java/org/apache/geode/cache30/DiskRegionDUnitTest.java
index e5d3fbd..f12672f 100644
--- a/geode-core/src/test/java/org/apache/geode/cache30/DiskRegionDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/cache30/DiskRegionDUnitTest.java
@@ -493,7 +493,7 @@ public class DiskRegionDUnitTest extends JUnit4CacheTestCase {
       public void close2() {}
     };
 
-    region.getAttributesMutator().setCacheListener(listener);
+    region.getAttributesMutator().addCacheListener(listener);
 
     for (int i = 0; i < total; i++) {
       String value = (String) region.get(new Integer(i));
@@ -513,7 +513,7 @@ public class DiskRegionDUnitTest extends JUnit4CacheTestCase {
       }
     };
 
-    region.getAttributesMutator().setCacheListener(listener);
+    region.getAttributesMutator().addCacheListener(listener);
 
     for (int i = 0; i < 20; i++) {
       region.put(new Integer(i), new byte[i]);

http://git-wip-us.apache.org/repos/asf/geode/blob/e24438b9/geode-core/src/test/java/org/apache/geode/cache30/RegionAttributesTestCase.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/cache30/RegionAttributesTestCase.java
b/geode-core/src/test/java/org/apache/geode/cache30/RegionAttributesTestCase.java
index d89003a..c521539 100644
--- a/geode-core/src/test/java/org/apache/geode/cache30/RegionAttributesTestCase.java
+++ b/geode-core/src/test/java/org/apache/geode/cache30/RegionAttributesTestCase.java
@@ -104,7 +104,7 @@ public abstract class RegionAttributesTestCase extends RegionTestCase
{
     assertEquals(region, mutator.getRegion());
     assertSame(region, mutator);
 
-    mutator.setCacheListener(listener);
+    mutator.addCacheListener(listener);
     mutator.setCacheLoader(loader);
     mutator.setCacheWriter(writer);
     mutator.setEntryIdleTimeout(entryIdle);
@@ -140,7 +140,8 @@ public abstract class RegionAttributesTestCase extends RegionTestCase
{
     ExpirationAttributes regionIdle2 = new ExpirationAttributes(7, ExpirationAction.DESTROY);
     ExpirationAttributes regionTTL2 = new ExpirationAttributes(8, ExpirationAction.INVALIDATE);
 
-    assertEquals(listener, mutator.setCacheListener(listener2));
+    mutator.initCacheListeners(new CacheListener[] {listener2});
+    assertEquals(listener2, attrs.getCacheListener());
     assertEquals(loader, mutator.setCacheLoader(loader2));
     assertEquals(writer, mutator.setCacheWriter(writer2));
     assertEquals(entryIdle, mutator.setEntryIdleTimeout(entryIdle2));

http://git-wip-us.apache.org/repos/asf/geode/blob/e24438b9/geode-core/src/test/java/org/apache/geode/internal/cache/DiskRegCbkChkJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/DiskRegCbkChkJUnitTest.java
b/geode-core/src/test/java/org/apache/geode/internal/cache/DiskRegCbkChkJUnitTest.java
index 2ba36b8..d460994 100755
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/DiskRegCbkChkJUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/DiskRegCbkChkJUnitTest.java
@@ -50,7 +50,7 @@ public class DiskRegCbkChkJUnitTest extends DiskRegionTestingBase {
         Scope.LOCAL);
 
     // testing create callbacks
-    region.getAttributesMutator().setCacheListener(new CacheListenerAdapter() {
+    region.getAttributesMutator().addCacheListener(new CacheListenerAdapter() {
       public void afterCreate(EntryEvent event) {
         intoCreateAfterCbk = true;
       }
@@ -64,7 +64,7 @@ public class DiskRegCbkChkJUnitTest extends DiskRegionTestingBase {
     assertTrue("Create callback not called", intoCreateAfterCbk);
 
     // testing update callbacks
-    region.getAttributesMutator().setCacheListener(new CacheListenerAdapter() {
+    region.getAttributesMutator().addCacheListener(new CacheListenerAdapter() {
       public void afterUpdate(EntryEvent event) {
         intoUpdateAfterCbk = true;
       }
@@ -79,7 +79,7 @@ public class DiskRegCbkChkJUnitTest extends DiskRegionTestingBase {
     assertTrue("Update callback not called", intoUpdateAfterCbk);
 
     // testing destroy callbacks
-    region.getAttributesMutator().setCacheListener(new CacheListenerAdapter() {
+    region.getAttributesMutator().addCacheListener(new CacheListenerAdapter() {
       public void afterDestroy(EntryEvent event) {
         intoDestroyAfterCbk = true;
       }

http://git-wip-us.apache.org/repos/asf/geode/blob/e24438b9/geode-core/src/test/java/org/apache/geode/internal/cache/DiskRegionJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/DiskRegionJUnitTest.java
b/geode-core/src/test/java/org/apache/geode/internal/cache/DiskRegionJUnitTest.java
index 77f6e06..8f6d77b 100755
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/DiskRegionJUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/DiskRegionJUnitTest.java
@@ -1527,7 +1527,7 @@ public class DiskRegionJUnitTest extends DiskRegionTestingBase {
       }
     });
 
-    region.getAttributesMutator().setCacheListener(new CacheListenerAdapter() {
+    region.getAttributesMutator().addCacheListener(new CacheListenerAdapter() {
       public void afterCreate(EntryEvent event) {
         th.start();
       }

http://git-wip-us.apache.org/repos/asf/geode/blob/e24438b9/geode-core/src/test/java/org/apache/geode/internal/cache/MapInterface2JUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/MapInterface2JUnitTest.java
b/geode-core/src/test/java/org/apache/geode/internal/cache/MapInterface2JUnitTest.java
index f4e20d7..3fea214 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/MapInterface2JUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/MapInterface2JUnitTest.java
@@ -110,7 +110,7 @@ public class MapInterface2JUnitTest {
   public void testBasicMapAfterClearCalback() {
     Region rgn = CacheUtils.getRegion("Portfolios");
     AttributesMutator atm = rgn.getAttributesMutator();
-    atm.setCacheListener(new CacheListenerAdapter() {
+    atm.addCacheListener(new CacheListenerAdapter() {
 
       public void afterRegionClear(RegionEvent event) {
         synchronized (MapInterface2JUnitTest.this) {

http://git-wip-us.apache.org/repos/asf/geode/blob/e24438b9/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/InterestListDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/InterestListDUnitTest.java
b/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/InterestListDUnitTest.java
index ab21f53..1008d54 100755
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/InterestListDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/InterestListDUnitTest.java
@@ -676,7 +676,7 @@ public class InterestListDUnitTest extends JUnit4DistributedTestCase {
   private static void addCacheListener(int expectedCreates) {
     // Add a cache listener to count the number of create and update events
     Region region = cache.getRegion(REGION_NAME);
-    region.getAttributesMutator().setCacheListener(new EventCountingCacheListener(expectedCreates));
+    region.getAttributesMutator().addCacheListener(new EventCountingCacheListener(expectedCreates));
   }
 
   private static void doGets(int numGets) {

http://git-wip-us.apache.org/repos/asf/geode/blob/e24438b9/geode-cq/src/test/java/org/apache/geode/cache/query/cq/dunit/CqDataDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-cq/src/test/java/org/apache/geode/cache/query/cq/dunit/CqDataDUnitTest.java
b/geode-cq/src/test/java/org/apache/geode/cache/query/cq/dunit/CqDataDUnitTest.java
index c7d734d..cc8c197 100644
--- a/geode-cq/src/test/java/org/apache/geode/cache/query/cq/dunit/CqDataDUnitTest.java
+++ b/geode-cq/src/test/java/org/apache/geode/cache/query/cq/dunit/CqDataDUnitTest.java
@@ -461,7 +461,7 @@ public class CqDataDUnitTest extends JUnit4CacheTestCase {
           Region region = createRegion(cqDUnitTest.regions[i], factory.createRegionAttributes());
           // Set CacheListener.
           region.getAttributesMutator()
-              .setCacheListener(new CertifiableTestCacheListener(LogWriterUtils.getLogWriter()));
+              .addCacheListener(new CertifiableTestCacheListener(LogWriterUtils.getLogWriter()));
         }
         Wait.pause(2000);
 

http://git-wip-us.apache.org/repos/asf/geode/blob/e24438b9/geode-cq/src/test/java/org/apache/geode/cache/query/cq/dunit/CqDataUsingPoolDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-cq/src/test/java/org/apache/geode/cache/query/cq/dunit/CqDataUsingPoolDUnitTest.java
b/geode-cq/src/test/java/org/apache/geode/cache/query/cq/dunit/CqDataUsingPoolDUnitTest.java
index ceedf69..5d3ce14 100644
--- a/geode-cq/src/test/java/org/apache/geode/cache/query/cq/dunit/CqDataUsingPoolDUnitTest.java
+++ b/geode-cq/src/test/java/org/apache/geode/cache/query/cq/dunit/CqDataUsingPoolDUnitTest.java
@@ -475,7 +475,7 @@ public class CqDataUsingPoolDUnitTest extends JUnit4CacheTestCase {
           Region region = createRegion(cqDUnitTest.regions[i], factory.createRegionAttributes());
           // Set CacheListener.
           region.getAttributesMutator()
-              .setCacheListener(new CertifiableTestCacheListener(LogWriterUtils.getLogWriter()));
+              .addCacheListener(new CertifiableTestCacheListener(LogWriterUtils.getLogWriter()));
         }
         Wait.pause(2000);
 

http://git-wip-us.apache.org/repos/asf/geode/blob/e24438b9/geode-cq/src/test/java/org/apache/geode/cache/query/cq/dunit/CqQueryDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-cq/src/test/java/org/apache/geode/cache/query/cq/dunit/CqQueryDUnitTest.java
b/geode-cq/src/test/java/org/apache/geode/cache/query/cq/dunit/CqQueryDUnitTest.java
index 18a61f2..ef5449a 100644
--- a/geode-cq/src/test/java/org/apache/geode/cache/query/cq/dunit/CqQueryDUnitTest.java
+++ b/geode-cq/src/test/java/org/apache/geode/cache/query/cq/dunit/CqQueryDUnitTest.java
@@ -973,7 +973,7 @@ public class CqQueryDUnitTest extends JUnit4CacheTestCase {
         try {
           region = getRootRegion().getSubregion(regionName);
           region.getAttributesMutator()
-              .setCacheListener(new CertifiableTestCacheListener(LogWriterUtils.getLogWriter()));
+              .addCacheListener(new CertifiableTestCacheListener(LogWriterUtils.getLogWriter()));
         } catch (Exception cqe) {
           AssertionError err = new AssertionError("Failed to get Region.");
           err.initCause(cqe);

http://git-wip-us.apache.org/repos/asf/geode/blob/e24438b9/geode-cq/src/test/java/org/apache/geode/cache/query/cq/dunit/CqQueryUsingPoolDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-cq/src/test/java/org/apache/geode/cache/query/cq/dunit/CqQueryUsingPoolDUnitTest.java
b/geode-cq/src/test/java/org/apache/geode/cache/query/cq/dunit/CqQueryUsingPoolDUnitTest.java
index f9c6b4b..7e1dc03 100644
--- a/geode-cq/src/test/java/org/apache/geode/cache/query/cq/dunit/CqQueryUsingPoolDUnitTest.java
+++ b/geode-cq/src/test/java/org/apache/geode/cache/query/cq/dunit/CqQueryUsingPoolDUnitTest.java
@@ -843,7 +843,7 @@ public class CqQueryUsingPoolDUnitTest extends JUnit4CacheTestCase {
         try {
           region = getRootRegion().getSubregion(regionName);
           region.getAttributesMutator()
-              .setCacheListener(new CertifiableTestCacheListener(LogWriterUtils.getLogWriter()));
+              .addCacheListener(new CertifiableTestCacheListener(LogWriterUtils.getLogWriter()));
         } catch (Exception cqe) {
           fail("Failed to get Region.", cqe);
         }

http://git-wip-us.apache.org/repos/asf/geode/blob/e24438b9/geode-cq/src/test/java/org/apache/geode/cache/query/dunit/QueryIndexUpdateRIDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-cq/src/test/java/org/apache/geode/cache/query/dunit/QueryIndexUpdateRIDUnitTest.java
b/geode-cq/src/test/java/org/apache/geode/cache/query/dunit/QueryIndexUpdateRIDUnitTest.java
index 289d915..9eb6360 100644
--- a/geode-cq/src/test/java/org/apache/geode/cache/query/dunit/QueryIndexUpdateRIDUnitTest.java
+++ b/geode-cq/src/test/java/org/apache/geode/cache/query/dunit/QueryIndexUpdateRIDUnitTest.java
@@ -492,7 +492,7 @@ public class QueryIndexUpdateRIDUnitTest extends JUnit4CacheTestCase {
             region = getRootRegion().getSubregion(regionName);
           }
           region.getAttributesMutator()
-              .setCacheListener(new CertifiableTestCacheListener(LogWriterUtils.getLogWriter()));
+              .addCacheListener(new CertifiableTestCacheListener(LogWriterUtils.getLogWriter()));
         } catch (Exception cqe) {
           AssertionError err = new AssertionError("Failed to get Region.");
           err.initCause(cqe);
@@ -537,7 +537,7 @@ public class QueryIndexUpdateRIDUnitTest extends JUnit4CacheTestCase {
             region = getRootRegion().getSubregion(regionName);
           }
           region.getAttributesMutator()
-              .setCacheListener(new CertifiableTestCacheListener(LogWriterUtils.getLogWriter()));
+              .addCacheListener(new CertifiableTestCacheListener(LogWriterUtils.getLogWriter()));
         } catch (Exception cqe) {
           AssertionError err = new AssertionError("Failed to get Region.");
           err.initCause(cqe);
@@ -802,7 +802,7 @@ public class QueryIndexUpdateRIDUnitTest extends JUnit4CacheTestCase {
             region = getRootRegion().getSubregion(regionName);
           }
           region.getAttributesMutator()
-              .setCacheListener(new CertifiableTestCacheListener(LogWriterUtils.getLogWriter()));
+              .addCacheListener(new CertifiableTestCacheListener(LogWriterUtils.getLogWriter()));
         } catch (Exception cqe) {
           AssertionError err = new AssertionError("Failed to get Region.");
           err.initCause(cqe);

http://git-wip-us.apache.org/repos/asf/geode/blob/e24438b9/geode-cq/src/test/java/org/apache/geode/internal/cache/ha/CQListGIIDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-cq/src/test/java/org/apache/geode/internal/cache/ha/CQListGIIDUnitTest.java
b/geode-cq/src/test/java/org/apache/geode/internal/cache/ha/CQListGIIDUnitTest.java
index 5e8bdac..2b44a8e 100755
--- a/geode-cq/src/test/java/org/apache/geode/internal/cache/ha/CQListGIIDUnitTest.java
+++ b/geode-cq/src/test/java/org/apache/geode/internal/cache/ha/CQListGIIDUnitTest.java
@@ -425,7 +425,7 @@ public class CQListGIIDUnitTest extends JUnit4DistributedTestCase {
     Region region = null;
     try {
       region = cache.getRegion("root").getSubregion(regionName);
-      region.getAttributesMutator().setCacheListener(new CertifiableTestCacheListener(
+      region.getAttributesMutator().addCacheListener(new CertifiableTestCacheListener(
           org.apache.geode.test.dunit.LogWriterUtils.getLogWriter()));
     } catch (Exception e) {
       fail("Failed to get Region.", e);


Mime
View raw message