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 65679200AC8 for ; Tue, 7 Jun 2016 22:54:45 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 63AA2160A4F; Tue, 7 Jun 2016 20:54:45 +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 0D926160968 for ; Tue, 7 Jun 2016 22:54:42 +0200 (CEST) Received: (qmail 97344 invoked by uid 500); 7 Jun 2016 20:54:42 -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 97330 invoked by uid 99); 7 Jun 2016 20:54:42 -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, 07 Jun 2016 20:54:42 +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 76709C27DD for ; Tue, 7 Jun 2016 20:54:41 +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 mx2-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 PDhM3_7S7c-r for ; Tue, 7 Jun 2016 20:54:35 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx2-lw-eu.apache.org (ASF Mail Server at mx2-lw-eu.apache.org) with SMTP id 87F1760E3D for ; Tue, 7 Jun 2016 20:54:18 +0000 (UTC) Received: (qmail 93284 invoked by uid 99); 7 Jun 2016 20:54:17 -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, 07 Jun 2016 20:54:17 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 89437E78B2; Tue, 7 Jun 2016 20:54:17 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: klund@apache.org To: commits@geode.incubator.apache.org Date: Tue, 07 Jun 2016 20:55:04 -0000 Message-Id: <65114c4b41d54fac8a28c2f78ce56028@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [49/62] [abbrv] incubator-geode git commit: Merge remote-tracking branch 'origin/develop' into feature/GEODE-837 archived-at: Tue, 07 Jun 2016 20:54:45 -0000 http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/persistence/PersistentRecoveryOrderDUnitTest.java ---------------------------------------------------------------------- diff --cc geode-core/src/test/java/com/gemstone/gemfire/internal/cache/persistence/PersistentRecoveryOrderDUnitTest.java index 4fb2f82,dabdd3c..b61cd25 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/persistence/PersistentRecoveryOrderDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/persistence/PersistentRecoveryOrderDUnitTest.java @@@ -16,31 -16,6 +16,26 @@@ */ package com.gemstone.gemfire.internal.cache.persistence; - 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 static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*; +import static com.gemstone.gemfire.internal.lang.ThrowableUtils.*; ++import static org.junit.Assert.*; + +import java.io.ByteArrayInputStream; +import java.io.DataInputStream; +import java.io.File; +import java.io.IOException; +import java.net.InetAddress; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Properties; +import java.util.Set; +import java.util.concurrent.atomic.AtomicBoolean; + +import org.junit.Ignore; ++import org.junit.Test; ++import org.junit.experimental.categories.Category; + import com.gemstone.gemfire.DataSerializer; import com.gemstone.gemfire.admin.AdminDistributedSystem; import com.gemstone.gemfire.admin.AdminDistributedSystemFactory; @@@ -71,37 -37,36 +66,36 @@@ import com.gemstone.gemfire.internal.He import com.gemstone.gemfire.internal.Version; import com.gemstone.gemfire.internal.cache.AbstractUpdateOperation.AbstractUpdateMessage; import com.gemstone.gemfire.internal.cache.DestroyRegionOperation.DestroyRegionMessage; -import com.gemstone.gemfire.internal.cache.*; +import com.gemstone.gemfire.internal.cache.DiskRegion; +import com.gemstone.gemfire.internal.cache.DiskRegionStats; +import com.gemstone.gemfire.internal.cache.DistributedRegion; +import com.gemstone.gemfire.internal.cache.GemFireCacheImpl; import com.gemstone.gemfire.internal.cache.InitialImageOperation.RequestImageMessage; +import com.gemstone.gemfire.internal.cache.InternalRegionArguments; +import com.gemstone.gemfire.internal.cache.LocalRegion; +import com.gemstone.gemfire.internal.cache.TXManagerImpl; import com.gemstone.gemfire.internal.cache.versions.RegionVersionHolder; import com.gemstone.gemfire.internal.cache.versions.RegionVersionVector; -import com.gemstone.gemfire.test.dunit.*; -import org.junit.Ignore; - -import java.io.ByteArrayInputStream; -import java.io.DataInputStream; -import java.io.File; -import java.io.IOException; -import java.net.InetAddress; -import java.util.*; -import java.util.concurrent.atomic.AtomicBoolean; - -import static com.gemstone.gemfire.internal.lang.ThrowableUtils.getRootCause; -import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*; +import com.gemstone.gemfire.test.dunit.Assert; +import com.gemstone.gemfire.test.dunit.AsyncInvocation; ++import com.gemstone.gemfire.test.dunit.Host; +import com.gemstone.gemfire.test.dunit.IgnoredException; +import com.gemstone.gemfire.test.dunit.LogWriterUtils; - 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.dunit.Wait; +import com.gemstone.gemfire.test.dunit.WaitCriterion; ++import com.gemstone.gemfire.test.junit.categories.DistributedTest; /** * This is a test of how persistent distributed * regions recover. This test makes sure that when * multiple VMs are persisting the same region, they recover * with the latest data during recovery. -- * -- * */ +@Category(DistributedTest.class) public class PersistentRecoveryOrderDUnitTest extends PersistentReplicatedTestBase { - public PersistentRecoveryOrderDUnitTest(String name) { - super(name); - } public static void resetAckWaitThreshold() { if (SAVED_ACK_WAIT_THRESHOLD != null) { @@@ -112,10 -77,9 +106,9 @@@ /** * Tests to make sure that a persistent region will wait * for any members that were online when is crashed before starting up. -- * @throws Throwable */ - public void testWaitForLatestMember() throws Throwable { + @Test - public void testWaitForLatestMember() throws Throwable { ++ public void testWaitForLatestMember() throws Exception { Host host = Host.getHost(0); VM vm0 = host.getVM(0); VM vm1 = host.getVM(1); @@@ -165,10 -129,9 +158,10 @@@ /** * Tests to make sure that we stop waiting for a member * that we revoke. -- * @throws Throwable ++ * @throws Exception */ - public void testRevokeAMember() throws Throwable { + @Test - public void testRevokeAMember() throws Throwable { ++ public void testRevokeAMember() throws Exception { Host host = Host.getHost(0); VM vm0 = host.getVM(0); VM vm1 = host.getVM(1); @@@ -301,10 -264,9 +294,10 @@@ /** * Tests to make sure that we can revoke a member * before initialization, and that member will stay revoked -- * @throws Throwable ++ * @throws Exception */ - public void testRevokeAHostBeforeInitialization() throws Throwable { + @Test - public void testRevokeAHostBeforeInitialization() throws Throwable { ++ public void testRevokeAHostBeforeInitialization() throws Exception { Host host = Host.getHost(0); VM vm0 = host.getVM(0); VM vm1 = host.getVM(1); @@@ -394,10 -356,9 +387,10 @@@ /** * Test which members show up in the list of members we're waiting on. -- * @throws Throwable ++ * @throws Exception */ - public void testWaitingMemberList() throws Throwable { + @Test - public void testWaitingMemberList() throws Throwable { ++ public void testWaitingMemberList() throws Exception { Host host = Host.getHost(0); VM vm0 = host.getVM(0); VM vm1 = host.getVM(1); @@@ -536,10 -497,9 +529,10 @@@ * A crashes. * B crashes. * B starts up. It should not wait for A. -- * @throws Throwable ++ * @throws Exception */ - public void testDontWaitForOldMember() throws Throwable { + @Test - public void testDontWaitForOldMember() throws Throwable { ++ public void testDontWaitForOldMember() throws Exception { Host host = Host.getHost(0); VM vm0 = host.getVM(0); VM vm1 = host.getVM(1); @@@ -568,10 -528,9 +561,10 @@@ * Tests that if two members crash simultaneously, they * negotiate which member should initialize with what is * on disk and which member should copy data from that member. -- * @throws Throwable ++ * @throws Exception */ - public void testSimultaneousCrash() throws Throwable { + @Test - public void testSimultaneousCrash() throws Throwable { ++ public void testSimultaneousCrash() throws Exception { Host host = Host.getHost(0); VM vm0 = host.getVM(0); VM vm1 = host.getVM(1); @@@ -628,8 -587,7 +621,8 @@@ * AC are started, they should figure out who * has the latest data, without needing B. */ - public void testTransmitCrashedMembers() throws Throwable { + @Test - public void testTransmitCrashedMembers() throws Throwable { ++ public void testTransmitCrashedMembers() throws Exception { Host host = Host.getHost(0); VM vm0 = host.getVM(0); VM vm1 = host.getVM(1); @@@ -672,8 -630,7 +665,8 @@@ * Tests that a persistent region cannot recover from * a non persistent region. */ - public void testRecoverFromNonPeristentRegion() throws Throwable { + @Test - public void testRecoverFromNonPeristentRegion() throws Throwable { ++ public void testRecoverFromNonPeristentRegion() throws Exception { Host host = Host.getHost(0); VM vm0 = host.getVM(0); VM vm1 = host.getVM(1); @@@ -704,8 -661,7 +697,8 @@@ checkForEntry(vm1); } - public void testFinishIncompleteInitializationNoSend() throws Throwable { + @Test - public void testFinishIncompleteInitializationNoSend() throws Throwable { ++ public void testFinishIncompleteInitializationNoSend() throws Exception { Host host = Host.getHost(0); VM vm0 = host.getVM(0); VM vm1 = host.getVM(1); @@@ -836,13 -792,11 +829,13 @@@ return vm.invokeAsync(createRegion); } - public void testPersistConflictOperations() throws Throwable { + @Test - public void testPersistConflictOperations() throws Throwable { ++ public void testPersistConflictOperations() throws Exception { doTestPersistConflictOperations(true); } - public void testPersistConflictOperationsAsync() throws Throwable { + @Test - public void testPersistConflictOperationsAsync() throws Throwable { ++ public void testPersistConflictOperationsAsync() throws Exception { doTestPersistConflictOperations(false); } @@@ -854,7 -808,7 +847,7 @@@ * tag, while another member will persist both of the 2 operations. * Overall, their RVV should match after the operations. */ -- public void doTestPersistConflictOperations(boolean diskSync) throws Throwable { ++ public void doTestPersistConflictOperations(boolean diskSync) throws Exception { Host host = Host.getHost(0); VM vm0 = host.getVM(0); VM vm1 = host.getVM(1); @@@ -1005,8 -959,7 +998,8 @@@ * of crashed members to other persistent regions, So that the persistent * regions can negotiate who has the latest data during recovery. */ - public void testTransmitCrashedMembersWithNonPeristentRegion() throws Throwable { + @Test - public void testTransmitCrashedMembersWithNonPeristentRegion() throws Throwable { ++ public void testTransmitCrashedMembersWithNonPeristentRegion() throws Exception { Host host = Host.getHost(0); VM vm0 = host.getVM(0); VM vm1 = host.getVM(1); @@@ -1048,8 -1001,7 +1041,8 @@@ checkForEntry(vm2); } - public void testSplitBrain() throws Throwable { + @Test - public void testSplitBrain() throws Throwable { ++ public void testSplitBrain() throws Exception { Host host = Host.getHost(0); VM vm0 = host.getVM(0); VM vm1 = host.getVM(1); @@@ -1093,8 -1045,7 +1086,8 @@@ * while a GII is in progress, we wait * for the member to come back for starting. */ - public void testCrashDuringGII() throws Throwable { + @Test - public void testCrashDuringGII() throws Throwable { ++ public void testCrashDuringGII() throws Exception { Host host = Host.getHost(0); VM vm0 = host.getVM(0); VM vm1 = host.getVM(1); @@@ -1196,8 -1147,7 +1189,8 @@@ * Test to make sure we don't leak any persistent ids if a member does GII * while a distributed destroy is in progress */ - public void testGIIDuringDestroy() throws Throwable { + @Test - public void testGIIDuringDestroy() throws Throwable { ++ public void testGIIDuringDestroy() throws Exception { Host host = Host.getHost(0); final VM vm0 = host.getVM(0); final VM vm1 = host.getVM(1); @@@ -1294,8 -1244,7 +1287,8 @@@ }); } - public void testCrashDuringPreparePersistentId() throws Throwable { + @Test - public void testCrashDuringPreparePersistentId() throws Throwable { ++ public void testCrashDuringPreparePersistentId() throws Exception { Host host = Host.getHost(0); VM vm0 = host.getVM(0); VM vm1 = host.getVM(1); @@@ -1356,8 -1305,7 +1349,8 @@@ checkForEntry(vm1); } - public void testSplitBrainWithNonPersistentRegion() throws Throwable { + @Test - public void testSplitBrainWithNonPersistentRegion() throws Throwable { ++ public void testSplitBrainWithNonPersistentRegion() throws Exception { Host host = Host.getHost(0); VM vm0 = host.getVM(0); VM vm1 = host.getVM(1); @@@ -1392,8 -1340,7 +1385,8 @@@ checkForRecoveryStat(vm1, true); } - public void testMissingEntryOnDisk() throws Throwable { + @Test - public void testMissingEntryOnDisk() throws Throwable { ++ public void testMissingEntryOnDisk() throws Exception { Host host = Host.getHost(0); VM vm0 = host.getVM(0); VM vm1 = host.getVM(1); @@@ -1452,10 -1399,9 +1445,10 @@@ /** * Tests to make sure that we stop waiting for a member * that we revoke. -- * @throws Throwable ++ * @throws Exception */ - public void testCompactFromAdmin() throws Throwable { + @Test - public void testCompactFromAdmin() throws Throwable { ++ public void testCompactFromAdmin() throws Exception { Host host = Host.getHost(0); final VM vm0 = host.getVM(0); VM vm1 = host.getVM(1); @@@ -1532,8 -1478,7 +1525,8 @@@ vm1.invoke(compactVM); } - public void testCloseDuringRegionOperation() throws Throwable { + @Test - public void testCloseDuringRegionOperation() throws Throwable { ++ public void testCloseDuringRegionOperation() throws Exception { Host host = Host.getHost(0); VM vm0 = host.getVM(0); VM vm1 = host.getVM(1); @@@ -1610,8 -1555,8 +1603,9 @@@ checkConcurrentCloseValue(vm0, vm1, 1, lastSuccessfulInt1); } -- @Ignore("Disabled due to bug #52240") -- public void DISABLED_testCloseDuringRegionOperationWithTX() throws Throwable { ++ @Ignore("TODO: Disabled due to bug #52240") ++ @Test ++ public void testCloseDuringRegionOperationWithTX() throws Exception { Host host = Host.getHost(0); VM vm0 = host.getVM(0); VM vm1 = host.getVM(1); @@@ -1696,8 -1641,7 +1690,8 @@@ * * This is bug XX. */ - public void testRecoverAfterConflict() throws Throwable { + @Test - public void testRecoverAfterConflict() throws Throwable { ++ public void testRecoverAfterConflict() throws Exception { 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/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/persistence/PersistentReplicatedTestBase.java ---------------------------------------------------------------------- diff --cc geode-core/src/test/java/com/gemstone/gemfire/internal/cache/persistence/PersistentReplicatedTestBase.java index 3929471,1500269..5c68f38 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/persistence/PersistentReplicatedTestBase.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/persistence/PersistentReplicatedTestBase.java @@@ -23,21 -21,21 +23,15 @@@ import java.io.IOException import java.util.Map; import java.util.Set; --import com.gemstone.gemfire.cache.AttributesFactory; import com.gemstone.gemfire.cache.Cache; import com.gemstone.gemfire.cache.DataPolicy; import com.gemstone.gemfire.cache.DiskStore; import com.gemstone.gemfire.cache.DiskStoreFactory; import com.gemstone.gemfire.cache.Region; --import com.gemstone.gemfire.cache.RegionExistsException; import com.gemstone.gemfire.cache.RegionFactory; import com.gemstone.gemfire.cache.Scope; --import com.gemstone.gemfire.cache.TimeoutException; --import com.gemstone.gemfire.cache30.CacheTestCase; import com.gemstone.gemfire.internal.FileUtil; import com.gemstone.gemfire.internal.cache.GemFireCacheImpl; --import com.gemstone.gemfire.internal.cache.InternalRegionArguments; --import com.gemstone.gemfire.internal.cache.RegionFactoryImpl; import com.gemstone.gemfire.test.dunit.AsyncInvocation; import com.gemstone.gemfire.test.dunit.Invoke; import com.gemstone.gemfire.test.dunit.SerializableRunnable; @@@ -158,7 -159,7 +152,7 @@@ public abstract class PersistentReplica return vm0.invokeAsync(close); } -- protected void createNonPersistentRegion(VM vm) throws Throwable { ++ protected void createNonPersistentRegion(VM vm) throws Exception { SerializableRunnable createRegion = new SerializableRunnable("Create non persistent region") { public void run() { Cache cache = getCache(); @@@ -171,13 -172,13 +165,13 @@@ vm.invoke(createRegion); } -- protected AsyncInvocation createPersistentRegionWithWait(VM vm) throws Throwable { ++ protected AsyncInvocation createPersistentRegionWithWait(VM vm) throws Exception { return _createPersistentRegion(vm, true); } -- protected void createPersistentRegion(VM vm) throws Throwable { ++ protected void createPersistentRegion(VM vm) throws Exception { _createPersistentRegion(vm, false); } -- private AsyncInvocation _createPersistentRegion(VM vm, boolean wait) throws Throwable { ++ private AsyncInvocation _createPersistentRegion(VM vm, boolean wait) throws Exception { AsyncInvocation future = createPersistentRegionAsync(vm); long waitTime = wait ? 500 : MAX_WAIT; future.join(waitTime); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/Bug40396DUnitTest.java ---------------------------------------------------------------------- diff --cc geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/Bug40396DUnitTest.java index 6394a17,e21e780..a643c95 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/Bug40396DUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/Bug40396DUnitTest.java @@@ -39,15 -35,11 +39,15 @@@ import com.gemstone.gemfire.test.dunit. 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; + /** * Test delta propagation for faulty delta implementation - * @since 6.1 + * @since GemFire 6.1 */ -public class Bug40396DUnitTest extends DistributedTestCase { +@Category(DistributedTest.class) +public class Bug40396DUnitTest extends JUnit4DistributedTestCase { private static Cache cache; private static final String REGION_NAME="Bug40396DUnitTest_region"; http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/BackwardCompatibilityHigherVersionClientDUnitTest.java ---------------------------------------------------------------------- diff --cc geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/BackwardCompatibilityHigherVersionClientDUnitTest.java index 4256d77,e447917..f49f068 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/BackwardCompatibilityHigherVersionClientDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/BackwardCompatibilityHigherVersionClientDUnitTest.java @@@ -16,41 -16,28 +16,41 @@@ */ package com.gemstone.gemfire.internal.cache.tier.sockets; -import com.gemstone.gemfire.cache.*; ++import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*; +import static org.junit.Assert.*; + +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.CacheFactory; +import com.gemstone.gemfire.cache.DataPolicy; +import com.gemstone.gemfire.cache.Region; +import com.gemstone.gemfire.cache.RegionAttributes; +import com.gemstone.gemfire.cache.Scope; import com.gemstone.gemfire.cache.client.PoolManager; import com.gemstone.gemfire.cache.client.internal.ConnectionFactoryImpl; import com.gemstone.gemfire.cache.client.internal.PoolImpl; import com.gemstone.gemfire.cache.server.CacheServer; import com.gemstone.gemfire.distributed.DistributedSystem; - import com.gemstone.gemfire.distributed.internal.DistributionConfig; import com.gemstone.gemfire.internal.AvailablePort; import com.gemstone.gemfire.internal.cache.tier.ConnectionProxy; -import com.gemstone.gemfire.test.dunit.*; - -import java.util.Properties; - -import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.LOCATORS; -import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT; +import com.gemstone.gemfire.test.dunit.Assert; +import com.gemstone.gemfire.test.dunit.Host; +import com.gemstone.gemfire.test.dunit.NetworkUtils; +import com.gemstone.gemfire.test.dunit.VM; +import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase; +import com.gemstone.gemfire.test.junit.categories.DistributedTest; /** - * * Test to verify that server responds to a higher versioned client. */ +@Category(DistributedTest.class) +public class BackwardCompatibilityHigherVersionClientDUnitTest extends JUnit4DistributedTestCase { -public class BackwardCompatibilityHigherVersionClientDUnitTest extends - DistributedTestCase { /** the cache */ private static Cache cache = null; @@@ -92,12 -84,12 +92,11 @@@ public static void createClientCache(String host, Integer port1) throws Exception { - new BackwardCompatibilityHigherVersionClientDUnitTest("temp"); + new BackwardCompatibilityHigherVersionClientDUnitTest(); Properties props = new Properties(); - props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0"); - props.setProperty(DistributionConfig.LOCATORS_NAME, ""); - new BackwardCompatibilityHigherVersionClientDUnitTest() - .createCache(props); + props.setProperty(MCAST_PORT, "0"); + props.setProperty(LOCATORS, ""); - new BackwardCompatibilityHigherVersionClientDUnitTest("temp") - .createCache(props); ++ new BackwardCompatibilityHigherVersionClientDUnitTest().createCache(props); PoolImpl p = (PoolImpl)PoolManager.createFactory().addServer(host, port1.intValue()).setSubscriptionEnabled(true) .setSubscriptionRedundancy(1).setThreadLocalConnections(true) http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug36269DUnitTest.java ---------------------------------------------------------------------- diff --cc geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug36269DUnitTest.java index 9867dd5,4b31e49..8a5d29c --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug36269DUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug36269DUnitTest.java @@@ -16,19 -16,7 +16,20 @@@ */ package com.gemstone.gemfire.internal.cache.tier.sockets; -import com.gemstone.gemfire.cache.*; ++import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*; +import static org.junit.Assert.*; + +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.CacheFactory; +import com.gemstone.gemfire.cache.MirrorType; +import com.gemstone.gemfire.cache.Region; +import com.gemstone.gemfire.cache.Scope; import com.gemstone.gemfire.cache.client.PoolManager; import com.gemstone.gemfire.cache.client.internal.Connection; import com.gemstone.gemfire.cache.client.internal.PoolImpl; @@@ -71,24 -57,24 +71,16 @@@ public class Bug36269DUnitTest extends private static PoolImpl pool = null; -- /** constructor */ - public Bug36269DUnitTest() { - super(); - public Bug36269DUnitTest(String name) { - super(name); -- } -- @Override public final void postSetUp() throws Exception { disconnectAllFromDS(); final Host host = Host.getHost(0); -- // Server1 VM server1 = host.getVM(0); -- -- // Server2 VM server2 = host.getVM(1); -- PORT1 = ((Integer)server1.invoke(() -> Bug36269DUnitTest.createServerCache())).intValue(); -- PORT2 = ((Integer)server2.invoke(() -> Bug36269DUnitTest.createServerCache())).intValue(); ++ PORT1 = server1.invoke(() -> Bug36269DUnitTest.createServerCache()); ++ PORT2 = server2.invoke(() -> Bug36269DUnitTest.createServerCache()); } private void createCache(Properties props) throws Exception @@@ -98,33 -84,32 +90,20 @@@ assertNotNull(cache); } --// static private final String WAIT_PROPERTY = "Bug36269DUnitTest.maxWaitTime"; --// --// static private final int WAIT_DEFAULT = 60000; -- /** * This tests whether the region destroy are not received by the sender -- * */ - public void testRegionDestroyNotReceivedBySender() throws Exception - { - try { - createClientCache(); - acquireConnectionsAndDestroyRegion(NetworkUtils.getServerHostName(Host.getHost(0))); - server1.invoke(() -> Bug36269DUnitTest.verifyRegionDestroy()); - server2.invoke(() -> Bug36269DUnitTest.verifyRegionDestroy()); - Wait.pause(5000); - verifyNoRegionDestroyOnOriginator(); - } - catch (Exception ex) { - fail("failed gggg testRegionDestroyNotReceivedBySender " + ex); - } - + @Test - public void testRegionDestroyNotReceivedBySender() throws Exception - { - try { - createClientCache(); - acquireConnectionsAndDestroyRegion(NetworkUtils.getServerHostName(Host.getHost(0))); - server1.invoke(() -> Bug36269DUnitTest.verifyRegionDestroy()); - server2.invoke(() -> Bug36269DUnitTest.verifyRegionDestroy()); - Wait.pause(5000); - verifyNoRegionDestroyOnOriginator(); - } - catch (Exception ex) { - fail("failed gggg testRegionDestroyNotReceivedBySender " + ex); - } - ++ public void testRegionDestroyNotReceivedBySender() throws Exception { ++ createClientCache(); ++ acquireConnectionsAndDestroyRegion(NetworkUtils.getServerHostName(Host.getHost(0))); ++ server1.invoke(() -> Bug36269DUnitTest.verifyRegionDestroy()); ++ server2.invoke(() -> Bug36269DUnitTest.verifyRegionDestroy()); ++ Wait.pause(5000); ++ verifyNoRegionDestroyOnOriginator(); } -- public static void acquireConnectionsAndDestroyRegion(String host) -- { ++ public static void acquireConnectionsAndDestroyRegion(String host) { try { Connection desCon = pool.acquireConnection(new ServerLocation(host, PORT2)); ServerRegionProxy srp = new ServerRegionProxy(Region.SEPARATOR + REGION_NAME, pool); @@@ -135,13 -120,13 +114,11 @@@ } } -- public static void createClientCache() throws Exception -- { -- ++ public static void createClientCache() throws Exception { Properties props = new Properties(); - props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0"); - props.setProperty(DistributionConfig.LOCATORS_NAME, ""); + props.setProperty(MCAST_PORT, "0"); + props.setProperty(LOCATORS, ""); - new Bug36269DUnitTest("temp").createCache(props); + new Bug36269DUnitTest().createCache(props); CacheServerTestUtil.disableShufflingOfEndpoints(); PoolImpl p; String host = NetworkUtils.getServerHostName(Host.getHost(0)); @@@ -165,7 -150,7 +142,6 @@@ pool = p; assertNotNull(pool); cache.createRegion(REGION_NAME, factory.create()); -- } public static Integer createServerCache() throws Exception http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug36457DUnitTest.java ---------------------------------------------------------------------- diff --cc geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug36457DUnitTest.java index 5f2e9af,14acf01..9af315e --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug36457DUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug36457DUnitTest.java @@@ -16,22 -16,7 +16,23 @@@ */ package com.gemstone.gemfire.internal.cache.tier.sockets; -import com.gemstone.gemfire.cache.*; ++import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*; +import static org.junit.Assert.*; + +import java.util.ArrayList; +import java.util.List; +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.CacheFactory; +import com.gemstone.gemfire.cache.DataPolicy; +import com.gemstone.gemfire.cache.Region; +import com.gemstone.gemfire.cache.RegionAttributes; +import com.gemstone.gemfire.cache.Scope; import com.gemstone.gemfire.cache.client.Pool; import com.gemstone.gemfire.cache.client.PoolManager; import com.gemstone.gemfire.cache.client.internal.PoolImpl; @@@ -103,9 -87,9 +103,9 @@@ public class Bug36457DUnitTest extends throws Exception { Properties props = new Properties(); - props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0"); - props.setProperty(DistributionConfig.LOCATORS_NAME, ""); + props.setProperty(MCAST_PORT, "0"); + props.setProperty(LOCATORS, ""); - new Bug36457DUnitTest("temp").createCache(props); + new Bug36457DUnitTest().createCache(props); Pool p = PoolManager.createFactory() .addServer(host, port1.intValue()) .addServer(host, port2.intValue()) http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug36805DUnitTest.java ---------------------------------------------------------------------- diff --cc geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug36805DUnitTest.java index c3e18f4,e53a1e0..7a4791f --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug36805DUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug36805DUnitTest.java @@@ -16,36 -16,21 +16,43 @@@ */ package com.gemstone.gemfire.internal.cache.tier.sockets; +import static org.junit.Assert.*; + +import java.util.ArrayList; +import java.util.List; +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.CacheFactory; +import com.gemstone.gemfire.cache.Region; +import com.gemstone.gemfire.cache.RegionAttributes; +import com.gemstone.gemfire.cache.RegionDestroyedException; +import com.gemstone.gemfire.cache.Scope; + import com.gemstone.gemfire.cache.*; import com.gemstone.gemfire.cache.client.PoolManager; import com.gemstone.gemfire.cache.client.ServerOperationException; import com.gemstone.gemfire.cache.client.internal.PoolImpl; import com.gemstone.gemfire.cache.server.CacheServer; import com.gemstone.gemfire.distributed.DistributedSystem; - import com.gemstone.gemfire.distributed.internal.DistributionConfig; import com.gemstone.gemfire.internal.AvailablePort; +import com.gemstone.gemfire.test.dunit.Host; +import com.gemstone.gemfire.test.dunit.NetworkUtils; +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; + import com.gemstone.gemfire.test.dunit.*; + + import java.util.ArrayList; + import java.util.List; + import java.util.Properties; + -import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.LOCATORS; -import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT; ++import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*; /** * bug test for bug 36805 @@@ -105,9 -91,9 +112,9 @@@ public class Bug36805DUnitTest extends throws Exception { Properties props = new Properties(); - props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0"); - props.setProperty(DistributionConfig.LOCATORS_NAME, ""); + props.setProperty(MCAST_PORT, "0"); + props.setProperty(LOCATORS, ""); - new Bug36805DUnitTest("temp").createCache(props); + new Bug36805DUnitTest().createCache(props); PoolImpl p = (PoolImpl)PoolManager.createFactory() .addServer(host, port1.intValue()) .addServer(host, port2.intValue()) http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug36829DUnitTest.java ---------------------------------------------------------------------- diff --cc geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug36829DUnitTest.java index ef401f0,71c15d9..0f5045c --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug36829DUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug36829DUnitTest.java @@@ -16,13 -16,6 +16,14 @@@ */ package com.gemstone.gemfire.internal.cache.tier.sockets; ++import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*; +import static org.junit.Assert.*; + +import java.util.Properties; + +import org.junit.Test; +import org.junit.experimental.categories.Category; + import com.gemstone.gemfire.cache.CacheException; import com.gemstone.gemfire.cache.InterestResultPolicy; import com.gemstone.gemfire.cache.Region; @@@ -31,18 -24,14 +32,16 @@@ import com.gemstone.gemfire.cache.clien import com.gemstone.gemfire.cache.client.PoolManager; import com.gemstone.gemfire.cache.client.ServerOperationException; import com.gemstone.gemfire.cache30.CacheSerializableRunnable; - import com.gemstone.gemfire.distributed.internal.DistributionConfig; import com.gemstone.gemfire.internal.cache.PoolFactoryImpl; - import com.gemstone.gemfire.test.dunit.Assert; -import com.gemstone.gemfire.test.dunit.*; +import com.gemstone.gemfire.test.dunit.Host; +import com.gemstone.gemfire.test.dunit.NetworkUtils; +import com.gemstone.gemfire.test.dunit.VM; +import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase; +import com.gemstone.gemfire.test.junit.categories.DistributedTest; -import java.util.Properties; +@Category(DistributedTest.class) +public class Bug36829DUnitTest extends JUnit4DistributedTestCase { -import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*; - -public class Bug36829DUnitTest extends DistributedTestCase { private VM serverVM; private VM ClientVM; @@@ -51,10 -40,10 +50,6 @@@ private int PORT; - public Bug36829DUnitTest() { - super(); - public Bug36829DUnitTest(String name) { - super(name); -- } -- @Override public final void postSetUp() throws Exception { Host host = Host.getHost(0); @@@ -64,9 -53,8 +59,8 @@@ CacheServerTestUtil.disableShufflingOfEndpoints(); } + @Test public void testBug36829() { -- // Step 1: Starting the servers final String durableClientId = getName() + "_client"; @@@ -92,64 -80,64 +86,36 @@@ // If exception is not thrown then the test fails. this.ClientVM.invoke(() -> Bug36829DUnitTest.registerKey( "Key1" )); -- -- // creating REgion on the Server ++ // creating Region on the Server /* this.serverVM.invoke(() -> CacheServerTestUtil.createRegion( regionName )); // should be successful. this.ClientVM.invoke(() -> Bug36829DUnitTest.registerKeyAfterRegionCreation( "Key1" ));*/ -- // Stop the durable client this.ClientVM.invoke(() -> CacheServerTestUtil.closeCache()); // Stop server 1 this.serverVM.invoke(() -> CacheServerTestUtil.closeCache()); -- } -- private static void registerKey(String key) throws Exception { ++ // Get the region ++ Region region = CacheServerTestUtil.getCache().getRegion(Bug36829DUnitTest.class.getName() + "_region"); ++ assertNotNull(region); try { -- // Get the region -- Region region = CacheServerTestUtil.getCache().getRegion( -- Bug36829DUnitTest.class.getName() + "_region"); -- // Region region = -- // CacheServerTestUtil.getCache().getRegion(regionName); -- assertNotNull(region); -- try { -- region.registerInterest(key, InterestResultPolicy.NONE); -- fail("expected ServerOperationException"); -- } -- catch (ServerOperationException expected) { -- } ++ region.registerInterest(key, InterestResultPolicy.NONE); ++ fail("expected ServerOperationException"); } -- catch (Exception ex) { -- Assert.fail("failed while registering interest in registerKey function", ex); ++ catch (ServerOperationException expected) { } } -- private static void registerKeyAfterRegionCreation(String key) -- throws Exception { -- try { -- // Get the region -- Region region = CacheServerTestUtil.getCache().getRegion( -- Bug36829DUnitTest.class.getName() + "_region"); -- // Region region = -- // CacheServerTestUtil.getCache().getRegion(regionName); -- assertNotNull(region); -- try { -- region.registerInterest(key, InterestResultPolicy.NONE); -- } -- catch (Exception e) { -- fail("unexpected Exception while registerInterest inspite of region present on the server." -- + " Details of Exception:" + "\ne.getCause:" + e.getCause() -- + "\ne.getMessage:" + e.getMessage()); -- } -- } ++ private static void registerKeyAfterRegionCreation(String key) throws Exception { ++ // Get the region ++ Region region = CacheServerTestUtil.getCache().getRegion(Bug36829DUnitTest.class.getName() + "_region"); ++ assertNotNull(region); -- catch (Exception ex) { -- Assert.fail("failed while registering interest in registerKey function", ex); -- } ++ region.registerInterest(key, InterestResultPolicy.NONE); } private Pool getClientPool(String host, int server1Port, http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug36995DUnitTest.java ---------------------------------------------------------------------- diff --cc geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug36995DUnitTest.java index d286d14,ba57fb9..4a05668 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug36995DUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug36995DUnitTest.java @@@ -16,14 -16,6 +16,15 @@@ */ package com.gemstone.gemfire.internal.cache.tier.sockets; - import static org.junit.Assert.*; ++import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*; ++import static com.gemstone.gemfire.test.dunit.Assert.*; + +import java.util.Iterator; +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.CacheFactory; @@@ -33,20 -25,17 +34,19 @@@ import com.gemstone.gemfire.cache.clien import com.gemstone.gemfire.cache.client.internal.PoolImpl; import com.gemstone.gemfire.cache.server.CacheServer; import com.gemstone.gemfire.distributed.DistributedSystem; - import com.gemstone.gemfire.distributed.internal.DistributionConfig; import com.gemstone.gemfire.internal.AvailablePort; -import com.gemstone.gemfire.test.dunit.*; +import com.gemstone.gemfire.test.dunit.Host; +import com.gemstone.gemfire.test.dunit.IgnoredException; +import com.gemstone.gemfire.test.dunit.NetworkUtils; +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; + +@Category(DistributedTest.class) +public class Bug36995DUnitTest extends JUnit4DistributedTestCase { -import java.util.Iterator; -import java.util.Properties; - -import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.LOCATORS; -import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT; - -public class Bug36995DUnitTest extends DistributedTestCase -{ private static Cache cache = null; private static VM server1 = null; @@@ -57,12 -46,12 +57,7 @@@ protected static PoolImpl pool = null; -- private static final String regionName = "Bug36995DUnitTest_Region"; -- -- /** constructor */ - public Bug36995DUnitTest() { - super(); - public Bug36995DUnitTest(String name) { - super(name); -- } ++ private static final String regionName = Bug36995DUnitTest.class.getSimpleName() + "_Region"; @Override public final void postSetUp() throws Exception { @@@ -86,9 -75,9 +81,9 @@@ { try { Properties props = new Properties(); - props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0"); - props.setProperty(DistributionConfig.LOCATORS_NAME, ""); + props.setProperty(MCAST_PORT, "0"); + props.setProperty(LOCATORS, ""); - new Bug36995DUnitTest("temp").createCache(props); + new Bug36995DUnitTest().createCache(props); PoolImpl p = (PoolImpl)PoolManager.createFactory() .addServer(host, port1) .addServer(host, port2) @@@ -106,7 -95,7 +101,7 @@@ pool = p; } catch (Exception e) { -- fail("Test failed due to " + e); ++ fail("Test failed due to ", e); } } @@@ -115,9 -104,9 +110,9 @@@ { try { Properties props = new Properties(); - props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0"); - props.setProperty(DistributionConfig.LOCATORS_NAME, ""); + props.setProperty(MCAST_PORT, "0"); + props.setProperty(LOCATORS, ""); - new Bug36995DUnitTest("temp").createCache(props); + new Bug36995DUnitTest().createCache(props); PoolImpl p = (PoolImpl)PoolManager.createFactory() .addServer(host, port1) .addServer(host, port2) @@@ -130,7 -119,7 +125,7 @@@ pool = p; } catch (Exception e) { -- fail("Test failed due to " + e); ++ fail("Test failed due to ", e); } } @@@ -219,7 -205,7 +214,7 @@@ } } catch (Exception e) { -- fail("failed while stopServer()" + e); ++ fail("failed while stopServer()", e); } } @@@ -236,30 -222,30 +231,5 @@@ } }; Wait.waitForCriterion(wc, 3 * 60 * 1000, 1000, true); -- -- // we no longer verify dead servers; just live --// while (proxy.getDeadServers().size() != expectedDeadServers) { // wait --// // until --// // condition --// // is --// // met --// assertTrue( --// "Waited over " --// + maxWaitTime --// + "for dead servers to become : " --// + expectedDeadServers --// + " This issue can occur on Solaris as DSM thread get stuck in connectForServer() call, and hence not recovering any newly started server This may be beacuase of tcp_ip_abort_cinterval kernal level property on solaris which has 3 minutes as a default value", --// (System.currentTimeMillis() - start) < maxWaitTime); --// try { --// Thread.yield(); --// synchronized (delayLock) { --// delayLock.wait(2000); --// } --// } --// catch (InterruptedException ie) { --// fail("Interrupted while waiting ", ie); --// } --// } --// start = System.currentTimeMillis(); } } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug37210DUnitTest.java ---------------------------------------------------------------------- diff --cc geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug37210DUnitTest.java index 32771cf,2fe3d67..a132881 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug37210DUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug37210DUnitTest.java @@@ -16,22 -16,7 +16,23 @@@ */ package com.gemstone.gemfire.internal.cache.tier.sockets; -import com.gemstone.gemfire.cache.*; ++import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*; +import static org.junit.Assert.*; + +import java.util.Iterator; +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.CacheFactory; +import com.gemstone.gemfire.cache.DataPolicy; +import com.gemstone.gemfire.cache.Region; +import com.gemstone.gemfire.cache.RegionAttributes; +import com.gemstone.gemfire.cache.Scope; import com.gemstone.gemfire.cache.client.Pool; import com.gemstone.gemfire.cache.client.PoolManager; import com.gemstone.gemfire.cache.server.CacheServer; @@@ -196,10 -191,10 +196,10 @@@ public class Bug37210DUnitTest extends */ public static void createClientCache(String host, Integer port) throws Exception { - Bug37210DUnitTest test = new Bug37210DUnitTest("temp"); + Bug37210DUnitTest test = new Bug37210DUnitTest(); Properties props = new Properties(); - props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0"); - props.setProperty(DistributionConfig.LOCATORS_NAME, ""); + props.setProperty(MCAST_PORT, "0"); + props.setProperty(LOCATORS, ""); cache = test.createCache(props); Pool p = PoolManager.createFactory() .addServer(host, port.intValue()) http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug37805DUnitTest.java ---------------------------------------------------------------------- diff --cc geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug37805DUnitTest.java index e53a223,d6905d9..e35a172 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug37805DUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug37805DUnitTest.java @@@ -16,24 -16,15 +16,24 @@@ */ package com.gemstone.gemfire.internal.cache.tier.sockets; ++import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*; +import static org.junit.Assert.*; + +import java.util.Iterator; +import java.util.Properties; +import java.util.Set; + +import org.junit.Test; +import org.junit.experimental.categories.Category; + import com.gemstone.gemfire.cache.CacheException; import com.gemstone.gemfire.cache.Region; import com.gemstone.gemfire.cache.client.Pool; import com.gemstone.gemfire.cache.client.PoolFactory; import com.gemstone.gemfire.cache.client.PoolManager; import com.gemstone.gemfire.cache30.CacheSerializableRunnable; - import com.gemstone.gemfire.distributed.internal.DistributionConfig; import com.gemstone.gemfire.internal.cache.HARegion; import com.gemstone.gemfire.internal.cache.PoolFactoryImpl; -import com.gemstone.gemfire.test.dunit.DistributedTestCase; import com.gemstone.gemfire.test.dunit.Host; import com.gemstone.gemfire.test.dunit.NetworkUtils; import com.gemstone.gemfire.test.dunit.VM; @@@ -55,10 -53,10 +55,6 @@@ public class Bug37805DUnitTest extends private int PORT1; - public Bug37805DUnitTest() { - super(); - public Bug37805DUnitTest(String name) { - super(name); -- } -- @Override public final void postSetUp() throws Exception { Host host = Host.getHost(0); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/CacheServerMaxConnectionsJUnitTest.java ---------------------------------------------------------------------- diff --cc geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/CacheServerMaxConnectionsJUnitTest.java index 878b9a7,893354c..bce5711 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/CacheServerMaxConnectionsJUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/CacheServerMaxConnectionsJUnitTest.java @@@ -16,22 -16,9 +16,23 @@@ */ package com.gemstone.gemfire.internal.cache.tier.sockets; ++import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*; +import static org.junit.Assert.*; + +import java.io.IOException; +import java.util.Properties; + +import org.junit.After; +import org.junit.Test; +import org.junit.experimental.categories.Category; + import com.gemstone.gemfire.Statistics; import com.gemstone.gemfire.StatisticsType; -import com.gemstone.gemfire.cache.*; +import com.gemstone.gemfire.cache.AttributesFactory; +import com.gemstone.gemfire.cache.Cache; +import com.gemstone.gemfire.cache.CacheFactory; +import com.gemstone.gemfire.cache.RegionAttributes; +import com.gemstone.gemfire.cache.Scope; import com.gemstone.gemfire.cache.client.NoAvailableServersException; import com.gemstone.gemfire.cache.client.PoolFactory; import com.gemstone.gemfire.cache.client.PoolManager; @@@ -84,42 -85,59 +85,41 @@@ public class CacheServerMaxConnectionsJ /** * Initializes proxy object and creates region for client - * */ - private void createProxyAndRegionForClient() - { - try { - //props.setProperty("retryAttempts", "0"); - PoolFactory pf = PoolManager.createFactory(); - pf.addServer("localhost", PORT); - pf.setMinConnections(0); - pf.setPingInterval(10000); - pf.setThreadLocalConnections(true); - pf.setReadTimeout(2000); - pf.setSocketBufferSize(32768); - proxy = (PoolImpl)pf.create("junitPool"); - AttributesFactory factory = new AttributesFactory(); - factory.setScope(Scope.DISTRIBUTED_ACK); - factory.setPoolName("junitPool"); - RegionAttributes attrs = factory.createRegionAttributes(); - cache.createVMRegion(regionName, attrs); - } - catch (Exception ex) { - ex.printStackTrace(); - fail("Failed to initialize client"); - } + private void createProxyAndRegionForClient() { + //props.setProperty("retryAttempts", "0"); + PoolFactory pf = PoolManager.createFactory(); + pf.addServer("localhost", PORT); + pf.setMinConnections(0); + pf.setPingInterval(10000); + pf.setThreadLocalConnections(true); + pf.setReadTimeout(2000); + pf.setSocketBufferSize(32768); + proxy = (PoolImpl)pf.create("junitPool"); + AttributesFactory factory = new AttributesFactory(); + factory.setScope(Scope.DISTRIBUTED_ACK); + factory.setPoolName("junitPool"); + RegionAttributes attrs = factory.createRegionAttributes(); + cache.createVMRegion(regionName, attrs); } - private final static int MAX_CNXS = 100; - /** * Creates and starts the server instance - *¥ - * */ - private int createServer() - { + private int createServer() throws IOException { CacheServer server = null; - try { - Properties p = new Properties(); - // make it a loner - p.put(MCAST_PORT, "0"); - p.put(LOCATORS, ""); - this.system = DistributedSystem.connect(p); - this.cache = CacheFactory.create(system); - server = this.cache.addCacheServer(); - int port = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET); - server.setMaxConnections(MAX_CNXS); - server.setMaxThreads(getMaxThreads()); - server.setPort(port); - server.start(); - } - catch (Exception e) { - e.printStackTrace(); - fail("Failed to create server"); - } + Properties p = new Properties(); + // make it a loner - p.put("mcast-port", "0"); - p.put("locators", ""); ++ p.put(MCAST_PORT, "0"); ++ p.put(LOCATORS, ""); + this.system = DistributedSystem.connect(p); + this.cache = CacheFactory.create(system); + server = this.cache.addCacheServer(); + int port = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET); + server.setMaxConnections(MAX_CNXS); + server.setMaxThreads(getMaxThreads()); + server.setPort(port); + server.start(); return server.getPort(); } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/CacheServerTestUtil.java ---------------------------------------------------------------------- diff --cc geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/CacheServerTestUtil.java index e9bae1f,bae4e50..c131442 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/CacheServerTestUtil.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/CacheServerTestUtil.java @@@ -16,30 -16,10 +16,31 @@@ */ package com.gemstone.gemfire.internal.cache.tier.sockets; + import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*; +import static com.gemstone.gemfire.test.dunit.Assert.*; -import com.gemstone.gemfire.cache.*; -import com.gemstone.gemfire.cache.client.*; +import java.io.File; +import java.net.InetSocketAddress; +import java.net.URISyntaxException; +import java.net.URL; +import java.util.Enumeration; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.Properties; + +import com.gemstone.gemfire.cache.AttributesFactory; +import com.gemstone.gemfire.cache.Cache; +import com.gemstone.gemfire.cache.CacheFactory; +import com.gemstone.gemfire.cache.DataPolicy; +import com.gemstone.gemfire.cache.Declarable; +import com.gemstone.gemfire.cache.EntryEvent; +import com.gemstone.gemfire.cache.RegionAttributes; +import com.gemstone.gemfire.cache.Scope; +import com.gemstone.gemfire.cache.client.ClientCache; +import com.gemstone.gemfire.cache.client.ClientCacheFactory; +import com.gemstone.gemfire.cache.client.ClientRegionShortcut; +import com.gemstone.gemfire.cache.client.Pool; +import com.gemstone.gemfire.cache.client.PoolManager; import com.gemstone.gemfire.cache.client.internal.PoolImpl; import com.gemstone.gemfire.cache.query.CqEvent; import com.gemstone.gemfire.cache.server.CacheServer; @@@ -116,25 -114,34 +117,25 @@@ public class CacheServerTestUtil extend pool = (PoolImpl)((GemFireCacheImpl)cc).getDefaultPool(); } - - public static void createPool(PoolAttributes poolAttr) throws Exception { Properties props = new Properties(); - props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0"); - props.setProperty(DistributionConfig.LOCATORS_NAME, ""); + props.setProperty(MCAST_PORT, "0"); + props.setProperty(LOCATORS, ""); - DistributedSystem ds = new CacheServerTestUtil("tmp").getSystem(props);; - - PoolFactoryImpl pf = (PoolFactoryImpl)PoolManager.createFactory(); - pf.init(poolAttr); - PoolImpl p = (PoolImpl)pf.create("CacheServerTestUtil"); - AttributesFactory factory = new AttributesFactory(); - factory.setScope(Scope.LOCAL); - factory.setPoolName(p.getName()); + DistributedSystem ds = new CacheServerTestUtil().getSystem(props);; - RegionAttributes attrs = factory.create(); - pool = p; - } - - - - - - - - public static void createCacheClient(Pool poolAttr, String regionName, - Properties dsProperties, Boolean addControlListener) throws Exception { + PoolFactoryImpl pf = (PoolFactoryImpl)PoolManager.createFactory(); + pf.init(poolAttr); + PoolImpl p = (PoolImpl)pf.create("CacheServerTestUtil"); + AttributesFactory factory = new AttributesFactory(); + factory.setScope(Scope.LOCAL); + factory.setPoolName(p.getName()); + + RegionAttributes attrs = factory.create(); + pool = p; + } + + public static void createCacheClient(Pool poolAttr, String regionName, Properties dsProperties, Boolean addControlListener) throws Exception { createCacheClient(poolAttr, regionName, dsProperties, addControlListener, null); } @@@ -285,25 -297,29 +286,25 @@@ cache.createRegion(regionName2, factory2.create()); } - private static Properties getClientProperties() - { + private static Properties getClientProperties() { Properties props = new Properties(); - props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0"); - props.setProperty(DistributionConfig.LOCATORS_NAME, ""); + props.setProperty(MCAST_PORT, "0"); + props.setProperty(LOCATORS, ""); return props; } - private static Properties getClientProperties(boolean durable) - { + private static Properties getClientProperties(boolean durable) { Properties props = new Properties(); - props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0"); - props.setProperty(DistributionConfig.LOCATORS_NAME, ""); + props.setProperty(MCAST_PORT, "0"); + props.setProperty(LOCATORS, ""); return props; } - public static Integer createCacheServer(String regionName, - Boolean notifyBySubscription) throws Exception - { + public static Integer createCacheServer(String regionName, Boolean notifyBySubscription) throws Exception { Properties props = new Properties(); - props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0"); - props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost["+DistributedTestUtils.getDUnitLocatorPort()+"]"); + props.setProperty(MCAST_PORT, "0"); + props.setProperty(LOCATORS, "localhost[" + DistributedTestUtils.getDUnitLocatorPort() + "]"); - new CacheServerTestUtil("temp").createCache(props); + new CacheServerTestUtil().createCache(props); AttributesFactory factory = new AttributesFactory(); factory.setScope(Scope.DISTRIBUTED_ACK); factory.setEnableBridgeConflation(true); @@@ -318,11 -334,14 +319,11 @@@ return new Integer(server1.getPort()); } - public static Integer[] createCacheServerReturnPorts(String regionName, - Boolean notifyBySubscription) throws Exception - { + public static Integer[] createCacheServerReturnPorts(String regionName, Boolean notifyBySubscription) throws Exception { Properties props = new Properties(); - props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0"); - props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost["+DistributedTestUtils.getDUnitLocatorPort()+"]"); -// int mcastPort = AvailablePort.getRandomAvailablePort(AvailablePort.JGROUPS); + props.setProperty(MCAST_PORT, "0"); + props.setProperty(LOCATORS, "localhost[" + DistributedTestUtils.getDUnitLocatorPort() + "]"); - new CacheServerTestUtil("temp").createCache(props); + new CacheServerTestUtil().createCache(props); AttributesFactory factory = new AttributesFactory(); factory.setScope(Scope.DISTRIBUTED_ACK); factory.setEnableBridgeConflation(true); @@@ -337,11 -356,13 +338,11 @@@ return new Integer[] {port, 0}; } - public static void createCacheServer(String regionName, - Boolean notifyBySubscription, Integer serverPort) - throws Exception { + public static void createCacheServer(String regionName, Boolean notifyBySubscription, Integer serverPort) throws Exception { Properties props = new Properties(); - props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0"); - props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost["+DistributedTestUtils.getDUnitLocatorPort()+"]"); + props.setProperty(MCAST_PORT, "0"); + props.setProperty(LOCATORS, "localhost[" + DistributedTestUtils.getDUnitLocatorPort() + "]"); - new CacheServerTestUtil("temp").createCache(props); + new CacheServerTestUtil().createCache(props); AttributesFactory factory = new AttributesFactory(); factory.setScope(Scope.DISTRIBUTED_ACK); factory.setEnableBridgeConflation(true); @@@ -467,30 -499,34 +468,30 @@@ /** * Disables the shuffling of endpoints for a client - * */ - public static void disableShufflingOfEndpoints() - { + public static void disableShufflingOfEndpoints() { // TODO DISABLE_RANDOM doesn't seem to be used anywhere - System.setProperty("gemfire.PoolImpl.DISABLE_RANDOM", "true"); - System.setProperty("gemfire.bridge.disableShufflingOfEndpoints", "true"); + System.setProperty(DistributionConfig.GEMFIRE_PREFIX + "PoolImpl.DISABLE_RANDOM", "true"); + System.setProperty(DistributionConfig.GEMFIRE_PREFIX + "bridge.disableShufflingOfEndpoints", "true"); } + /** * Enables the shuffling of endpoints for a client - * @since 5.7 + * @since GemFire 5.7 */ - public static void enableShufflingOfEndpoints() - { + public static void enableShufflingOfEndpoints() { // TODO DISABLE_RANDOM doesn't seem to be used anywhere - System.setProperty("gemfire.PoolImpl.DISABLE_RANDOM", "false"); - System.setProperty("gemfire.bridge.disableShufflingOfEndpoints", "false"); + System.setProperty(DistributionConfig.GEMFIRE_PREFIX + "PoolImpl.DISABLE_RANDOM", "false"); + System.setProperty(DistributionConfig.GEMFIRE_PREFIX + "bridge.disableShufflingOfEndpoints", "false"); } /** * Resets the 'disableShufflingOfEndpoints' flag - * */ - public static void resetDisableShufflingOfEndpointsFlag() - { + public static void resetDisableShufflingOfEndpointsFlag() { - System.setProperty("gemfire.bridge.disableShufflingOfEndpoints", "false"); + System.setProperty(DistributionConfig.GEMFIRE_PREFIX + "bridge.disableShufflingOfEndpoints", "false"); } -- ++ public static class EventWrapper { public final EntryEvent event; public final Object key; http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/CacheServerTransactionsDUnitTest.java ---------------------------------------------------------------------- diff --cc geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/CacheServerTransactionsDUnitTest.java index 2698913,e416b3c..8315019 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/CacheServerTransactionsDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/CacheServerTransactionsDUnitTest.java @@@ -16,24 -16,7 +16,25 @@@ */ package com.gemstone.gemfire.internal.cache.tier.sockets; -import com.gemstone.gemfire.cache.*; ++import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*; +import static org.junit.Assert.*; + +import java.util.ArrayList; +import java.util.List; +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; +import com.gemstone.gemfire.cache.CacheFactory; +import com.gemstone.gemfire.cache.CommitConflictException; +import com.gemstone.gemfire.cache.DataPolicy; +import com.gemstone.gemfire.cache.EntryEvent; +import com.gemstone.gemfire.cache.Region; +import com.gemstone.gemfire.cache.Scope; import com.gemstone.gemfire.cache.client.PoolManager; import com.gemstone.gemfire.cache.client.internal.PoolImpl; import com.gemstone.gemfire.cache.server.CacheServer; @@@ -54,13 -36,12 +55,10 @@@ import com.gemstone.gemfire.test.junit. /** * Tests behaviour of transactions in client server model */ -public class CacheServerTransactionsDUnitTest extends DistributedTestCase -{ - /** constructor */ - public CacheServerTransactionsDUnitTest(String name) { - super(name); - } +@Category(DistributedTest.class) +public class CacheServerTransactionsDUnitTest extends JUnit4DistributedTestCase { + - /** constructor */ - public CacheServerTransactionsDUnitTest() { - super(); - } ++ private static final int PAUSE = 5 * 1000; private static Cache cache = null; @@@ -96,8 -77,8 +94,6 @@@ private static VM client2 = null; --// private static RegionAttributes attrs = null; -- protected static boolean destroyed = false; protected static boolean invalidated = false; @@@ -111,14 -92,13 +107,11 @@@ client2 = host.getVM(3); } -- private static final int PAUSE = 5 * 1000; -- /** * Test for update propagation to the clients when there is one server and two * clients connected to the server. -- * */ + @Test public void testOneServerToClientTransactionsPropagation() { Integer port1 = initServerCache(server1); @@@ -144,14 -124,13 +137,11 @@@ client2.invoke(() -> CacheServerTransactionsDUnitTest.verifyUpdates()); } -- -- /** * Test for update propagation to the clients when there are 2 servers and two * clients connected to both the servers. -- * */ + @Test public void testServerToClientTransactionsPropagation() { Integer port1 = initServerCache(server1); @@@ -184,9 -163,8 +174,8 @@@ /** * Test for update propagation to the clients when there are 2 servers and two * clients connected to separate server. -- * */ + @Test public void testServerToClientTransactionsPropagationWithOneClientConnectedToOneServer() { Integer port1 = initServerCache(server1); @@@ -272,9 -248,8 +261,8 @@@ /** * Test for invalidate propagation to the clients when there are 2 servers and two * clients connected to separate servers. -- * */ + @Test public void testInvalidatesServerToClientTransactionsPropagationWithOneConnection() { Integer port1 = initServerCache(server1); @@@ -302,9 -277,8 +290,8 @@@ /** * Test for destroy propagation to the clients when there is one server and two * clients connected to the server. -- * */ + @Test public void testDestroysOneServerToClientTransactionsPropagation() { Integer port1 = initServerCache(server1); @@@ -661,9 -633,9 +648,9 @@@ public static void createClientCache(String host, Integer port) throws Exception { Properties props = new Properties(); - props.setProperty("mcast-port", "0"); - props.setProperty("locators", ""); + props.setProperty(MCAST_PORT, "0"); + props.setProperty(LOCATORS, ""); - new CacheServerTransactionsDUnitTest("temp").createCache(props); + new CacheServerTransactionsDUnitTest().createCache(props); PoolImpl p = (PoolImpl)PoolManager.createFactory() .addServer(host, port.intValue()) .setSubscriptionEnabled(true) @@@ -696,9 -668,9 +683,9 @@@ throws Exception { Properties props = new Properties(); - props.setProperty("mcast-port", "0"); - props.setProperty("locators", ""); + props.setProperty(MCAST_PORT, "0"); + props.setProperty(LOCATORS, ""); - new CacheServerTransactionsDUnitTest("temp").createCache(props); + new CacheServerTransactionsDUnitTest().createCache(props); PoolImpl p = (PoolImpl)PoolManager.createFactory() .addServer(host, port1.intValue()) .addServer(host, port2.intValue()) http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ClearPropagationDUnitTest.java ---------------------------------------------------------------------- diff --cc geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ClearPropagationDUnitTest.java index 4dd053f,8e25607..29fb164 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ClearPropagationDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ClearPropagationDUnitTest.java @@@ -16,24 -16,7 +16,25 @@@ */ package com.gemstone.gemfire.internal.cache.tier.sockets; -import com.gemstone.gemfire.cache.*; ++import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*; +import static org.junit.Assert.*; + +import java.util.ArrayList; +import java.util.List; +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; +import com.gemstone.gemfire.cache.CacheFactory; +import com.gemstone.gemfire.cache.DataPolicy; +import com.gemstone.gemfire.cache.Region; +import com.gemstone.gemfire.cache.RegionAttributes; +import com.gemstone.gemfire.cache.RegionEvent; +import com.gemstone.gemfire.cache.Scope; import com.gemstone.gemfire.cache.client.Pool; import com.gemstone.gemfire.cache.client.PoolManager; import com.gemstone.gemfire.cache.client.internal.Connection; @@@ -359,9 -344,9 +360,9 @@@ public class ClearPropagationDUnitTest PORT1 = port1.intValue(); PORT2 = port2.intValue(); Properties props = new Properties(); - props.setProperty("mcast-port", "0"); - props.setProperty("locators", ""); + props.setProperty(MCAST_PORT, "0"); + props.setProperty(LOCATORS, ""); - new ClearPropagationDUnitTest("temp").createCache(props); + new ClearPropagationDUnitTest().createCache(props); CacheServerTestUtil.disableShufflingOfEndpoints(); Pool p; try { http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ClientConflationDUnitTest.java ---------------------------------------------------------------------- diff --cc geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ClientConflationDUnitTest.java index 588fb0e,e05f9ff..47524bd --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ClientConflationDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ClientConflationDUnitTest.java @@@ -16,22 -16,7 +16,23 @@@ */ package com.gemstone.gemfire.internal.cache.tier.sockets; -import com.gemstone.gemfire.cache.*; ++import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*; +import static org.junit.Assert.*; + +import java.util.Iterator; +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.CacheFactory; +import com.gemstone.gemfire.cache.CacheWriterException; +import com.gemstone.gemfire.cache.EntryEvent; +import com.gemstone.gemfire.cache.Region; +import com.gemstone.gemfire.cache.RegionAttributes; +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; @@@ -58,11 -40,10 +59,11 @@@ import com.gemstone.gemfire.test.junit. * This test verifies the per-client queue conflation override functionality * Taken from the existing ConflationDUnitTest.java and modified. * - * @since 5.7 + * @since GemFire 5.7 */ -public class ClientConflationDUnitTest extends DistributedTestCase -{ +@Category(DistributedTest.class) +public class ClientConflationDUnitTest extends JUnit4DistributedTestCase { + VM vm0 = null; // server VM vm1 = null; // client private static Cache cacheClient = null; @@@ -73,11 -54,11 +74,6 @@@ private static final String REGION_NAME1 = "ClientConflationDUnitTest_region1" ; private static final String REGION_NAME2 = "ClientConflationDUnitTest_region2" ; -- /** constructor */ - public ClientConflationDUnitTest() { - super(); - public ClientConflationDUnitTest(String name) { - super(name); -- } -- @Override public final void postSetUp() throws Exception { disconnectAllFromDS(); @@@ -412,8 -390,8 +408,8 @@@ public static Integer createServerCache() throws Exception { Properties props = new Properties(); - props.setProperty(DistributionConfig.DELTA_PROPAGATION_PROP_NAME, "false"); + props.setProperty(DELTA_PROPAGATION, "false"); - ClientConflationDUnitTest test = new ClientConflationDUnitTest("temp"); + ClientConflationDUnitTest test = new ClientConflationDUnitTest(); cacheServer = test.createCache(props); AttributesFactory factory = new AttributesFactory(); factory.setScope(Scope.DISTRIBUTED_ACK); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ClientInterestNotifyDUnitTest.java ---------------------------------------------------------------------- diff --cc geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ClientInterestNotifyDUnitTest.java index 37aaecc,7e51fe4..4261568 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ClientInterestNotifyDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ClientInterestNotifyDUnitTest.java @@@ -16,26 -16,7 +16,27 @@@ */ package com.gemstone.gemfire.internal.cache.tier.sockets; +import static org.junit.Assert.*; + +import java.util.Iterator; +import java.util.Properties; +import java.util.concurrent.TimeUnit; + +import com.jayway.awaitility.Awaitility; +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.CacheFactory; +import com.gemstone.gemfire.cache.CacheWriterException; +import com.gemstone.gemfire.cache.DataPolicy; +import com.gemstone.gemfire.cache.EntryEvent; +import com.gemstone.gemfire.cache.InterestResultPolicy; +import com.gemstone.gemfire.cache.Region; +import com.gemstone.gemfire.cache.RegionAttributes; +import com.gemstone.gemfire.cache.Scope; + import com.gemstone.gemfire.cache.*; import com.gemstone.gemfire.cache.client.Pool; import com.gemstone.gemfire.cache.client.PoolFactory; import com.gemstone.gemfire.cache.client.PoolManager; @@@ -45,27 -26,24 +46,34 @@@ import com.gemstone.gemfire.distributed import com.gemstone.gemfire.internal.AvailablePort; import com.gemstone.gemfire.internal.cache.CacheServerImpl; import com.gemstone.gemfire.internal.cache.GemFireCacheImpl; +import com.gemstone.gemfire.test.dunit.Assert; +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.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; + import com.gemstone.gemfire.test.dunit.*; + import com.jayway.awaitility.Awaitility; + + import java.util.Iterator; + import java.util.Properties; + import java.util.concurrent.TimeUnit; + + import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*; /** * This test verifies the per-client notify-by-subscription (NBS) override * functionality along with register interest new receiveValues flag. * Taken from the existing ClientConflationDUnitTest.java and modified. * - * @since 6.0.3 + * @since GemFire 6.0.3 */ -public class ClientInterestNotifyDUnitTest extends DistributedTestCase -{ +@Category(DistributedTest.class) +public class ClientInterestNotifyDUnitTest extends JUnit4DistributedTestCase { + class EventListener extends CacheListenerAdapter { public EventListener(String name) @@@ -152,11 -130,11 +160,6 @@@ // Region 3 does NOT register any interest private static final String REGION_NAME3 = "ClientInterestNotifyDUnitTest_region3" ; -- /** constructor */ - public ClientInterestNotifyDUnitTest() { - super(); - public ClientInterestNotifyDUnitTest(String name) { - super(name); -- } -- @Override public final void postSetUp() throws Exception { disconnectAllFromDS(); @@@ -184,14 -156,13 +181,9 @@@ return cache; } - public void testInterestNotify() { - try { - performSteps(); - } - catch( Exception e ) { - Assert.fail("testInterestNotify failed due to exception", e); - } + @Test - public void testInterestNotify() { - try { - performSteps(); - } - catch( Exception e ) { - Assert.fail("testInterestNotify failed due to exception", e); - } ++ public void testInterestNotify() throws Exception { ++ performSteps(); } private void performSteps() throws Exception { @@@ -478,9 -412,9 +433,9 @@@ */ public static Integer createServerCache() throws Exception { - ClientInterestNotifyDUnitTest test = new ClientInterestNotifyDUnitTest("temp"); + ClientInterestNotifyDUnitTest test = new ClientInterestNotifyDUnitTest(); Properties props = new Properties(); - props.setProperty(DistributionConfig.DELTA_PROPAGATION_PROP_NAME, "false"); + props.setProperty(DELTA_PROPAGATION, "false"); cacheServer = test.createCache(props); AttributesFactory factory = new AttributesFactory(); factory.setScope(Scope.DISTRIBUTED_ACK); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ClientServerForceInvalidateDUnitTest.java ---------------------------------------------------------------------- diff --cc geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ClientServerForceInvalidateDUnitTest.java index 6867b8b,04a8568..2f10dc1 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ClientServerForceInvalidateDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ClientServerForceInvalidateDUnitTest.java @@@ -16,40 -16,14 +16,34 @@@ */ package com.gemstone.gemfire.internal.cache.tier.sockets; - import org.junit.experimental.categories.Category; - import org.junit.Test; - -import com.gemstone.gemfire.cache.*; ++import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*; ++import static com.jayway.awaitility.Awaitility.*; +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 static com.jayway.awaitility.Awaitility.with; - +import java.util.Properties; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.TimeUnit; + +import org.apache.logging.log4j.Logger; ++import org.junit.Test; ++import org.junit.experimental.categories.Category; + +import com.gemstone.gemfire.cache.Cache; +import com.gemstone.gemfire.cache.CacheListener; +import com.gemstone.gemfire.cache.DataPolicy; +import com.gemstone.gemfire.cache.EntryEvent; +import com.gemstone.gemfire.cache.InterestPolicy; +import com.gemstone.gemfire.cache.InterestResultPolicy; +import com.gemstone.gemfire.cache.PartitionAttributesFactory; +import com.gemstone.gemfire.cache.Region; +import com.gemstone.gemfire.cache.RegionFactory; +import com.gemstone.gemfire.cache.SubscriptionAttributes; import com.gemstone.gemfire.cache.client.NoAvailableServersException; import com.gemstone.gemfire.cache.client.PoolManager; import com.gemstone.gemfire.cache.client.internal.Connection; import com.gemstone.gemfire.cache.client.internal.PoolImpl; import com.gemstone.gemfire.cache.server.CacheServer; import com.gemstone.gemfire.cache.util.CacheListenerAdapter; --import com.gemstone.gemfire.cache30.CacheTestCase; import com.gemstone.gemfire.distributed.DistributedSystem; import com.gemstone.gemfire.internal.AvailablePort; import com.gemstone.gemfire.internal.cache.AbstractRegionMap; @@@ -60,14 -34,22 +54,14 @@@ import com.gemstone.gemfire.internal.lo import com.gemstone.gemfire.test.dunit.Host; import com.gemstone.gemfire.test.dunit.NetworkUtils; import com.gemstone.gemfire.test.dunit.VM; -import org.apache.logging.log4j.Logger; - -import java.util.Properties; -import java.util.concurrent.CountDownLatch; -import java.util.concurrent.TimeUnit; - -import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.LOCATORS; -import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT; -import static com.jayway.awaitility.Awaitility.with; ++import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase; ++import com.gemstone.gemfire.test.junit.categories.DistributedTest; /** * Tests client server FORCE_INVALIDATE */ -public class ClientServerForceInvalidateDUnitTest extends CacheTestCase -{ - private static final long serialVersionUID = 1L; +@Category(DistributedTest.class) - public class ClientServerForceInvalidateDUnitTest extends JUnit4CacheTestCase - { - private static final long serialVersionUID = 1L; ++public class ClientServerForceInvalidateDUnitTest extends JUnit4CacheTestCase { private static final Logger logger = LogService.getLogger(); @@@ -80,14 -62,14 +74,8 @@@ private static VM server1; private static VM server2; -- /** constructor */ - public ClientServerForceInvalidateDUnitTest() { - super(); - public ClientServerForceInvalidateDUnitTest(String name) { - super(name); -- } -- @Override -- public final void postSetUp() throws Exception -- { ++ public final void postSetUp() throws Exception { host = Host.getHost(0); server1 = host.getVM(0); server2 = host.getVM(1); @@@ -257,7 -230,7 +245,6 @@@ } } return false; -- } private boolean hasClientListenerAfterInvalidateBeenInvoked() { @@@ -273,11 -246,11 +260,11 @@@ } return false; } -- private static Integer createServerCache(Boolean concurrencyChecksEnabled, Boolean partitioned, Integer maxThreads) -- throws Exception { ++ ++ private static Integer createServerCache(Boolean concurrencyChecksEnabled, Boolean partitioned, Integer maxThreads) throws Exception { AbstractRegionMap.FORCE_INVALIDATE_EVENT = true; Properties props = new Properties(); - Cache cache = new ClientServerForceInvalidateDUnitTest("temp").createCacheV(props); + Cache cache = new ClientServerForceInvalidateDUnitTest().createCacheV(props); RegionFactory factory = cache.createRegionFactory(); if (partitioned) { factory.setDataPolicy(DataPolicy.PARTITION); @@@ -304,13 -277,13 +291,12 @@@ } -- public static void createClientCache(String h, int port1, int port2, boolean empty, boolean concurrenctChecksEnabled) -- throws Exception { ++ public static void createClientCache(String h, int port1, int port2, boolean empty, boolean concurrenctChecksEnabled) throws Exception { AbstractRegionMap.FORCE_INVALIDATE_EVENT = true; Properties props = new Properties(); - props.setProperty("mcast-port", "0"); - props.setProperty("locators", ""); + props.setProperty(MCAST_PORT, "0"); + props.setProperty(LOCATORS, ""); - Cache cache = new ClientServerForceInvalidateDUnitTest("temp").createCacheV(props); + Cache cache = new ClientServerForceInvalidateDUnitTest().createCacheV(props); PoolImpl p = (PoolImpl)PoolManager.createFactory() .addServer(h, port1) .addServer(h, port2) @@@ -369,27 -342,27 +355,27 @@@ static class ClientListener extends CacheListenerAdapter { public boolean afterInvalidateInvoked; @Override -- public void afterCreate(EntryEvent event) { -- super.afterCreate(event); -- logger.info("afterCreate: {" + event.getOldValue() + " -> " + event.getNewValue() + "} at=" + System.currentTimeMillis()); -- } -- @Override -- public void afterUpdate(EntryEvent event) { -- super.afterUpdate(event); -- logger.info("afterUpdate: {" + event.getOldValue() + " -> " + event.getNewValue() + "} at=" + System.currentTimeMillis()); -- } -- @Override -- public void afterInvalidate(final EntryEvent event) { -- super.afterInvalidate(event); -- afterInvalidateInvoked = true; -- String prefix = ""; -- if (!event.isOriginRemote()) { -- prefix = " "; -- } -- logger.info(prefix + "afterInvalidate: {" + event.getOldValue() + " -> " + event.getNewValue() + "} at=" + System.currentTimeMillis()); -- ++ public void afterCreate(EntryEvent event) { ++ super.afterCreate(event); ++ logger.info("afterCreate: {" + event.getOldValue() + " -> " + event.getNewValue() + "} at=" + System.currentTimeMillis()); ++ } ++ @Override ++ public void afterUpdate(EntryEvent event) { ++ super.afterUpdate(event); ++ logger.info("afterUpdate: {" + event.getOldValue() + " -> " + event.getNewValue() + "} at=" + System.currentTimeMillis()); ++ } ++ @Override ++ public void afterInvalidate(final EntryEvent event) { ++ super.afterInvalidate(event); ++ afterInvalidateInvoked = true; ++ String prefix = ""; ++ if (!event.isOriginRemote()) { ++ prefix = " "; } ++ logger.info(prefix + "afterInvalidate: {" + event.getOldValue() + " -> " + event.getNewValue() + "} at=" + System.currentTimeMillis()); ++ } } ++ static class ServerListener extends CacheListenerAdapter { boolean afterInvalidateInvoked; @Override