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 F253F200AC8 for ; Tue, 7 Jun 2016 22:55:10 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id F0BE8160968; Tue, 7 Jun 2016 20:55:10 +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 8839C160A5C for ; Tue, 7 Jun 2016 22:55:08 +0200 (CEST) Received: (qmail 784 invoked by uid 500); 7 Jun 2016 20:55:07 -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 769 invoked by uid 99); 7 Jun 2016 20:55:07 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Jun 2016 20:55:07 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id CFEFE180A56 for ; Tue, 7 Jun 2016 20:55:06 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-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-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id jeZzKSPkgxLS for ; Tue, 7 Jun 2016 20:54:28 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with SMTP id 1CCC25FD4D for ; Tue, 7 Jun 2016 20:54:18 +0000 (UTC) Received: (qmail 93283 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 843B4E69BE; Tue, 7 Jun 2016 20:54:17 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: klund@apache.org To: commits@geode.incubator.apache.org Date: Tue, 07 Jun 2016 20:55:03 -0000 Message-Id: <672d6dc8426645b1918f03144f7dc80f@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [48/62] [abbrv] incubator-geode git commit: Merge remote-tracking branch 'origin/develop' into feature/GEODE-837 archived-at: Tue, 07 Jun 2016 20:55:11 -0000 http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ClientServerMiscDUnitTest.java ---------------------------------------------------------------------- diff --cc geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ClientServerMiscDUnitTest.java index bff0f16,d91e3f5..3d5bdf7 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ClientServerMiscDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ClientServerMiscDUnitTest.java @@@ -16,28 -16,8 +16,25 @@@ */ package com.gemstone.gemfire.internal.cache.tier.sockets; - import org.junit.experimental.categories.Category; - import org.junit.Test; - ++import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*; +import static org.junit.Assert.*; + - import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase; - import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase; - import com.gemstone.gemfire.test.junit.categories.DistributedTest; - +import java.util.Iterator; +import java.util.Properties; +import java.util.Set; + ++import org.junit.Test; ++import org.junit.experimental.categories.Category; ++ import com.gemstone.gemfire.GemFireIOException; -import com.gemstone.gemfire.cache.*; +import com.gemstone.gemfire.cache.AttributesFactory; +import com.gemstone.gemfire.cache.Cache; +import com.gemstone.gemfire.cache.CacheException; +import com.gemstone.gemfire.cache.CacheWriterException; +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.NoAvailableServersException; import com.gemstone.gemfire.cache.client.Pool; import com.gemstone.gemfire.cache.client.PoolManager; @@@ -47,32 -27,30 +44,28 @@@ import com.gemstone.gemfire.cache.clien import com.gemstone.gemfire.cache.client.internal.RegisterInterestTracker; import com.gemstone.gemfire.cache.server.CacheServer; import com.gemstone.gemfire.cache30.CacheSerializableRunnable; --import com.gemstone.gemfire.cache30.CacheTestCase; import com.gemstone.gemfire.distributed.DistributedSystem; import com.gemstone.gemfire.distributed.DistributedSystemDisconnectedException; - import com.gemstone.gemfire.distributed.internal.DistributionConfig; import com.gemstone.gemfire.internal.AvailablePort; import com.gemstone.gemfire.internal.cache.CacheServerImpl; import com.gemstone.gemfire.internal.cache.GemFireCacheImpl; import com.gemstone.gemfire.internal.cache.LocalRegion; -import com.gemstone.gemfire.test.dunit.*; - -import java.util.Iterator; -import java.util.Properties; -import java.util.Set; - -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.IgnoredException; +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.cache.internal.JUnit4CacheTestCase; ++import com.gemstone.gemfire.test.junit.categories.DistributedTest; /** * Tests client server corner cases between Region and Pool -- * -- * */ -public class ClientServerMiscDUnitTest extends CacheTestCase -{ -// private static Cache cache = null; +@Category(DistributedTest.class) - public class ClientServerMiscDUnitTest extends JUnit4CacheTestCase - { - // private static Cache cache = null; ++public class ClientServerMiscDUnitTest extends JUnit4CacheTestCase { protected static PoolImpl pool = null; @@@ -104,7 -82,7 +97,6 @@@ private static RegionAttributes attrs; -- // variables for concurrent map API test Properties props = new Properties(); final int putRange_1Start = 1; @@@ -120,13 -98,13 +112,6 @@@ final int removeRange_2Start = 7; final int removeRange_2End = 9; -- -- -- /** constructor */ - public ClientServerMiscDUnitTest() { - super(); - public ClientServerMiscDUnitTest(String name) { - super(name); -- } -- @Override public final void postSetUp() throws Exception { host = Host.getHost(0); @@@ -588,19 -557,18 +573,17 @@@ * populate some entries on region both on client and server. * Update the entries on server the client. * The client should not have entry invalidate. -- * -- * @throws Exception */ + @Test public void testInvalidatesPropagateOnRegionHavingNoPool() throws Exception { // start server first PORT1 = initServerCache(false); 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 ClientServerMiscDUnitTest("temp").createCache(props); + new ClientServerMiscDUnitTest().createCache(props); String host = NetworkUtils.getServerHostName(server1.getHost()); PoolImpl p = (PoolImpl)PoolManager.createFactory() .addServer(host, PORT1) @@@ -837,9 -803,9 +820,9 @@@ public static Pool _createClientCache(String h, int port, boolean empty) throws Exception { Properties props = new Properties(); - props.setProperty("mcast-port", "0"); - props.setProperty("locators", ""); + props.setProperty(MCAST_PORT, "0"); + props.setProperty(LOCATORS, ""); - Cache cache = new ClientServerMiscDUnitTest("temp").createCacheV(props); + Cache cache = new ClientServerMiscDUnitTest().createCacheV(props); ClientServerMiscDUnitTest.static_cache = cache; PoolImpl p = (PoolImpl)PoolManager.createFactory() .addServer(h, port) http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ConflationDUnitTest.java ---------------------------------------------------------------------- diff --cc geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ConflationDUnitTest.java index 5c73577,0ab0116..e0d672f --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ConflationDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ConflationDUnitTest.java @@@ -16,47 -16,25 +16,47 @@@ */ 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.HashMap; +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.PoolManager; 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.distributed.DistributedSystem; - import com.gemstone.gemfire.distributed.internal.DistributionConfig; import com.gemstone.gemfire.internal.AvailablePort; -import com.gemstone.gemfire.internal.cache.*; +import com.gemstone.gemfire.internal.cache.CacheServerImpl; +import com.gemstone.gemfire.internal.cache.ClientServerObserverAdapter; +import com.gemstone.gemfire.internal.cache.ClientServerObserverHolder; +import com.gemstone.gemfire.internal.cache.GemFireCacheImpl; +import com.gemstone.gemfire.internal.cache.HARegion; import com.gemstone.gemfire.internal.cache.ha.HAHelper; import com.gemstone.gemfire.internal.cache.ha.HARegionQueue; -import com.gemstone.gemfire.test.dunit.*; - -import java.util.HashMap; -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; +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; /** * This test verifies the conflation functionality of the @@@ -79,7 -57,7 +79,7 @@@ public class ConflationDUnitTest extend private int PORT ; private static final String REGION_NAME1 = "ConflationDUnitTest_region1" ; private static final String REGION_NAME2 = "ConflationDUnitTest_region2" ; -- final static String MARKER = "markerKey"; ++ static final String MARKER = "markerKey"; private static HashMap statMap = new HashMap(); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DataSerializerPropogationDUnitTest.java ---------------------------------------------------------------------- diff --cc geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DataSerializerPropogationDUnitTest.java index fd9e574,ba08e33..74987f0 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DataSerializerPropogationDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DataSerializerPropogationDUnitTest.java @@@ -16,26 -16,9 +16,27 @@@ */ package com.gemstone.gemfire.internal.cache.tier.sockets; ++import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*; +import static org.junit.Assert.*; + +import java.io.DataInput; +import java.io.DataOutput; +import java.io.IOException; +import java.util.Properties; + +import org.junit.Test; +import org.junit.experimental.categories.Category; + import com.gemstone.gemfire.DataSerializer; import com.gemstone.gemfire.TestDataSerializer; -import com.gemstone.gemfire.cache.*; +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.MirrorType; +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; @@@ -49,23 -31,20 +49,21 @@@ import com.gemstone.gemfire.internal.ca import com.gemstone.gemfire.internal.cache.ClientServerObserverAdapter; import com.gemstone.gemfire.internal.cache.ClientServerObserverHolder; import com.gemstone.gemfire.internal.cache.EventID; -import com.gemstone.gemfire.test.dunit.*; - -import java.io.DataInput; -import java.io.DataOutput; -import java.io.IOException; -import java.util.Properties; - -import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.LOCATORS; -import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT; - -public class DataSerializerPropogationDUnitTest extends DistributedTestCase { - - private static final long serialVersionUID = 0L; +import com.gemstone.gemfire.test.dunit.Assert; +import com.gemstone.gemfire.test.dunit.DistributedTestUtils; +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.StoppableWaitCriterion; +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 DataSerializerPropogationDUnitTest extends JUnit4DistributedTestCase { - private static final long serialVersionUID = 0L; - private static Cache cache = null; private static VM client1 = null; @@@ -113,9 -97,9 +111,9 @@@ public static void createClientCache(String host, Integer port1) 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 DataSerializerPropogationDUnitTest("temp").createCache(props); + new DataSerializerPropogationDUnitTest().createCache(props); Pool p = PoolManager.createFactory().addServer(host, port1.intValue()) .setMinConnections(1).setSubscriptionEnabled(true).setPingInterval(200) .create("ClientServerDataSerializersRegistrationDUnitTestPool"); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DestroyEntryPropagationDUnitTest.java ---------------------------------------------------------------------- diff --cc geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DestroyEntryPropagationDUnitTest.java index 4c39aef,592b179..99f4a80 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DestroyEntryPropagationDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DestroyEntryPropagationDUnitTest.java @@@ -16,26 -16,7 +16,27 @@@ */ package com.gemstone.gemfire.internal.cache.tier.sockets; -import com.gemstone.gemfire.cache.*; ++import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*; +import static com.gemstone.gemfire.test.dunit.Assert.*; + +import java.util.ArrayList; +import java.util.Iterator; +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.CacheWriterException; +import com.gemstone.gemfire.cache.DataPolicy; +import com.gemstone.gemfire.cache.Operation; +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.Connection; @@@ -149,7 -122,7 +149,6 @@@ public class DestroyEntryPropagationDUn vm2.invoke(() -> DestroyEntryPropagationDUnitTest.verifyEntriesAreDestroyed()); // verify only key-1 is destroyed vm3.invoke(() -> DestroyEntryPropagationDUnitTest.verifyOnlyRegisteredEntriesAreDestroyed()); -- } /** @@@ -175,9 -149,13 +174,8 @@@ vm2.invoke(() -> DestroyEntryPropagationDUnitTest.verifyOnlyRegisteredEntriesAreDestroyed()); // verify destroy entry only for registered keys in client 2 vm3.invoke(() -> DestroyEntryPropagationDUnitTest.verifyOnlyRegisteredEntriesAreDestroyed()); -- } - static private final String WAIT_PROPERTY = - "DestroyEntryPropagationDUnitTest.maxWaitTime"; - static private final int WAIT_DEFAULT = 120000; - /** * This tests whether the destroy are received by the sender or not if there * are situation of Interest List fail over @@@ -256,10 -234,11 +254,9 @@@ vm1.invoke(() -> DestroyEntryPropagationDUnitTest.verifyEntriesAreDestroyed()); vm2.invoke(() -> DestroyEntryPropagationDUnitTest.verifyNoDestroyEntryInSender()); -- } - public void acquireConnectionsAndDestroyEntriesK1andK2() - { + private void acquireConnectionsAndDestroyEntriesK1andK2() { try { Region r1 = cache.getRegion(Region.SEPARATOR+REGION_NAME); assertNotNull(r1); @@@ -406,9 -395,9 +403,9 @@@ int PORT1 = port1.intValue(); int PORT2 = port2.intValue(); 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 DestroyEntryPropagationDUnitTest("temp").createCache(props); + new DestroyEntryPropagationDUnitTest().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/DurableClientBug39997DUnitTest.java ---------------------------------------------------------------------- diff --cc geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientBug39997DUnitTest.java index 6438847,fb5a60d..0821592 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientBug39997DUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientBug39997DUnitTest.java @@@ -16,47 -16,27 +16,37 @@@ */ package com.gemstone.gemfire.internal.cache.tier.sockets; - import org.junit.experimental.categories.Category; - import org.junit.Test; - -import com.gemstone.gemfire.cache.*; -import com.gemstone.gemfire.cache.client.PoolManager; -import com.gemstone.gemfire.cache.client.internal.PoolImpl; -import com.gemstone.gemfire.cache.server.CacheServer; -import com.gemstone.gemfire.cache30.CacheTestCase; -import com.gemstone.gemfire.internal.AvailablePortHelper; -import com.gemstone.gemfire.test.dunit.*; ++import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*; +import static org.junit.Assert.*; - import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase; - import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase; - import com.gemstone.gemfire.test.junit.categories.DistributedTest; - import java.io.IOException; import java.util.Properties; -import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*; - -public class DurableClientBug39997DUnitTest extends CacheTestCase { ++import org.junit.Test; ++import org.junit.experimental.categories.Category; + - private static final long serialVersionUID = -2712855295338732543L; +import com.gemstone.gemfire.cache.AttributesFactory; +import com.gemstone.gemfire.cache.Cache; +import com.gemstone.gemfire.cache.NoSubscriptionServersAvailableException; +import com.gemstone.gemfire.cache.Region; +import com.gemstone.gemfire.cache.Scope; - import com.gemstone.gemfire.cache.client.NoAvailableServersException; +import com.gemstone.gemfire.cache.client.PoolManager; +import com.gemstone.gemfire.cache.client.internal.PoolImpl; +import com.gemstone.gemfire.cache.server.CacheServer; - import com.gemstone.gemfire.cache30.CacheTestCase; +import com.gemstone.gemfire.internal.AvailablePortHelper; +import com.gemstone.gemfire.test.dunit.Assert; +import com.gemstone.gemfire.test.dunit.Host; - import com.gemstone.gemfire.test.dunit.Invoke; +import com.gemstone.gemfire.test.dunit.NetworkUtils; +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.dunit.cache.internal.JUnit4CacheTestCase; ++import com.gemstone.gemfire.test.junit.categories.DistributedTest; - public DurableClientBug39997DUnitTest(String name) { - super(name); - } +@Category(DistributedTest.class) +public class DurableClientBug39997DUnitTest extends JUnit4CacheTestCase { - private static final long serialVersionUID = -2712855295338732543L; - - public DurableClientBug39997DUnitTest() { - super(); - } - public final void postTearDownCacheTestCase() { Host.getHost(0) .getVM(0).invoke(() -> disconnectFromDS()); } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientQueueSizeDUnitTest.java ---------------------------------------------------------------------- diff --cc geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientQueueSizeDUnitTest.java index cf1d44c,11a3e45..9ccc3c9 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientQueueSizeDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientQueueSizeDUnitTest.java @@@ -16,15 -16,6 +16,16 @@@ */ 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 org.junit.Ignore; +import org.junit.Test; +import org.junit.experimental.categories.Category; + import com.gemstone.gemfire.cache.CacheFactory; import com.gemstone.gemfire.cache.Region; import com.gemstone.gemfire.cache.RegionFactory; @@@ -64,9 -53,9 +65,9 @@@ public class DurableClientQueueSizeDUni private static final int EXCEPTION = -5; -- public static final String REGION_NAME = "DurableClientQueueSizeDunitTest_region"; ++ public static final String REGION_NAME = DurableClientQueueSizeDUnitTest.class.getSimpleName() + "_region"; -- public static final String NEW_REGION = "DurableClientQueueSizeDunitTest_region_2"; ++ public static final String NEW_REGION = DurableClientQueueSizeDUnitTest.class.getSimpleName() + "_region_2"; public static final String POOL_NAME = "my-pool"; @@@ -96,9 -92,8 +97,9 @@@ vm1.invoke(() -> DurableClientQueueSizeDUnitTest.closeCache()); } + @Test public void testNonDurableClientFails() throws Exception { -- vm2.invoke(DurableClientQueueSizeDUnitTest.class, "createClientCache", ++ vm2.invoke(DurableClientQueueSizeDUnitTest.class, "createClientCache", // TODO: change to lambda new Object[] { vm2.getHost(), new Integer[] { port0, port1 }, false }); vm2.invoke(() -> DurableClientQueueSizeDUnitTest.verifyQueueSize( EXCEPTION )); @@@ -107,7 -102,7 +108,9 @@@ // this test is disabled due to a high rate of failure. It fails with // the queue size being 11 instead of 10 in the first verifyQueueSize check. // See internal ticket #52227. -- public void disabledtestSinglePoolClientReconnectsBeforeTimeOut() throws Exception { ++ @Ignore("TODO: test is disabled due to #52227") ++ @Test ++ public void testSinglePoolClientReconnectsBeforeTimeOut() throws Exception { int num = 10; vm2.invoke(DurableClientQueueSizeDUnitTest.class, "createClientCache", new Object[] { vm2.getHost(), new Integer[] { port0, port1 }}); @@@ -182,7 -175,7 +185,9 @@@ vm2.invoke(() -> DurableClientQueueSizeDUnitTest.verifyQueueSize( PoolImpl.PRIMARY_QUEUE_NOT_AVAILABLE )); } -- public void bug51854_testMultiPoolClientReconnectsBeforeTimeOut() throws Exception { ++ @Ignore("TODO: test is disabled due to #51854") ++ @Test ++ public void testMultiPoolClientReconnectsBeforeTimeOut() throws Exception { int num = 10; vm2.invoke(DurableClientQueueSizeDUnitTest.class, "createClientCache", new Object[] { vm2.getHost(), new Integer[] { port0, port1 }, "300", @@@ -204,7 -197,7 +209,9 @@@ vm2.invoke(() -> DurableClientQueueSizeDUnitTest.verifyQueueSize( EXCEPTION, EXCEPTION )); } -- public void bug51854_testMultiPoolClientReconnectsAfterTimeOut() throws Exception { ++ @Ignore("TODO: test is disabled due to #51854") ++ @Test ++ public void testMultiPoolClientReconnectsAfterTimeOut() throws Exception { int num = 10; long timeout = 10; vm2.invoke( @@@ -232,9 -225,7 +239,9 @@@ vm2.invoke(() -> DurableClientQueueSizeDUnitTest.verifyQueueSize( PoolImpl.PRIMARY_QUEUE_TIMED_OUT, PoolImpl.PRIMARY_QUEUE_TIMED_OUT)); } - @Ignore("TODO") - public void _testMultiPoolClientFailsOver() throws Exception { ++ @Ignore("TODO: test is not implemented") + @Test + public void testMultiPoolClientFailsOver() throws Exception { } public static void closeCache() throws Exception { @@@ -261,18 -252,13 +268,11 @@@ public static Integer createCacheServer(Integer serverPort) throws Exception { Properties props = new Properties(); - props.setProperty("locators", "localhost["+DistributedTestUtils.getDUnitLocatorPort()+"]"); - // props.setProperty("log-level", "fine"); - // props.setProperty("log-file", "server_" + OSProcess.getId() + ".log"); - // props.setProperty("statistic-archive-file", "server_" + OSProcess.getId() - // + ".gfs"); - // props.setProperty("statistic-sampling-enabled", "true"); - + props.setProperty(LOCATORS, "localhost[" + DistributedTestUtils.getDUnitLocatorPort() + "]"); - DurableClientQueueSizeDUnitTest test = new DurableClientQueueSizeDUnitTest( - "DurableClientQueueSizeDUnitTest"); + DurableClientQueueSizeDUnitTest test = new DurableClientQueueSizeDUnitTest(); DistributedSystem ds = test.getSystem(props); ds.disconnect(); cache = (GemFireCacheImpl)CacheFactory.create(test.getSystem()); --// cache = (GemFireCacheImpl) new CacheFactory(props).create(); RegionFactory rf = cache .createRegionFactory(RegionShortcut.REPLICATE); @@@ -313,18 -299,14 +313,13 @@@ } Properties props = new Properties(); if (durable) { - props.setProperty(DistributionConfig.DURABLE_CLIENT_ID_NAME, + props.setProperty(DURABLE_CLIENT_ID, "my-durable-client"); - props.setProperty(DistributionConfig.DURABLE_CLIENT_TIMEOUT_NAME, + props.setProperty(DURABLE_CLIENT_TIMEOUT, timeoutSeconds); } - // props.setProperty("log-file", "client_" + OSProcess.getId() + ".log"); - // props.setProperty("log-level", "fine"); - // props.setProperty("statistic-archive-file", "client_" + OSProcess.getId() - // + ".gfs"); - // props.setProperty("statistic-sampling-enabled", "true"); - DistributedSystem ds = new DurableClientQueueSizeDUnitTest( - "DurableClientQueueSizeDUnitTest").getSystem(props); + DistributedSystem ds = new DurableClientQueueSizeDUnitTest().getSystem(props); ds.disconnect(); ClientCacheFactory ccf = new ClientCacheFactory(props); ccf.setPoolSubscriptionEnabled(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/DurableClientReconnectAutoDUnitTest.java ---------------------------------------------------------------------- diff --cc geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientReconnectAutoDUnitTest.java index 1812dca,4936053..7c46acc --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientReconnectAutoDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientReconnectAutoDUnitTest.java @@@ -26,25 -21,25 +26,30 @@@ import com.gemstone.gemfire.cache.clien import com.gemstone.gemfire.test.dunit.DistributedTestUtils; import com.gemstone.gemfire.test.dunit.Host; import com.gemstone.gemfire.test.dunit.NetworkUtils; +import com.gemstone.gemfire.test.junit.categories.DistributedTest; /** ++<<<<<<< HEAD ++======= + * @since GemFire 5.7 + * ++>>>>>>> origin/develop * Test reconnecting a durable client that is using * the locator to discover its servers + * + * @since 5.7 */ -public class DurableClientReconnectAutoDUnitTest extends - DurableClientReconnectDUnitTest { +@Category(DistributedTest.class) +public class DurableClientReconnectAutoDUnitTest extends DurableClientReconnectDUnitTest { + @BeforeClass public static void caseSetUp() throws Exception { - DistributedTestCase.disconnectAllFromDS(); + disconnectAllFromDS(); } - public DurableClientReconnectAutoDUnitTest(String name) { - super(name); - } - + @Ignore("do nothing, this test doesn't make sense with the locator") + @Override + @Test public void testDurableReconnectSingleServerWithZeroConnPerServer() { //do nothing, this test doesn't make sense with the locator } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientReconnectDUnitTest.java ---------------------------------------------------------------------- diff --cc geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientReconnectDUnitTest.java index 9b0691d,e8b24cf..b2b1b5c --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientReconnectDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientReconnectDUnitTest.java @@@ -16,29 -16,7 +16,30 @@@ */ 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.net.SocketException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashSet; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; +import java.util.Properties; +import java.util.Set; + +import org.junit.BeforeClass; +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.PoolFactory; import com.gemstone.gemfire.cache.client.PoolManager; import com.gemstone.gemfire.cache.client.internal.Connection; @@@ -49,25 -27,22 +50,25 @@@ import com.gemstone.gemfire.distributed import com.gemstone.gemfire.distributed.internal.ServerLocation; import com.gemstone.gemfire.internal.AvailablePort; import com.gemstone.gemfire.internal.cache.CacheServerImpl; -import com.gemstone.gemfire.test.dunit.*; - -import java.net.SocketException; -import java.util.*; - -import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*; - - -/** +import com.gemstone.gemfire.test.dunit.Assert; +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.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; + - /** ++/** * Tests for durable reconnect issue * - * @since 5.2 + * @since GemFire 5.2 */ +@Category(DistributedTest.class) +public class DurableClientReconnectDUnitTest extends JUnit4DistributedTestCase { -public class DurableClientReconnectDUnitTest extends DistributedTestCase -{ private static Cache cache = null; private static VM server1 = null; @@@ -87,7 -62,7 +88,7 @@@ private static String SERVER3; private static String SERVER4; -- private static final String REGION_NAME = "DurableClientReconnectDUnitTest_region"; ++ private static final String REGION_NAME = DurableClientReconnectDUnitTest.class.getSimpleName() + "_region"; private DurableClientReconnectDUnitTest instance = null ; @@@ -115,11 -94,11 +116,11 @@@ SERVER4 = NetworkUtils.getServerHostName(host)+PORT4; //CacheServerTestUtil.disableShufflingOfEndpoints(); - System.setProperty("gemfire.bridge.disableShufflingOfEndpoints", "false"); + System.setProperty(DistributionConfig.GEMFIRE_PREFIX + "bridge.disableShufflingOfEndpoints", "false"); } - public void testDurableReconnectSingleServer() throws Exception - { + @Test + public void testDurableReconnectSingleServer() throws Exception { createCacheClientAndConnectToSingleServer(NetworkUtils.getServerHostName(Host.getHost(0)), 0); List redundantServers = pool.getRedundantNames(); String primaryName = pool.getPrimaryName(); @@@ -715,17 -694,18 +716,17 @@@ cache.readyForEvents(); - }catch(Exception e){ - Assert.fail("test failed due to " , e ); - } + }catch(Exception e){ + Assert.fail("test failed due to " , e ); + } } - private Properties getClientDistributedSystemProperties( - String durableClientId, int durableClientTimeout) { + private Properties getClientDistributedSystemProperties( String durableClientId, int durableClientTimeout) { Properties properties = new Properties(); - properties.setProperty(DistributionConfig.MCAST_PORT_NAME, "0"); - properties.setProperty(DistributionConfig.LOCATORS_NAME, ""); - properties.setProperty(DistributionConfig.DURABLE_CLIENT_ID_NAME, durableClientId); - properties.setProperty(DistributionConfig.DURABLE_CLIENT_TIMEOUT_NAME, String.valueOf(durableClientTimeout)); + properties.setProperty(MCAST_PORT, "0"); + properties.setProperty(LOCATORS, ""); + properties.setProperty(DURABLE_CLIENT_ID, durableClientId); + properties.setProperty(DURABLE_CLIENT_TIMEOUT, String.valueOf(durableClientTimeout)); return properties; } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientStatsDUnitTest.java ---------------------------------------------------------------------- diff --cc geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientStatsDUnitTest.java index b731728,c2145b3..b1f0095 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientStatsDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientStatsDUnitTest.java @@@ -16,15 -16,6 +16,16 @@@ */ 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.ArrayList; +import java.util.Properties; +import java.util.concurrent.RejectedExecutionException; + +import org.junit.Test; +import org.junit.experimental.categories.Category; + import com.gemstone.gemfire.cache.Cache; import com.gemstone.gemfire.cache.CacheException; import com.gemstone.gemfire.cache.InterestResultPolicy; @@@ -33,18 -24,19 +34,17 @@@ import com.gemstone.gemfire.cache.clien 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.CacheServerImpl; import com.gemstone.gemfire.internal.cache.PoolFactoryImpl; -import com.gemstone.gemfire.test.dunit.*; - -import java.util.ArrayList; -import java.util.Properties; -import java.util.concurrent.RejectedExecutionException; - -import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*; +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.Wait; +import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase; +import com.gemstone.gemfire.test.junit.categories.DistributedTest; /** - * - * * The DUnitTest checks whether the following Three counts are incremented * correctly or not: * 1) DurableReconnectionCount -> Incremented Each time @@@ -70,10 -61,10 +70,6 @@@ public class DurableClientStatsDUnitTes private final String K1 = "Key1"; - public DurableClientStatsDUnitTest() { - super(); - public DurableClientStatsDUnitTest(String name) { - super(name); -- } -- @Override public final void postSetUp() throws Exception { Host host = Host.getHost(0); @@@ -90,10 -81,9 +86,8 @@@ CacheServerTestUtil.resetDisableShufflingOfEndpointsFlag(); } + @Test public void testNonDurableClientStatistics() { -- -- // Step 1: Starting the servers PORT1 = ((Integer)this.server1VM.invoke(() -> CacheServerTestUtil.createCacheServer( regionName, new Boolean(true) ))).intValue(); @@@ -129,10 -119,9 +123,9 @@@ this.server1VM.invoke(() -> DurableClientStatsDUnitTest.checkStatisticsWithExpectedValues( new Integer(0), new Integer(0), new Integer(0) )); -- -- } ++ + @Test public void testDurableClientStatistics() { // Step 1: Starting the servers @@@ -171,9 -160,9 +164,7 @@@ this.server1VM.invoke(() -> DurableClientStatsDUnitTest.checkStatisticsWithExpectedValues( new Integer(3), new Integer(4), new Integer(2) )); } -- -- -- ++ public void startRegisterAndCloseDurableClientCache(int durableClientTimeout) { final String durableClientId = getName() + "_client"; @@@ -280,7 -269,7 +271,7 @@@ + stats.get_eventEnqueuedWhileClientAwayCount()); } catch (Exception e) { -- fail("Exception thrown while executing checkStatistics()"); ++ fail("Exception thrown while executing checkStatistics()", e); } } @@@ -304,7 -293,7 +295,7 @@@ assertEquals(enqueueCount, stats.get_eventEnqueuedWhileClientAwayCount()); } catch (Exception e) { -- fail("Exception thrown while executing checkStatisticsWithExpectedValues()"); ++ fail("Exception thrown while executing checkStatisticsWithExpectedValues()", e); } } @@@ -350,9 -339,9 +341,7 @@@ assertEquals(value, r.getEntry(key).getValue()); } catch (Exception e) { -- -- fail("Put in Server has some fight"); -- ++ fail("Put in Server has some fight", e); } } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableRegistrationDUnitTest.java ---------------------------------------------------------------------- diff --cc geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableRegistrationDUnitTest.java index cf64d93,5710ad2..6bfbff3 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableRegistrationDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableRegistrationDUnitTest.java @@@ -16,16 -16,6 +16,17 @@@ */ package com.gemstone.gemfire.internal.cache.tier.sockets; ++import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*; +import static org.junit.Assert.*; + +import java.util.Collections; +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.Cache; import com.gemstone.gemfire.cache.CacheException; import com.gemstone.gemfire.cache.InterestResultPolicy; http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableResponseMatrixDUnitTest.java ---------------------------------------------------------------------- diff --cc geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableResponseMatrixDUnitTest.java index 79ddff7,12ad99d..46fd108 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableResponseMatrixDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableResponseMatrixDUnitTest.java @@@ -16,21 -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.Properties; + ++import org.junit.Ignore; +import org.junit.Test; +import org.junit.experimental.categories.Category; + +import com.gemstone.gemfire.cache.AttributesFactory; +import com.gemstone.gemfire.cache.Cache; +import com.gemstone.gemfire.cache.CacheFactory; +import com.gemstone.gemfire.cache.DataPolicy; +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.client.Pool; import com.gemstone.gemfire.cache.client.PoolManager; import com.gemstone.gemfire.cache.client.internal.PoolImpl; @@@ -54,10 -35,12 +55,10 @@@ import com.gemstone.gemfire.test.junit. * Tests that the Matris defined in ServerResponseMatrix is * applied or not * - * @since 5.1 + * @since GemFire 5.1 - * */ -public class DurableResponseMatrixDUnitTest extends DistributedTestCase -{ +@Category(DistributedTest.class) +public class DurableResponseMatrixDUnitTest extends JUnit4DistributedTestCase { protected static Cache cache = null; @@@ -69,11 -52,11 +70,6 @@@ public static final String KEY = "KeyMatrix1" ; -- /** constructor */ - public DurableResponseMatrixDUnitTest() { - super(); - public DurableResponseMatrixDUnitTest(String name) { - super(name); -- } -- @Override public final void postSetUp() throws Exception { final Host host = Host.getHost(0); @@@ -105,7 -86,7 +101,9 @@@ assertEquals("ValueMatrix1", r.getEntry(KEY).getValue()); } -- public void BROKEN_testRegisterInterestResponse_Valid_Invalid() throws Exception ++ @Ignore("TODO: test is broken and disabled") ++ @Test ++ public void testRegisterInterestResponse_Valid_Invalid() throws Exception { Region r = cache.getRegion(Region.SEPARATOR + REGION_NAME); r.put(KEY, "ValueMatrix1"); @@@ -133,7 -112,7 +131,9 @@@ assertEquals(null, r.getEntry(KEY).getValue()); } -- public void BROKEN_testRegisterInterestResponse_Invalid_Valid() ++ @Ignore("TODO: test is broken and disabled") ++ @Test ++ public void testRegisterInterestResponse_Invalid_Valid() throws Exception { Region r = cache.getRegion(Region.SEPARATOR + REGION_NAME); @@@ -271,7 -241,7 +271,9 @@@ waitForValue(r, KEY, "ValueMatrix2"); } -- public void BROKEN_testNotification_Valid_Invalid() throws Exception ++ @Ignore("TODO: test is broken and disabled") ++ @Test ++ public void testNotification_Valid_Invalid() throws Exception { Region r = cache.getRegion(Region.SEPARATOR + REGION_NAME); r.put(KEY, "DummyValue"); @@@ -310,7 -277,7 +312,9 @@@ waitForValue(r, KEY, "ValueMatrix1"); } -- public void BROKEN_testNotification_Invalid_Invalid() throws Exception ++ @Ignore("TODO: test is broken and disabled") ++ @Test ++ public void testNotification_Invalid_Invalid() throws Exception { Region r = cache.getRegion(Region.SEPARATOR + REGION_NAME); invalidateEntry(KEY); @@@ -349,7 -313,7 +353,9 @@@ waitForValue(r, KEY, "ValueMatrix1"); } -- public void BROKEN_testNotification_LocalInvalid_Invalid() throws Exception ++ @Ignore("TODO: test is broken and disabled") ++ @Test ++ public void testNotification_LocalInvalid_Invalid() throws Exception { Region r = cache.getRegion(Region.SEPARATOR + REGION_NAME); localInvalidateEntry(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/EventIDVerificationDUnitTest.java ---------------------------------------------------------------------- diff --cc geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/EventIDVerificationDUnitTest.java index dd5a7be,1b81297..a18adf7 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/EventIDVerificationDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/EventIDVerificationDUnitTest.java @@@ -16,43 -16,20 +16,43 @@@ */ 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.CacheWriter; +import com.gemstone.gemfire.cache.CacheWriterException; +import com.gemstone.gemfire.cache.DataPolicy; +import com.gemstone.gemfire.cache.EntryEvent; +import com.gemstone.gemfire.cache.MirrorType; +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.server.CacheServer; import com.gemstone.gemfire.cache.util.CacheListenerAdapter; import com.gemstone.gemfire.cache.util.CacheWriterAdapter; import com.gemstone.gemfire.cache30.ClientServerTestCase; 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.*; -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.internal.cache.CacheObserverAdapter; +import com.gemstone.gemfire.internal.cache.CacheObserverHolder; +import com.gemstone.gemfire.internal.cache.EntryEventImpl; +import com.gemstone.gemfire.internal.cache.EventID; +import com.gemstone.gemfire.internal.cache.RegionEventImpl; +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 EventID generated from Cache Client is correctly passed on to @@@ -72,7 -51,7 +72,7 @@@ public class EventIDVerificationDUnitTe private static int PORT2; -- private static final String REGION_NAME = "EventIDVerificationDUnitTest_region"; ++ private static final String REGION_NAME = EventIDVerificationDUnitTest.class.getSimpleName() + "_region"; protected static EventID eventId; @@@ -170,9 -146,9 +170,9 @@@ PORT1 = port1.intValue(); PORT2 = port2.intValue(); 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 EventIDVerificationDUnitTest("temp").createCache(props); + new EventIDVerificationDUnitTest().createCache(props); AttributesFactory factory = new AttributesFactory(); factory.setScope(Scope.DISTRIBUTED_ACK); factory.setMirrorType(MirrorType.NONE); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ForceInvalidateOffHeapEvictionDUnitTest.java ---------------------------------------------------------------------- diff --cc geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ForceInvalidateOffHeapEvictionDUnitTest.java index 54d705e,f0daf23..b75ca4c --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ForceInvalidateOffHeapEvictionDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ForceInvalidateOffHeapEvictionDUnitTest.java @@@ -16,27 -16,18 +16,22 @@@ */ package com.gemstone.gemfire.internal.cache.tier.sockets; - 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.internal.cache.OffHeapTestUtil; -import com.gemstone.gemfire.test.dunit.Invoke; -import com.gemstone.gemfire.test.dunit.SerializableRunnable; ++import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*; import java.util.Properties; - import com.gemstone.gemfire.distributed.internal.DistributionConfig; -import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*; ++import org.junit.experimental.categories.Category; ++ +import com.gemstone.gemfire.internal.cache.OffHeapTestUtil; +import com.gemstone.gemfire.test.dunit.Invoke; +import com.gemstone.gemfire.test.dunit.SerializableRunnable; ++import com.gemstone.gemfire.test.junit.categories.DistributedTest; /** * Runs force invalidate eviction tests with off-heap regions. - * @since 9.0 + * @since Geode 1.0 */ +@Category(DistributedTest.class) public class ForceInvalidateOffHeapEvictionDUnitTest extends ForceInvalidateEvictionDUnitTest { http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/HAInterestTestCase.java ---------------------------------------------------------------------- diff --cc geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/HAInterestTestCase.java index 8b45aa5,7120f28..2c12118 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/HAInterestTestCase.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/HAInterestTestCase.java @@@ -16,25 -16,7 +16,26 @@@ */ 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.io.IOException; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Properties; +import java.util.Set; + +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.InterestResultPolicy; +import com.gemstone.gemfire.cache.MirrorType; +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.Connection; import com.gemstone.gemfire.cache.client.internal.PoolImpl; @@@ -889,9 -872,9 +889,9 @@@ public class HAInterestTestCase extend public static void createClientPoolCache(String testName, String host) 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 HAInterestTestCase("temp").createCache(props); + new HAInterestTestCase().createCache(props); CacheServerTestUtil.disableShufflingOfEndpoints(); PoolImpl p; try { @@@ -923,9 -906,9 +923,9 @@@ public static void createClientPoolCacheWithSmallRetryInterval(String testName, String host) 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 HAInterestTestCase("temp").createCache(props); + new HAInterestTestCase().createCache(props); CacheServerTestUtil.disableShufflingOfEndpoints(); PoolImpl p; try { @@@ -958,9 -941,9 +958,9 @@@ public static void createClientPoolCacheConnectionToSingleServer(String testName, String hostName) 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 HAInterestTestCase("temp").createCache(props); + new HAInterestTestCase().createCache(props); PoolImpl p = (PoolImpl) PoolManager.createFactory() .addServer(hostName, PORT1) .setSubscriptionEnabled(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/HAStartupAndFailoverDUnitTest.java ---------------------------------------------------------------------- diff --cc geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/HAStartupAndFailoverDUnitTest.java index 5a4cafc,dae8d2a..4f62f67 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/HAStartupAndFailoverDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/HAStartupAndFailoverDUnitTest.java @@@ -16,25 -16,7 +16,26 @@@ */ 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.Collection; +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.DataPolicy; +import com.gemstone.gemfire.cache.NoSubscriptionServersAvailableException; +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.Connection; import com.gemstone.gemfire.cache.client.internal.PoolImpl; @@@ -82,11 -60,13 +82,6 @@@ public class HAStartupAndFailoverDUnitT //To verify the primary identification on client side toggeled after notification on client side protected static boolean identifiedPrimary = false; - private static final String REGION_NAME = "HAStartupAndFailoverDUnitTest_region"; - -- /** constructor */ - public HAStartupAndFailoverDUnitTest() { - super(); - public HAStartupAndFailoverDUnitTest(String name) { - super(name); -- } -- @Override public final void postSetUp() throws Exception { final Host host = Host.getHost(0); @@@ -106,10 -86,9 +101,9 @@@ /** * Stops primary server one by one to ensure new primary is selected -- * */ - public void testPrimaryFailover() throws Exception + @Test + public void testPrimaryFailover() throws Exception { createClientCache(this.getName(), NetworkUtils.getServerHostName(server1.getHost())); @@@ -564,9 -535,9 +558,9 @@@ public static void createClientCache(String testName, String host) 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 HAStartupAndFailoverDUnitTest("temp").createCache(props); + new HAStartupAndFailoverDUnitTest().createCache(props); PoolImpl p = (PoolImpl)PoolManager.createFactory() .addServer(host, PORT1.intValue()) .addServer(host, PORT2.intValue()) @@@ -593,9 -564,9 +587,9 @@@ public static void createClientCacheWithLargeRetryInterval(String testName, String host) 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 HAStartupAndFailoverDUnitTest("temp").createCache(props); + new HAStartupAndFailoverDUnitTest().createCache(props); PoolImpl p = (PoolImpl)PoolManager.createFactory() .addServer(host, PORT1.intValue()) .addServer(host, PORT2.intValue()) @@@ -624,9 -595,9 +618,9 @@@ String testName, String host) 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 HAStartupAndFailoverDUnitTest("temp").createCache(props); + new HAStartupAndFailoverDUnitTest().createCache(props); CacheServerTestUtil.disableShufflingOfEndpoints(); PoolImpl p; @@@ -662,9 -633,9 +656,9 @@@ public static void createClientCacheWithIncorrectPrimary(String testName, String host) 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 HAStartupAndFailoverDUnitTest("temp").createCache(props); + new HAStartupAndFailoverDUnitTest().createCache(props); final int INCORRECT_PORT = 1; PoolImpl p = (PoolImpl)PoolManager.createFactory() .addServer(host, INCORRECT_PORT) http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InstantiatorPropagationDUnitTest.java ---------------------------------------------------------------------- diff --cc geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InstantiatorPropagationDUnitTest.java index e831e3a,28f70b3..5879bd4 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InstantiatorPropagationDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InstantiatorPropagationDUnitTest.java @@@ -16,29 -16,9 +16,30 @@@ */ package com.gemstone.gemfire.internal.cache.tier.sockets; ++import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*; +import static com.gemstone.gemfire.test.dunit.DistributedTestUtils.*; +import static org.junit.Assert.*; + +import java.io.DataInput; +import java.io.DataOutput; +import java.io.IOException; +import java.util.Properties; +import java.util.Random; + +import org.junit.Ignore; +import org.junit.Test; +import org.junit.experimental.categories.Category; + import com.gemstone.gemfire.DataSerializable; import com.gemstone.gemfire.Instantiator; -import com.gemstone.gemfire.cache.*; +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.MirrorType; +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; @@@ -83,7 -62,7 +83,7 @@@ public class InstantiatorPropagationDUn private static int instanceCountWithOnePut = 1; -- private static final String REGION_NAME = "ClientServerInstantiatorRegistrationDUnitTest"; ++ private static final String REGION_NAME = InstantiatorPropagationDUnitTest.class.getSimpleName() + "_region"; protected static EventID eventId; @@@ -109,12 -96,12 +109,11 @@@ assertNotNull(cache); } -- public static void createClientCache(String host, Integer port1) -- throws Exception { ++ public static void createClientCache(String host, Integer port1) 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 InstantiatorPropagationDUnitTest("temp").createCache(props); + new InstantiatorPropagationDUnitTest().createCache(props); Pool p = PoolManager.createFactory().addServer(host, port1.intValue()) .setMinConnections(1).setSubscriptionEnabled(true).setPingInterval(200) .create("ClientServerInstantiatorRegistrationDUnitTestPool"); @@@ -715,9 -696,8 +714,8 @@@ * client(client1). Verified, if that instantiator gets propagated to the * server the client is connected to(server1), to client2, to the other * server(server2) in the DS and the client that is connected to server2. -- * */ + @Test public void testInstantiatorCount() throws Exception { PORT1 = initServerCache(server1); PORT2 = initServerCache(server2); @@@ -750,12 -730,12 +748,11 @@@ unregisterInstantiatorsInAllVMs(); } -- public static void createClientCache_EventId(String host, Integer port1) throws Exception -- { ++ public static void createClientCache_EventId(String host, Integer port1) 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 InstantiatorPropagationDUnitTest("temp").createCache(props); + new InstantiatorPropagationDUnitTest().createCache(props); Pool p = PoolManager.createFactory() .addServer(host, port1.intValue()) .setSubscriptionEnabled(true) @@@ -793,11 -773,11 +790,10 @@@ assertTrue("EventId found Different", pass.booleanValue()); PoolImpl.IS_INSTANTIATOR_CALLBACK = false; - } - public void testLazyRegistrationOfInstantiators() - throws Exception { + @Test - public void testLazyRegistrationOfInstantiators() - throws Exception { ++ public void testLazyRegistrationOfInstantiators() throws Exception { try { PORT1 = initServerCache(server1); PORT2 = initServerCache(server2); @@@ -849,12 -829,12 +845,7 @@@ /** * this method initializes the appropriate server cache -- * -- * @param server -- * @param serverNo -- * @return portNo. */ -- private int initServerCache(VM server, int serverNo) { Object[] args = new Object[] { new Integer(getMaxThreads()) }; @@@ -872,15 -852,15 +863,9 @@@ /** * This method creates the server cache -- * -- * @param maxThreads -- * @return -- * @throws Exception */ -- public static Integer createServerCacheTwo(Integer maxThreads) -- throws Exception -- { - new InstantiatorPropagationDUnitTest("temp") ++ public static Integer createServerCacheTwo(Integer maxThreads) throws Exception { + new InstantiatorPropagationDUnitTest() .createCache(new Properties()); AttributesFactory factory = new AttributesFactory(); factory.setScope(Scope.DISTRIBUTED_ACK); @@@ -899,15 -879,15 +884,9 @@@ /** * This method creates the server cache -- * -- * @param maxThreads -- * @return -- * @throws Exception */ -- public static Integer createServerCacheOne(Integer maxThreads) -- throws Exception -- { - new InstantiatorPropagationDUnitTest("temp") ++ public static Integer createServerCacheOne(Integer maxThreads) throws Exception { + new InstantiatorPropagationDUnitTest() .createCache(new Properties()); AttributesFactory factory = new AttributesFactory(); factory.setScope(Scope.DISTRIBUTED_ACK); @@@ -923,8 -903,8 +902,7 @@@ return new Integer(port); } -- public static void setClientServerObserver1() -- { ++ public static void setClientServerObserver1() { PoolImpl.IS_INSTANTIATOR_CALLBACK = true; ClientServerObserverHolder .setInstance(new ClientServerObserverAdapter() { @@@ -941,8 -921,8 +919,6 @@@ /** * sets the EventId value in the VM -- * -- * @param eventID */ public static void setEventId(EventID eventID) { @@@ -964,6 -944,6 +940,7 @@@ } } ++// TODO: move the following classes to be inner classes abstract class ConfigurableObject { public abstract void init(int index); @@@ -971,9 -951,9 +948,6 @@@ public abstract void validate(int index); } -- -- -- class TestObject1 extends ConfigurableObject implements DataSerializable { private int field1; @@@ -986,32 -966,32 +960,37 @@@ */ static { Instantiator.register(new Instantiator(TestObject1.class, -100123) { ++ @Override public DataSerializable newInstance() { return new TestObject1(); } }); } ++ @Override public void init(int index) { Random random = new Random(); this.field1 = random.nextInt(); } ++ @Override public int getIndex() { return 1; } ++ @Override public void validate(int index) { } ++ @Override public void fromData(DataInput in) throws IOException, ClassNotFoundException { this.field1 = in.readInt(); } ++ @Override public void toData(DataOutput out) throws IOException { out.writeInt(this.field1); } -- } class TestObject2 extends ConfigurableObject implements DataSerializable { @@@ -1023,6 -1003,6 +1002,7 @@@ static { Instantiator.register(new Instantiator(TestObject2.class, -100122) { ++ @Override public DataSerializable newInstance() { return new TestObject2(); } @@@ -1032,27 -1012,27 +1012,30 @@@ /** * Initializes a Instantiator1DUnitTestObject1. */ -- ++ @Override public void init(int index) { Random random = new Random(); this.field1 = random.nextInt(); } ++ @Override public int getIndex() { return 1; } ++ @Override public void validate(int index) { } ++ @Override public void fromData(DataInput in) throws IOException, ClassNotFoundException { this.field1 = in.readInt(); } ++ @Override public void toData(DataOutput out) throws IOException { out.writeInt(this.field1); } -- } class TestObject3 extends ConfigurableObject implements DataSerializable { @@@ -1064,6 -1044,6 +1047,7 @@@ static { Instantiator.register(new Instantiator(TestObject3.class, -121) { ++ @Override public DataSerializable newInstance() { return new TestObject3(); } @@@ -1073,22 -1053,22 +1057,27 @@@ /** * Initializes a Instantiator1DUnitTestObject1. */ ++ @Override public void init(int index) { Random random = new Random(); this.field1 = random.nextInt(); } ++ @Override public int getIndex() { return 1; } ++ @Override public void validate(int index) { } ++ @Override public void fromData(DataInput in) throws IOException, ClassNotFoundException { this.field1 = in.readInt(); } ++ @Override public void toData(DataOutput out) throws IOException { out.writeInt(this.field1); } @@@ -1103,6 -1083,6 +1092,7 @@@ class TestObject4 extends ConfigurableO static { Instantiator.register(new Instantiator(TestObject4.class, -122) { ++ @Override public DataSerializable newInstance() { return new TestObject4(); } @@@ -1112,22 -1092,22 +1102,27 @@@ /** * Initializes a Instantiator1DUnitTestObject1. */ ++ @Override public void init(int index) { Random random = new Random(); this.field1 = random.nextInt(); } ++ @Override public int getIndex() { return 1; } ++ @Override public void validate(int index) { } ++ @Override public void fromData(DataInput in) throws IOException, ClassNotFoundException { this.field1 = in.readInt(); } ++ @Override public void toData(DataOutput out) throws IOException { out.writeInt(this.field1); } @@@ -1142,6 -1122,6 +1137,7 @@@ class TestObject5 extends ConfigurableO static { Instantiator.register(new Instantiator(TestObject5.class, -123) { ++ @Override public DataSerializable newInstance() { return new TestObject5(); } @@@ -1151,22 -1131,22 +1147,27 @@@ /** * Initializes a Instantiator1DUnitTestObject1. */ ++ @Override public void init(int index) { Random random = new Random(); this.field1 = random.nextInt(); } ++ @Override public int getIndex() { return 1; } ++ @Override public void validate(int index) { } ++ @Override public void fromData(DataInput in) throws IOException, ClassNotFoundException { this.field1 = in.readInt(); } ++ @Override public void toData(DataOutput out) throws IOException { out.writeInt(this.field1); } @@@ -1181,6 -1161,6 +1182,7 @@@ class TestObject6 extends ConfigurableO static { Instantiator.register(new Instantiator(TestObject6.class, -124) { ++ @Override public DataSerializable newInstance() { return new TestObject6(); } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestListDUnitTest.java ---------------------------------------------------------------------- diff --cc geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestListDUnitTest.java index ff199d0,b756100..b191a85 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestListDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestListDUnitTest.java @@@ -16,34 -16,7 +16,35 @@@ */ 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 java.util.Set; +import java.util.concurrent.atomic.AtomicInteger; + +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.CacheLoader; +import com.gemstone.gemfire.cache.CacheLoaderException; +import com.gemstone.gemfire.cache.ClientSession; +import com.gemstone.gemfire.cache.DataPolicy; +import com.gemstone.gemfire.cache.EntryEvent; +import com.gemstone.gemfire.cache.InterestRegistrationEvent; +import com.gemstone.gemfire.cache.InterestRegistrationListener; +import com.gemstone.gemfire.cache.InterestResultPolicy; +import com.gemstone.gemfire.cache.LoaderHelper; +import com.gemstone.gemfire.cache.NoSubscriptionServersAvailableException; +import com.gemstone.gemfire.cache.Region; +import com.gemstone.gemfire.cache.RegionAttributes; +import com.gemstone.gemfire.cache.RegionShortcut; +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; @@@ -51,20 -24,18 +52,19 @@@ import com.gemstone.gemfire.cache.serve import com.gemstone.gemfire.cache.util.CacheListenerAdapter; import com.gemstone.gemfire.distributed.DistributedMember; 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.CacheServerImpl; -import com.gemstone.gemfire.test.dunit.*; -import junit.framework.AssertionFailedError; - -import java.util.ArrayList; -import java.util.List; -import java.util.Properties; -import java.util.Set; -import java.util.concurrent.atomic.AtomicInteger; - -import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*; +import com.gemstone.gemfire.test.dunit.Assert; +import com.gemstone.gemfire.test.dunit.Host; +import com.gemstone.gemfire.test.dunit.Invoke; +import com.gemstone.gemfire.test.dunit.LogWriterUtils; +import com.gemstone.gemfire.test.dunit.NetworkUtils; +import com.gemstone.gemfire.test.dunit.SerializableRunnable; +import com.gemstone.gemfire.test.dunit.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; /** * Test Scenario : @@@ -526,13 -493,15 +526,13 @@@ public class InterestListDUnitTest exte return createClientCache(host, port, 0); } - public static DistributedMember createClientCache(String host, - int port, int port2) throws Exception - { + private static DistributedMember createClientCache(String host, int port, int port2) throws Exception { Properties props = new Properties(); - props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0"); - props.setProperty(DistributionConfig.LOCATORS_NAME, ""); - props.setProperty(DistributionConfig.DELTA_PROPAGATION_PROP_NAME, "false"); + props.setProperty(MCAST_PORT, "0"); + props.setProperty(LOCATORS, ""); + props.setProperty(DELTA_PROPAGATION, "false"); - new InterestListDUnitTest("temp").createCache(props); + new InterestListDUnitTest().createCache(props); PoolFactory pfactory = PoolManager.createFactory() .addServer(host, port) .setThreadLocalConnections(true) @@@ -563,8 -532,8 +563,8 @@@ private static void createCache(boolean addReplicatedRegion) throws Exception { Properties props = new Properties(); - props.setProperty(DistributionConfig.DELTA_PROPAGATION_PROP_NAME, "false"); + props.setProperty(DELTA_PROPAGATION, "false"); - new InterestListDUnitTest("temp").createCache(props); + new InterestListDUnitTest().createCache(props); if (addReplicatedRegion) { addReplicatedRegion(); } else { http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestListEndpointDUnitTest.java ---------------------------------------------------------------------- diff --cc geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestListEndpointDUnitTest.java index 2ef451a,6213e85..f5c4bc0 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestListEndpointDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestListEndpointDUnitTest.java @@@ -16,25 -16,7 +16,26 @@@ */ 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.io.IOException; +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.CacheException; +import com.gemstone.gemfire.cache.CacheFactory; +import com.gemstone.gemfire.cache.CacheWriterException; +import com.gemstone.gemfire.cache.DataPolicy; +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.client.Pool; import com.gemstone.gemfire.cache.client.PoolManager; import com.gemstone.gemfire.cache.client.internal.Connection; @@@ -43,21 -25,24 +44,20 @@@ import com.gemstone.gemfire.cache.clien import com.gemstone.gemfire.cache.server.CacheServer; import com.gemstone.gemfire.cache30.CacheSerializableRunnable; 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.CacheServerImpl; -import com.gemstone.gemfire.test.dunit.*; -import junit.framework.Assert; - -import java.io.IOException; -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 InterestListEndpointDUnitTest extends DistributedTestCase -{ +import com.gemstone.gemfire.test.dunit.Host; +import com.gemstone.gemfire.test.dunit.Invoke; +import com.gemstone.gemfire.test.dunit.NetworkUtils; +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.dunit.internal.JUnit4DistributedTestCase; +import com.gemstone.gemfire.test.junit.categories.DistributedTest; + +@Category(DistributedTest.class) +public class InterestListEndpointDUnitTest extends JUnit4DistributedTestCase { VM server1 = null; @@@ -319,9 -305,9 +319,9 @@@ { CacheServerTestUtil.disableShufflingOfEndpoints(); 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 InterestListEndpointDUnitTest("temp").createCache(props); + new InterestListEndpointDUnitTest().createCache(props); Pool p; try { p = PoolManager.createFactory()