Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 2FFEB200B33 for ; Tue, 14 Jun 2016 21:10:54 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 2E658160A5F; Tue, 14 Jun 2016 19:10:54 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 390EB160A06 for ; Tue, 14 Jun 2016 21:10:52 +0200 (CEST) Received: (qmail 43296 invoked by uid 500); 14 Jun 2016 19:10:51 -0000 Mailing-List: contact commits-help@geode.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@geode.incubator.apache.org Delivered-To: mailing list commits@geode.incubator.apache.org Received: (qmail 43287 invoked by uid 99); 14 Jun 2016 19:10:51 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 Jun 2016 19:10:51 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id D83B3C02B9 for ; Tue, 14 Jun 2016 19:10:50 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -4.646 X-Spam-Level: X-Spam-Status: No, score=-4.646 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-1.426] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id NyINkIiAQVyz for ; Tue, 14 Jun 2016 19:10:46 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with SMTP id A7CE560E47 for ; Tue, 14 Jun 2016 19:10:13 +0000 (UTC) Received: (qmail 34322 invoked by uid 99); 14 Jun 2016 19:10:12 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 Jun 2016 19:10:12 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 7EFC2E0BAC; Tue, 14 Jun 2016 19:10:12 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: sai_boorlagadda@apache.org To: commits@geode.incubator.apache.org Date: Tue, 14 Jun 2016 19:10:48 -0000 Message-Id: <072ac92a7d9e492f95f74652fc53980c@git.apache.org> In-Reply-To: <0f37fed0a7ca4cbbacc4deb855d88529@git.apache.org> References: <0f37fed0a7ca4cbbacc4deb855d88529@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [38/90] [abbrv] [partial] incubator-geode git commit: GEODE-837: update tests from JUnit3 to JUnit4 archived-at: Tue, 14 Jun 2016 19:10:54 -0000 http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/OffHeapLRUEvictionControllerDUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/OffHeapLRUEvictionControllerDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/OffHeapLRUEvictionControllerDUnitTest.java index dd49966..18d08c5 100644 --- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/OffHeapLRUEvictionControllerDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/OffHeapLRUEvictionControllerDUnitTest.java @@ -16,16 +16,19 @@ */ package com.gemstone.gemfire.cache30; +import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*; + +import java.util.Properties; + +import org.junit.experimental.categories.Category; + import com.gemstone.gemfire.internal.cache.GemFireCacheImpl; import com.gemstone.gemfire.internal.cache.OffHeapTestUtil; import com.gemstone.gemfire.internal.cache.control.InternalResourceManager.ResourceType; import com.gemstone.gemfire.internal.cache.lru.HeapEvictor; import com.gemstone.gemfire.test.dunit.Invoke; import com.gemstone.gemfire.test.dunit.SerializableRunnable; - -import java.util.Properties; - -import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*; +import com.gemstone.gemfire.test.junit.categories.DistributedTest; /** * Tests the basic functionality of the lru eviction @@ -33,11 +36,12 @@ import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties * * @since Geode 1.0 */ +@Category(DistributedTest.class) public class OffHeapLRUEvictionControllerDUnitTest extends LRUEvictionControllerDUnitTest { - public OffHeapLRUEvictionControllerDUnitTest(String name) { - super(name); + public OffHeapLRUEvictionControllerDUnitTest() { + super(); } @Override http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/PRBucketSynchronizationDUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/PRBucketSynchronizationDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/PRBucketSynchronizationDUnitTest.java index 3a202c6..8fb4487 100644 --- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/PRBucketSynchronizationDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/PRBucketSynchronizationDUnitTest.java @@ -15,6 +15,15 @@ * limitations under the License. */ package com.gemstone.gemfire.cache30; + +import org.junit.experimental.categories.Category; +import org.junit.Test; + +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.util.HashSet; @@ -54,7 +63,8 @@ import com.gemstone.gemfire.test.dunit.WaitCriterion; * * */ -public class PRBucketSynchronizationDUnitTest extends CacheTestCase { +@Category(DistributedTest.class) +public class PRBucketSynchronizationDUnitTest extends JUnit4CacheTestCase { static enum TestType { IN_MEMORY, OVERFLOW, @@ -63,18 +73,21 @@ public class PRBucketSynchronizationDUnitTest extends CacheTestCase { public static LocalRegion TestRegion; - public PRBucketSynchronizationDUnitTest(String name) { - super(name); + public PRBucketSynchronizationDUnitTest() { + super(); } + @Test public void testThatBucketSyncOnPrimaryLoss() { doBucketsSyncOnPrimaryLoss(TestType.IN_MEMORY); } + @Test public void testThatBucketsSyncOnPrimaryLossWithPersistence() { doBucketsSyncOnPrimaryLoss(TestType.PERSISTENT); } + @Test public void testThatBucketsSyncOnPrimaryLossWithOverflow() { doBucketsSyncOnPrimaryLoss(TestType.OVERFLOW); } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/PartitionedRegionCompressionDUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/PartitionedRegionCompressionDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/PartitionedRegionCompressionDUnitTest.java index d099761..78d7db9 100644 --- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/PartitionedRegionCompressionDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/PartitionedRegionCompressionDUnitTest.java @@ -16,6 +16,15 @@ */ package com.gemstone.gemfire.cache30; +import org.junit.experimental.categories.Category; +import org.junit.Test; + +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 com.gemstone.gemfire.cache.AttributesFactory; import com.gemstone.gemfire.cache.RegionAttributes; import com.gemstone.gemfire.compression.Compressor; @@ -26,11 +35,12 @@ import com.gemstone.gemfire.compression.SnappyCompressor; * * @since GemFire 8.0 */ +@Category(DistributedTest.class) public class PartitionedRegionCompressionDUnitTest extends PartitionedRegionDUnitTest { - public PartitionedRegionCompressionDUnitTest(String name) { - super(name); + public PartitionedRegionCompressionDUnitTest() { + super(); } @SuppressWarnings({ "rawtypes", "unchecked" }) http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/PartitionedRegionDUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/PartitionedRegionDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/PartitionedRegionDUnitTest.java index 09084be..9896110 100644 --- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/PartitionedRegionDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/PartitionedRegionDUnitTest.java @@ -16,12 +16,16 @@ */ package com.gemstone.gemfire.cache30; +import static org.junit.Assert.*; + import java.io.Serializable; import java.util.Collection; import java.util.Iterator; import java.util.Random; import java.util.Set; +import org.junit.Ignore; +import org.junit.Test; import org.junit.experimental.categories.Category; import com.gemstone.gemfire.LogWriter; @@ -48,6 +52,7 @@ import com.gemstone.gemfire.test.dunit.Host; import com.gemstone.gemfire.test.dunit.SerializableCallable; import com.gemstone.gemfire.test.dunit.SerializableRunnable; import com.gemstone.gemfire.test.dunit.VM; +import com.gemstone.gemfire.test.junit.categories.DistributedTest; import com.gemstone.gemfire.test.junit.categories.FlakyTest; /** @@ -57,63 +62,65 @@ import com.gemstone.gemfire.test.junit.categories.FlakyTest; * * @since GemFire 5.1 */ +@Category(DistributedTest.class) public class PartitionedRegionDUnitTest extends MultiVMRegionTestCase { - + + public static boolean InvalidateInvoked = false; + static int oldLogLevel; - public PartitionedRegionDUnitTest(String name) { - super(name); + @Override + protected boolean supportsSubregions() { + return false; } - /* - * (non-Javadoc) - * @see com.gemstone.gemfire.cache30.RegionTestCase#supportsSubregions() - */ - protected boolean supportsSubregions() { return false; } - - /* - * (non-Javadoc) - * @see com.gemstone.gemfire.cache30.MultiVMRegionTestCase#supportsNetLoad() - */ - protected boolean supportsNetLoad() { return false; } + @Override + protected boolean supportsNetLoad() { + return false; + } - /* - * (non-Javadoc) - * @see com.gemstone.gemfire.cache30.MultiVMRegionTestCase#supportsReplication() - */ - protected boolean supportsReplication() { return false; } + @Override + protected boolean supportsReplication() { + return false; + } - /* - * (non-Javadoc) - * @see com.gemstone.gemfire.cache30.MultiVMRegionTestCase#supportsTransactions() - */ - protected boolean supportsTransactions() { return false; } + @Override + protected boolean supportsTransactions() { + return false; + } - /* - * (non-Javadoc) - * @see com.gemstone.gemfire.cache30.RegionTestCase#supportsLocalDestroyAndLocalInvalidate() - */ - protected boolean supportsLocalDestroyAndLocalInvalidate() { return false; } + protected boolean supportsLocalDestroyAndLocalInvalidate() { + return false; + } + @Ignore("TODO: test is not implemented for partioned regions") + @Override + @Test public void testCacheLoaderModifyingArgument() throws InterruptedException { // TODO, implement a specific PR related test that properly reflects primary allocation // and event deliver based on that allocation } + @Ignore("TODO: test is not implemented for partioned regions") + @Override + @Test public void testLocalAndRemoteCacheWriters() throws InterruptedException { // TODO, implement a specific PR related test that properly reflects primary allocation // and event deliver based on that allocation } + @Ignore("TODO: test is not implemented for partioned regions") + @Override + @Test public void testLocalCacheLoader() { // TODO, implement a specific PR related test that properly reflects primary allocation // and event deliver based on that allocation } - /** * Returns region attributes for a partitioned region with distributed-ack scope */ + @Override protected RegionAttributes getRegionAttributes() { AttributesFactory factory = new AttributesFactory(); factory.setEarlyAck(false); @@ -163,17 +170,12 @@ public class PartitionedRegionDUnitTest extends MultiVMRegionTestCase { } } - ////////////////////// Test Methods ////////////////////// - - public static boolean InvalidateInvoked = false; - /** * Bug #47235 concerns assertion failures being thrown when there is a * member that receives adjunct messages (as in a WAN gateway, a peer * with clients, etc). - * - * @throws Exception */ + @Test public void testRegionInvalidationWithAdjunctMessages() throws Exception { final String name = getUniqueName(); VM vm1 = Host.getHost(0).getVM(1); @@ -213,12 +215,9 @@ public class PartitionedRegionDUnitTest extends MultiVMRegionTestCase { /** * Tests the compatibility of creating certain kinds of subregions * of a local region. - * - * @see Region#createSubregion */ - public void testIncompatibleSubregions() - throws CacheException, InterruptedException { - + @Test + public void testIncompatibleSubregions() throws CacheException, InterruptedException { Host host = Host.getHost(0); VM vm0 = host.getVM(0); VM vm1 = host.getVM(1); @@ -253,7 +252,6 @@ public class PartitionedRegionDUnitTest extends MultiVMRegionTestCase { } }); } - private void setupExtendedTest(final String regionName, final int numVals) { Host host = Host.getHost(0); @@ -313,6 +311,7 @@ public class PartitionedRegionDUnitTest extends MultiVMRegionTestCase { * test with multiple vms and a decent spread of keys */ @Category(FlakyTest.class) // GEODE-555: retry loops, use of Random + @Test public void testExtendedKeysValues() { final String regionName = getUniqueName(); final int numEntries = 20000; @@ -375,76 +374,59 @@ public class PartitionedRegionDUnitTest extends MultiVMRegionTestCase { } // these tests make no sense for partitioned regions + + @Ignore("Not implemented for partitioned regions") + @Override + @Test public void testDefinedEntryUpdated() { - unimplemented(); } + + @Ignore("Not implemented for partitioned regions") + @Override + @Test public void testRemoteCacheListener() { - unimplemented(); } - - // these tests require getEntry support - need an alternative way of checking - // the results that can be overridden here -// public void testDistributedUpdate() { -// unimplemented(); -// } -// public void testDistributedPutNoUpdate() { -// unimplemented(); -// } -// public void testDistributedInvalidate() { -// unimplemented(); -// } -// public void testDistributedInvalidate4() { -// unimplemented(); -// } -// public void testContainsKey() { -// unimplemented(); -// } -// public void testBadRegionAccess() { -// unimplemented(); -// } -// public void testPutNonExistentEntry() { -// unimplemented(); -// } -// public void testDestroyEntry() { -// unimplemented(); -// } -// public void testInvalidateEntry() { -// unimplemented(); -// } -// public void testDistributedDestroy() { -// unimplemented(); -// } - - // user attributes aren't supported in partitioned regions at this time (5.1) + + @Ignore("Not implemented for partitioned regions") + @Override + @Test public void testEntryUserAttribute() { - unimplemented(); } - // these tests require misc Region operations not currently supported by PRs + + @Ignore("Not implemented for partitioned regions") + @Override + @Test public void testInvalidateRegion() { - unimplemented(); } + + @Ignore("Not implemented for partitioned regions") + @Override + @Test public void testLocalDestroyRegion() { - unimplemented(); } + + @Ignore("Not implemented for partitioned regions") + @Override + @Test public void testLocalInvalidateRegion() { - unimplemented(); } + + @Ignore("Not implemented for partitioned regions") + @Override + @Test public void testSnapshot() { - unimplemented(); } + + @Ignore("Not implemented for partitioned regions") + @Override + @Test public void testRootSnapshot() { - unimplemented(); } - private void unimplemented() { -// StackTraceElement stack[] = new Exception("dummy").getStackTrace(); -// getLogWriter().info(stack[1].getClassName() + "." + stack[1].getMethodName() -// + ": this test is not implemented for PartitionedRegions at this time"); - } static class PoisonedKey implements Serializable { static volatile boolean poisoned = false; static volatile boolean poisonDetected = false; @@ -458,7 +440,8 @@ public class PartitionedRegionDUnitTest extends MultiVMRegionTestCase { poisonDetected = false; // restore default static value return result; } - + + @Override public int hashCode() { int result = k.hashCode(); synchronized (PoisonedKey.class) { @@ -474,7 +457,8 @@ public class PartitionedRegionDUnitTest extends MultiVMRegionTestCase { PoisonedKey(String s) { this.k = s; } - + + @Override public boolean equals(Object o) { if (o == null) { return false; @@ -490,6 +474,7 @@ public class PartitionedRegionDUnitTest extends MultiVMRegionTestCase { } } + @Test public void testBadHash() { final String regionName = getUniqueName(); Host host = Host.getHost(0); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/PartitionedRegionMembershipListenerDUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/PartitionedRegionMembershipListenerDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/PartitionedRegionMembershipListenerDUnitTest.java index f4b5f12..573d62e 100644 --- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/PartitionedRegionMembershipListenerDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/PartitionedRegionMembershipListenerDUnitTest.java @@ -20,6 +20,15 @@ */ package com.gemstone.gemfire.cache30; +import org.junit.experimental.categories.Category; +import org.junit.Test; + +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.util.Arrays; import java.util.List; @@ -36,14 +45,15 @@ import com.gemstone.gemfire.test.dunit.VM; /** * @since GemFire 6.0 */ +@Category(DistributedTest.class) public class PartitionedRegionMembershipListenerDUnitTest extends RegionMembershipListenerDUnitTest { private transient MyRML myPRListener; private transient Region prr; // root region - public PartitionedRegionMembershipListenerDUnitTest(String name) { - super(name); + public PartitionedRegionMembershipListenerDUnitTest() { + super(); } @Override http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/PartitionedRegionOffHeapDUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/PartitionedRegionOffHeapDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/PartitionedRegionOffHeapDUnitTest.java index b487ac7..97856d2 100755 --- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/PartitionedRegionOffHeapDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/PartitionedRegionOffHeapDUnitTest.java @@ -16,27 +16,27 @@ */ package com.gemstone.gemfire.cache30; +import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*; + +import java.util.Properties; + +import org.junit.experimental.categories.Category; + import com.gemstone.gemfire.cache.AttributesFactory; import com.gemstone.gemfire.cache.RegionAttributes; import com.gemstone.gemfire.internal.cache.OffHeapTestUtil; import com.gemstone.gemfire.test.dunit.Invoke; import com.gemstone.gemfire.test.dunit.SerializableRunnable; - -import java.util.Properties; - -import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*; +import com.gemstone.gemfire.test.junit.categories.DistributedTest; /** * Tests Partitioned Region with OffHeap memory. * * @since Geode 1.0 */ +@Category(DistributedTest.class) public class PartitionedRegionOffHeapDUnitTest extends PartitionedRegionDUnitTest { - public PartitionedRegionOffHeapDUnitTest(String name) { - super(name); - } - @Override public final void preTearDownAssertions() throws Exception { SerializableRunnable checkOrphans = new SerializableRunnable() { @@ -59,8 +59,8 @@ public class PartitionedRegionOffHeapDUnitTest extends PartitionedRegionDUnitTes return props; } - @SuppressWarnings({ "rawtypes", "unchecked" }) @Override + @SuppressWarnings({ "rawtypes", "unchecked" }) protected RegionAttributes getRegionAttributes() { RegionAttributes attrs = super.getRegionAttributes(); AttributesFactory factory = new AttributesFactory(attrs); @@ -68,8 +68,8 @@ public class PartitionedRegionOffHeapDUnitTest extends PartitionedRegionDUnitTes return factory.create(); } - @SuppressWarnings({ "rawtypes", "unchecked" }) @Override + @SuppressWarnings({ "rawtypes", "unchecked" }) protected RegionAttributes getRegionAttributes(String type) { RegionAttributes ra = super.getRegionAttributes(type); AttributesFactory factory = new AttributesFactory(ra); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/PreloadedRegionTestCase.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/PreloadedRegionTestCase.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/PreloadedRegionTestCase.java index 3508e7c..b897603 100644 --- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/PreloadedRegionTestCase.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/PreloadedRegionTestCase.java @@ -16,6 +16,15 @@ */ package com.gemstone.gemfire.cache30; +import org.junit.experimental.categories.Category; +import org.junit.Test; + +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 com.gemstone.gemfire.cache.AttributesFactory; import com.gemstone.gemfire.cache.CacheException; import com.gemstone.gemfire.cache.DataPolicy; @@ -33,10 +42,11 @@ import com.gemstone.gemfire.test.dunit.VM; * * @since GemFire 3.0 */ +@Category(DistributedTest.class) public class PreloadedRegionTestCase extends MultiVMRegionTestCase { - public PreloadedRegionTestCase(String name) { - super(name); + public PreloadedRegionTestCase() { + super(); } /** @@ -52,6 +62,7 @@ public class PreloadedRegionTestCase extends MultiVMRegionTestCase { /** * Tests that created entries are not propagated to other caches */ + @Test public void testDistributedCreate() throws Exception { final String rgnName = getUniqueName(); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/ProxyDUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/ProxyDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/ProxyDUnitTest.java index 3f66b32..9d63376 100644 --- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/ProxyDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/ProxyDUnitTest.java @@ -16,6 +16,15 @@ */ package com.gemstone.gemfire.cache30; +import org.junit.experimental.categories.Category; +import org.junit.Test; + +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.util.HashMap; import java.util.Map; @@ -50,15 +59,16 @@ import com.gemstone.gemfire.test.dunit.VM; * * @since GemFire 5.0 */ -public class ProxyDUnitTest extends CacheTestCase { +@Category(DistributedTest.class) +public class ProxyDUnitTest extends JUnit4CacheTestCase { private transient Region r; private transient DistributedMember otherId; protected transient int clInvokeCount; protected transient CacheEvent clLastEvent; - public ProxyDUnitTest(String name) { - super(name); + public ProxyDUnitTest() { + super(); } private VM getOtherVm() { @@ -532,13 +542,16 @@ public class ProxyDUnitTest extends CacheTestCase { assertTrue(r.isDestroyed()); } + @Test public void testDistributedOpsPROXY() throws CacheException { distributedOps(DataPolicy.EMPTY, InterestPolicy.CACHE_CONTENT); } + @Test public void testRemoteOriginOpsPROXY() throws CacheException { remoteOriginOps(DataPolicy.EMPTY, InterestPolicy.CACHE_CONTENT); } + @Test public void testRemoteOriginOpsPROXY_ALL() throws CacheException { remoteOriginOps(DataPolicy.EMPTY, InterestPolicy.ALL); } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/PutAllCallBkRemoteVMDUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/PutAllCallBkRemoteVMDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/PutAllCallBkRemoteVMDUnitTest.java index a2019bf..0be9153 100644 --- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/PutAllCallBkRemoteVMDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/PutAllCallBkRemoteVMDUnitTest.java @@ -22,10 +22,15 @@ */ package com.gemstone.gemfire.cache30; +import static org.junit.Assert.*; + import java.util.HashMap; import java.util.Map; import java.util.Properties; +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; @@ -40,22 +45,16 @@ import com.gemstone.gemfire.cache.Scope; import com.gemstone.gemfire.cache.util.CacheListenerAdapter; import com.gemstone.gemfire.cache.util.CacheWriterAdapter; import com.gemstone.gemfire.distributed.DistributedSystem; -import com.gemstone.gemfire.test.dunit.DistributedTestCase; import com.gemstone.gemfire.test.dunit.Host; import com.gemstone.gemfire.test.dunit.LogWriterUtils; import com.gemstone.gemfire.test.dunit.VM; import com.gemstone.gemfire.test.dunit.Wait; import com.gemstone.gemfire.test.dunit.WaitCriterion; +import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase; +import com.gemstone.gemfire.test.junit.categories.DistributedTest; -/** - * - */ -public class PutAllCallBkRemoteVMDUnitTest extends DistributedTestCase { - - /** Creates a new instance of PutAllCallBkRemoteVMDUnitTest */ - public PutAllCallBkRemoteVMDUnitTest(String name) { - super(name); - } +@Category(DistributedTest.class) +public class PutAllCallBkRemoteVMDUnitTest extends JUnit4DistributedTestCase { static volatile Cache cache; static Properties props = new Properties(); @@ -96,7 +95,7 @@ public class PutAllCallBkRemoteVMDUnitTest extends DistributedTestCase { public static synchronized void createCacheForVM0(){ try{ - ds = (new PutAllCallBkRemoteVMDUnitTest("temp")).getSystem(props); + ds = (new PutAllCallBkRemoteVMDUnitTest()).getSystem(props); cache = CacheFactory.create(ds); AttributesFactory factory = new AttributesFactory(); factory.setDataPolicy(DataPolicy.REPLICATE); @@ -116,7 +115,7 @@ public class PutAllCallBkRemoteVMDUnitTest extends DistributedTestCase { CacheListener aListener = new AfterCreateCallback(); CacheWriter aWriter = new BeforeCreateCallback(); - ds = (new PutAllCallBkRemoteVMDUnitTest("temp")).getSystem(props); + ds = (new PutAllCallBkRemoteVMDUnitTest()).getSystem(props); cache = CacheFactory.create(ds); AttributesFactory factory = new AttributesFactory(); factory.setDataPolicy(DataPolicy.REPLICATE); @@ -148,7 +147,8 @@ public class PutAllCallBkRemoteVMDUnitTest extends DistributedTestCase { //test methods - public void testputAllRemoteVM(){ + @Test + public void testputAllRemoteVM(){ Host host = Host.getHost(0); VM vm0 = host.getVM(0); @@ -214,7 +214,8 @@ public class PutAllCallBkRemoteVMDUnitTest extends DistributedTestCase { } - public void testPutAllAfterUpdateCallbacks(){ + @Test + public void testPutAllAfterUpdateCallbacks(){ Host host = Host.getHost(0); VM vm0 = host.getVM(0); VM vm1 = host.getVM(1); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/PutAllCallBkSingleVMDUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/PutAllCallBkSingleVMDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/PutAllCallBkSingleVMDUnitTest.java index faeb8b3..db3e9e9 100644 --- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/PutAllCallBkSingleVMDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/PutAllCallBkSingleVMDUnitTest.java @@ -22,10 +22,15 @@ */ package com.gemstone.gemfire.cache30; +import static org.junit.Assert.*; + import java.util.HashMap; import java.util.Map; import java.util.Properties; +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; @@ -40,17 +45,14 @@ import com.gemstone.gemfire.cache.util.CacheListenerAdapter; import com.gemstone.gemfire.cache.util.CacheWriterAdapter; import com.gemstone.gemfire.distributed.DistributedSystem; import com.gemstone.gemfire.test.dunit.Assert; -import com.gemstone.gemfire.test.dunit.DistributedTestCase; import com.gemstone.gemfire.test.dunit.Host; import com.gemstone.gemfire.test.dunit.LogWriterUtils; import com.gemstone.gemfire.test.dunit.VM; +import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase; +import com.gemstone.gemfire.test.junit.categories.DistributedTest; -public class PutAllCallBkSingleVMDUnitTest extends DistributedTestCase{ - - /** Creates a new instance of PutAllCallBkSingleVMDUnitTest */ - public PutAllCallBkSingleVMDUnitTest(String name) { - super(name); - } +@Category(DistributedTest.class) +public class PutAllCallBkSingleVMDUnitTest extends JUnit4DistributedTestCase { static volatile Cache cache; static Properties props = new Properties(); @@ -89,7 +91,7 @@ public class PutAllCallBkSingleVMDUnitTest extends DistributedTestCase{ try{ CacheListener aListener = new AfterCreateCallback(); CacheWriter aWriter = new BeforeCreateCallback(); - ds = (new PutAllCallBkSingleVMDUnitTest("temp")).getSystem(props); + ds = (new PutAllCallBkSingleVMDUnitTest()).getSystem(props); cache = CacheFactory.create(ds); AttributesFactory factory = new AttributesFactory(); factory.setScope(Scope.DISTRIBUTED_ACK); @@ -118,7 +120,8 @@ public class PutAllCallBkSingleVMDUnitTest extends DistributedTestCase{ } //test methods - public void testputAllSingleVM(){ + @Test + public void testputAllSingleVM(){ Host host = Host.getHost(0); VM vm0 = host.getVM(0); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/PutAllMultiVmDUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/PutAllMultiVmDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/PutAllMultiVmDUnitTest.java index cee7263..f6f2198 100644 --- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/PutAllMultiVmDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/PutAllMultiVmDUnitTest.java @@ -22,11 +22,16 @@ */ package com.gemstone.gemfire.cache30; +import static org.junit.Assert.*; + import java.util.HashMap; import java.util.Map; import java.util.Properties; import java.util.TreeMap; +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; @@ -38,21 +43,15 @@ import com.gemstone.gemfire.cache.RegionAttributes; import com.gemstone.gemfire.cache.RegionDestroyedException; import com.gemstone.gemfire.cache.Scope; import com.gemstone.gemfire.distributed.DistributedSystem; -import com.gemstone.gemfire.test.dunit.DistributedTestCase; import com.gemstone.gemfire.test.dunit.Host; import com.gemstone.gemfire.test.dunit.Invoke; import com.gemstone.gemfire.test.dunit.SerializableRunnable; import com.gemstone.gemfire.test.dunit.VM; +import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase; +import com.gemstone.gemfire.test.junit.categories.DistributedTest; -/** - * - */ -public class PutAllMultiVmDUnitTest extends DistributedTestCase{ - - /** Creates a new instance of PutAllMultiVmDUnitTest */ - public PutAllMultiVmDUnitTest(String name) { - super(name); - } +@Category(DistributedTest.class) +public class PutAllMultiVmDUnitTest extends JUnit4DistributedTestCase { // TODO: reformat static Cache cache; static Properties props = new Properties(); @@ -84,7 +83,7 @@ public class PutAllMultiVmDUnitTest extends DistributedTestCase{ public static void createCache(){ try{ - ds = (new PutAllMultiVmDUnitTest("temp")).getSystem(props); + ds = (new PutAllMultiVmDUnitTest()).getSystem(props); cache = CacheFactory.create(ds); AttributesFactory factory = new AttributesFactory(); factory.setScope(Scope.DISTRIBUTED_ACK); @@ -122,7 +121,8 @@ public class PutAllMultiVmDUnitTest extends DistributedTestCase{ //tests methods - public void testSimplePutAll(){ + @Test + public void testSimplePutAll(){ Host host = Host.getHost(0); VM vm0 = host.getVM(0); VM vm1 = host.getVM(1); @@ -226,7 +226,8 @@ public class PutAllMultiVmDUnitTest extends DistributedTestCase{ }//end of testSimplePutAll - public void testPutAllExceptions(){ + @Test + public void testPutAllExceptions(){ Host host = Host.getHost(0); VM vm0 = host.getVM(0); VM vm1 = host.getVM(1); @@ -326,7 +327,8 @@ public class PutAllMultiVmDUnitTest extends DistributedTestCase{ }//end of testPutAllExceptions - public void testPutAllExceptionHandling(){ + @Test + public void testPutAllExceptionHandling(){ Host host = Host.getHost(0); VM vm0 = host.getVM(0); // VM vm1 = host.getVM(1); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/QueueMsgDUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/QueueMsgDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/QueueMsgDUnitTest.java index 7a98188..590166b 100644 --- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/QueueMsgDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/QueueMsgDUnitTest.java @@ -16,39 +16,54 @@ */ package com.gemstone.gemfire.cache30; -import com.gemstone.gemfire.cache.*; -import com.gemstone.gemfire.internal.cache.CachePerfStats; -import com.gemstone.gemfire.internal.cache.DistributedRegion; -import com.gemstone.gemfire.test.dunit.*; +import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*; +import static org.junit.Assert.*; import java.util.List; import java.util.Map; import java.util.Properties; import java.util.TreeMap; -import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*; +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.CacheEvent; +import com.gemstone.gemfire.cache.CacheException; +import com.gemstone.gemfire.cache.DataPolicy; +import com.gemstone.gemfire.cache.EntryEvent; +import com.gemstone.gemfire.cache.InterestPolicy; +import com.gemstone.gemfire.cache.Operation; +import com.gemstone.gemfire.cache.Region; +import com.gemstone.gemfire.cache.RegionEvent; +import com.gemstone.gemfire.cache.Scope; +import com.gemstone.gemfire.cache.SubscriptionAttributes; +import com.gemstone.gemfire.internal.cache.CachePerfStats; +import com.gemstone.gemfire.internal.cache.DistributedRegion; +import com.gemstone.gemfire.test.dunit.Host; +import com.gemstone.gemfire.test.dunit.SerializableRunnable; +import com.gemstone.gemfire.test.dunit.VM; +import com.gemstone.gemfire.test.dunit.Wait; +import com.gemstone.gemfire.test.dunit.WaitCriterion; +import com.gemstone.gemfire.test.junit.categories.DistributedTest; /** * Test to make sure message queuing works. * * @since GemFire 5.0 */ +@Category(DistributedTest.class) public class QueueMsgDUnitTest extends ReliabilityTestCase { - public QueueMsgDUnitTest(String name) { - super(name); - } - /** * Make sure that cache operations are queued when a required role is missing */ - public void disabled_testQueueWhenRoleMissing() throws Exception { + @Ignore("TODO: test is disabled") + @Test + public void testQueueWhenRoleMissing() throws Exception { AttributesFactory factory = new AttributesFactory(); factory.setScope(Scope.DISTRIBUTED_ACK); -// factory.setMembershipAttributes( -// new MembershipAttributes(new String[]{"missing"}, -// LossAction.FULL_ACCESS_WITH_QUEUING, -// ResumptionAction.NONE)); DistributedRegion r = (DistributedRegion)createRootRegion(factory.create()); final CachePerfStats stats = r.getCachePerfStats(); int queuedOps = stats.getReliableQueuedOps(); @@ -207,13 +222,11 @@ public class QueueMsgDUnitTest extends ReliabilityTestCase { /** * Make sure a queued region does not allow non-queued subscribers */ - public void disabled_testIllegalConfigQueueExists() throws Exception { + @Ignore("TODO: test is disabled") + @Test + public void testIllegalConfigQueueExists() throws Exception { AttributesFactory factory = new AttributesFactory(); factory.setScope(Scope.DISTRIBUTED_ACK); -// factory.setMembershipAttributes( -// new MembershipAttributes(new String[]{"pubFirst"}, -// LossAction.FULL_ACCESS_WITH_QUEUING, -// ResumptionAction.NONE)); createRootRegion(factory.create()); VM vm = Host.getHost(0).getVM(0); @@ -247,11 +260,14 @@ public class QueueMsgDUnitTest extends ReliabilityTestCase { } }); } + /** * Make sure a subscriber that does not allow queued messages causes a * queued publisher to fail creation */ - public void disable_testIllegalConfigSubscriberExists() throws Exception { + @Ignore("TODO: test is disabled") + @Test + public void testIllegalConfigSubscriberExists() throws Exception { final String expectedExceptions = "does not allow queued messages"; VM vm = Host.getHost(0).getVM(0); @@ -277,11 +293,7 @@ public class QueueMsgDUnitTest extends ReliabilityTestCase { AttributesFactory factory = new AttributesFactory(); factory.setScope(Scope.DISTRIBUTED_ACK); -// factory.setMembershipAttributes( -// new MembershipAttributes(new String[]{"subFirst"}, -// LossAction.FULL_ACCESS_WITH_QUEUING, -// ResumptionAction.NONE)); - getCache().getLogger().info("" + + getCache().getLogger().info("" + expectedExceptions + ""); try { createRootRegion(factory.create()); @@ -292,7 +304,4 @@ public class QueueMsgDUnitTest extends ReliabilityTestCase { expectedExceptions + ""); } } - public void testEmpty() { - // just to dunit happy - } } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/RRSynchronizationDUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/RRSynchronizationDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/RRSynchronizationDUnitTest.java index fc69bda..a46bbab 100644 --- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/RRSynchronizationDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/RRSynchronizationDUnitTest.java @@ -15,6 +15,15 @@ * limitations under the License. */ package com.gemstone.gemfire.cache30; + +import org.junit.experimental.categories.Category; +import org.junit.Test; + +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 com.gemstone.gemfire.cache.*; import com.gemstone.gemfire.distributed.internal.membership.InternalDistributedMember; @@ -29,7 +38,8 @@ import com.gemstone.gemfire.test.dunit.*; * * */ -public class RRSynchronizationDUnitTest extends CacheTestCase { +@Category(DistributedTest.class) +public class RRSynchronizationDUnitTest extends JUnit4CacheTestCase { static enum TestType { IN_MEMORY, OVERFLOW, @@ -38,18 +48,21 @@ public class RRSynchronizationDUnitTest extends CacheTestCase { public static LocalRegion TestRegion; - public RRSynchronizationDUnitTest(String name) { - super(name); + public RRSynchronizationDUnitTest() { + super(); } + @Test public void testThatRegionsSyncOnPeerLoss() { doRegionsSyncOnPeerLoss(TestType.IN_MEMORY); } + @Test public void testThatRegionsSyncOnPeerLossWithPersistence() { doRegionsSyncOnPeerLoss(TestType.PERSISTENT); } + @Test public void testThatRegionsSyncOnPeerLossWithOverflow() { doRegionsSyncOnPeerLoss(TestType.OVERFLOW); } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/ReconnectDUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/ReconnectDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/ReconnectDUnitTest.java index a3ad8f5..f7a9830 100755 --- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/ReconnectDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/ReconnectDUnitTest.java @@ -16,6 +16,15 @@ */ package com.gemstone.gemfire.cache30; +import org.junit.experimental.categories.Category; +import org.junit.Test; + +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 com.gemstone.gemfire.CancelException; import com.gemstone.gemfire.SystemFailure; import com.gemstone.gemfire.cache.*; @@ -50,7 +59,8 @@ import java.util.concurrent.TimeUnit; import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*; @SuppressWarnings("serial") -public class ReconnectDUnitTest extends CacheTestCase +@Category(DistributedTest.class) +public class ReconnectDUnitTest extends JUnit4CacheTestCase { static int locatorPort; static Locator locator; @@ -62,8 +72,8 @@ public class ReconnectDUnitTest extends CacheTestCase static Properties dsProperties; static String fileSeparator = File.separator; - public ReconnectDUnitTest(String name) { - super(name); + public ReconnectDUnitTest() { + super(); } @Override @@ -169,6 +179,7 @@ public class ReconnectDUnitTest extends CacheTestCase } + @Test public void testReconnectWithQuorum() throws Exception { // quorum check fails, then succeeds IgnoredException.addIgnoredException("killing member's ds"); @@ -230,6 +241,7 @@ public class ReconnectDUnitTest extends CacheTestCase } + @Test public void testReconnectOnForcedDisconnect() throws Exception { doTestReconnectOnForcedDisconnect(false); } @@ -237,6 +249,7 @@ public class ReconnectDUnitTest extends CacheTestCase /** bug #51335 - customer is also trying to recreate the cache */ // this test is disabled due to a high failure rate during CI test runs. // see bug #52160 + @Test public void testReconnectCollidesWithApplication() throws Exception { doTestReconnectOnForcedDisconnect(true); } @@ -457,6 +470,7 @@ public class ReconnectDUnitTest extends CacheTestCase @Category(FlakyTest.class) // GEODE-1407 + @Test public void testReconnectALocator() throws Exception { Host host = Host.getHost(0); VM vm0 = host.getVM(0); @@ -611,6 +625,7 @@ public class ReconnectDUnitTest extends CacheTestCase * see if the reconnect is triggered for the configured number of times */ + @Test public void testReconnectWithRoleLoss() throws TimeoutException, RegionExistsException { @@ -1027,6 +1042,7 @@ public class ReconnectDUnitTest extends CacheTestCase * listener to crash the reconnecting distributed system during cache * creation and asserts that it then reconnects and rebuilds the cache. */ + @Test public void testReconnectFailsInCacheCreation() throws Exception { Host host = Host.getHost(0); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/ReconnectedCacheServerDUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/ReconnectedCacheServerDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/ReconnectedCacheServerDUnitTest.java index df2699e..3735e13 100755 --- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/ReconnectedCacheServerDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/ReconnectedCacheServerDUnitTest.java @@ -15,6 +15,15 @@ * limitations under the License. */ package com.gemstone.gemfire.cache30; + +import org.junit.experimental.categories.Category; +import org.junit.Test; + +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 com.gemstone.gemfire.cache.Cache; import com.gemstone.gemfire.cache.server.CacheServer; @@ -25,10 +34,11 @@ import com.gemstone.gemfire.distributed.internal.membership.gms.mgr.GMSMembershi import com.gemstone.gemfire.internal.cache.GemFireCacheImpl; -public class ReconnectedCacheServerDUnitTest extends CacheTestCase { +@Category(DistributedTest.class) +public class ReconnectedCacheServerDUnitTest extends JUnit4CacheTestCase { - public ReconnectedCacheServerDUnitTest(String name) { - super(name); + public ReconnectedCacheServerDUnitTest() { + super(); } private static final long serialVersionUID = 1L; @@ -56,6 +66,7 @@ public class ReconnectedCacheServerDUnitTest extends CacheTestCase { } } + @Test public void testCacheServerConfigRetained() { // make sure the environment isn't polluted assertFalse(Boolean.getBoolean(DistributionConfig.GEMFIRE_PREFIX + "autoReconnect-useCacheXMLFile")); @@ -72,6 +83,7 @@ public class ReconnectedCacheServerDUnitTest extends CacheTestCase { assertNotNull(gc.getCacheConfig().getCacheServerCreation()); } + @Test public void testDefaultCacheServerNotCreatedOnReconnect() { assertFalse(Boolean.getBoolean(DistributionConfig.GEMFIRE_PREFIX + "autoReconnect-useCacheXMLFile")); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionAttributesTestCase.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionAttributesTestCase.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionAttributesTestCase.java index 588ed82..8e2782e 100644 --- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionAttributesTestCase.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionAttributesTestCase.java @@ -16,6 +16,15 @@ */ package com.gemstone.gemfire.cache30; +import org.junit.experimental.categories.Category; +import org.junit.Test; + +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 com.gemstone.gemfire.cache.*; import com.gemstone.gemfire.cache.Region.Entry; @@ -37,8 +46,8 @@ import java.util.Properties; public abstract class RegionAttributesTestCase extends RegionTestCase { - public RegionAttributesTestCase(String name) { - super(name); + public RegionAttributesTestCase() { + super(); } protected static class TestExpiry implements CustomExpiry, Declarable { @@ -76,6 +85,7 @@ public abstract class RegionAttributesTestCase * region's attributes. Also tests the return values of the mutator * methods. */ + @Test public void testAttributesMutator() throws CacheException { String name = this.getUniqueName(); AttributesFactory fac = new AttributesFactory(getRegionAttributes()); @@ -160,6 +170,7 @@ public abstract class RegionAttributesTestCase * Tests sending null or bogus values to an {@link * AttributesMutator}. */ + @Test public void testAttributesMutatorBogus() throws CacheException { String name = this.getUniqueName(); Region region = createRegion(name); @@ -233,6 +244,7 @@ public abstract class RegionAttributesTestCase } /** Test to make sure region attributes take */ + @Test public void testRegionAttributes() throws CacheException { // @todo for now just test concurrencyLevel, add tests for the rest AttributesFactory factory = new AttributesFactory(); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionExpirationDUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionExpirationDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionExpirationDUnitTest.java index c471ddf..1acc802 100644 --- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionExpirationDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionExpirationDUnitTest.java @@ -16,6 +16,15 @@ */ package com.gemstone.gemfire.cache30; +import org.junit.experimental.categories.Category; +import org.junit.Test; + +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 com.gemstone.gemfire.cache.AttributesFactory; import com.gemstone.gemfire.cache.CacheException; import com.gemstone.gemfire.cache.ExpirationAction; @@ -38,10 +47,11 @@ import com.gemstone.gemfire.test.dunit.WaitCriterion; * * @since GemFire 3.0 */ -public class RegionExpirationDUnitTest extends CacheTestCase { +@Category(DistributedTest.class) +public class RegionExpirationDUnitTest extends JUnit4CacheTestCase { - public RegionExpirationDUnitTest(String name) { - super(name); + public RegionExpirationDUnitTest() { + super(); } // /** @@ -58,6 +68,7 @@ public class RegionExpirationDUnitTest extends CacheTestCase { * Test internal methods that encode & decode time */ /* The encode and decode time methods are now private in MetaMap + @Test public void testTimeEncoding() throws CacheException { Region r = createRegion(getUniqueName(), getRegionAttributes()); long start = ((InternalDistributedSystem)getCache().getDistributedSystem()).getStartTime(); @@ -74,30 +85,35 @@ public class RegionExpirationDUnitTest extends CacheTestCase { } */ + @Test public void testRegionTTLLocalDestroy() throws CacheException, InterruptedException { _testRegionTTL(getUniqueName(), ExpirationAction.LOCAL_DESTROY); } + @Test public void testRegionTTLDestroy() throws CacheException, InterruptedException { _testRegionTTL(getUniqueName(), ExpirationAction.DESTROY); } + @Test public void testRegionTTLLocalInvalidate() throws CacheException, InterruptedException { _testRegionTTL(getUniqueName(), ExpirationAction.LOCAL_INVALIDATE); } + @Test public void testRegionTTLInvalidate() throws CacheException, InterruptedException { _testRegionTTL(getUniqueName(), ExpirationAction.INVALIDATE); } + @Test public void testRegionTTLAfterMutating() throws InterruptedException, CacheException { @@ -129,6 +145,7 @@ public class RegionExpirationDUnitTest extends CacheTestCase { Wait.waitForCriterion(wc, 30 * 1000, 1000, true); } + @Test public void testWhenBothTtlAndIdleAreSet() throws InterruptedException, CacheException { http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionMembershipListenerDUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionMembershipListenerDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionMembershipListenerDUnitTest.java index 8485d52..156577a 100644 --- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionMembershipListenerDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionMembershipListenerDUnitTest.java @@ -16,6 +16,15 @@ */ package com.gemstone.gemfire.cache30; +import org.junit.experimental.categories.Category; +import org.junit.Test; + +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.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -48,7 +57,8 @@ import com.gemstone.gemfire.test.dunit.WaitCriterion; * * @since GemFire 5.0 */ -public class RegionMembershipListenerDUnitTest extends CacheTestCase { +@Category(DistributedTest.class) +public class RegionMembershipListenerDUnitTest extends JUnit4CacheTestCase { private transient MyRML myListener; private transient MyRML mySRListener; @@ -56,8 +66,8 @@ public class RegionMembershipListenerDUnitTest extends CacheTestCase { private transient Region sr; // subregion protected transient DistributedMember otherId; - public RegionMembershipListenerDUnitTest(String name) { - super(name); + public RegionMembershipListenerDUnitTest() { + super(); } @Override @@ -163,6 +173,7 @@ public class RegionMembershipListenerDUnitTest extends CacheTestCase { /** * tests {@link RegionMembershipListener#initialMembers} */ + @Test public void testInitialMembers() throws CacheException { final String rName = getUniqueName(); initOtherId(); @@ -204,6 +215,7 @@ public class RegionMembershipListenerDUnitTest extends CacheTestCase { /** * tests {@link RegionMembershipListener#afterRemoteRegionCreate} */ + @Test public void testCreate() throws CacheException { final String rName = getUniqueName(); initOtherId(); @@ -237,6 +249,7 @@ public class RegionMembershipListenerDUnitTest extends CacheTestCase { /** * tests {@link RegionMembershipListener#afterRemoteRegionDeparture} */ + @Test public void testDeparture() throws CacheException { final String rName = getUniqueName(); initOtherId(); @@ -281,6 +294,7 @@ public class RegionMembershipListenerDUnitTest extends CacheTestCase { /** * tests {@link RegionMembershipListener#afterRemoteRegionCrash} */ + @Test public void testCrash() throws CacheException { final String rName = getUniqueName(); initOtherId(); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionReliabilityDistAckDUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionReliabilityDistAckDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionReliabilityDistAckDUnitTest.java index e639ce0..ec8b1af 100644 --- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionReliabilityDistAckDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionReliabilityDistAckDUnitTest.java @@ -16,6 +16,15 @@ */ package com.gemstone.gemfire.cache30; +import org.junit.experimental.categories.Category; +import org.junit.Test; + +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 com.gemstone.gemfire.cache.*; /** @@ -24,10 +33,11 @@ import com.gemstone.gemfire.cache.*; * * @since GemFire 5.0 */ +@Category(DistributedTest.class) public class RegionReliabilityDistAckDUnitTest extends RegionReliabilityTestCase { - public RegionReliabilityDistAckDUnitTest(String name) { - super(name); + public RegionReliabilityDistAckDUnitTest() { + super(); } protected Scope getRegionScope() { http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionReliabilityDistNoAckDUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionReliabilityDistNoAckDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionReliabilityDistNoAckDUnitTest.java index 46b3f2e..b2b6e09 100644 --- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionReliabilityDistNoAckDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionReliabilityDistNoAckDUnitTest.java @@ -16,6 +16,15 @@ */ package com.gemstone.gemfire.cache30; +import org.junit.experimental.categories.Category; +import org.junit.Test; + +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 com.gemstone.gemfire.cache.*; /** @@ -24,10 +33,11 @@ import com.gemstone.gemfire.cache.*; * * @since GemFire 5.0 */ +@Category(DistributedTest.class) public class RegionReliabilityDistNoAckDUnitTest extends RegionReliabilityTestCase { - public RegionReliabilityDistNoAckDUnitTest(String name) { - super(name); + public RegionReliabilityDistNoAckDUnitTest() { + super(); } protected Scope getRegionScope() { http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionReliabilityGlobalDUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionReliabilityGlobalDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionReliabilityGlobalDUnitTest.java index 3e44012..5ca3761 100644 --- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionReliabilityGlobalDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionReliabilityGlobalDUnitTest.java @@ -16,6 +16,15 @@ */ package com.gemstone.gemfire.cache30; +import org.junit.experimental.categories.Category; +import org.junit.Test; + +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 com.gemstone.gemfire.cache.*; /** @@ -24,10 +33,11 @@ import com.gemstone.gemfire.cache.*; * * @since GemFire 5.0 */ +@Category(DistributedTest.class) public class RegionReliabilityGlobalDUnitTest extends RegionReliabilityTestCase { - public RegionReliabilityGlobalDUnitTest(String name) { - super(name); + public RegionReliabilityGlobalDUnitTest() { + super(); } protected Scope getRegionScope() { http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionReliabilityListenerDUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionReliabilityListenerDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionReliabilityListenerDUnitTest.java index fc088ee..614e541 100644 --- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionReliabilityListenerDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionReliabilityListenerDUnitTest.java @@ -16,34 +16,51 @@ */ package com.gemstone.gemfire.cache30; -import com.gemstone.gemfire.cache.*; +import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*; +import static org.junit.Assert.*; + +import java.util.Properties; +import java.util.Set; + +import org.junit.Test; +import org.junit.experimental.categories.Category; + +import com.gemstone.gemfire.cache.AttributesFactory; +import com.gemstone.gemfire.cache.CacheException; +import com.gemstone.gemfire.cache.LossAction; +import com.gemstone.gemfire.cache.MembershipAttributes; +import com.gemstone.gemfire.cache.Region; +import com.gemstone.gemfire.cache.RegionAttributes; +import com.gemstone.gemfire.cache.RegionRoleListener; +import com.gemstone.gemfire.cache.ResumptionAction; +import com.gemstone.gemfire.cache.RoleEvent; +import com.gemstone.gemfire.cache.Scope; import com.gemstone.gemfire.cache.util.RegionRoleListenerAdapter; import com.gemstone.gemfire.distributed.Role; import com.gemstone.gemfire.distributed.internal.membership.InternalRole; import com.gemstone.gemfire.test.dunit.Host; import com.gemstone.gemfire.test.dunit.SerializableRunnable; +import com.gemstone.gemfire.test.junit.categories.DistributedTest; -import java.util.Properties; -import java.util.Set; - -import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*; /** * Tests the functionality of the {@link RegionRoleListener} class. * * @since GemFire 5.0 */ +@Category(DistributedTest.class) public class RegionReliabilityListenerDUnitTest extends ReliabilityTestCase { protected static transient Set rolesGain = null; protected static transient Set rolesLoss = null; - public RegionReliabilityListenerDUnitTest(String name) { - super(name); + public RegionReliabilityListenerDUnitTest() { + super(); } /** * Tests the notification of afterRoleGain and afterRoleLoss */ + @Test public void testRoleGainAndLoss() throws Exception { final String name = this.getUniqueName(); final int vm0 = 0; http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionReliabilityTestCase.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionReliabilityTestCase.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionReliabilityTestCase.java index bf5c2c8..ea369eb 100644 --- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionReliabilityTestCase.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionReliabilityTestCase.java @@ -16,7 +16,44 @@ */ package com.gemstone.gemfire.cache30; -import com.gemstone.gemfire.cache.*; +import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*; +import static org.junit.Assert.*; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Properties; +import java.util.Set; +import java.util.concurrent.locks.Lock; + +import org.junit.Test; +import org.junit.experimental.categories.Category; + +import com.gemstone.gemfire.cache.AttributesFactory; +import com.gemstone.gemfire.cache.AttributesMutator; +import com.gemstone.gemfire.cache.CacheException; +import com.gemstone.gemfire.cache.CacheLoader; +import com.gemstone.gemfire.cache.CacheLoaderException; +import com.gemstone.gemfire.cache.CacheTransactionManager; +import com.gemstone.gemfire.cache.CommitDistributionException; +import com.gemstone.gemfire.cache.DataPolicy; +import com.gemstone.gemfire.cache.ExpirationAction; +import com.gemstone.gemfire.cache.ExpirationAttributes; +import com.gemstone.gemfire.cache.LoaderHelper; +import com.gemstone.gemfire.cache.LossAction; +import com.gemstone.gemfire.cache.MembershipAttributes; +import com.gemstone.gemfire.cache.Region; +import com.gemstone.gemfire.cache.RegionAccessException; +import com.gemstone.gemfire.cache.RegionAttributes; +import com.gemstone.gemfire.cache.RegionDistributionException; +import com.gemstone.gemfire.cache.RegionEvent; +import com.gemstone.gemfire.cache.RegionMembershipListener; +import com.gemstone.gemfire.cache.RegionReinitializedException; +import com.gemstone.gemfire.cache.RequiredRoles; +import com.gemstone.gemfire.cache.ResumptionAction; +import com.gemstone.gemfire.cache.Scope; import com.gemstone.gemfire.cache.query.Query; import com.gemstone.gemfire.cache.query.QueryService; import com.gemstone.gemfire.cache.util.RegionMembershipListenerAdapter; @@ -25,17 +62,21 @@ import com.gemstone.gemfire.distributed.internal.DM; import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem; import com.gemstone.gemfire.distributed.internal.membership.InternalDistributedMember; import com.gemstone.gemfire.distributed.internal.membership.InternalRole; -import com.gemstone.gemfire.internal.cache.*; -import com.gemstone.gemfire.test.dunit.*; +import com.gemstone.gemfire.internal.cache.AbstractRegion; +import com.gemstone.gemfire.internal.cache.DistributedCacheOperation; +import com.gemstone.gemfire.internal.cache.GemFireCacheImpl; +import com.gemstone.gemfire.internal.cache.LocalRegion; +import com.gemstone.gemfire.internal.cache.TXManagerImpl; +import com.gemstone.gemfire.internal.cache.TXState; +import com.gemstone.gemfire.internal.cache.TXStateInterface; +import com.gemstone.gemfire.internal.cache.TXStateProxyImpl; +import com.gemstone.gemfire.test.dunit.Host; +import com.gemstone.gemfire.test.dunit.SerializableRunnable; +import com.gemstone.gemfire.test.dunit.SerializableRunnableIF; +import com.gemstone.gemfire.test.dunit.ThreadUtils; +import com.gemstone.gemfire.test.dunit.Wait; +import com.gemstone.gemfire.test.dunit.WaitCriterion; import com.gemstone.gemfire.test.junit.categories.FlakyTest; -import org.junit.experimental.categories.Category; - -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.util.*; -import java.util.concurrent.locks.Lock; - -import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*; /** * Tests region reliability defined by MembershipAttributes. @@ -44,19 +85,11 @@ import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties */ public abstract class RegionReliabilityTestCase extends ReliabilityTestCase { - public RegionReliabilityTestCase(String name) { - super(name); - } - @Override public final void preTearDownCacheTestCase() throws Exception { DistributedCacheOperation.setBeforePutOutgoing(null); } - // ------------------------------------------------------------------------- - // Configuration and setup methods - // ------------------------------------------------------------------------- - /** Returns scope to execute tests under. */ protected abstract Scope getRegionScope(); @@ -416,6 +449,7 @@ public abstract class RegionReliabilityTestCase extends ReliabilityTestCase { /** * Tests affect of NO_ACCESS on region operations. */ + @Test public void testNoAccess() throws Exception { final String name = this.getUniqueName(); @@ -502,6 +536,7 @@ public abstract class RegionReliabilityTestCase extends ReliabilityTestCase { /** * Tests affect of NO_ACCESS on local entry expiration actions. */ + @Test public void testNoAccessWithLocalEntryExpiration() throws Exception { final String name = this.getUniqueName(); @@ -583,6 +618,7 @@ public abstract class RegionReliabilityTestCase extends ReliabilityTestCase { /** * Tests affect of NO_ACCESS on local region expiration actions. */ + @Test public void testNoAccessWithLocalRegionExpiration() throws Exception { final String name = this.getUniqueName(); @@ -641,6 +677,7 @@ public abstract class RegionReliabilityTestCase extends ReliabilityTestCase { /** * Tests affect of LIMITED_ACCESS on region operations. */ + @Test public void testLimitedAccess() throws Exception { final String name = this.getUniqueName(); @@ -724,6 +761,7 @@ public abstract class RegionReliabilityTestCase extends ReliabilityTestCase { /** * Tests affect of LIMITED_ACCESS on local entry expiration actions. */ + @Test public void testLimitedAccessWithLocalEntryExpiration() throws Exception { final String name = this.getUniqueName(); @@ -812,6 +850,7 @@ public abstract class RegionReliabilityTestCase extends ReliabilityTestCase { /** * Tests affect of LIMITED_ACCESS on local region expiration actions. */ + @Test public void testLimitedAccessWithLocalRegionExpiration() throws Exception { final String name = this.getUniqueName(); @@ -855,6 +894,7 @@ public abstract class RegionReliabilityTestCase extends ReliabilityTestCase { /** * Tests affect of FULL_ACCESS on region operations. */ + @Test public void testFullAccess() throws Exception { final String name = this.getUniqueName(); @@ -919,6 +959,7 @@ public abstract class RegionReliabilityTestCase extends ReliabilityTestCase { * Tests affect of FULL_ACCESS on local entry expiration actions. */ @Category(FlakyTest.class) // GEODE-447: time sensitive, expiration, waitForMemberTimeout is unimplemented + @Test public void testFullAccessWithLocalEntryExpiration() throws Exception { final String name = this.getUniqueName(); @@ -992,6 +1033,7 @@ public abstract class RegionReliabilityTestCase extends ReliabilityTestCase { /** * Tests affect of FULL_ACCESS on local region expiration actions. */ + @Test public void testFullAccessWithLocalRegionExpiration() throws Exception { final String name = this.getUniqueName(); @@ -1033,6 +1075,7 @@ public abstract class RegionReliabilityTestCase extends ReliabilityTestCase { protected static Boolean[] detectedDeparture_testCommitDistributionException = { Boolean.FALSE }; + @Test public void testCommitDistributionException() throws Exception { if (getRegionScope().isGlobal()) return; // skip test under Global if (getRegionScope().isDistributedNoAck()) return; // skip test under DistributedNoAck @@ -1156,6 +1199,7 @@ public abstract class RegionReliabilityTestCase extends ReliabilityTestCase { protected static Boolean[] detectedDeparture_testRegionDistributionException = { Boolean.FALSE }; + @Test public void testRegionDistributionException() throws Exception { if (getRegionScope().isDistributedNoAck()) return; // skip test under DistributedNoAck @@ -1323,6 +1367,7 @@ public abstract class RegionReliabilityTestCase extends ReliabilityTestCase { } } + @Test public void testReinitialization() throws Exception { final String name = this.getUniqueName(); final String roleA = name+"-A";