http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/70612010/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/Bug47388DUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/Bug47388DUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/Bug47388DUnitTest.java index 853dee3..9723b53 100644 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/Bug47388DUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/Bug47388DUnitTest.java @@ -19,16 +19,7 @@ */ package com.gemstone.gemfire.internal.cache.partitioned; -import java.util.Properties; - -import com.gemstone.gemfire.cache.CacheFactory; -import com.gemstone.gemfire.cache.EntryEvent; -import com.gemstone.gemfire.cache.ExpirationAction; -import com.gemstone.gemfire.cache.ExpirationAttributes; -import com.gemstone.gemfire.cache.PartitionAttributesFactory; -import com.gemstone.gemfire.cache.Region; -import com.gemstone.gemfire.cache.RegionFactory; -import com.gemstone.gemfire.cache.RegionShortcut; +import com.gemstone.gemfire.cache.*; import com.gemstone.gemfire.cache.client.ClientCacheFactory; import com.gemstone.gemfire.cache.client.ClientRegionFactory; import com.gemstone.gemfire.cache.client.ClientRegionShortcut; @@ -41,11 +32,9 @@ import com.gemstone.gemfire.internal.cache.GemFireCacheImpl; import com.gemstone.gemfire.internal.cache.ha.HARegionQueueStats; import com.gemstone.gemfire.internal.cache.tier.sockets.CacheClientNotifier; import com.gemstone.gemfire.internal.cache.tier.sockets.CacheClientProxy; -import com.gemstone.gemfire.test.dunit.DistributedTestCase; -import com.gemstone.gemfire.test.dunit.Host; -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.*; + +import java.util.Properties; /** * The test creates two datastores with a partitioned region, and also running a
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/70612010/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/Bug51400DUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/Bug51400DUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/Bug51400DUnitTest.java index 1a0bfa3..2df292d 100644 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/Bug51400DUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/Bug51400DUnitTest.java @@ -19,8 +19,6 @@ */ package com.gemstone.gemfire.internal.cache.partitioned; -import java.util.Properties; - import com.gemstone.gemfire.cache.CacheFactory; import com.gemstone.gemfire.cache.Region; import com.gemstone.gemfire.cache.RegionFactory; @@ -35,12 +33,11 @@ import com.gemstone.gemfire.internal.cache.GemFireCacheImpl; import com.gemstone.gemfire.internal.cache.tier.sockets.CacheClientNotifier; import com.gemstone.gemfire.internal.cache.tier.sockets.CacheClientProxy; import com.gemstone.gemfire.internal.cache.tier.sockets.CacheClientProxyStats; -import com.gemstone.gemfire.test.dunit.AsyncInvocation; -import com.gemstone.gemfire.test.dunit.DistributedTestCase; -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.dunit.VM; +import com.gemstone.gemfire.test.dunit.*; + +import java.util.Properties; + +import static com.gemstone.gemfire.distributed.SystemConfigurationProperties.LOCATORS; /** * @@ -93,9 +90,9 @@ public class Bug51400DUnitTest extends DistributedTestCase { public static Integer createServerCache(Integer mcastPort, Integer maxMessageCount) throws Exception { Properties props = new Properties(); - props.setProperty("locators", "localhost["+DistributedTestUtils.getDUnitLocatorPort()+"]"); + props.setProperty(LOCATORS, "localhost[" + DistributedTestUtils.getDUnitLocatorPort() + "]"); // props.setProperty("log-file", "server_" + OSProcess.getId() + ".log"); -// props.setProperty("log-level", "fine"); + // props.setProperty(DistributionConfig.LOG_LEVEL_NAME, "fine"); // props.setProperty("statistic-archive-file", "server_" + OSProcess.getId() // + ".gfs"); // props.setProperty("statistic-sampling-enabled", "true"); @@ -127,7 +124,7 @@ public class Bug51400DUnitTest extends DistributedTestCase { // "my-durable-client-" + ports.length); // props.setProperty(DistributionConfig.DURABLE_CLIENT_TIMEOUT_NAME, "300000"); // props.setProperty("log-file", "client_" + OSProcess.getId() + ".log"); -// props.setProperty("log-level", "fine"); + // props.setProperty(DistributionConfig.LOG_LEVEL_NAME, "fine"); // props.setProperty("statistic-archive-file", "client_" + OSProcess.getId() // + ".gfs"); // props.setProperty("statistic-sampling-enabled", "true"); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/70612010/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/PersistentPartitionedRegionDUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/PersistentPartitionedRegionDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/PersistentPartitionedRegionDUnitTest.java index b8c5ba1..a1a6ad2 100644 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/PersistentPartitionedRegionDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/PersistentPartitionedRegionDUnitTest.java @@ -16,44 +16,9 @@ */ package com.gemstone.gemfire.internal.cache.partitioned; -import static org.assertj.core.api.Assertions.assertThat; -import static com.jayway.awaitility.Awaitility.await; -import static java.util.concurrent.TimeUnit.SECONDS; -import java.io.DataInput; -import java.io.DataOutput; -import java.io.File; -import java.io.IOException; -import java.io.Serializable; -import java.util.Collections; -import java.util.ConcurrentModificationException; -import java.util.HashSet; -import java.util.Properties; -import java.util.Set; -import java.util.concurrent.CountDownLatch; - -import org.junit.Ignore; -import org.junit.experimental.categories.Category; - import com.gemstone.gemfire.DataSerializable; -import com.gemstone.gemfire.cache.AttributesFactory; -import com.gemstone.gemfire.cache.Cache; -import com.gemstone.gemfire.cache.CacheClosedException; -import com.gemstone.gemfire.cache.CustomExpiry; -import com.gemstone.gemfire.cache.DataPolicy; -import com.gemstone.gemfire.cache.DiskAccessException; -import com.gemstone.gemfire.cache.DiskStore; -import com.gemstone.gemfire.cache.EvictionAction; -import com.gemstone.gemfire.cache.EvictionAttributes; -import com.gemstone.gemfire.cache.ExpirationAction; -import com.gemstone.gemfire.cache.ExpirationAttributes; -import com.gemstone.gemfire.cache.PartitionAttributesFactory; -import com.gemstone.gemfire.cache.PartitionedRegionStorageException; -import com.gemstone.gemfire.cache.Region; +import com.gemstone.gemfire.cache.*; import com.gemstone.gemfire.cache.Region.Entry; -import com.gemstone.gemfire.cache.RegionAttributes; -import com.gemstone.gemfire.cache.RegionFactory; -import com.gemstone.gemfire.cache.RegionShortcut; -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.ServerOperationException; @@ -76,20 +41,20 @@ import com.gemstone.gemfire.internal.cache.InitialImageOperation.RequestImageMes import com.gemstone.gemfire.internal.cache.control.InternalResourceManager; import com.gemstone.gemfire.internal.cache.partitioned.ManageBucketMessage.ManageBucketReplyMessage; import com.gemstone.gemfire.internal.i18n.LocalizedStrings; -import com.gemstone.gemfire.test.dunit.Assert; -import com.gemstone.gemfire.test.dunit.AsyncInvocation; -import com.gemstone.gemfire.test.dunit.DistributedTestCase; -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.Host; -import com.gemstone.gemfire.test.dunit.RMIException; -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.dunit.*; import com.gemstone.gemfire.test.junit.categories.FlakyTest; +import org.junit.Ignore; +import org.junit.experimental.categories.Category; + +import java.io.*; +import java.util.*; +import java.util.concurrent.CountDownLatch; + +import static com.gemstone.gemfire.distributed.SystemConfigurationProperties.LOCATORS; +import static com.gemstone.gemfire.distributed.SystemConfigurationProperties.MCAST_PORT; +import static com.jayway.awaitility.Awaitility.await; +import static java.util.concurrent.TimeUnit.SECONDS; +import static org.assertj.core.api.Assertions.assertThat; /** * Tests the basic use cases for PR persistence. @@ -1384,8 +1349,8 @@ public class PersistentPartitionedRegionDUnitTest extends PersistentPartitionedR public void run () { Properties props = new Properties(); - props.setProperty("mcast-port", "0"); - props.setProperty("locators", ""); + props.setProperty(MCAST_PORT, "0"); + props.setProperty(LOCATORS, ""); getSystem(props ); try { Cache cache = getCache(); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/70612010/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/fixed/FixedPartitioningTestBase.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/fixed/FixedPartitioningTestBase.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/fixed/FixedPartitioningTestBase.java index 42428b8..cbef135 100644 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/fixed/FixedPartitioningTestBase.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/fixed/FixedPartitioningTestBase.java @@ -16,67 +16,31 @@ */ package com.gemstone.gemfire.internal.cache.partitioned.fixed; -import java.io.File; -import java.io.IOException; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Locale; -import java.util.Map; -import java.util.Properties; -import java.util.Set; - import com.gemstone.gemfire.SystemFailure; -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.DiskStore; -import com.gemstone.gemfire.cache.FixedPartitionAttributes; -import com.gemstone.gemfire.cache.PartitionAttributesFactory; -import com.gemstone.gemfire.cache.PartitionResolver; -import com.gemstone.gemfire.cache.Region; +import com.gemstone.gemfire.cache.*; import com.gemstone.gemfire.cache.control.RebalanceOperation; import com.gemstone.gemfire.cache.control.RebalanceResults; import com.gemstone.gemfire.cache.control.ResourceManager; import com.gemstone.gemfire.cache.partition.PartitionRegionHelper; -import com.gemstone.gemfire.cache30.CacheTestCase; import com.gemstone.gemfire.distributed.DistributedSystem; +import com.gemstone.gemfire.distributed.internal.DistributionConfig; import com.gemstone.gemfire.distributed.internal.membership.InternalDistributedMember; -import com.gemstone.gemfire.internal.Assert; import com.gemstone.gemfire.internal.FileUtil; -import com.gemstone.gemfire.internal.cache.ClientServerObserver; -import com.gemstone.gemfire.internal.cache.ClientServerObserverAdapter; -import com.gemstone.gemfire.internal.cache.ClientServerObserverHolder; -import com.gemstone.gemfire.internal.cache.FixedPartitionAttributesImpl; -import com.gemstone.gemfire.internal.cache.GemFireCacheImpl; -import com.gemstone.gemfire.internal.cache.HARegion; -import com.gemstone.gemfire.internal.cache.LocalRegion; -import com.gemstone.gemfire.internal.cache.Node; -import com.gemstone.gemfire.internal.cache.PRHARedundancyProvider; -import com.gemstone.gemfire.internal.cache.PartitionRegionConfig; -import com.gemstone.gemfire.internal.cache.PartitionedRegion; -import com.gemstone.gemfire.internal.cache.PartitionedRegionHelper; -import com.gemstone.gemfire.internal.cache.execute.data.CustId; +import com.gemstone.gemfire.internal.cache.*; +import com.gemstone.gemfire.internal.cache.execute.data.*; import com.gemstone.gemfire.internal.cache.execute.data.Customer; import com.gemstone.gemfire.internal.cache.execute.data.Order; -import com.gemstone.gemfire.internal.cache.execute.data.OrderId; import com.gemstone.gemfire.internal.cache.execute.data.Shipment; -import com.gemstone.gemfire.internal.cache.execute.data.ShipmentId; import com.gemstone.gemfire.internal.cache.partitioned.PartitionedRegionObserver; import com.gemstone.gemfire.internal.cache.partitioned.PartitionedRegionObserverAdapter; import com.gemstone.gemfire.internal.cache.partitioned.PartitionedRegionObserverHolder; -import com.gemstone.gemfire.internal.cache.tier.sockets.CacheClientProxy; -import com.gemstone.gemfire.internal.cache.tier.sockets.Message; -import com.gemstone.gemfire.test.dunit.DistributedTestCase; -import com.gemstone.gemfire.test.dunit.Host; -import com.gemstone.gemfire.test.dunit.LogWriterUtils; -import com.gemstone.gemfire.test.dunit.VM; -import com.gemstone.gemfire.test.dunit.Wait; -import com.gemstone.gemfire.test.dunit.WaitCriterion; +import com.gemstone.gemfire.test.dunit.*; + +import java.io.File; +import java.io.IOException; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.*; /** * This is the base class to do operations @@ -140,7 +104,7 @@ public class FixedPartitioningTestBase extends DistributedTestCase { } public static void createCacheOnMember_DisableMovePrimary() { - System.setProperty("gemfire.DISABLE_MOVE_PRIMARIES_ON_STARTUP", "true"); + System.setProperty(DistributionConfig.GEMFIRE_PREFIX + "DISABLE_MOVE_PRIMARIES_ON_STARTUP", "true"); new FixedPartitioningTestBase("Temp").createCache(); } @@ -1395,7 +1359,7 @@ public class FixedPartitioningTestBase extends DistributedTestCase { } public static void closeCache() { - System.clearProperty("gemfire.DISABLE_MOVE_PRIMARIES_ON_STARTUP"); + System.clearProperty(DistributionConfig.GEMFIRE_PREFIX + "DISABLE_MOVE_PRIMARIES_ON_STARTUP"); //System.setProperty("gemfire.DISABLE_MOVE_PRIMARIES_ON_STARTUP", "false"); if (cache != null && !cache.isClosed()) { cache.close(); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/70612010/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/persistence/PersistentRecoveryOrderDUnitTest.java ---------------------------------------------------------------------- diff --git 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 index 4f0fcca..0978878 100644 --- 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,37 +16,12 @@ */ package com.gemstone.gemfire.internal.cache.persistence; -import static com.gemstone.gemfire.internal.lang.ThrowableUtils.*; - -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 com.gemstone.gemfire.DataSerializer; import com.gemstone.gemfire.admin.AdminDistributedSystem; import com.gemstone.gemfire.admin.AdminDistributedSystemFactory; import com.gemstone.gemfire.admin.AdminException; import com.gemstone.gemfire.admin.DistributedSystemConfig; -import com.gemstone.gemfire.cache.AttributesFactory; -import com.gemstone.gemfire.cache.Cache; -import com.gemstone.gemfire.cache.CacheClosedException; -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.RegionDestroyedException; -import com.gemstone.gemfire.cache.RegionFactory; -import com.gemstone.gemfire.cache.Scope; +import com.gemstone.gemfire.cache.*; import com.gemstone.gemfire.cache.persistence.ConflictingPersistentDataException; import com.gemstone.gemfire.cache.persistence.PersistentID; import com.gemstone.gemfire.cache.persistence.PersistentReplicatesOfflineException; @@ -62,26 +37,22 @@ import com.gemstone.gemfire.internal.HeapDataOutputStream; 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.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.*; 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.Assert; -import com.gemstone.gemfire.test.dunit.AsyncInvocation; -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.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; /** * This is a test of how persistent distributed @@ -98,7 +69,7 @@ public class PersistentRecoveryOrderDUnitTest extends PersistentReplicatedTestBa public static void resetAckWaitThreshold() { if (SAVED_ACK_WAIT_THRESHOLD != null) { - System.setProperty("gemfire.ack_wait_threshold", SAVED_ACK_WAIT_THRESHOLD); + System.setProperty(DistributionConfig.GEMFIRE_PREFIX + "ack_wait_threshold", SAVED_ACK_WAIT_THRESHOLD); } } @@ -1782,11 +1753,11 @@ public class PersistentRecoveryOrderDUnitTest extends PersistentReplicatedTestBa @Override public Properties getDistributedSystemProperties() { LogWriterUtils.getLogWriter().info("Looking for ack-wait-threshold"); - String s = System.getProperty("gemfire.ack-wait-threshold"); + String s = System.getProperty(DistributionConfig.GEMFIRE_PREFIX + "ack-wait-threshold"); if (s != null) { SAVED_ACK_WAIT_THRESHOLD = s; LogWriterUtils.getLogWriter().info("removing system property gemfire.ack-wait-threshold"); - System.getProperties().remove("gemfire.ack-wait-threshold"); + System.getProperties().remove(DistributionConfig.GEMFIRE_PREFIX + "ack-wait-threshold"); } Properties props = super.getDistributedSystemProperties(); props.put(DistributionConfig.ACK_WAIT_THRESHOLD_NAME, "5"); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/70612010/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/AcceptorImplJUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/AcceptorImplJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/AcceptorImplJUnitTest.java index 0ac9357..29de762 100644 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/AcceptorImplJUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/AcceptorImplJUnitTest.java @@ -16,30 +16,27 @@ */ package com.gemstone.gemfire.internal.cache.tier.sockets; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; - -import java.io.IOException; -import java.net.BindException; -import java.util.Collections; -import java.util.Properties; - -import org.junit.After; -import org.junit.Before; -import org.junit.Test; -import org.junit.experimental.categories.Category; - import com.gemstone.gemfire.cache.CacheException; import com.gemstone.gemfire.cache.CacheFactory; import com.gemstone.gemfire.cache.server.CacheServer; -import com.gemstone.gemfire.cache.server.CacheServer; import com.gemstone.gemfire.distributed.DistributedSystem; import com.gemstone.gemfire.distributed.internal.DistributionConfig; import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem; import com.gemstone.gemfire.internal.AvailablePortHelper; import com.gemstone.gemfire.internal.cache.InternalCache; import com.gemstone.gemfire.test.junit.categories.IntegrationTest; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import org.junit.experimental.categories.Category; + +import java.io.IOException; +import java.net.BindException; +import java.util.Collections; +import java.util.Properties; + +import static com.gemstone.gemfire.distributed.SystemConfigurationProperties.MCAST_PORT; +import static org.junit.Assert.*; @Category(IntegrationTest.class) public class AcceptorImplJUnitTest @@ -52,7 +49,7 @@ public class AcceptorImplJUnitTest public void setUp() throws Exception { Properties p = new Properties(); - p.setProperty(DistributionConfig.MCAST_PORT_NAME ,"0"); + p.setProperty(MCAST_PORT, "0"); this.system = DistributedSystem.connect(p); this.cache = (InternalCache) CacheFactory.create(system); } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/70612010/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/BackwardCompatibilityHigherVersionClientDUnitTest.java ---------------------------------------------------------------------- diff --git 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 index d876986..1517def 100755 --- 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,28 +16,20 @@ */ package com.gemstone.gemfire.internal.cache.tier.sockets; -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.Region; -import com.gemstone.gemfire.cache.RegionAttributes; -import com.gemstone.gemfire.cache.Scope; +import com.gemstone.gemfire.cache.*; +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.Assert; -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; -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.test.dunit.*; + +import java.util.Properties; + +import static com.gemstone.gemfire.distributed.SystemConfigurationProperties.LOCATORS; +import static com.gemstone.gemfire.distributed.SystemConfigurationProperties.MCAST_PORT; /** * @@ -94,8 +86,8 @@ public class BackwardCompatibilityHigherVersionClientDUnitTest extends throws Exception { new BackwardCompatibilityHigherVersionClientDUnitTest("temp"); 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 BackwardCompatibilityHigherVersionClientDUnitTest("temp") .createCache(props); PoolImpl p = (PoolImpl)PoolManager.createFactory().addServer(host, http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/70612010/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug36269DUnitTest.java ---------------------------------------------------------------------- diff --git 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 index 80d238e..7023a9b 100644 --- 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,31 +16,22 @@ */ package com.gemstone.gemfire.internal.cache.tier.sockets; -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.MirrorType; -import com.gemstone.gemfire.cache.Region; -import com.gemstone.gemfire.cache.Scope; +import com.gemstone.gemfire.cache.*; 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.client.internal.ServerRegionProxy; import com.gemstone.gemfire.cache.server.CacheServer; import com.gemstone.gemfire.distributed.DistributedSystem; -import com.gemstone.gemfire.distributed.internal.DistributionConfig; import com.gemstone.gemfire.distributed.internal.ServerLocation; import com.gemstone.gemfire.internal.AvailablePort; import com.gemstone.gemfire.internal.cache.EventID; -import com.gemstone.gemfire.test.dunit.Assert; -import com.gemstone.gemfire.test.dunit.DistributedTestCase; -import com.gemstone.gemfire.test.dunit.Host; -import com.gemstone.gemfire.test.dunit.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.*; + +import java.util.Properties; + +import static com.gemstone.gemfire.distributed.SystemConfigurationProperties.LOCATORS; +import static com.gemstone.gemfire.distributed.SystemConfigurationProperties.MCAST_PORT; /** * The Region Destroy Operation from Cache Client does not pass the Client side @@ -133,8 +124,8 @@ public class Bug36269DUnitTest extends DistributedTestCase { 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); CacheServerTestUtil.disableShufflingOfEndpoints(); PoolImpl p; http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/70612010/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug36457DUnitTest.java ---------------------------------------------------------------------- diff --git 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 index 545b2a8..6b3dcaa 100755 --- 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,33 +16,24 @@ */ package com.gemstone.gemfire.internal.cache.tier.sockets; -import java.util.ArrayList; -import java.util.List; -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.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.PoolManager; 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.distributed.internal.ServerLocation; import com.gemstone.gemfire.internal.AvailablePort; import com.gemstone.gemfire.internal.cache.ClientServerObserverAdapter; import com.gemstone.gemfire.internal.cache.ClientServerObserverHolder; -import com.gemstone.gemfire.test.dunit.Assert; -import com.gemstone.gemfire.test.dunit.DistributedTestCase; -import com.gemstone.gemfire.test.dunit.Host; -import com.gemstone.gemfire.test.dunit.LogWriterUtils; -import com.gemstone.gemfire.test.dunit.NetworkUtils; -import com.gemstone.gemfire.test.dunit.VM; +import com.gemstone.gemfire.test.dunit.*; + +import java.util.ArrayList; +import java.util.List; +import java.util.Properties; + +import static com.gemstone.gemfire.distributed.SystemConfigurationProperties.LOCATORS; +import static com.gemstone.gemfire.distributed.SystemConfigurationProperties.MCAST_PORT; /** * Bug Test for bug#36457 @@ -96,8 +87,8 @@ public class Bug36457DUnitTest extends DistributedTestCase 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); Pool p = PoolManager.createFactory() .addServer(host, port1.intValue()) http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/70612010/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug36805DUnitTest.java ---------------------------------------------------------------------- diff --git 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 index 6ce5520..9bdb1e1 100755 --- 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,30 +16,21 @@ */ package com.gemstone.gemfire.internal.cache.tier.sockets; -import java.util.ArrayList; -import java.util.List; -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.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.DistributedTestCase; -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.*; + +import java.util.ArrayList; +import java.util.List; +import java.util.Properties; + +import static com.gemstone.gemfire.distributed.SystemConfigurationProperties.LOCATORS; +import static com.gemstone.gemfire.distributed.SystemConfigurationProperties.MCAST_PORT; /** * bug test for bug 36805 @@ -100,8 +91,8 @@ public class Bug36805DUnitTest extends DistributedTestCase 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); PoolImpl p = (PoolImpl)PoolManager.createFactory() .addServer(host, port1.intValue()) http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/70612010/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug36829DUnitTest.java ---------------------------------------------------------------------- diff --git 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 index 8eeec93..91b661e 100644 --- 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,22 +16,22 @@ */ package com.gemstone.gemfire.internal.cache.tier.sockets; -import java.util.Properties; - import com.gemstone.gemfire.cache.CacheException; import com.gemstone.gemfire.cache.InterestResultPolicy; 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.cache.client.ServerOperationException; import com.gemstone.gemfire.cache30.CacheSerializableRunnable; import com.gemstone.gemfire.distributed.internal.DistributionConfig; -import com.gemstone.gemfire.internal.AvailablePort; -import com.gemstone.gemfire.cache.RegionDestroyedException; -import com.gemstone.gemfire.cache.client.*; import com.gemstone.gemfire.internal.cache.PoolFactoryImpl; -import com.gemstone.gemfire.test.dunit.Assert; -import com.gemstone.gemfire.test.dunit.DistributedTestCase; -import com.gemstone.gemfire.test.dunit.Host; -import com.gemstone.gemfire.test.dunit.NetworkUtils; -import com.gemstone.gemfire.test.dunit.VM; +import com.gemstone.gemfire.test.dunit.*; + +import java.util.Properties; + +import static com.gemstone.gemfire.distributed.SystemConfigurationProperties.LOCATORS; +import static com.gemstone.gemfire.distributed.SystemConfigurationProperties.MCAST_PORT; public class Bug36829DUnitTest extends DistributedTestCase { private VM serverVM; @@ -154,8 +154,8 @@ public class Bug36829DUnitTest extends DistributedTestCase { 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(MCAST_PORT, "0"); + properties.setProperty(LOCATORS, ""); properties.setProperty(DistributionConfig.DURABLE_CLIENT_ID_NAME, durableClientId); properties.setProperty(DistributionConfig.DURABLE_CLIENT_TIMEOUT_NAME, http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/70612010/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug36995DUnitTest.java ---------------------------------------------------------------------- diff --git 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 index 094635c..d841c22 100755 --- 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,26 +16,23 @@ */ package com.gemstone.gemfire.internal.cache.tier.sockets; -import java.util.Iterator; -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.RegionAttributes; +import com.gemstone.gemfire.cache.client.PoolFactory; +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.distributed.DistributedSystem; -import com.gemstone.gemfire.distributed.internal.DistributionConfig; import com.gemstone.gemfire.internal.AvailablePort; -import com.gemstone.gemfire.test.dunit.DistributedTestCase; -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.cache.client.*; -import com.gemstone.gemfire.cache.client.internal.PoolImpl; +import com.gemstone.gemfire.test.dunit.*; + +import java.util.Iterator; +import java.util.Properties; + +import static com.gemstone.gemfire.distributed.SystemConfigurationProperties.LOCATORS; +import static com.gemstone.gemfire.distributed.SystemConfigurationProperties.MCAST_PORT; public class Bug36995DUnitTest extends DistributedTestCase { @@ -78,8 +75,8 @@ public class Bug36995DUnitTest extends DistributedTestCase { 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); PoolImpl p = (PoolImpl)PoolManager.createFactory() .addServer(host, port1) @@ -107,8 +104,8 @@ public class Bug36995DUnitTest extends DistributedTestCase { 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); PoolImpl p = (PoolImpl)PoolManager.createFactory() .addServer(host, port1) http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/70612010/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug37210DUnitTest.java ---------------------------------------------------------------------- diff --git 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 index 77d1f8c..53d1aba 100755 --- 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,30 +16,22 @@ */ package com.gemstone.gemfire.internal.cache.tier.sockets; -import java.util.Iterator; -import java.util.Map; -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.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.PoolManager; 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.CacheServerImpl; import com.gemstone.gemfire.internal.cache.ha.HARegionQueue; -import com.gemstone.gemfire.test.dunit.DistributedTestCase; -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.cache.client.*; +import com.gemstone.gemfire.test.dunit.*; + +import java.util.Iterator; +import java.util.Map; +import java.util.Properties; + +import static com.gemstone.gemfire.distributed.SystemConfigurationProperties.LOCATORS; +import static com.gemstone.gemfire.distributed.SystemConfigurationProperties.MCAST_PORT; /** * This tests the fix for bug 73210. Reason for the bug was that HARegionQueue's @@ -201,8 +193,8 @@ public class Bug37210DUnitTest extends DistributedTestCase { Bug37210DUnitTest test = new Bug37210DUnitTest("temp"); 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/70612010/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug37805DUnitTest.java ---------------------------------------------------------------------- diff --git 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 index 3b0157f..f84c3ed 100644 --- 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,16 +16,13 @@ */ package com.gemstone.gemfire.internal.cache.tier.sockets; -import java.util.Iterator; -import java.util.Properties; -import java.util.Set; - import com.gemstone.gemfire.cache.CacheException; import com.gemstone.gemfire.cache.Region; -import com.gemstone.gemfire.cache.client.*; +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.AvailablePort; import com.gemstone.gemfire.internal.cache.HARegion; import com.gemstone.gemfire.internal.cache.PoolFactoryImpl; import com.gemstone.gemfire.test.dunit.DistributedTestCase; @@ -33,6 +30,13 @@ import com.gemstone.gemfire.test.dunit.Host; import com.gemstone.gemfire.test.dunit.NetworkUtils; import com.gemstone.gemfire.test.dunit.VM; +import java.util.Iterator; +import java.util.Properties; +import java.util.Set; + +import static com.gemstone.gemfire.distributed.SystemConfigurationProperties.LOCATORS; +import static com.gemstone.gemfire.distributed.SystemConfigurationProperties.MCAST_PORT; + /** * * @@ -127,8 +131,8 @@ public class Bug37805DUnitTest extends DistributedTestCase{ private Properties getDurableClientDistributedSystemProperties( String durableClientId, int durableClientTimeout) { Properties properties = new Properties(); - properties.setProperty(DistributionConfig.MCAST_PORT_NAME, "0"); - properties.setProperty(DistributionConfig.LOCATORS_NAME, ""); + properties.setProperty(MCAST_PORT, "0"); + properties.setProperty(LOCATORS, ""); properties.setProperty(DistributionConfig.DURABLE_CLIENT_ID_NAME, durableClientId); properties.setProperty(DistributionConfig.DURABLE_CLIENT_TIMEOUT_NAME, http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/70612010/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/CacheServerMaxConnectionsJUnitTest.java ---------------------------------------------------------------------- diff --git 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 index f86c2bf..398cee4 100644 --- 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,32 +16,30 @@ */ package com.gemstone.gemfire.internal.cache.tier.sockets; -import java.util.Properties; - -import org.junit.After; -import org.junit.Before; -import org.junit.Test; -import org.junit.experimental.categories.Category; - -import static org.junit.Assert.*; -import junit.framework.TestCase; - import com.gemstone.gemfire.Statistics; import com.gemstone.gemfire.StatisticsType; -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.*; -import com.gemstone.gemfire.cache.client.internal.PoolImpl; +import com.gemstone.gemfire.cache.*; +import com.gemstone.gemfire.cache.client.NoAvailableServersException; +import com.gemstone.gemfire.cache.client.PoolFactory; +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.distributed.DistributedSystem; import com.gemstone.gemfire.internal.AvailablePort; import com.gemstone.gemfire.test.dunit.Wait; import com.gemstone.gemfire.test.dunit.WaitCriterion; import com.gemstone.gemfire.test.junit.categories.IntegrationTest; +import org.junit.After; +import org.junit.Test; +import org.junit.experimental.categories.Category; + +import java.util.Properties; + +import static com.gemstone.gemfire.distributed.SystemConfigurationProperties.LOCATORS; +import static com.gemstone.gemfire.distributed.SystemConfigurationProperties.MCAST_PORT; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; /** * Make sure max-connections on cache server is enforced @@ -125,8 +123,8 @@ public class CacheServerMaxConnectionsJUnitTest try { 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(); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/70612010/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/CacheServerTestUtil.java ---------------------------------------------------------------------- diff --git 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 index c48482c..fc40aed 100755 --- 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,28 +16,8 @@ */ package com.gemstone.gemfire.internal.cache.tier.sockets; -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.*; +import com.gemstone.gemfire.cache.client.*; import com.gemstone.gemfire.cache.client.internal.PoolImpl; import com.gemstone.gemfire.cache.query.CqEvent; import com.gemstone.gemfire.cache.server.CacheServer; @@ -49,12 +29,19 @@ import com.gemstone.gemfire.internal.AvailablePort; import com.gemstone.gemfire.internal.cache.GemFireCacheImpl; import com.gemstone.gemfire.internal.cache.PoolFactoryImpl; import com.gemstone.gemfire.internal.cache.PoolFactoryImpl.PoolAttributes; -import com.gemstone.gemfire.internal.i18n.LocalizedStrings; -import com.gemstone.gemfire.test.dunit.Assert; -import com.gemstone.gemfire.test.dunit.DistributedTestCase; -import com.gemstone.gemfire.test.dunit.DistributedTestUtils; -import com.gemstone.gemfire.test.dunit.IgnoredException; -import com.gemstone.gemfire.test.dunit.LogWriterUtils; +import com.gemstone.gemfire.test.dunit.*; + +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 static com.gemstone.gemfire.distributed.SystemConfigurationProperties.LOCATORS; +import static com.gemstone.gemfire.distributed.SystemConfigurationProperties.MCAST_PORT; /** * * @@ -129,8 +116,8 @@ public class CacheServerTestUtil extends DistributedTestCase 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);; @@ -215,17 +202,17 @@ public class CacheServerTestUtil extends DistributedTestCase ClientCacheFactory ccf = new ClientCacheFactory(); try { File cacheXmlFile = new File(url.toURI().getPath()); - ccf.set("cache-xml-file", cacheXmlFile.toURI().getPath()); + ccf.set(DistributionConfig.CACHE_XML_FILE_NAME, cacheXmlFile.toURI().getPath()); } catch (URISyntaxException e) { throw new ExceptionInInitializerError(e); } - ccf.set("mcast-port", "0"); + ccf.set(MCAST_PORT, "0"); ccf.set(DistributionConfig.DURABLE_CLIENT_ID_NAME, durableClientId); ccf.set(DistributionConfig.DURABLE_CLIENT_TIMEOUT_NAME, String.valueOf(timeout)); - ccf.set("log-file", "abs_client_system.log"); - ccf.set("log-level", LogWriterUtils.getDUnitLogLevel()); + ccf.set(DistributionConfig.LOG_FILE_NAME, "abs_client_system.log"); + ccf.set(DistributionConfig.LOG_LEVEL_NAME, LogWriterUtils.getDUnitLogLevel()); cache = (Cache)ccf.create(); expected = IgnoredException.addIgnoredException("java.net.ConnectionException||java.net.SocketException"); pool = (PoolImpl)PoolManager.find(poolName); @@ -236,13 +223,13 @@ public class CacheServerTestUtil extends DistributedTestCase ClientCacheFactory ccf = new ClientCacheFactory(); try { File cacheXmlFile = new File(url.toURI().getPath()); - ccf.set("cache-xml-file", cacheXmlFile.toURI().getPath()); + ccf.set(DistributionConfig.CACHE_XML_FILE_NAME, cacheXmlFile.toURI().getPath()); } catch (URISyntaxException e) { throw new ExceptionInInitializerError(e); } - ccf.set("mcast-port", "0"); + ccf.set(MCAST_PORT, "0"); ccf.set(DistributionConfig.DURABLE_CLIENT_ID_NAME, durableClientId); ccf.set(DistributionConfig.DURABLE_CLIENT_TIMEOUT_NAME, String.valueOf(timeout)); cache = (Cache)ccf.create(); @@ -255,11 +242,11 @@ public class CacheServerTestUtil extends DistributedTestCase CacheFactory ccf = new CacheFactory(); try { File cacheXmlFile = new File(url.toURI().getPath()); - ccf.set("cache-xml-file", cacheXmlFile.toURI().getPath()); - ccf.set("mcast-port", "0"); - ccf.set("locators", "localhost["+DistributedTestUtils.getDUnitLocatorPort()+"]"); - ccf.set("log-file", "abs_server_system.log"); - ccf.set("log-level", LogWriterUtils.getDUnitLogLevel()); + ccf.set(DistributionConfig.CACHE_XML_FILE_NAME, cacheXmlFile.toURI().getPath()); + ccf.set(MCAST_PORT, "0"); + ccf.set(LOCATORS, "localhost[" + DistributedTestUtils.getDUnitLocatorPort() + "]"); + ccf.set(DistributionConfig.LOG_FILE_NAME, "abs_server_system.log"); + ccf.set(DistributionConfig.LOG_LEVEL_NAME, LogWriterUtils.getDUnitLogLevel()); } catch (URISyntaxException e) { throw new ExceptionInInitializerError(e); @@ -272,9 +259,9 @@ public class CacheServerTestUtil extends DistributedTestCase CacheFactory ccf = new CacheFactory(); try { File cacheXmlFile = new File(url.toURI().getPath()); - ccf.set("cache-xml-file", cacheXmlFile.toURI().getPath()); - ccf.set("mcast-port", "0"); - ccf.set("locators", "localhost["+DistributedTestUtils.getDUnitLocatorPort()+"]"); + ccf.set(DistributionConfig.CACHE_XML_FILE_NAME, cacheXmlFile.toURI().getPath()); + ccf.set(MCAST_PORT, "0"); + ccf.set(LOCATORS, "localhost[" + DistributedTestUtils.getDUnitLocatorPort() + "]"); } catch (URISyntaxException e) { throw new ExceptionInInitializerError(e); @@ -311,16 +298,16 @@ public class CacheServerTestUtil extends DistributedTestCase 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) { 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; } @@ -328,8 +315,8 @@ public class CacheServerTestUtil extends DistributedTestCase 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); AttributesFactory factory = new AttributesFactory(); factory.setScope(Scope.DISTRIBUTED_ACK); @@ -350,8 +337,8 @@ public class CacheServerTestUtil extends DistributedTestCase { Properties props = new Properties(); // int mcastPort = AvailablePort.getRandomAvailablePort(AvailablePort.JGROUPS); - 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); AttributesFactory factory = new AttributesFactory(); factory.setScope(Scope.DISTRIBUTED_ACK); @@ -371,8 +358,8 @@ public class CacheServerTestUtil extends DistributedTestCase 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); AttributesFactory factory = new AttributesFactory(); factory.setScope(Scope.DISTRIBUTED_ACK); @@ -515,8 +502,8 @@ public class CacheServerTestUtil extends DistributedTestCase 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 @@ -525,8 +512,8 @@ public class CacheServerTestUtil extends DistributedTestCase 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"); } /** @@ -535,7 +522,7 @@ public class CacheServerTestUtil extends DistributedTestCase */ public static void resetDisableShufflingOfEndpointsFlag() { - System.setProperty("gemfire.bridge.disableShufflingOfEndpoints", "false"); + System.setProperty(DistributionConfig.GEMFIRE_PREFIX + "bridge.disableShufflingOfEndpoints", "false"); } public static class EventWrapper { http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/70612010/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/CacheServerTransactionsDUnitTest.java ---------------------------------------------------------------------- diff --git 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 index f03f5fa..e80a115 100755 --- 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,19 +16,7 @@ */ package com.gemstone.gemfire.internal.cache.tier.sockets; -import java.util.ArrayList; -import java.util.List; -import java.util.Properties; - -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.*; import com.gemstone.gemfire.cache.client.PoolManager; import com.gemstone.gemfire.cache.client.internal.PoolImpl; import com.gemstone.gemfire.cache.server.CacheServer; @@ -36,14 +24,14 @@ import com.gemstone.gemfire.cache.util.CacheListenerAdapter; import com.gemstone.gemfire.cache30.CacheSerializableRunnable; import com.gemstone.gemfire.distributed.DistributedSystem; import com.gemstone.gemfire.internal.AvailablePort; -import com.gemstone.gemfire.test.dunit.Assert; -import com.gemstone.gemfire.test.dunit.DistributedTestCase; -import com.gemstone.gemfire.test.dunit.Host; -import com.gemstone.gemfire.test.dunit.LogWriterUtils; -import com.gemstone.gemfire.test.dunit.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.*; + +import java.util.ArrayList; +import java.util.List; +import java.util.Properties; + +import static com.gemstone.gemfire.distributed.SystemConfigurationProperties.LOCATORS; +import static com.gemstone.gemfire.distributed.SystemConfigurationProperties.MCAST_PORT; /** * Tests behaviour of transactions in client server model @@ -645,8 +633,8 @@ public class CacheServerTransactionsDUnitTest extends DistributedTestCase 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); PoolImpl p = (PoolImpl)PoolManager.createFactory() .addServer(host, port.intValue()) @@ -680,8 +668,8 @@ public class CacheServerTransactionsDUnitTest extends DistributedTestCase 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); PoolImpl p = (PoolImpl)PoolManager.createFactory() .addServer(host, port1.intValue()) http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/70612010/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ClearPropagationDUnitTest.java ---------------------------------------------------------------------- diff --git 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 index 63e1874..59fe5f9 100755 --- 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,17 +16,12 @@ */ package com.gemstone.gemfire.internal.cache.tier.sockets; -import java.util.*; - -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.*; +import com.gemstone.gemfire.cache.client.Pool; +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.client.internal.ServerRegionProxy; import com.gemstone.gemfire.cache.server.CacheServer; import com.gemstone.gemfire.cache.util.CacheListenerAdapter; import com.gemstone.gemfire.cache30.CacheSerializableRunnable; @@ -36,16 +31,14 @@ import com.gemstone.gemfire.internal.AvailablePort; import com.gemstone.gemfire.internal.cache.CacheObserverAdapter; import com.gemstone.gemfire.internal.cache.CacheObserverHolder; import com.gemstone.gemfire.internal.cache.EventID; -import com.gemstone.gemfire.test.dunit.Assert; -import com.gemstone.gemfire.test.dunit.DistributedTestCase; -import com.gemstone.gemfire.test.dunit.Host; -import com.gemstone.gemfire.test.dunit.LogWriterUtils; -import com.gemstone.gemfire.test.dunit.NetworkUtils; -import com.gemstone.gemfire.test.dunit.VM; -import com.gemstone.gemfire.cache.client.*; -import com.gemstone.gemfire.cache.client.internal.PoolImpl; -import com.gemstone.gemfire.cache.client.internal.ServerRegionProxy; -import com.gemstone.gemfire.cache.client.internal.Connection; +import com.gemstone.gemfire.test.dunit.*; + +import java.util.ArrayList; +import java.util.List; +import java.util.Properties; + +import static com.gemstone.gemfire.distributed.SystemConfigurationProperties.LOCATORS; +import static com.gemstone.gemfire.distributed.SystemConfigurationProperties.MCAST_PORT; /** * This is the DUnit Test to verify clear and DestroyRegion operation in @@ -351,8 +344,8 @@ public class ClearPropagationDUnitTest extends DistributedTestCase 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); CacheServerTestUtil.disableShufflingOfEndpoints(); Pool p; http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/70612010/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ClientConflationDUnitTest.java ---------------------------------------------------------------------- diff --git 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 index 1eb2700..8f185f5 100755 --- 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,17 +16,7 @@ */ package com.gemstone.gemfire.internal.cache.tier.sockets; -import java.util.Iterator; -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.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.*; import com.gemstone.gemfire.cache.client.Pool; import com.gemstone.gemfire.cache.client.PoolFactory; import com.gemstone.gemfire.cache.client.PoolManager; @@ -35,19 +25,17 @@ 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.distributed.internal.InternalDistributedSystem; import com.gemstone.gemfire.internal.AvailablePort; +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.test.dunit.Assert; -import com.gemstone.gemfire.test.dunit.DistributedTestCase; -import com.gemstone.gemfire.test.dunit.Host; -import com.gemstone.gemfire.test.dunit.LogWriterUtils; -import com.gemstone.gemfire.test.dunit.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.internal.cache.CacheServerImpl; +import com.gemstone.gemfire.test.dunit.*; + +import java.util.Iterator; +import java.util.Properties; + +import static com.gemstone.gemfire.distributed.SystemConfigurationProperties.LOCATORS; +import static com.gemstone.gemfire.distributed.SystemConfigurationProperties.MCAST_PORT; /** * This test verifies the per-client queue conflation override functionality @@ -154,8 +142,8 @@ public class ClientConflationDUnitTest extends DistributedTestCase private static Properties createProperties1(String conflation){ Properties props = new Properties(); props.setProperty(DistributionConfig.DELTA_PROPAGATION_PROP_NAME, "false"); - props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0"); - props.setProperty(DistributionConfig.LOCATORS_NAME, ""); + props.setProperty(MCAST_PORT, "0"); + props.setProperty(LOCATORS, ""); props.setProperty(DistributionConfig.CLIENT_CONFLATION_PROP_NAME, conflation); return props; } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/70612010/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ClientHealthMonitorJUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ClientHealthMonitorJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ClientHealthMonitorJUnitTest.java index 5953b8a..1014063 100755 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ClientHealthMonitorJUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ClientHealthMonitorJUnitTest.java @@ -16,15 +16,6 @@ */ package com.gemstone.gemfire.internal.cache.tier.sockets; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.fail; - -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.AttributesFactory; @@ -44,6 +35,16 @@ import com.gemstone.gemfire.internal.cache.EventID; import com.gemstone.gemfire.test.dunit.Wait; import com.gemstone.gemfire.test.dunit.WaitCriterion; import com.gemstone.gemfire.test.junit.categories.IntegrationTest; +import org.junit.After; +import org.junit.Test; +import org.junit.experimental.categories.Category; + +import java.util.Properties; + +import static com.gemstone.gemfire.distributed.SystemConfigurationProperties.LOCATORS; +import static com.gemstone.gemfire.distributed.SystemConfigurationProperties.MCAST_PORT; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; /** * This is a functional-test for <code>ClientHealthMonitor</code>. @@ -123,8 +124,8 @@ public class ClientHealthMonitorJUnitTest try { 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); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/70612010/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ClientInterestNotifyDUnitTest.java ---------------------------------------------------------------------- diff --git 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 index a4ab3c1..0f2c519 100755 --- 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,20 +16,7 @@ */ package com.gemstone.gemfire.internal.cache.tier.sockets; -import java.util.Iterator; -import java.util.Properties; -import java.util.concurrent.TimeUnit; - -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.Region; -import com.gemstone.gemfire.cache.RegionAttributes; -import com.gemstone.gemfire.cache.Scope; -import com.gemstone.gemfire.cache.InterestResultPolicy; +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; @@ -40,16 +27,16 @@ 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.test.dunit.Assert; -import com.gemstone.gemfire.test.dunit.DistributedTestCase; -import com.gemstone.gemfire.test.dunit.Host; -import com.gemstone.gemfire.test.dunit.LogWriterUtils; -import com.gemstone.gemfire.test.dunit.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.*; import com.jayway.awaitility.Awaitility; +import java.util.Iterator; +import java.util.Properties; +import java.util.concurrent.TimeUnit; + +import static com.gemstone.gemfire.distributed.SystemConfigurationProperties.LOCATORS; +import static com.gemstone.gemfire.distributed.SystemConfigurationProperties.MCAST_PORT; + /** * This test verifies the per-client notify-by-subscription (NBS) override * functionality along with register interest new receiveValues flag. @@ -167,8 +154,8 @@ public class ClientInterestNotifyDUnitTest extends DistributedTestCase ds.disconnect(); ds = getSystem(props); */ - props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0"); - props.setProperty(DistributionConfig.LOCATORS_NAME, ""); + props.setProperty(MCAST_PORT, "0"); + props.setProperty(LOCATORS, ""); DistributedSystem ds = DistributedSystem.connect(props); Cache cache = CacheFactory.create(ds); if (cache == null) { @@ -319,8 +306,8 @@ public class ClientInterestNotifyDUnitTest extends DistributedTestCase */ private static Properties createProperties1(/*String nbs*/){ Properties props = new Properties(); - props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0"); - props.setProperty(DistributionConfig.LOCATORS_NAME, ""); + props.setProperty(MCAST_PORT, "0"); + props.setProperty(LOCATORS, ""); //props.setProperty(DistributionConfig.NOTIFY_BY_SUBSCRIPTION_OVERRIDE_PROP_NAME, nbs); return props; } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/70612010/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ClientServerForceInvalidateDUnitTest.java ---------------------------------------------------------------------- diff --git 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 index ce411d8..23a4e2a 100644 --- 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,24 +16,7 @@ */ package com.gemstone.gemfire.internal.cache.tier.sockets; -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 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.*; import com.gemstone.gemfire.cache.client.NoAvailableServersException; import com.gemstone.gemfire.cache.client.PoolManager; import com.gemstone.gemfire.cache.client.internal.Connection; @@ -51,6 +34,15 @@ import com.gemstone.gemfire.internal.logging.LogService; 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.SystemConfigurationProperties.LOCATORS; +import static com.gemstone.gemfire.distributed.SystemConfigurationProperties.MCAST_PORT; +import static com.jayway.awaitility.Awaitility.with; /** * Tests client server FORCE_INVALIDATE @@ -289,8 +281,8 @@ public class ClientServerForceInvalidateDUnitTest extends CacheTestCase 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); PoolImpl p = (PoolImpl)PoolManager.createFactory() .addServer(h, port1) http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/70612010/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ClientServerMiscDUnitTest.java ---------------------------------------------------------------------- diff --git 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 index d5111bc..0fd1bb4 100755 --- 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,19 +16,8 @@ */ package com.gemstone.gemfire.internal.cache.tier.sockets; -import java.util.Iterator; -import java.util.Properties; -import java.util.Set; - import com.gemstone.gemfire.GemFireIOException; -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.*; import com.gemstone.gemfire.cache.client.NoAvailableServersException; import com.gemstone.gemfire.cache.client.Pool; import com.gemstone.gemfire.cache.client.PoolManager; @@ -41,19 +30,18 @@ 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.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.*; + +import java.util.Iterator; +import java.util.Properties; +import java.util.Set; + +import static com.gemstone.gemfire.distributed.SystemConfigurationProperties.LOCATORS; +import static com.gemstone.gemfire.distributed.SystemConfigurationProperties.MCAST_PORT; /** * Tests client server corner cases between Region and Pool @@ -578,8 +566,8 @@ public class ClientServerMiscDUnitTest extends CacheTestCase // 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); String host = NetworkUtils.getServerHostName(server1.getHost()); PoolImpl p = (PoolImpl)PoolManager.createFactory() @@ -677,8 +665,8 @@ public class ClientServerMiscDUnitTest extends CacheTestCase public void testProxyCreationBeforeCacheCreation() throws Exception { Properties props = new Properties(); - props.setProperty("mcast-port", "0"); - props.setProperty("locators", ""); + props.setProperty(MCAST_PORT, "0"); + props.setProperty(LOCATORS, ""); DistributedSystem ds = getSystem(props); assertNotNull(ds); ds.disconnect(); @@ -729,8 +717,8 @@ public class ClientServerMiscDUnitTest extends CacheTestCase //work around GEODE-477 IgnoredException.addIgnoredException("Connection reset"); Properties props = new Properties(); - props.setProperty("mcast-port", "0"); - props.setProperty("locators", ""); + props.setProperty(MCAST_PORT, "0"); + props.setProperty(LOCATORS, ""); DistributedSystem ds = getSystem(props); assertNotNull(ds); @@ -759,8 +747,8 @@ public class ClientServerMiscDUnitTest extends CacheTestCase ds.disconnect(); Properties prop = new Properties(); - prop.setProperty("mcast-port", "0"); - prop.setProperty("locators", ""); + prop.setProperty(MCAST_PORT, "0"); + prop.setProperty(LOCATORS, ""); ds = getSystem(prop); cache = getCache(); @@ -815,8 +803,8 @@ public class ClientServerMiscDUnitTest extends CacheTestCase 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); ClientServerMiscDUnitTest.static_cache = cache; PoolImpl p = (PoolImpl)PoolManager.createFactory()
