geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kl...@apache.org
Subject [42/62] [abbrv] incubator-geode git commit: Merge remote-tracking branch 'origin/develop' into feature/GEODE-837
Date Tue, 07 Jun 2016 20:54:57 GMT
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryMonitorDUnitTest.java
----------------------------------------------------------------------
diff --cc geode-cq/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryMonitorDUnitTest.java
index cf42aa8,8153ab2..98f5721
--- a/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryMonitorDUnitTest.java
+++ b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryMonitorDUnitTest.java
@@@ -16,32 -16,7 +16,27 @@@
   */
  package com.gemstone.gemfire.cache.query.dunit;
  
- import org.junit.experimental.categories.Category;
- import org.junit.Test;
- 
 -import com.gemstone.gemfire.cache.*;
 +import static org.junit.Assert.*;
 +
- import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
- import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
- import com.gemstone.gemfire.test.junit.categories.DistributedTest;
- 
 +import java.io.File;
 +import java.io.IOException;
 +import java.util.Properties;
 +
++import org.junit.Ignore;
++import org.junit.Test;
 +import org.junit.experimental.categories.Category;
 +
 +import com.gemstone.gemfire.cache.AttributesFactory;
 +import com.gemstone.gemfire.cache.Cache;
 +import com.gemstone.gemfire.cache.CacheException;
 +import com.gemstone.gemfire.cache.DataPolicy;
 +import com.gemstone.gemfire.cache.DiskStore;
 +import com.gemstone.gemfire.cache.DiskStoreFactory;
 +import com.gemstone.gemfire.cache.EvictionAction;
 +import com.gemstone.gemfire.cache.EvictionAttributes;
 +import com.gemstone.gemfire.cache.PartitionAttributesFactory;
 +import com.gemstone.gemfire.cache.Region;
 +import com.gemstone.gemfire.cache.Scope;
  import com.gemstone.gemfire.cache.client.Pool;
  import com.gemstone.gemfire.cache.client.PoolFactory;
  import com.gemstone.gemfire.cache.client.PoolManager;
@@@ -54,37 -29,32 +49,39 @@@ import com.gemstone.gemfire.cache.query
  import com.gemstone.gemfire.cache.query.internal.DefaultQuery;
  import com.gemstone.gemfire.cache.query.internal.QueryMonitor;
  import com.gemstone.gemfire.cache.server.CacheServer;
- import com.gemstone.gemfire.cache30.ClientServerTestCase;
- import com.gemstone.gemfire.distributed.internal.DistributionConfigImpl;
  import com.gemstone.gemfire.cache30.CacheSerializableRunnable;
  import com.gemstone.gemfire.cache30.CacheTestCase;
+ import com.gemstone.gemfire.cache30.ClientServerTestCase;
+ import com.gemstone.gemfire.distributed.internal.DistributionConfigImpl;
  import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
 -import com.gemstone.gemfire.test.dunit.*;
 +import com.gemstone.gemfire.test.dunit.Assert;
 +import com.gemstone.gemfire.test.dunit.AsyncInvocation;
 +import com.gemstone.gemfire.test.dunit.DistributedTestUtils;
 +import com.gemstone.gemfire.test.dunit.Host;
 +import com.gemstone.gemfire.test.dunit.LogWriterUtils;
 +import com.gemstone.gemfire.test.dunit.NetworkUtils;
 +import com.gemstone.gemfire.test.dunit.SerializableRunnable;
 +import com.gemstone.gemfire.test.dunit.ThreadUtils;
 +import com.gemstone.gemfire.test.dunit.VM;
 +import com.gemstone.gemfire.test.dunit.Wait;
++import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
++import com.gemstone.gemfire.test.junit.categories.DistributedTest;
  import com.gemstone.gemfire.test.junit.categories.FlakyTest;
 -import org.junit.experimental.categories.Category;
 -
 -import java.io.File;
 -import java.io.IOException;
 -import java.util.Properties;
  
  /**
   * Tests for QueryMonitoring service.
-  * @since 6.0
++ *
+  * @since GemFire 6.0
   */
 -public class QueryMonitorDUnitTest extends CacheTestCase {
 +@Category(DistributedTest.class)
 +public class QueryMonitorDUnitTest extends JUnit4CacheTestCase {
  
    private static int bridgeServerPort;
  
    private final String exampleRegionName = "exampleRegion";
    private final String exampleRegionName2 = "exampleRegion2";
    private final String poolName = "serverConnectionPool";
--  
--  
++
    /* Some of the queries are commented out as they were taking less time */
    String[]  queryStr = {
        "SELECT ID FROM /root/exampleRegion p WHERE  p.ID > 100",
@@@ -147,29 -117,29 +144,34 @@@
    
    private int numServers;
  
-   public QueryMonitorDUnitTest() {
-     super();
 -  public QueryMonitorDUnitTest(String name) {
 -    super(name);
++  @Override
++  public final void preTearDownCacheTestCase() throws Exception {
++    Host host = Host.getHost(0);
++    disconnectFromDS();
++    // shut down clients before servers
++    for (int i=numServers; i<4; i++) {
++      host.getVM(i).invoke(() -> CacheTestCase.disconnectFromDS());
++    }
    }
  
    public void setup(int numServers) throws Exception {
--    super.setUp();
      Host host = Host.getHost(0);
      this.numServers = numServers;
--    
++
      // avoid IllegalStateException from HandShake by connecting all vms tor
      // system before creating connection pools
      getSystem();
--    
++
      SerializableRunnable r = new SerializableRunnable("getSystem") {
        public void run() {
          getSystem();
        }
      };
--    
++
      for (int i=0; i<numServers; i++) {
        host.getVM(i).invoke(r);
      }
--    
++
      r = new SerializableRunnable("getClientSystem") {
        public void run() {
          Properties props = DistributedTestUtils.getAllDistributedSystemProperties(new Properties());
@@@ -177,22 -147,22 +179,12 @@@
          getSystem(props);
        }
      };
--    
++
      for (int i=numServers; i<4; i++) {
        host.getVM(i).invoke(r);
      }
    }
--  
--  @Override
--  public final void preTearDownCacheTestCase() throws Exception {
--    Host host = Host.getHost(0);
--    disconnectFromDS();
--    // shut down clients before servers
--    for (int i=numServers; i<4; i++) {
--      host.getVM(i).invoke(() -> CacheTestCase.disconnectFromDS());
--    }
--  }
--  
++
    public void createRegion(VM vm){
      createRegion(vm, false, null);
    }
@@@ -812,7 -776,7 +804,9 @@@
    /**
     * Tests query execution from client to server (multiple server) with eviction to disk.
     */
--  public void BUG46770WORKAROUNDtestQueryMonitorRegionWithEviction() throws CacheException
{
++  @Ignore("TODO:BUG46770WORKAROUND: test is disabled")
++  @Test
++  public void testQueryMonitorRegionWithEviction() throws CacheException {
  
      final Host host = Host.getHost(0);
      

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-cq/src/test/java/com/gemstone/gemfire/cache/snapshot/ClientSnapshotDUnitTest.java
----------------------------------------------------------------------
diff --cc geode-cq/src/test/java/com/gemstone/gemfire/cache/snapshot/ClientSnapshotDUnitTest.java
index cca9e8d,9d487dc..327de28
--- a/geode-cq/src/test/java/com/gemstone/gemfire/cache/snapshot/ClientSnapshotDUnitTest.java
+++ b/geode-cq/src/test/java/com/gemstone/gemfire/cache/snapshot/ClientSnapshotDUnitTest.java
@@@ -16,26 -16,9 +16,23 @@@
   */
  package com.gemstone.gemfire.cache.snapshot;
  
- import org.junit.experimental.categories.Category;
- import org.junit.Test;
- 
++import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
 +import static org.junit.Assert.*;
 +
- import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
- import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
- import com.gemstone.gemfire.test.junit.categories.DistributedTest;
- 
 +import java.io.File;
 +import java.util.concurrent.atomic.AtomicBoolean;
 +
  import com.examples.snapshot.MyObject;
  import com.examples.snapshot.MyPdxSerializer;
 -import com.gemstone.gemfire.cache.*;
++import org.junit.Test;
++import org.junit.experimental.categories.Category;
++
 +import com.gemstone.gemfire.cache.Cache;
 +import com.gemstone.gemfire.cache.CacheFactory;
 +import com.gemstone.gemfire.cache.EntryEvent;
 +import com.gemstone.gemfire.cache.EvictionAttributes;
 +import com.gemstone.gemfire.cache.Region;
 +import com.gemstone.gemfire.cache.RegionShortcut;
  import com.gemstone.gemfire.cache.client.ClientCache;
  import com.gemstone.gemfire.cache.client.ClientCacheFactory;
  import com.gemstone.gemfire.cache.client.ClientRegionShortcut;
@@@ -47,23 -30,26 +44,25 @@@ import com.gemstone.gemfire.cache.snaps
  import com.gemstone.gemfire.cache.util.CacheListenerAdapter;
  import com.gemstone.gemfire.cache.util.CacheWriterAdapter;
  import com.gemstone.gemfire.cache.util.CqListenerAdapter;
--import com.gemstone.gemfire.cache30.CacheTestCase;
  import com.gemstone.gemfire.internal.AvailablePortHelper;
  import com.gemstone.gemfire.test.dunit.Host;
  import com.gemstone.gemfire.test.dunit.LogWriterUtils;
  import com.gemstone.gemfire.test.dunit.NetworkUtils;
  import com.gemstone.gemfire.test.dunit.SerializableCallable;
++import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
++import com.gemstone.gemfire.test.junit.categories.DistributedTest;
  
 -import java.io.File;
 -import java.util.concurrent.atomic.AtomicBoolean;
 -
 -import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
 -
 -public class ClientSnapshotDUnitTest extends CacheTestCase {
 +@Category(DistributedTest.class)
 +public class ClientSnapshotDUnitTest extends JUnit4CacheTestCase {
  
    private transient Region<Integer, MyObject> region;
--  
-   public ClientSnapshotDUnitTest() {
-     super();
 -  public ClientSnapshotDUnitTest(String name) {
 -    super(name);
++
++  @Override
++  public final void postSetUp() throws Exception {
++    loadCache();
    }
  
 +  @Test
    public void testExport() throws Exception {
      int count = 10000;
      for (int i = 0; i < count; i++) {
@@@ -247,11 -230,11 +246,6 @@@
      assertNull(region.get(1));
    }
  
--  @Override
--  public final void postSetUp() throws Exception {
--    loadCache();
--  }
--  
    @SuppressWarnings("serial")
    public void loadCache() throws Exception {
      CacheFactory cf = new CacheFactory().setPdxSerializer(new MyPdxSerializer());

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-cq/src/test/java/com/gemstone/gemfire/internal/cache/PRDeltaPropagationDUnitTest.java
----------------------------------------------------------------------
diff --cc geode-cq/src/test/java/com/gemstone/gemfire/internal/cache/PRDeltaPropagationDUnitTest.java
index ccdd696,8614a80..c178454
--- a/geode-cq/src/test/java/com/gemstone/gemfire/internal/cache/PRDeltaPropagationDUnitTest.java
+++ b/geode-cq/src/test/java/com/gemstone/gemfire/internal/cache/PRDeltaPropagationDUnitTest.java
@@@ -16,33 -16,9 +16,34 @@@
   */
  package com.gemstone.gemfire.internal.cache;
  
++import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
 +import static org.junit.Assert.*;
 +
 +import java.io.DataInput;
 +import java.io.DataOutput;
 +import java.io.IOException;
 +import java.util.Properties;
 +
 +import org.junit.Test;
 +import org.junit.experimental.categories.Category;
 +
  import com.gemstone.gemfire.Delta;
  import com.gemstone.gemfire.DeltaTestImpl;
 -import com.gemstone.gemfire.cache.*;
 +import com.gemstone.gemfire.cache.AttributesFactory;
 +import com.gemstone.gemfire.cache.AttributesMutator;
 +import com.gemstone.gemfire.cache.Cache;
 +import com.gemstone.gemfire.cache.CacheFactory;
 +import com.gemstone.gemfire.cache.DataPolicy;
 +import com.gemstone.gemfire.cache.EntryEvent;
 +import com.gemstone.gemfire.cache.ExpirationAction;
 +import com.gemstone.gemfire.cache.ExpirationAttributes;
 +import com.gemstone.gemfire.cache.InterestPolicy;
 +import com.gemstone.gemfire.cache.PartitionAttributes;
 +import com.gemstone.gemfire.cache.PartitionAttributesFactory;
 +import com.gemstone.gemfire.cache.Region;
 +import com.gemstone.gemfire.cache.RegionAttributes;
 +import com.gemstone.gemfire.cache.Scope;
 +import com.gemstone.gemfire.cache.SubscriptionAttributes;
  import com.gemstone.gemfire.cache.client.PoolManager;
  import com.gemstone.gemfire.cache.client.internal.PoolImpl;
  import com.gemstone.gemfire.cache.query.CqAttributes;
@@@ -78,8 -54,8 +78,6 @@@ public class PRDeltaPropagationDUnitTes
    
    private final static Compressor compressor = SnappyCompressor.getDefaultInstance();
  
--  private static final long serialVersionUID = 1L;
--
    protected static Cache cache = null;
  
    protected static VM dataStore1 = null;
@@@ -117,7 -93,7 +115,6 @@@
    /*
     * cq 
     */
--  //private static final String CQ = "SELECT * FROM "+Region.SEPARATOR+REGION_NAME;
    private static final String CQ = "SELECT * FROM "+Region.SEPARATOR+REGION_NAME + " p where
p.intVar < 9";
      
    private static int numValidCqEvents = 0;
@@@ -126,10 -102,10 +123,6 @@@
    private static boolean queryDestroyExecuted = false;
    private static boolean notADeltaInstanceObj = false;
  
-   public PRDeltaPropagationDUnitTest() {
-     super();
 -  public PRDeltaPropagationDUnitTest(String name) {
 -    super(name);
--  }
--
    @Override
    public final void postSetUp() throws Exception {
      Host host = Host.getHost(0);
@@@ -145,13 -121,12 +138,12 @@@
    }
  
    /**
--   *  1) Put delta objects on accessor node.
--   *  2) From accessor to primary delta gets propagated as part of <code>PutMessage</code>
delta.
--   *  3) From primary to secondary delta gets propagated as part RR distribution.
--   * 
++   * 1) Put delta objects on accessor node.
++   * 2) From accessor to primary delta gets propagated as part of <code>PutMessage</code>
delta.
++   * 3) From primary to secondary delta gets propagated as part RR distribution.
     */
 -  public void testDeltaPropagationForPR() throws Throwable {
 +  @Test
-   public void testDeltaPropagationForPR() throws Throwable {
++  public void testDeltaPropagationForPR() throws Exception {
      createCacheInAllPRVms();
      createDeltaPR(Boolean.FALSE);
      put();
@@@ -161,11 -136,10 +153,11 @@@
    }
  
    /**
--   *  Monitor number of times constructor is called
--   *  Without copy or cloning, we should have 1 instance
++   * Monitor number of times constructor is called
++   * Without copy or cloning, we should have 1 instance
     */
 -  public void testConstructorCountWithoutCloning() throws Throwable {
 +  @Test
-   public void testConstructorCountWithoutCloning() throws Throwable {
++  public void testConstructorCountWithoutCloning() throws Exception {
  
      clearConstructorCounts();
      createCacheInAllPRVms();
@@@ -182,12 -156,11 +174,12 @@@
    }
    
    /**
--   *  Monitor number of times constructor is called
--   *  With cloning, we should have more than 1 instance
--   *  on members receiving delta updates
++   * Monitor number of times constructor is called
++   * With cloning, we should have more than 1 instance
++   * on members receiving delta updates
     */
 -  public void testConstructorCountWithCloning() throws Throwable {
 +  @Test
-   public void testConstructorCountWithCloning() throws Throwable {
++  public void testConstructorCountWithCloning() throws Exception {
  
      clearConstructorCounts();
      createCacheInAllPRVms();
@@@ -205,11 -178,10 +197,11 @@@
    }
  
    /**
--   *  Create partition with cloning disabled, then
--   *  enable cloning and verify proper operation 
++   * Create partition with cloning disabled, then
++   * enable cloning and verify proper operation
     */
 -  public void testConstructorCountWithMutator() throws Throwable {
 +  @Test
-   public void testConstructorCountWithMutator() throws Throwable {
++  public void testConstructorCountWithMutator() throws Exception {
  
      clearConstructorCounts();
      createCacheInAllPRVms();
@@@ -266,7 -238,7 +258,7 @@@
      assertFalse(copy);
    }
    
--  private void clearConstructorCounts() throws Throwable {
++  private void clearConstructorCounts() throws Exception {
      setBuildCount(0);
      dataStore1.invoke(() -> PRDeltaPropagationDUnitTest.setBuildCount(0));
      dataStore2.invoke(() -> PRDeltaPropagationDUnitTest.setBuildCount(0));
@@@ -283,9 -255,8 +275,8 @@@
    /**
     * Check delta propagation works properly with PR failover.    
     */
--
 -  public void testDeltaPropagationForPRFailover() throws Throwable {
 +  @Test
-   public void testDeltaPropagationForPRFailover() throws Throwable {
++  public void testDeltaPropagationForPRFailover() throws Exception {
      Object args[] = new Object[] { REGION_NAME, new Integer(1), new Integer(50),
          new Integer(8), Boolean.FALSE, null };
      Integer port1 = (Integer)dataStore1.invoke(
@@@ -319,8 -290,7 +310,8 @@@
      client1.invoke(() -> PRDeltaPropagationDUnitTest.checkDeltaInvoked(new Integer(deltaSent)));
   
    }
  
 -  public void testDeltaPropagationForPRFailoverWithCompression() throws Throwable {
 +  @Test
-   public void testDeltaPropagationForPRFailoverWithCompression() throws Throwable {
++  public void testDeltaPropagationForPRFailoverWithCompression() throws Exception {
      Object args[] = new Object[] { REGION_NAME, new Integer(1), new Integer(50),
          new Integer(8), Boolean.FALSE, compressor };
      Integer port1 = (Integer)dataStore1.invoke(
@@@ -362,9 -332,8 +353,8 @@@
    /**
     * Check full object gets resend if delta can not be applied    
     */
--
 -  public void testDeltaPropagationForPRWithExpiry() throws Throwable {
 +  @Test
-   public void testDeltaPropagationForPRWithExpiry() throws Throwable {
++  public void testDeltaPropagationForPRWithExpiry() throws Exception {
      createCacheInAllPRVms();
      createDeltaPR(Boolean.TRUE);
      putWithExpiry();
@@@ -373,13 -342,12 +363,12 @@@
    }
  
    /**
--   *  1) Put delta objects on client feeder connected PR accessor bridge server.
--   *  2) From accessor to data store delta gets propagated as part of <code>PutMessage</code>
delta.
--   *  3) From data store to client delta should get propagated.
--   * 
++   * 1) Put delta objects on client feeder connected PR accessor bridge server.
++   * 2) From accessor to data store delta gets propagated as part of <code>PutMessage</code>
delta.
++   * 3) From data store to client delta should get propagated.
     */
 -  public void testDeltaPropagationPRAccessorAsBridgeServer() throws Throwable {
 +  @Test
-   public void testDeltaPropagationPRAccessorAsBridgeServer() throws Throwable {
++  public void testDeltaPropagationPRAccessorAsBridgeServer() throws Exception {
      Object args1[] = new Object[] { REGION_NAME, new Integer(0), new Integer(0),
          new Integer(8), Boolean.FALSE, null };
      Object args2[] = new Object[] { REGION_NAME, new Integer(0), new Integer(50),
@@@ -404,10 -372,9 +393,9 @@@
     * datastore node. This invalid delta exception propagated back to client
     * through accessor. 
     * 4) Client sends full object in response.
--   * 
     */
 -  public void testDeltaPropagationPRAccessorAsBridgeServerWithDeltaException() throws Throwable
{
 +  @Test
-   public void testDeltaPropagationPRAccessorAsBridgeServerWithDeltaException() throws Throwable
{
++  public void testDeltaPropagationPRAccessorAsBridgeServerWithDeltaException() throws Exception
{
      Object args1[] = new Object[] { REGION_NAME, new Integer(0), new Integer(0),
          new Integer(8), Boolean.FALSE, null };
      Object args2[] = new Object[] { REGION_NAME, new Integer(0), new Integer(50),
@@@ -429,14 -396,14 +417,11 @@@
      // perform invalidate on accessor
      dataStore2.invoke(() -> PRDeltaPropagationDUnitTest.invalidateDeltaKey());
      
--    /*Thread.sleep(2000);*/
--
      test = new DeltaTestImpl();
      test.setStr("DELTA");
      deltaPR.put(DELTA_KEY, test);
  
--/*    putWithExpiry();*/    
--    deltaPR.put(LAST_KEY, "");    
++    deltaPR.put(LAST_KEY, "");
      client1.invoke(() -> PRDeltaPropagationDUnitTest.waitForLastKey());    
      client1.invoke(() -> PRDeltaPropagationDUnitTest.checkForFullObject());    
    }
@@@ -449,11 -416,10 +434,10 @@@
     * datastore node. This invalid delta exception propagated back to client
     * through accessor. 
     * 4) Client sends full object in response.
--   * 
     */
 +  @Test
    public void testDeltaPropagationClientEmptyPRAccessorAsBridgeServerWithDeltaException()
--      throws Throwable {
++      throws Exception {
      Object args1[] = new Object[] { REGION_NAME, new Integer(0),
          new Integer(0), new Integer(8), Boolean.FALSE, null };
      Object args2[] = new Object[] { REGION_NAME, new Integer(0),
@@@ -496,19 -462,18 +480,17 @@@
     * datastore node. This invalid delta exception propagated back to client
     * through accessor. 
     * 4) Client sends full object in response.
--   * 
     */
 -  public void testDeltaPropagationReplicatedRegionPeerWithDeltaException() throws Throwable
{
 +  @Test
-   public void testDeltaPropagationReplicatedRegionPeerWithDeltaException() throws Throwable
{
++  public void testDeltaPropagationReplicatedRegionPeerWithDeltaException() throws Exception
{
      Object args1[] = new Object[] {Boolean.FALSE, Boolean.TRUE};
      Object args2[] = new Object[] {Boolean.TRUE, Boolean.FALSE};
--//  server 1 with empty data policy
++    //  server 1 with empty data policy
      Integer port1 = (Integer)dataStore1.invoke(
          PRDeltaPropagationDUnitTest.class, "createServerCache", args1);
      
      // server 2 with non empty data policy
--   dataStore2.invoke(
--        PRDeltaPropagationDUnitTest.class, "createServerCache", args2);
++    dataStore2.invoke(PRDeltaPropagationDUnitTest.class, "createServerCache", args2);
      
      createClientCache(port1, Boolean.FALSE, Boolean.FALSE,  Boolean.FALSE);
  
@@@ -540,9 -505,8 +522,9 @@@
     * 2) Second client attached to datastore. Register CQ.
     * 3) Varifies that no data loss, event revcieved on second client 
     */
 +  @Test
    public void testCqClientConnectAccessorAndDataStore()
--      throws Throwable {
++      throws Exception {
      Object args1[] = new Object[] { REGION_NAME, new Integer(1),
          new Integer(0), new Integer(8), Boolean.FALSE, null };
      Object args2[] = new Object[] { REGION_NAME, new Integer(1),
@@@ -591,15 -555,14 +573,15 @@@
    }
    
    /**
--   * Toplogy: PR: Accessor, dataStore.
++   * Topology: PR: Accessor, dataStore.
     * client and client1 connected to PR accessor; 
     * client puts delta objects on dataStore via accessor
--   * Accesor gets adjunctMessage about put
++   * Accessor gets adjunctMessage about put
     * Verify on client1 that queryUpdate and queryDestroy are executed properly
     */
 +  @Test
    public void testClientOnAccessorReceivesCqEvents()
--      throws Throwable {
++      throws Exception {
      Object args1[] = new Object[] { REGION_NAME, new Integer(1),
          new Integer(0), new Integer(8), Boolean.FALSE, null };
      Object args2[] = new Object[] { REGION_NAME, new Integer(1),
@@@ -644,9 -607,8 +626,9 @@@
     * client puts delta objects on accessor
     * Verify on client1 that queryUpdate and queryDestroy are executed properly
     */  
 +  @Test
    public void testCQClientOnRedundantBucketReceivesCQEvents()
--      throws Throwable {
++      throws Exception {
      // args for accessor
      Object args1[] = new Object[] { REGION_NAME, new Integer(1),
          new Integer(0), new Integer(2), Boolean.FALSE, null };
@@@ -703,9 -665,8 +685,9 @@@
     * Verify that client1 receives 2 deltas for 2 updates (due to RI)
     * Verify on client1 that queryUpdate and queryDestroy are executed properly
     */  
 +  @Test
    public void testCQRIClientOnRedundantBucketReceivesDeltaAndCQEvents()
--      throws Throwable {
++      throws Exception {
      // args for accessor
      Object args1[] = new Object[] { REGION_NAME, new Integer(1),
          new Integer(0), new Integer(2), Boolean.FALSE, null };
@@@ -751,14 -712,13 +733,13 @@@
    }
  
    /**
--   *  1) Put delta objects on client feeder connected to PR accessor bridge server.
--   *  2) From accessor to data store delta gets propagated as part of <code>PutMessage</code>
delta.
--   *  3) From data store to accessor delta + full value gets propagated as part of Adjunct
Message.
--   *  4) From accessor to client delta should get propagated.
--   * 
++   * 1) Put delta objects on client feeder connected to PR accessor bridge server.
++   * 2) From accessor to data store delta gets propagated as part of <code>PutMessage</code>
delta.
++   * 3) From data store to accessor delta + full value gets propagated as part of Adjunct
Message.
++   * 4) From accessor to client delta should get propagated.
     */
 -  public void testDeltaPropagationWithAdjunctMessaging() throws Throwable {
 +  @Test
-   public void testDeltaPropagationWithAdjunctMessaging() throws Throwable {
++  public void testDeltaPropagationWithAdjunctMessaging() throws Exception {
      Object args1[] = new Object[] { REGION_NAME, new Integer(0), new Integer(0),
          new Integer(8), Boolean.FALSE, null };
      Object args2[] = new Object[] { REGION_NAME, new Integer(0), new Integer(50),
@@@ -776,14 -736,13 +757,13 @@@
    }
    
    /**
--   *  1) Accessor is a Feeder.From accessor to data store delta gets propagated as part
of <code>PutMessage</code> delta.
--   *  2) From data store to accessor delta + full value gets propagted as part of Adjunct
Message.
--   *  3) From accessor to a client with data policy normal delta should get propagated.
--   *  4) From accessor to client with data policy empty full value should get propagated.
--   * 
++   * 1) Accessor is a Feeder.From accessor to data store delta gets propagated as part of
<code>PutMessage</code> delta.
++   * 2) From data store to accessor delta + full value gets propagted as part of Adjunct
Message.
++   * 3) From accessor to a client with data policy normal delta should get propagated.
++   * 4) From accessor to client with data policy empty full value should get propagated.
     */
 -  public void testDeltaPropagationWithAdjunctMessagingForEmptyClient() throws Throwable
{
 +  @Test
-   public void testDeltaPropagationWithAdjunctMessagingForEmptyClient() throws Throwable
{
++  public void testDeltaPropagationWithAdjunctMessagingForEmptyClient() throws Exception
{
      Object args1[] = new Object[] { REGION_NAME, new Integer(0), new Integer(0),
          new Integer(8), Boolean.FALSE, null };
      Object args2[] = new Object[] { REGION_NAME, new Integer(0), new Integer(50),
@@@ -807,15 -766,14 +787,15 @@@
    }
    
    /**
--   *  1) One accessor and one datastore is defined with a PR with zero redundant copies.
--   *  2) Client is connected only to the accessor.
--   *  3) One delta put is performed on datastore.
--   *  4) Flag to cause toDelta() throw an exception is set on datastore.
--   *  5) Another delta put is performed on datastore.
--   *  6) Verify that the second delta put fails and value on datastore is same as the one
put by first delta update. 
++   * 1) One accessor and one datastore is defined with a PR with zero redundant copies.
++   * 2) Client is connected only to the accessor.
++   * 3) One delta put is performed on datastore.
++   * 4) Flag to cause toDelta() throw an exception is set on datastore.
++   * 5) Another delta put is performed on datastore.
++   * 6) Verify that the second delta put fails and value on datastore is same as the one
put by first delta update.
     */
 -  public void testDeltaPropagationWithAdjunctMessagingAndBadDelta() throws Throwable {
 +  @Test
-   public void testDeltaPropagationWithAdjunctMessagingAndBadDelta() throws Throwable {
++  public void testDeltaPropagationWithAdjunctMessagingAndBadDelta() throws Exception {
      Object accessor[] = new Object[] { REGION_NAME, 0, 0, 8, Boolean.FALSE, null };
      Object dataStore[] = new Object[] { REGION_NAME, 0, 50, 8, Boolean.FALSE, null };
  
@@@ -849,8 -807,8 +829,6 @@@
      DeltaTestImpl.resetDeltaInvokationCounters();
    }
  
--  
--  
    // check and reset delta counters
    public static void fromDeltaCounter(Integer count) {
      assertTrue("FromDelta counters do not match, expected: " + count.intValue()
@@@ -860,7 -818,7 +838,7 @@@
    }
    
    public static void checkIsFailed() {
--    assertFalse("Full value is not recieved by server", isFailed);
++    assertFalse("Full value is not reeived by server", isFailed);
    }
    
    public static Boolean isFailed() {
@@@ -992,6 -950,6 +970,7 @@@
      AttributesMutator am = deltaPR.getAttributesMutator();
      if (isListAttach.booleanValue()) {
        am.addCacheListener(new CacheListenerAdapter() {
++        @Override
          public void afterCreate(EntryEvent event) {
            if (event.getNewValue() == null)
              isFailed = true;
@@@ -1000,7 -958,7 +979,8 @@@
              lastKeyReceived = true;
            }
          }
--        
++
++        @Override
          public void afterUpdate(EntryEvent event) {
            if (event.getNewValue() == null)
              isFailed = true;
@@@ -1019,10 -977,10 +999,10 @@@
    
    public static void createClientCache(Integer port1,
        Boolean subscriptionEnable, Boolean isEmpty, Boolean isCq) throws Exception {
 -    PRDeltaPropagationDUnitTest test = new PRDeltaPropagationDUnitTest("temp");
 +    PRDeltaPropagationDUnitTest test = new PRDeltaPropagationDUnitTest();
      Properties props = new Properties();
-     props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
-     props.setProperty(DistributionConfig.LOCATORS_NAME, "");
+     props.setProperty(MCAST_PORT, "0");
+     props.setProperty(LOCATORS, "");
      test.createCache(props);
  
      lastKeyReceived = false;
@@@ -1050,21 -1008,21 +1030,25 @@@
      
      factory.setPoolName(p.getName());
      factory.setCloningEnabled(false);
--    factory.addCacheListener(new CacheListenerAdapter(){
--    public void afterCreate(EntryEvent event) {
++    factory.addCacheListener(new CacheListenerAdapter() {
++      @Override
++      public void afterCreate(EntryEvent event) {
          if (LAST_KEY.equals(event.getKey())) {          
--        lastKeyReceived = true;
--      }}});
++          lastKeyReceived = true;
++        }
++      }
++    });
  
      RegionAttributes attrs = factory.create();
      deltaPR = cache.createRegion(REGION_NAME, attrs);
--    //deltaPR.create(DELTA_KEY, new PRDeltaTestImpl());
--    if(subscriptionEnable.booleanValue())
++    if (subscriptionEnable.booleanValue()) {
        deltaPR.registerInterest("ALL_KEYS");
++    }
      pool = p;
      if (isCq.booleanValue()) {
        CqAttributesFactory cqf = new CqAttributesFactory();
        CqListenerAdapter cqlist = new CqListenerAdapter() {
++        @Override
          @SuppressWarnings("synthetic-access")
          public void onEvent(CqEvent cqEvent) {
            if (LAST_KEY.equals(cqEvent.getKey().toString())) {
@@@ -1107,10 -1065,10 +1091,10 @@@
    }
  
    public static void createClientCache(Integer port1, Integer port2) throws Exception {
 -    PRDeltaPropagationDUnitTest test = new PRDeltaPropagationDUnitTest("temp");
 +    PRDeltaPropagationDUnitTest test = new PRDeltaPropagationDUnitTest();
      Properties props = new Properties();
-     props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
-     props.setProperty(DistributionConfig.LOCATORS_NAME, "");
+     props.setProperty(MCAST_PORT, "0");
+     props.setProperty(LOCATORS, "");
      test.createCache(props);
  
      lastKeyReceived = false;
@@@ -1127,10 -1085,10 +1111,13 @@@
      factory.setCloningEnabled(false);
      factory.setConcurrencyChecksEnabled(true);
      factory.addCacheListener(new CacheListenerAdapter(){
--    public void afterCreate(EntryEvent event) {
++      @Override
++      public void afterCreate(EntryEvent event) {
          if (LAST_KEY.equals(event.getKey())) {
--        lastKeyReceived = true;
--      }}});
++          lastKeyReceived = true;
++        }
++      }
++    });
  
      RegionAttributes attrs = factory.create();
      deltaPR = cache.createRegion(REGION_NAME, attrs);
@@@ -1257,15 -1215,15 +1244,19 @@@
    public static Boolean verifyQueryUpdateExecuted() {
      return PRDeltaPropagationDUnitTest.queryUpdateExecuted;
    }
++
    public static Boolean verifyQueryDestroyExecuted() {
      return PRDeltaPropagationDUnitTest.queryDestroyExecuted;
    }
++
    public static Boolean checkVMRecievesDeltaObjectThrCQListner() {
      return PRDeltaPropagationDUnitTest.notADeltaInstanceObj;
    }
++
    public static boolean isLastKeyReceived() {
      return lastKeyReceived;
    }
++
    public static void verifyDeltaSent(Integer deltas) {
      CacheClientNotifier ccn = ((CacheServerImpl)cache
          .getCacheServers().toArray()[0]).getAcceptor()
@@@ -1317,6 -1275,6 +1308,7 @@@
      public PRDeltaTestImpl() {
      }
  
++    @Override
      public void toDelta(DataOutput out) throws IOException {
        super.toDelta(out);
        if (isBadToDelta) {
@@@ -1325,6 -1283,6 +1317,7 @@@
        deltaSent++;
      }
  
++    @Override
      public void fromDelta(DataInput in) throws IOException {
        super.fromDelta(in);
        if (isBadFromDelta) {
@@@ -1341,6 -1299,6 +1334,7 @@@
        return deltaApplied;
      }
  
++    @Override
      public String toString() {
        return "PRDeltaTestImpl[deltaApplied=" + deltaApplied + "]"
            + super.toString();


Mime
View raw message