http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/70612010/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/GridAdvisorDUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/GridAdvisorDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/GridAdvisorDUnitTest.java index 62fae10..4d69eb3 100644 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/GridAdvisorDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/GridAdvisorDUnitTest.java @@ -16,12 +16,6 @@ */ package com.gemstone.gemfire.internal.cache; -import java.io.File; -import java.io.IOException; -import java.util.Arrays; -import java.util.List; -import java.util.Properties; - import com.gemstone.gemfire.cache.Cache; import com.gemstone.gemfire.cache.CacheFactory; import com.gemstone.gemfire.cache.server.CacheServer; @@ -33,13 +27,16 @@ import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem; import com.gemstone.gemfire.distributed.internal.InternalLocator; import com.gemstone.gemfire.internal.AvailablePort.Keeper; import com.gemstone.gemfire.internal.AvailablePortHelper; -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.SerializableRunnable; -import com.gemstone.gemfire.test.dunit.VM; +import com.gemstone.gemfire.test.dunit.*; + +import java.io.File; +import java.io.IOException; +import java.util.Arrays; +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 the GridAdvisor @@ -85,9 +82,9 @@ public class GridAdvisorDUnitTest extends DistributedTestCase { + host0 + "[" + port2 + "]"; final Properties dsProps = new Properties(); - dsProps.setProperty("locators", locators); - dsProps.setProperty("mcast-port", "0"); - dsProps.setProperty("log-level", LogWriterUtils.getDUnitLogLevel()); + dsProps.setProperty(LOCATORS, locators); + dsProps.setProperty(MCAST_PORT, "0"); + dsProps.setProperty(DistributionConfig.LOG_LEVEL_NAME, LogWriterUtils.getDUnitLogLevel()); dsProps.setProperty(DistributionConfig.ENABLE_CLUSTER_CONFIGURATION_NAME, "false"); keeper1.release(); @@ -123,9 +120,9 @@ public class GridAdvisorDUnitTest extends DistributedTestCase { new SerializableRunnable("Connect to " + locators) { public void run() { Properties props = new Properties(); - props.setProperty("mcast-port", "0"); - props.setProperty("locators", locators); - dsProps.setProperty("log-level", LogWriterUtils.getDUnitLogLevel()); + props.setProperty(MCAST_PORT, "0"); + props.setProperty(LOCATORS, locators); + dsProps.setProperty(DistributionConfig.LOG_LEVEL_NAME, LogWriterUtils.getDUnitLogLevel()); CacheFactory.create(DistributedSystem.connect(props)); } }; @@ -419,8 +416,8 @@ public class GridAdvisorDUnitTest extends DistributedTestCase { new SerializableRunnable("Disconnect from " + locators) { public void run() { Properties props = new Properties(); - props.setProperty("mcast-port", "0"); - props.setProperty("locators", locators); + props.setProperty(MCAST_PORT, "0"); + props.setProperty(LOCATORS, locators); DistributedSystem.connect(props).disconnect(); } }; @@ -594,9 +591,9 @@ public class GridAdvisorDUnitTest extends DistributedTestCase { + host0 + "[" + port2 + "]"; final Properties dsProps = new Properties(); - dsProps.setProperty("locators", locators); - dsProps.setProperty("mcast-port", "0"); - dsProps.setProperty("log-level", LogWriterUtils.getDUnitLogLevel()); + dsProps.setProperty(LOCATORS, locators); + dsProps.setProperty(MCAST_PORT, "0"); + dsProps.setProperty(DistributionConfig.LOG_LEVEL_NAME, LogWriterUtils.getDUnitLogLevel()); dsProps.setProperty(DistributionConfig.ENABLE_CLUSTER_CONFIGURATION_NAME, "false"); keeper1.release(); @@ -631,20 +628,20 @@ public class GridAdvisorDUnitTest extends DistributedTestCase { vm1.invoke(new SerializableRunnable("Connect to " + locators) { public void run() { Properties props = new Properties(); - props.setProperty("mcast-port", "0"); - props.setProperty("locators", locators); - props.setProperty("groups", "bs1Group1, bs1Group2"); - props.setProperty("log-level", LogWriterUtils.getDUnitLogLevel()); + props.setProperty(MCAST_PORT, "0"); + props.setProperty(LOCATORS, locators); + props.setProperty(DistributionConfig.GROUPS_NAME, "bs1Group1, bs1Group2"); + props.setProperty(DistributionConfig.LOG_LEVEL_NAME, LogWriterUtils.getDUnitLogLevel()); CacheFactory.create(DistributedSystem.connect(props)); } }); vm2.invoke(new SerializableRunnable("Connect to " + locators) { public void run() { Properties props = new Properties(); - props.setProperty("mcast-port", "0"); - props.setProperty("locators", locators); - props.setProperty("groups", "bs2Group1, bs2Group2"); - props.setProperty("log-level", LogWriterUtils.getDUnitLogLevel()); + props.setProperty(MCAST_PORT, "0"); + props.setProperty(LOCATORS, locators); + props.setProperty(DistributionConfig.GROUPS_NAME, "bs2Group1, bs2Group2"); + props.setProperty(DistributionConfig.LOG_LEVEL_NAME, LogWriterUtils.getDUnitLogLevel()); CacheFactory.create(DistributedSystem.connect(props)); } });
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/70612010/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/HAOverflowMemObjectSizerDUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/HAOverflowMemObjectSizerDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/HAOverflowMemObjectSizerDUnitTest.java index d4581b2..59ea3e7 100755 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/HAOverflowMemObjectSizerDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/HAOverflowMemObjectSizerDUnitTest.java @@ -19,17 +19,7 @@ */ package com.gemstone.gemfire.internal.cache; -import java.util.Iterator; -import java.util.Properties; -import java.util.Set; - -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.server.CacheServer; import com.gemstone.gemfire.cache30.ClientServerTestCase; import com.gemstone.gemfire.distributed.DistributedSystem; @@ -43,6 +33,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; + /** * Tests the size of clientUpdateMessageImpl with the size calculated by * {@link com.gemstone.gemfire.internal.cache.lru.MemLRUCapacityController} for HA overFlow @@ -159,8 +156,8 @@ public class HAOverflowMemObjectSizerDUnitTest extends DistributedTestCase { public static void createCacheClient(Integer port1, String host) throws Exception { Properties props = new Properties(); - props.setProperty("mcast-port", "0"); - props.setProperty("locators", ""); + props.setProperty(MCAST_PORT, "0"); + props.setProperty(LOCATORS, ""); new HAOverflowMemObjectSizerDUnitTest("temp").createCache(props); AttributesFactory factory = new AttributesFactory(); factory.setScope(Scope.DISTRIBUTED_ACK); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/70612010/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/IncrementalBackupDUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/IncrementalBackupDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/IncrementalBackupDUnitTest.java index 8091fe7..cbba60b 100644 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/IncrementalBackupDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/IncrementalBackupDUnitTest.java @@ -16,33 +16,14 @@ */ package com.gemstone.gemfire.internal.cache; -import java.io.BufferedReader; -import java.io.File; -import java.io.FileFilter; -import java.io.IOException; -import java.io.InputStreamReader; -import java.util.Collection; -import java.util.HashSet; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.gemstone.gemfire.admin.AdminDistributedSystem; -import com.gemstone.gemfire.admin.AdminDistributedSystemFactory; -import com.gemstone.gemfire.admin.AdminException; -import com.gemstone.gemfire.admin.BackupStatus; -import com.gemstone.gemfire.admin.DistributedSystemConfig; +import com.gemstone.gemfire.admin.*; import com.gemstone.gemfire.admin.internal.AdminDistributedSystemImpl; -import com.gemstone.gemfire.cache.Cache; -import com.gemstone.gemfire.cache.CacheFactory; -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.persistence.PersistentID; import com.gemstone.gemfire.cache30.CacheTestCase; import com.gemstone.gemfire.distributed.DistributedMember; import com.gemstone.gemfire.distributed.DistributedSystem; +import com.gemstone.gemfire.distributed.internal.DistributionConfig; import com.gemstone.gemfire.internal.ClassBuilder; import com.gemstone.gemfire.internal.FileUtil; import com.gemstone.gemfire.internal.JarClassLoader; @@ -50,13 +31,10 @@ import com.gemstone.gemfire.internal.JarDeployer; import com.gemstone.gemfire.internal.cache.persistence.BackupManager; import com.gemstone.gemfire.internal.util.IOUtils; import com.gemstone.gemfire.internal.util.TransformUtils; -import com.gemstone.gemfire.test.dunit.Host; -import com.gemstone.gemfire.test.dunit.LogWriterUtils; -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 java.io.*; +import java.util.*; /** * Tests for the incremental backup feature. @@ -89,7 +67,7 @@ public class IncrementalBackupDUnitTest extends CacheTestCase { private final SerializableRunnable createRegions = new SerializableRunnable() { @Override public void run() { - Cache cache = getCache(new CacheFactory().set("log-level", LogWriterUtils.getDUnitLogLevel())); + Cache cache = getCache(new CacheFactory().set(DistributionConfig.LOG_LEVEL_NAME, LogWriterUtils.getDUnitLogLevel())); cache.createDiskStoreFactory().setDiskDirs(getDiskDirs()).create("fooStore"); cache.createDiskStoreFactory().setDiskDirs(getDiskDirs()).create("barStore"); getRegionFactory(cache).setDiskStoreName("fooStore").create("fooRegion"); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/70612010/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/InterruptDiskJUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/InterruptDiskJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/InterruptDiskJUnitTest.java index 57372b2..4180a75 100644 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/InterruptDiskJUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/InterruptDiskJUnitTest.java @@ -16,30 +16,28 @@ */ package com.gemstone.gemfire.internal.cache; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.fail; - -import java.io.File; -import java.util.Properties; -import java.util.concurrent.Callable; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; -import java.util.concurrent.Future; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.atomic.AtomicLong; - -import org.junit.After; -import org.junit.Before; -import org.junit.Ignore; -import org.junit.Test; -import org.junit.experimental.categories.Category; - import com.gemstone.gemfire.cache.Cache; import com.gemstone.gemfire.cache.CacheFactory; import com.gemstone.gemfire.cache.Region; import com.gemstone.gemfire.cache.RegionShortcut; import com.gemstone.gemfire.distributed.DistributedSystem; +import com.gemstone.gemfire.distributed.internal.DistributionConfig; import com.gemstone.gemfire.test.junit.categories.IntegrationTest; +import org.junit.After; +import org.junit.Before; +import org.junit.Ignore; +import org.junit.Test; +import org.junit.experimental.categories.Category; + +import java.io.File; +import java.util.Properties; +import java.util.concurrent.*; +import java.util.concurrent.atomic.AtomicLong; + +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; /** * Test of interrupting threads doing disk writes to see the effect. @@ -72,12 +70,12 @@ public class InterruptDiskJUnitTest { @Before public void setUp() { Properties props = new Properties(); - props.setProperty("mcast-port", "0"); - props.setProperty("locators", ""); - props.setProperty("log-level", "config"); // to keep diskPerf logs smaller - props.setProperty("statistic-sampling-enabled", "true"); - props.setProperty("enable-time-statistics", "true"); - props.setProperty("statistic-archive-file", "stats.gfs"); + props.setProperty(MCAST_PORT, "0"); + props.setProperty(LOCATORS, ""); + props.setProperty(DistributionConfig.LOG_LEVEL_NAME, "config"); // to keep diskPerf logs smaller + props.setProperty(DistributionConfig.STATISTIC_SAMPLING_ENABLED_NAME, "true"); + props.setProperty(DistributionConfig.ENABLE_TIME_STATISTICS_NAME, "true"); + props.setProperty(DistributionConfig.STATISTIC_ARCHIVE_FILE_NAME, "stats.gfs"); ds = DistributedSystem.connect(props); cache = CacheFactory.create(ds); File diskStore = new File("diskStore"); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/70612010/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/InterruptsConserveSocketsFalseDUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/InterruptsConserveSocketsFalseDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/InterruptsConserveSocketsFalseDUnitTest.java index 0761962..eaa6f57 100644 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/InterruptsConserveSocketsFalseDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/InterruptsConserveSocketsFalseDUnitTest.java @@ -16,6 +16,8 @@ */ package com.gemstone.gemfire.internal.cache; +import com.gemstone.gemfire.distributed.internal.DistributionConfig; + import java.util.Properties; public class InterruptsConserveSocketsFalseDUnitTest extends @@ -28,7 +30,7 @@ public class InterruptsConserveSocketsFalseDUnitTest extends @Override public Properties getDistributedSystemProperties() { Properties props = super.getDistributedSystemProperties(); - props.setProperty("conserve-sockets", "false"); + props.setProperty(DistributionConfig.CONSERVE_SOCKETS_NAME, "false"); return props; } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/70612010/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/LIFOEvictionAlgoEnabledRegionJUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/LIFOEvictionAlgoEnabledRegionJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/LIFOEvictionAlgoEnabledRegionJUnitTest.java index 72cf04f..6e59e06 100755 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/LIFOEvictionAlgoEnabledRegionJUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/LIFOEvictionAlgoEnabledRegionJUnitTest.java @@ -16,34 +16,23 @@ */ package com.gemstone.gemfire.internal.cache; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; - -import java.io.File; -import java.util.Properties; - +import com.gemstone.gemfire.cache.*; +import com.gemstone.gemfire.distributed.DistributedSystem; +import com.gemstone.gemfire.distributed.internal.DistributionConfig; +import com.gemstone.gemfire.internal.cache.lru.LRUStatistics; +import com.gemstone.gemfire.internal.cache.lru.NewLRUClockHand; +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 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.DiskStoreFactory; -import com.gemstone.gemfire.cache.EvictionAction; -import com.gemstone.gemfire.cache.Region; -import com.gemstone.gemfire.cache.RegionAttributes; -import com.gemstone.gemfire.cache.Scope; -import com.gemstone.gemfire.distributed.DistributedSystem; -import com.gemstone.gemfire.internal.cache.lru.LRUStatistics; -import com.gemstone.gemfire.internal.cache.lru.NewLRUClockHand; -import com.gemstone.gemfire.test.junit.categories.IntegrationTest; +import java.io.File; +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.*; /** * This is a test verifies region is LIFO enabled by ENTRY COUNT verifies correct stats updating @@ -91,9 +80,9 @@ public class LIFOEvictionAlgoEnabledRegionJUnitTest { */ private static void initializeVM() throws Exception { Properties props = new Properties(); - props.setProperty("mcast-port", "0"); - props.setProperty("locators", ""); - props.setProperty("log-level", "info"); // to keep diskPerf logs smaller + props.setProperty(MCAST_PORT, "0"); + props.setProperty(LOCATORS, ""); + props.setProperty(DistributionConfig.LOG_LEVEL_NAME, "info"); // to keep diskPerf logs smaller distributedSystem = DistributedSystem.connect(props); cache = CacheFactory.create(distributedSystem); assertNotNull(cache); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/70612010/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/LIFOEvictionAlgoMemoryEnabledRegionJUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/LIFOEvictionAlgoMemoryEnabledRegionJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/LIFOEvictionAlgoMemoryEnabledRegionJUnitTest.java index 0460481..4376c88 100755 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/LIFOEvictionAlgoMemoryEnabledRegionJUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/LIFOEvictionAlgoMemoryEnabledRegionJUnitTest.java @@ -16,16 +16,14 @@ */ package com.gemstone.gemfire.internal.cache; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; - -import java.io.File; -import java.util.Arrays; -import java.util.Properties; - +import com.gemstone.gemfire.cache.*; +import com.gemstone.gemfire.distributed.DistributedSystem; +import com.gemstone.gemfire.distributed.internal.DistributionConfig; +import com.gemstone.gemfire.internal.cache.lru.EnableLRU; +import com.gemstone.gemfire.internal.cache.lru.LRUClockNode; +import com.gemstone.gemfire.internal.cache.lru.LRUStatistics; +import com.gemstone.gemfire.internal.cache.lru.NewLRUClockHand; +import com.gemstone.gemfire.test.junit.categories.IntegrationTest; import org.junit.After; import org.junit.Before; import org.junit.FixMethodOrder; @@ -33,21 +31,13 @@ import org.junit.Test; import org.junit.experimental.categories.Category; import org.junit.runners.MethodSorters; -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.DiskStoreFactory; -import com.gemstone.gemfire.cache.EvictionAction; -import com.gemstone.gemfire.cache.Region; -import com.gemstone.gemfire.cache.RegionAttributes; -import com.gemstone.gemfire.cache.Scope; -import com.gemstone.gemfire.distributed.DistributedSystem; -import com.gemstone.gemfire.internal.cache.lru.LRUStatistics; -import com.gemstone.gemfire.internal.cache.lru.NewLRUClockHand; -import com.gemstone.gemfire.test.junit.categories.IntegrationTest; -import com.gemstone.gemfire.internal.cache.lru.LRUClockNode; -import com.gemstone.gemfire.internal.cache.lru.EnableLRU; +import java.io.File; +import java.util.Arrays; +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.*; /** * This is a test verifies region is LIFO enabled by MEMORY verifies correct @@ -103,9 +93,9 @@ public class LIFOEvictionAlgoMemoryEnabledRegionJUnitTest { */ private static void initializeVM() throws Exception { Properties props = new Properties(); - props.setProperty("mcast-port", "0"); - props.setProperty("locators", ""); - props.setProperty("log-level", "info"); // to keep diskPerf logs smaller + props.setProperty(MCAST_PORT, "0"); + props.setProperty(LOCATORS, ""); + props.setProperty(DistributionConfig.LOG_LEVEL_NAME, "info"); // to keep diskPerf logs smaller distributedSystem = DistributedSystem.connect(props); cache = CacheFactory.create(distributedSystem); assertNotNull(cache); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/70612010/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/MapClearGIIDUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/MapClearGIIDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/MapClearGIIDUnitTest.java index 7c27e8f..b250cf0 100644 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/MapClearGIIDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/MapClearGIIDUnitTest.java @@ -21,26 +21,12 @@ */ package com.gemstone.gemfire.internal.cache; -import java.util.Properties; - -import com.gemstone.gemfire.cache.AttributesFactory; -import com.gemstone.gemfire.cache.CacheException; -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.cache30.CacheSerializableRunnable; import com.gemstone.gemfire.cache30.CacheTestCase; -import com.gemstone.gemfire.test.dunit.Assert; -import com.gemstone.gemfire.test.dunit.AsyncInvocation; -import com.gemstone.gemfire.test.dunit.Host; -import com.gemstone.gemfire.test.dunit.LogWriterUtils; -import com.gemstone.gemfire.test.dunit.SerializableRunnable; -import com.gemstone.gemfire.test.dunit.ThreadUtils; -import com.gemstone.gemfire.test.dunit.VM; -import com.gemstone.gemfire.test.dunit.Wait; -import com.gemstone.gemfire.test.dunit.WaitCriterion; +import com.gemstone.gemfire.test.dunit.*; + +import java.util.Properties; /** * @@ -76,7 +62,7 @@ public class MapClearGIIDUnitTest extends CacheTestCase { /* public static void createCacheVM0() throws Exception { InitialImageOperation.slowImageProcessing = 200; Properties mprops = new Properties(); - // mprops.setProperty("mcast-port", "7777"); + // mprops.setProperty(DistributionConfig.SystemConfigurationProperties.MCAST_PORT, "7777"); ds = (new MapClearGIIDUnitTest("Clear")).getSystem(mprops); //ds = DistributedSystem.connect(props); @@ -88,7 +74,7 @@ public class MapClearGIIDUnitTest extends CacheTestCase { public static void createCacheVM1() throws Exception { Properties mprops = new Properties(); - // mprops.setProperty("mcast-port", "7777"); + // mprops.setProperty(DistributionConfig.SystemConfigurationProperties.MCAST_PORT, "7777"); ds = (new MapClearGIIDUnitTest("Clear")).getSystem(mprops); // ds = DistributedSystem.connect(null); cache = CacheFactory.create(ds); @@ -187,7 +173,7 @@ public class MapClearGIIDUnitTest extends CacheTestCase { InitialImageOperation.slowImageProcessing = 10; InitialImageOperation.slowImageSleeps = 0; Properties mprops = new Properties(); - // mprops.setProperty("mcast-port", "7777"); + // mprops.setProperty(DistributionConfig.SystemConfigurationProperties.MCAST_PORT, "7777"); getSystem(mprops); //ds = DistributedSystem.connect(props); @@ -201,7 +187,7 @@ public class MapClearGIIDUnitTest extends CacheTestCase { public void run2() throws CacheException { Properties mprops = new Properties(); - // mprops.setProperty("mcast-port", "7777"); + // mprops.setProperty(DistributionConfig.SystemConfigurationProperties.MCAST_PORT, "7777"); getSystem(mprops); // ds = DistributedSystem.connect(null); getCache(); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/70612010/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/MapInterfaceJUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/MapInterfaceJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/MapInterfaceJUnitTest.java index e3a3324..7591e66 100755 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/MapInterfaceJUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/MapInterfaceJUnitTest.java @@ -16,30 +16,22 @@ */ package com.gemstone.gemfire.internal.cache; -import java.util.*; - -import org.junit.After; -import org.junit.Before; +import com.gemstone.gemfire.cache.*; +import com.gemstone.gemfire.cache.util.CacheWriterAdapter; +import com.gemstone.gemfire.distributed.DistributedSystem; +import com.gemstone.gemfire.test.junit.categories.IntegrationTest; +import junit.framework.Assert; import org.junit.Test; import org.junit.experimental.categories.Category; -import static org.junit.Assert.*; +import java.util.HashMap; +import java.util.Map; +import java.util.Properties; -import junit.framework.Assert; -import junit.framework.TestCase; - -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.RegionEvent; -import com.gemstone.gemfire.cache.Scope; -import com.gemstone.gemfire.cache.util.CacheWriterAdapter; -import com.gemstone.gemfire.distributed.DistributedSystem; -import com.gemstone.gemfire.test.junit.categories.IntegrationTest; +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; @Category(IntegrationTest.class) public class MapInterfaceJUnitTest { @@ -47,8 +39,8 @@ public class MapInterfaceJUnitTest { @Test public void testLocalClear() { Properties props = new Properties(); - props.setProperty("mcast-port", "0"); - props.setProperty("locators", ""); + props.setProperty(MCAST_PORT, "0"); + props.setProperty(LOCATORS, ""); DistributedSystem ds = DistributedSystem.connect(props); Cache cache = null; Region region = null; @@ -100,8 +92,8 @@ public class MapInterfaceJUnitTest { @Test public void testLocalPutAll() { Properties props = new Properties(); - props.setProperty("mcast-port", "0"); - props.setProperty("locators", ""); + props.setProperty(MCAST_PORT, "0"); + props.setProperty(LOCATORS, ""); DistributedSystem ds = DistributedSystem.connect(props); Cache cache = null; Region region = null; @@ -159,8 +151,8 @@ public class MapInterfaceJUnitTest { public void testBeforeRegionClearCallBack() { Properties props = new Properties(); - props.setProperty("mcast-port", "0"); - props.setProperty("locators", ""); + props.setProperty(MCAST_PORT, "0"); + props.setProperty(LOCATORS, ""); DistributedSystem ds = DistributedSystem.connect(props); Cache cache = null; Region region = null; @@ -231,8 +223,8 @@ public class MapInterfaceJUnitTest { public void testSetValue() { Properties props = new Properties(); - props.setProperty("mcast-port", "0"); - props.setProperty("locators", ""); + props.setProperty(MCAST_PORT, "0"); + props.setProperty(LOCATORS, ""); DistributedSystem ds = DistributedSystem.connect(props); Cache cache = null; http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/70612010/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/MultipleOplogsRollingFeatureJUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/MultipleOplogsRollingFeatureJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/MultipleOplogsRollingFeatureJUnitTest.java index 6ac9e60..4a5967e 100755 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/MultipleOplogsRollingFeatureJUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/MultipleOplogsRollingFeatureJUnitTest.java @@ -16,15 +16,15 @@ */ package com.gemstone.gemfire.internal.cache; +import com.gemstone.gemfire.cache.Scope; +import com.gemstone.gemfire.distributed.internal.DistributionConfig; +import com.gemstone.gemfire.test.junit.categories.IntegrationTest; import org.junit.After; import org.junit.Test; import org.junit.experimental.categories.Category; import static org.junit.Assert.*; -import com.gemstone.gemfire.cache.Scope; -import com.gemstone.gemfire.test.junit.categories.IntegrationTest; - /** * The test will verify <br> * 1. Multiple oplogs are being rolled at once <br> @@ -60,7 +60,7 @@ public class MultipleOplogsRollingFeatureJUnitTest extends @Test public void testMultipleRolling() { - System.setProperty("gemfire.MAX_OPLOGS_PER_COMPACTION", "17"); + System.setProperty(DistributionConfig.GEMFIRE_PREFIX + "MAX_OPLOGS_PER_COMPACTION", "17"); try { deleteFiles(); diskProps.setMaxOplogSize(450); @@ -157,7 +157,7 @@ public class MultipleOplogsRollingFeatureJUnitTest extends ex.printStackTrace(); fail("testMultipleRolling: test failed due to " + ex); } finally { - System.clearProperty("gemfire.MAX_OPLOGS_PER_COMPACTION"); + System.clearProperty(DistributionConfig.GEMFIRE_PREFIX + "MAX_OPLOGS_PER_COMPACTION"); } } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/70612010/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/NetSearchMessagingDUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/NetSearchMessagingDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/NetSearchMessagingDUnitTest.java index e0b8b2f..1b63aec 100644 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/NetSearchMessagingDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/NetSearchMessagingDUnitTest.java @@ -16,33 +16,15 @@ */ package com.gemstone.gemfire.internal.cache; -import org.junit.experimental.categories.Category; - -import com.gemstone.gemfire.cache.Cache; -import com.gemstone.gemfire.cache.DataPolicy; -import com.gemstone.gemfire.cache.EvictionAction; -import com.gemstone.gemfire.cache.EvictionAttributes; -import com.gemstone.gemfire.cache.InterestPolicy; -import com.gemstone.gemfire.cache.Region; -import com.gemstone.gemfire.cache.RegionFactory; -import com.gemstone.gemfire.cache.RegionShortcut; -import com.gemstone.gemfire.cache.Scope; -import com.gemstone.gemfire.cache.SubscriptionAttributes; +import com.gemstone.gemfire.cache.*; import com.gemstone.gemfire.cache30.CacheTestCase; -import com.gemstone.gemfire.distributed.internal.DistributionConfig; import com.gemstone.gemfire.distributed.internal.DistributionManager; import com.gemstone.gemfire.distributed.internal.DistributionMessage; import com.gemstone.gemfire.distributed.internal.DistributionMessageObserver; import com.gemstone.gemfire.internal.cache.SearchLoadAndWriteProcessor.NetSearchRequestMessage; -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.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.experimental.categories.Category; public class NetSearchMessagingDUnitTest extends CacheTestCase { http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/70612010/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/OffHeapEvictionDUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/OffHeapEvictionDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/OffHeapEvictionDUnitTest.java index d93aa89..e51a35c 100644 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/OffHeapEvictionDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/OffHeapEvictionDUnitTest.java @@ -16,8 +16,6 @@ */ package com.gemstone.gemfire.internal.cache; -import java.util.Properties; - import com.gemstone.gemfire.cache.CacheException; import com.gemstone.gemfire.cache.CacheFactory; import com.gemstone.gemfire.cache30.CacheSerializableRunnable; @@ -25,13 +23,9 @@ import com.gemstone.gemfire.distributed.DistributedSystem; import com.gemstone.gemfire.distributed.internal.DistributionConfig; import com.gemstone.gemfire.internal.cache.control.InternalResourceManager.ResourceType; import com.gemstone.gemfire.internal.cache.lru.HeapEvictor; -import com.gemstone.gemfire.test.dunit.Assert; -import com.gemstone.gemfire.test.dunit.Invoke; -import com.gemstone.gemfire.test.dunit.LogWriterUtils; -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 java.util.Properties; /** * Performs eviction dunit tests for off-heap memory. @@ -58,8 +52,8 @@ public class OffHeapEvictionDUnitTest extends EvictionDUnitTest { @Override public Properties getDistributedSystemProperties() { - Properties properties = super.getDistributedSystemProperties(); - properties.setProperty(DistributionConfig.OFF_HEAP_MEMORY_SIZE_NAME, "200m"); + Properties properties = super.getDistributedSystemProperties(); + properties.setProperty(DistributionConfig.OFF_HEAP_MEMORY_SIZE_NAME, "200m"); return properties; } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/70612010/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/OffHeapEvictionStatsDUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/OffHeapEvictionStatsDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/OffHeapEvictionStatsDUnitTest.java index 3fb883b..1fa1fca 100644 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/OffHeapEvictionStatsDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/OffHeapEvictionStatsDUnitTest.java @@ -16,8 +16,6 @@ */ package com.gemstone.gemfire.internal.cache; -import java.util.Properties; - import com.gemstone.gemfire.cache.CacheFactory; import com.gemstone.gemfire.distributed.DistributedSystem; import com.gemstone.gemfire.distributed.internal.DistributionConfig; @@ -26,6 +24,8 @@ import com.gemstone.gemfire.test.dunit.Invoke; import com.gemstone.gemfire.test.dunit.LogWriterUtils; import com.gemstone.gemfire.test.dunit.SerializableRunnable; +import java.util.Properties; + /** * Performs eviction stat dunit tests for off-heap regions. * @since Geode 1.0 @@ -54,8 +54,8 @@ public class OffHeapEvictionStatsDUnitTest extends EvictionStatsDUnitTest { @Override public Properties getDistributedSystemProperties() { - Properties properties = super.getDistributedSystemProperties(); - properties.setProperty(DistributionConfig.OFF_HEAP_MEMORY_SIZE_NAME, "100m"); + Properties properties = super.getDistributedSystemProperties(); + properties.setProperty(DistributionConfig.OFF_HEAP_MEMORY_SIZE_NAME, "100m"); return properties; } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/70612010/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/OfflineSnapshotJUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/OfflineSnapshotJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/OfflineSnapshotJUnitTest.java index 129d942..38123be 100644 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/OfflineSnapshotJUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/OfflineSnapshotJUnitTest.java @@ -16,21 +16,6 @@ */ package com.gemstone.gemfire.internal.cache; -import java.io.File; -import java.io.FilenameFilter; -import java.util.HashMap; -import java.util.Map; -import java.util.Map.Entry; - -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.examples.snapshot.MyObject; import com.examples.snapshot.MyPdxSerializer; import com.gemstone.gemfire.cache.Cache; @@ -40,9 +25,19 @@ import com.gemstone.gemfire.cache.Region; import com.gemstone.gemfire.cache.snapshot.RegionGenerator; import com.gemstone.gemfire.cache.snapshot.RegionGenerator.RegionType; import com.gemstone.gemfire.cache.snapshot.RegionGenerator.SerializationType; -import com.gemstone.gemfire.cache.snapshot.SnapshotIterator; -import com.gemstone.gemfire.cache.snapshot.SnapshotReader; +import com.gemstone.gemfire.distributed.internal.DistributionConfig; 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.File; +import java.io.FilenameFilter; +import java.util.HashMap; +import java.util.Map; + +import static com.gemstone.gemfire.distributed.SystemConfigurationProperties.MCAST_PORT; @Category(IntegrationTest.class) public class OfflineSnapshotJUnitTest { @@ -126,8 +121,8 @@ public class OfflineSnapshotJUnitTest { public void reset() { CacheFactory cf = new CacheFactory() - .set("mcast-port", "0") - .set("log-level", "error") + .set(MCAST_PORT, "0") + .set(DistributionConfig.LOG_LEVEL_NAME, "error") .setPdxSerializer(new MyPdxSerializer()) .setPdxPersistent(true); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/70612010/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/P2PDeltaPropagationDUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/P2PDeltaPropagationDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/P2PDeltaPropagationDUnitTest.java index 21f5c05..78b0d61 100755 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/P2PDeltaPropagationDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/P2PDeltaPropagationDUnitTest.java @@ -16,18 +16,8 @@ */ package com.gemstone.gemfire.internal.cache; -import java.util.Properties; - import com.gemstone.gemfire.DeltaTestImpl; -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.EntryEvent; -import com.gemstone.gemfire.cache.InterestPolicy; -import com.gemstone.gemfire.cache.Region; -import com.gemstone.gemfire.cache.Scope; -import com.gemstone.gemfire.cache.SubscriptionAttributes; +import com.gemstone.gemfire.cache.*; import com.gemstone.gemfire.cache.client.internal.PoolImpl; import com.gemstone.gemfire.cache.server.CacheServer; import com.gemstone.gemfire.cache.util.CacheListenerAdapter; @@ -39,6 +29,8 @@ import com.gemstone.gemfire.test.dunit.DistributedTestCase; import com.gemstone.gemfire.test.dunit.Host; import com.gemstone.gemfire.test.dunit.VM; +import java.util.Properties; + /** * * Tests the P2P delta propagation functionality. http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/70612010/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PRConcurrentMapOpsJUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PRConcurrentMapOpsJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PRConcurrentMapOpsJUnitTest.java index e1f6c50..e755dc0 100644 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PRConcurrentMapOpsJUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PRConcurrentMapOpsJUnitTest.java @@ -16,29 +16,18 @@ */ package com.gemstone.gemfire.internal.cache; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; - -import java.util.Properties; - +import com.gemstone.gemfire.cache.*; +import com.gemstone.gemfire.distributed.DistributedSystem; +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 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.PartitionAttributes; -import com.gemstone.gemfire.cache.PartitionAttributesFactory; -import com.gemstone.gemfire.cache.RegionAttributes; -import com.gemstone.gemfire.distributed.DistributedSystem; -import com.gemstone.gemfire.distributed.internal.DistributionConfig; -import com.gemstone.gemfire.test.junit.categories.IntegrationTest; +import java.util.Properties; + +import static com.gemstone.gemfire.distributed.SystemConfigurationProperties.MCAST_PORT; +import static org.junit.Assert.*; /** * Tests ConcurrentMap operations on a PartitionedRegion on a single node. @@ -88,7 +77,7 @@ public class PRConcurrentMapOpsJUnitTest { public void setUp() { if (cache == null) { Properties dsProps = new Properties(); - dsProps.setProperty(DistributionConfig.MCAST_PORT_NAME, "0"); + dsProps.setProperty(MCAST_PORT, "0"); // Connect to a DS and create a Cache. sys = DistributedSystem.connect(dsProps); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/70612010/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PRDataStoreMemoryJUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PRDataStoreMemoryJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PRDataStoreMemoryJUnitTest.java index 31c8db8..3a839f1 100644 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PRDataStoreMemoryJUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PRDataStoreMemoryJUnitTest.java @@ -16,26 +16,18 @@ */ package com.gemstone.gemfire.internal.cache; -import java.util.Properties; - +import com.gemstone.gemfire.cache.*; +import com.gemstone.gemfire.distributed.DistributedSystem; +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 static org.junit.Assert.*; - -import junit.framework.TestCase; +import java.util.Properties; -import com.gemstone.gemfire.cache.PartitionAttributesFactory; -import com.gemstone.gemfire.distributed.DistributedSystem; -import com.gemstone.gemfire.distributed.internal.DistributionConfig; -import com.gemstone.gemfire.cache.Cache; -import com.gemstone.gemfire.cache.CacheFactory; -import com.gemstone.gemfire.cache.CacheException; -import com.gemstone.gemfire.cache.PartitionAttributes; -import com.gemstone.gemfire.cache.RegionFactory; -import com.gemstone.gemfire.test.junit.categories.IntegrationTest; +import static com.gemstone.gemfire.distributed.SystemConfigurationProperties.MCAST_PORT; +import static org.junit.Assert.assertEquals; /** * Tests memory allocation operations on a PartitionedRegion on a single node. @@ -62,7 +54,7 @@ public class PRDataStoreMemoryJUnitTest { protected Properties getDistributedSystemProperties() { Properties dsProps = new Properties(); - dsProps.setProperty(DistributionConfig.MCAST_PORT_NAME, "0"); + dsProps.setProperty(MCAST_PORT, "0"); return dsProps; } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/70612010/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PRDataStoreMemoryOffHeapJUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PRDataStoreMemoryOffHeapJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PRDataStoreMemoryOffHeapJUnitTest.java index 5dbce01..597b7e8 100755 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PRDataStoreMemoryOffHeapJUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PRDataStoreMemoryOffHeapJUnitTest.java @@ -16,14 +16,12 @@ */ package com.gemstone.gemfire.internal.cache; -import java.util.Properties; - -import org.junit.experimental.categories.Category; - -import com.gemstone.gemfire.cache.CacheException; import com.gemstone.gemfire.cache.RegionFactory; import com.gemstone.gemfire.distributed.internal.DistributionConfig; import com.gemstone.gemfire.test.junit.categories.IntegrationTest; +import org.junit.experimental.categories.Category; + +import java.util.Properties; /** * Tests PartitionedRegion DataStore currentAllocatedMemory operation. http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/70612010/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionAPIConserveSocketsFalseDUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionAPIConserveSocketsFalseDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionAPIConserveSocketsFalseDUnitTest.java index 5529981..b0e1fe6 100644 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionAPIConserveSocketsFalseDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionAPIConserveSocketsFalseDUnitTest.java @@ -16,10 +16,10 @@ */ package com.gemstone.gemfire.internal.cache; -import java.util.Properties; - import com.gemstone.gemfire.distributed.internal.DistributionConfig; +import java.util.Properties; + /** * Test all the PartitionedRegion api calls when ConserveSockets is set to false * @since GemFire 5.0 http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/70612010/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionBucketCreationDistributionDUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionBucketCreationDistributionDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionBucketCreationDistributionDUnitTest.java index 749e451..d2309cd 100755 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionBucketCreationDistributionDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionBucketCreationDistributionDUnitTest.java @@ -16,38 +16,17 @@ */ package com.gemstone.gemfire.internal.cache; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Iterator; -import java.util.List; -import java.util.NoSuchElementException; -import java.util.Properties; -import java.util.Set; - -import com.gemstone.gemfire.cache.AttributesFactory; -import com.gemstone.gemfire.cache.Cache; -import com.gemstone.gemfire.cache.CacheException; -import com.gemstone.gemfire.cache.CacheExistsException; -import com.gemstone.gemfire.cache.CacheFactory; -import com.gemstone.gemfire.cache.MirrorType; -import com.gemstone.gemfire.cache.PartitionAttributes; -import com.gemstone.gemfire.cache.PartitionAttributesFactory; -import com.gemstone.gemfire.cache.PartitionedRegionStorageException; -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.cache30.CacheSerializableRunnable; import com.gemstone.gemfire.distributed.internal.DistributionConfig; import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem; import com.gemstone.gemfire.internal.cache.PartitionedRegionDataStore.BucketVisitor; -import com.gemstone.gemfire.test.dunit.Assert; -import com.gemstone.gemfire.test.dunit.AsyncInvocation; -import com.gemstone.gemfire.test.dunit.Host; -import com.gemstone.gemfire.test.dunit.Invoke; -import com.gemstone.gemfire.test.dunit.LogWriterUtils; -import com.gemstone.gemfire.test.dunit.SerializableRunnable; -import com.gemstone.gemfire.test.dunit.ThreadUtils; -import com.gemstone.gemfire.test.dunit.VM; +import com.gemstone.gemfire.test.dunit.*; + +import java.util.*; + +import static com.gemstone.gemfire.distributed.SystemConfigurationProperties.LOCATORS; +import static com.gemstone.gemfire.distributed.SystemConfigurationProperties.MCAST_PORT; /** * @@ -501,7 +480,7 @@ public class PartitionedRegionBucketCreationDistributionDUnitTest extends private final Cache createLonerCacheWithEnforceUniqueHost() { Cache myCache = null; try { - System.setProperty("gemfire.DISABLE_DISCONNECT_DS_ON_CACHE_CLOSE", "true"); + System.setProperty(DistributionConfig.GEMFIRE_PREFIX + "DISABLE_DISCONNECT_DS_ON_CACHE_CLOSE", "true"); myCache = CacheFactory.create(getLonerSystemWithEnforceUniqueHost()); } catch (CacheExistsException e) { Assert.fail("the cache already exists", e); @@ -512,7 +491,7 @@ public class PartitionedRegionBucketCreationDistributionDUnitTest extends } catch (Exception ex) { Assert.fail("Checked exception while initializing cache??", ex); } finally { - System.clearProperty("gemfire.DISABLE_DISCONNECT_DS_ON_CACHE_CLOSE"); + System.clearProperty(DistributionConfig.GEMFIRE_PREFIX + "DISABLE_DISCONNECT_DS_ON_CACHE_CLOSE"); } return myCache; } @@ -528,8 +507,8 @@ public class PartitionedRegionBucketCreationDistributionDUnitTest extends */ private final InternalDistributedSystem getLonerSystemWithEnforceUniqueHost() { Properties props = getDistributedSystemProperties(); - props.put(DistributionConfig.MCAST_PORT_NAME, "0"); - props.put(DistributionConfig.LOCATORS_NAME, ""); + props.put(MCAST_PORT, "0"); + props.put(LOCATORS, ""); props.put(DistributionConfig.ENFORCE_UNIQUE_HOST_NAME, "true"); props.put(DistributionConfig.REDUNDANCY_ZONE_NAME, "zone1"); return getSystem(props); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/70612010/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionCacheXMLExampleDUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionCacheXMLExampleDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionCacheXMLExampleDUnitTest.java index 8503b43..25aeccb 100755 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionCacheXMLExampleDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionCacheXMLExampleDUnitTest.java @@ -16,16 +16,17 @@ */ package com.gemstone.gemfire.internal.cache; -import java.util.Properties; - +import com.gemstone.gemfire.cache.Cache; import com.gemstone.gemfire.cache.CacheException; +import com.gemstone.gemfire.cache.Region; import com.gemstone.gemfire.cache30.CacheSerializableRunnable; +import com.gemstone.gemfire.distributed.internal.DistributionConfig; import com.gemstone.gemfire.test.dunit.Host; import com.gemstone.gemfire.test.dunit.VM; -import com.gemstone.gemfire.cache.Cache; -import com.gemstone.gemfire.cache.Region; import com.gemstone.gemfire.util.test.TestUtil; +import java.util.Properties; + /** * This class tests regions created by xml files */ @@ -49,8 +50,8 @@ public class PartitionedRegionCacheXMLExampleDUnitTest extends Properties props = new Properties(); String xmlfilepath = TestUtil.getResourcePath(getClass(), "PartitionRegionCacheExample1.xml"); - props.setProperty("cache-xml-file", xmlfilepath); - + props.setProperty(DistributionConfig.CACHE_XML_FILE_NAME, xmlfilepath); + getSystem(props); cache = getCache(); } @@ -104,7 +105,7 @@ public class PartitionedRegionCacheXMLExampleDUnitTest extends Properties props = new Properties(); String xmlfilepath = TestUtil.getResourcePath(getClass(), "PartitionRegionCacheExample2.xml"); - props.setProperty("cache-xml-file", xmlfilepath); + props.setProperty(DistributionConfig.CACHE_XML_FILE_NAME, xmlfilepath); getSystem(props); cache = getCache(); } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/70612010/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionDataStoreJUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionDataStoreJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionDataStoreJUnitTest.java index ed73991..2a5f4a1 100644 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionDataStoreJUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionDataStoreJUnitTest.java @@ -16,41 +16,23 @@ */ package com.gemstone.gemfire.internal.cache; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; - -import java.util.Properties; - +import com.gemstone.gemfire.cache.*; +import com.gemstone.gemfire.cache.partition.PartitionRegionHelper; +import com.gemstone.gemfire.distributed.DistributedSystem; +import com.gemstone.gemfire.internal.cache.partitioned.PartitionedRegionObserverAdapter; +import com.gemstone.gemfire.internal.cache.partitioned.PartitionedRegionObserverHolder; +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.util.Properties; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; -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.CacheLoader; -import com.gemstone.gemfire.cache.CacheLoaderException; -import com.gemstone.gemfire.cache.LoaderHelper; -import com.gemstone.gemfire.cache.PartitionAttributes; -import com.gemstone.gemfire.cache.PartitionAttributesFactory; -import com.gemstone.gemfire.cache.RegionAttributes; -import com.gemstone.gemfire.cache.RegionFactory; -import com.gemstone.gemfire.distributed.DistributedSystem; -import com.gemstone.gemfire.distributed.internal.DistributionConfig; -import com.gemstone.gemfire.test.junit.categories.IntegrationTest; -import com.gemstone.gemfire.cache.RegionShortcut; -import com.gemstone.gemfire.cache.partition.PartitionRegionHelper; -import com.gemstone.gemfire.distributed.DistributedSystem; -import com.gemstone.gemfire.distributed.internal.DistributionConfig; -import com.gemstone.gemfire.internal.logging.InternalLogWriter; -import com.gemstone.gemfire.internal.logging.PureLogWriter; -import com.gemstone.gemfire.internal.cache.partitioned.PartitionedRegionObserverAdapter; -import com.gemstone.gemfire.internal.cache.partitioned.PartitionedRegionObserverHolder; +import static com.gemstone.gemfire.distributed.SystemConfigurationProperties.MCAST_PORT; +import static org.junit.Assert.*; /** * This test checks functionality of the PartitionedRegionDatastore on a sinle @@ -75,7 +57,7 @@ public class PartitionedRegionDataStoreJUnitTest @Before public void setUp() { Properties dsProps = new Properties(); - dsProps.setProperty(DistributionConfig.MCAST_PORT_NAME, "0"); + dsProps.setProperty(MCAST_PORT, "0"); // Connect to a DS and create a Cache. sys = DistributedSystem.connect(dsProps); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/70612010/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionEvictionDUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionEvictionDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionEvictionDUnitTest.java index ce10abb..4e36ea8 100755 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionEvictionDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionEvictionDUnitTest.java @@ -16,43 +16,24 @@ */ package com.gemstone.gemfire.internal.cache; -import java.io.File; -import java.util.Iterator; -import java.util.Map; -import java.util.Properties; -import java.util.concurrent.TimeUnit; - -import com.gemstone.gemfire.cache.AttributesFactory; -import com.gemstone.gemfire.cache.CacheException; -import com.gemstone.gemfire.cache.CacheListener; -import com.gemstone.gemfire.cache.DiskStore; -import com.gemstone.gemfire.cache.DiskStoreFactory; -import com.gemstone.gemfire.cache.EntryEvent; -import com.gemstone.gemfire.cache.EvictionAction; -import com.gemstone.gemfire.cache.EvictionAttributes; -import com.gemstone.gemfire.cache.InterestPolicy; -import com.gemstone.gemfire.cache.Operation; -import com.gemstone.gemfire.cache.PartitionAttributes; -import com.gemstone.gemfire.cache.PartitionAttributesFactory; -import com.gemstone.gemfire.cache.Region; -import com.gemstone.gemfire.cache.RegionAttributes; -import com.gemstone.gemfire.cache.SubscriptionAttributes; +import com.gemstone.gemfire.cache.*; import com.gemstone.gemfire.cache.util.CacheListenerAdapter; import com.gemstone.gemfire.cache.util.ObjectSizerImpl; import com.gemstone.gemfire.cache30.CacheSerializableRunnable; import com.gemstone.gemfire.cache30.CacheTestCase; +import com.gemstone.gemfire.distributed.internal.DistributionConfig; import com.gemstone.gemfire.internal.OSProcess; import com.gemstone.gemfire.internal.cache.control.HeapMemoryMonitor; import com.gemstone.gemfire.internal.cache.control.InternalResourceManager.ResourceType; import com.gemstone.gemfire.internal.cache.lru.HeapEvictor; import com.gemstone.gemfire.internal.cache.lru.HeapLRUCapacityController; -import com.gemstone.gemfire.test.dunit.Assert; -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 java.io.File; +import java.util.Iterator; +import java.util.Map; +import java.util.Properties; +import java.util.concurrent.TimeUnit; public class PartitionedRegionEvictionDUnitTest extends CacheTestCase { public PartitionedRegionEvictionDUnitTest(final String name) { @@ -190,7 +171,7 @@ public class PartitionedRegionEvictionDUnitTest extends CacheTestCase { protected void raiseFakeNotification() { ((GemFireCacheImpl) getCache()).getHeapEvictor().testAbortAfterLoopCount = 1; HeapMemoryMonitor.setTestDisableMemoryUpdates(true); - System.setProperty("gemfire.memoryEventTolerance", "0"); + System.setProperty(DistributionConfig.GEMFIRE_PREFIX + "memoryEventTolerance", "0"); setEvictionPercentage(85); HeapMemoryMonitor hmm = ((GemFireCacheImpl) getCache()).getResourceManager().getHeapMonitor(); @@ -202,7 +183,7 @@ public class PartitionedRegionEvictionDUnitTest extends CacheTestCase { protected void cleanUpAfterFakeNotification() { ((GemFireCacheImpl) getCache()).getHeapEvictor().testAbortAfterLoopCount = Integer.MAX_VALUE; HeapMemoryMonitor.setTestDisableMemoryUpdates(false); - System.clearProperty("gemfire.memoryEventTolerance"); + System.clearProperty(DistributionConfig.GEMFIRE_PREFIX + "memoryEventTolerance"); } public void testHeapLRUWithLocalDestroy() { http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/70612010/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionLocalMaxMemoryOffHeapDUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionLocalMaxMemoryOffHeapDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionLocalMaxMemoryOffHeapDUnitTest.java index da894a4..246a862 100755 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionLocalMaxMemoryOffHeapDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionLocalMaxMemoryOffHeapDUnitTest.java @@ -16,8 +16,6 @@ */ package com.gemstone.gemfire.internal.cache; -import java.util.Properties; - import com.gemstone.gemfire.cache.AttributesFactory; import com.gemstone.gemfire.cache.EvictionAttributes; import com.gemstone.gemfire.cache.RegionAttributes; @@ -25,6 +23,8 @@ import com.gemstone.gemfire.distributed.internal.DistributionConfig; import com.gemstone.gemfire.test.dunit.Invoke; import com.gemstone.gemfire.test.dunit.SerializableRunnable; +import java.util.Properties; + /** * Tests PartitionedRegion localMaxMemory with Off-Heap memory. * http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/70612010/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionOffHeapEvictionDUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionOffHeapEvictionDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionOffHeapEvictionDUnitTest.java index 48f88e8..e1ae38a 100644 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionOffHeapEvictionDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionOffHeapEvictionDUnitTest.java @@ -16,8 +16,6 @@ */ package com.gemstone.gemfire.internal.cache; -import java.util.Properties; - import com.gemstone.gemfire.cache.Region; import com.gemstone.gemfire.distributed.internal.DistributionConfig; import com.gemstone.gemfire.internal.cache.control.InternalResourceManager.ResourceType; @@ -26,6 +24,8 @@ import com.gemstone.gemfire.internal.cache.lru.HeapEvictor; import com.gemstone.gemfire.test.dunit.Invoke; import com.gemstone.gemfire.test.dunit.SerializableRunnable; +import java.util.Properties; + public class PartitionedRegionOffHeapEvictionDUnitTest extends PartitionedRegionEvictionDUnitTest { @@ -50,8 +50,8 @@ public class PartitionedRegionOffHeapEvictionDUnitTest extends @Override public Properties getDistributedSystemProperties() { - Properties properties = super.getDistributedSystemProperties(); - properties.setProperty(DistributionConfig.OFF_HEAP_MEMORY_SIZE_NAME, "100m"); + Properties properties = super.getDistributedSystemProperties(); + properties.setProperty(DistributionConfig.OFF_HEAP_MEMORY_SIZE_NAME, "100m"); return properties; } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/70612010/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionRedundancyZoneDUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionRedundancyZoneDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionRedundancyZoneDUnitTest.java index a2dafbf..b661b3e 100644 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionRedundancyZoneDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionRedundancyZoneDUnitTest.java @@ -16,14 +16,7 @@ */ package com.gemstone.gemfire.internal.cache; -import java.util.Properties; - -import com.gemstone.gemfire.cache.AttributesFactory; -import com.gemstone.gemfire.cache.Cache; -import com.gemstone.gemfire.cache.DataPolicy; -import com.gemstone.gemfire.cache.PartitionAttributes; -import com.gemstone.gemfire.cache.PartitionAttributesFactory; -import com.gemstone.gemfire.cache.Region; +import com.gemstone.gemfire.cache.*; import com.gemstone.gemfire.cache30.CacheTestCase; import com.gemstone.gemfire.distributed.DistributedMember; import com.gemstone.gemfire.distributed.DistributedSystem; @@ -33,6 +26,8 @@ import com.gemstone.gemfire.test.dunit.SerializableCallable; import com.gemstone.gemfire.test.dunit.SerializableRunnable; import com.gemstone.gemfire.test.dunit.VM; +import java.util.Properties; + public class PartitionedRegionRedundancyZoneDUnitTest extends CacheTestCase { @Override http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/70612010/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionSingleHopDUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionSingleHopDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionSingleHopDUnitTest.java index 65cc7eb..f358be0 100755 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionSingleHopDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionSingleHopDUnitTest.java @@ -16,38 +16,9 @@ */ package com.gemstone.gemfire.internal.cache; -import java.io.DataInput; -import java.io.DataOutput; -import java.io.File; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Properties; -import java.util.Set; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.TimeUnit; - -import com.jayway.awaitility.Awaitility; -import org.jgroups.blocks.locking.AwaitInfo; -import org.junit.Ignore; -import org.junit.experimental.categories.Category; - import com.gemstone.gemfire.DataSerializable; import com.gemstone.gemfire.DataSerializer; -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.DiskStore; -import com.gemstone.gemfire.cache.PartitionAttributesFactory; -import com.gemstone.gemfire.cache.Region; -import com.gemstone.gemfire.cache.RegionAttributes; -import com.gemstone.gemfire.cache.Scope; +import com.gemstone.gemfire.cache.*; import com.gemstone.gemfire.cache.client.Pool; import com.gemstone.gemfire.cache.client.PoolManager; import com.gemstone.gemfire.cache.client.internal.ClientMetadataService; @@ -69,17 +40,23 @@ import com.gemstone.gemfire.internal.cache.execute.data.CustId; import com.gemstone.gemfire.internal.cache.execute.data.OrderId; import com.gemstone.gemfire.internal.cache.execute.data.ShipmentId; import com.gemstone.gemfire.internal.cache.tier.sockets.CacheServerTestUtil; -import com.gemstone.gemfire.test.dunit.Assert; -import com.gemstone.gemfire.test.dunit.AsyncInvocation; -import com.gemstone.gemfire.test.dunit.DistributedTestUtils; -import com.gemstone.gemfire.test.dunit.Host; -import com.gemstone.gemfire.test.dunit.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 com.gemstone.gemfire.test.junit.categories.FlakyTest; +import com.jayway.awaitility.Awaitility; +import org.junit.Ignore; +import org.junit.experimental.categories.Category; + +import java.io.DataInput; +import java.io.DataOutput; +import java.io.File; +import java.io.IOException; +import java.util.*; +import java.util.Map.Entry; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.TimeUnit; + +import static com.gemstone.gemfire.distributed.SystemConfigurationProperties.LOCATORS; +import static com.gemstone.gemfire.distributed.SystemConfigurationProperties.MCAST_PORT; public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase { @@ -176,7 +153,7 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase { Properties props = new Properties(); props = new Properties(); - props.setProperty("locators", locString); + props.setProperty(LOCATORS, locString); CacheTestCase test = new PartitionedRegionSingleHopDUnitTest( "PartitionedRegionSingleHopDUnitTest"); DistributedSystem ds = test.getSystem(props); @@ -1103,8 +1080,8 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase { public static void createClientWithoutPRSingleHopEnabled(int port0) { Properties props = new Properties(); props = new Properties(); - props.setProperty("mcast-port", "0"); - props.setProperty("locators", ""); + props.setProperty(MCAST_PORT, "0"); + props.setProperty(LOCATORS, ""); CacheTestCase test = new PartitionedRegionSingleHopDUnitTest( "PartitionedRegionSingleHopDUnitTest"); DistributedSystem ds = test.getSystem(props); @@ -1585,8 +1562,8 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase { public static void createClient(int port0) { Properties props = new Properties(); props = new Properties(); - props.setProperty("mcast-port", "0"); - props.setProperty("locators", ""); + props.setProperty(MCAST_PORT, "0"); + props.setProperty(LOCATORS, ""); CacheTestCase test = new PartitionedRegionSingleHopDUnitTest( "PartitionedRegionSingleHopDUnitTest"); DistributedSystem ds = test.getSystem(props); @@ -1611,8 +1588,8 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase { public static void createClient(int port0, int port1) { Properties props = new Properties(); props = new Properties(); - props.setProperty("mcast-port", "0"); - props.setProperty("locators", ""); + props.setProperty(MCAST_PORT, "0"); + props.setProperty(LOCATORS, ""); CacheTestCase test = new PartitionedRegionSingleHopDUnitTest( "PartitionedRegionSingleHopDUnitTest"); DistributedSystem ds = test.getSystem(props); @@ -1637,8 +1614,8 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase { public static void createClientWithLocator(String host, int port0) { Properties props = new Properties(); props = new Properties(); - props.setProperty("mcast-port", "0"); - props.setProperty("locators", ""); + props.setProperty(MCAST_PORT, "0"); + props.setProperty(LOCATORS, ""); CacheTestCase test = new PartitionedRegionSingleHopDUnitTest( "PartitionedRegionSingleHopDUnitTest"); DistributedSystem ds = test.getSystem(props); @@ -1662,8 +1639,8 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase { public static void createClient(int port0, int port1, int port2, int port3) { Properties props = new Properties(); props = new Properties(); - props.setProperty("mcast-port", "0"); - props.setProperty("locators", ""); + props.setProperty(MCAST_PORT, "0"); + props.setProperty(LOCATORS, ""); CacheTestCase test = new PartitionedRegionSingleHopDUnitTest( "PartitionedRegionSingleHopDUnitTest"); DistributedSystem ds = test.getSystem(props); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/70612010/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionSingleHopWithServerGroupDUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionSingleHopWithServerGroupDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionSingleHopWithServerGroupDUnitTest.java index 2680d04..d2b319b 100644 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionSingleHopWithServerGroupDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionSingleHopWithServerGroupDUnitTest.java @@ -19,18 +19,11 @@ */ package com.gemstone.gemfire.internal.cache; -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.PartitionAttributesFactory; -import com.gemstone.gemfire.cache.Region; -import com.gemstone.gemfire.cache.RegionAttributes; +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.ClientMetadataService; import com.gemstone.gemfire.cache.client.internal.ClientPartitionAdvisor; -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.distributed.DistributedSystem; @@ -41,19 +34,8 @@ import com.gemstone.gemfire.internal.cache.execute.data.CustId; import com.gemstone.gemfire.internal.cache.execute.data.OrderId; import com.gemstone.gemfire.internal.cache.execute.data.ShipmentId; import com.gemstone.gemfire.internal.cache.tier.sockets.CacheServerTestUtil; -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.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 java.io.File; +import com.gemstone.gemfire.test.dunit.*; + import java.io.IOException; import java.util.List; import java.util.Map; @@ -61,6 +43,9 @@ import java.util.Map.Entry; import java.util.Properties; import java.util.StringTokenizer; +import static com.gemstone.gemfire.distributed.SystemConfigurationProperties.LOCATORS; +import static com.gemstone.gemfire.distributed.SystemConfigurationProperties.MCAST_PORT; + /** * */ @@ -802,9 +787,9 @@ public class PartitionedRegionSingleHopWithServerGroupDUnitTest extends CacheTes Properties props = new Properties(); props = new Properties(); - props.setProperty("locators", locator); - - System.setProperty("gemfire.PoolImpl.honourServerGroupsInPRSingleHop", "true"); + props.setProperty(LOCATORS, locator); + + System.setProperty(DistributionConfig.GEMFIRE_PREFIX + "PoolImpl.honourServerGroupsInPRSingleHop", "true"); CacheTestCase test = new PartitionedRegionSingleHopWithServerGroupDUnitTest( "PartitionedRegionSingleHopWithServerGroupDUnitTest"); DistributedSystem ds = test.getSystem(props); @@ -888,9 +873,9 @@ public class PartitionedRegionSingleHopWithServerGroupDUnitTest extends CacheTes Properties props = new Properties(); props = new Properties(); - props.setProperty("locators", locator); - - System.setProperty("gemfire.PoolImpl.honourServerGroupsInPRSingleHop", "true"); + props.setProperty(LOCATORS, locator); + + System.setProperty(DistributionConfig.GEMFIRE_PREFIX + "PoolImpl.honourServerGroupsInPRSingleHop", "true"); CacheTestCase test = new PartitionedRegionSingleHopWithServerGroupDUnitTest( "PartitionedRegionSingleHopWithServerGroupDUnitTest"); DistributedSystem ds = test.getSystem(props); @@ -1025,8 +1010,8 @@ public class PartitionedRegionSingleHopWithServerGroupDUnitTest extends CacheTes public static void createClientWithLocator(String host, int port0, String group) { Properties props = new 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.LOG_FILE_NAME, ""); CacheTestCase test = new PartitionedRegionSingleHopWithServerGroupDUnitTest( "PartitionedRegionSingleHopWithServerGroupDUnitTest"); @@ -1051,8 +1036,8 @@ public class PartitionedRegionSingleHopWithServerGroupDUnitTest extends CacheTes public static void create2ClientWithLocator(String host, int port0, String group1, String group2) { Properties props = new Properties(); props = new Properties(); - props.setProperty("mcast-port", "0"); - props.setProperty("locators", ""); + props.setProperty(MCAST_PORT, "0"); + props.setProperty(LOCATORS, ""); CacheTestCase test = new PartitionedRegionSingleHopWithServerGroupDUnitTest( "PartitionedRegionSingleHopWithServerGroupDUnitTest"); DistributedSystem ds = test.getSystem(props); @@ -1080,8 +1065,8 @@ public class PartitionedRegionSingleHopWithServerGroupDUnitTest extends CacheTes public static void createClientWith3PoolLocator(String host, int port0, String group1, String group2,String group3) { Properties props = new Properties(); props = new Properties(); - props.setProperty("mcast-port", "0"); - props.setProperty("locators", ""); + props.setProperty(MCAST_PORT, "0"); + props.setProperty(LOCATORS, ""); CacheTestCase test = new PartitionedRegionSingleHopWithServerGroupDUnitTest( "PartitionedRegionSingleHopWithServerGroupDUnitTest"); DistributedSystem ds = test.getSystem(props); @@ -1339,8 +1324,8 @@ public class PartitionedRegionSingleHopWithServerGroupDUnitTest extends CacheTes public static void createClientWithLocatorWithoutSystemProperty(String host, int port0, String group) { Properties props = new Properties(); props = new Properties(); - props.setProperty("mcast-port", "0"); - props.setProperty("locators", ""); + props.setProperty(MCAST_PORT, "0"); + props.setProperty(LOCATORS, ""); CacheTestCase test = new PartitionedRegionSingleHopWithServerGroupDUnitTest( "PartitionedRegionSingleHopWithServerGroupDUnitTest"); DistributedSystem ds = test.getSystem(props); @@ -1636,7 +1621,7 @@ public class PartitionedRegionSingleHopWithServerGroupDUnitTest extends CacheTes public static void startLocatorInVM(final int locatorPort) { Properties props = new Properties(); - props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0"); + props.setProperty(MCAST_PORT, "0"); props.setProperty(DistributionConfig.ENABLE_CLUSTER_CONFIGURATION_NAME, "false"); props.setProperty(DistributionConfig.LOG_FILE_NAME, ""); @@ -1654,10 +1639,10 @@ public class PartitionedRegionSingleHopWithServerGroupDUnitTest extends CacheTes } public static void resetHonourServerGroupsInPRSingleHop() { - System.setProperty("gemfire.PoolImpl.honourServerGroupsInPRSingleHop", "False"); + System.setProperty(DistributionConfig.GEMFIRE_PREFIX + "PoolImpl.honourServerGroupsInPRSingleHop", "False"); } public static void setHonourServerGroupsInPRSingleHop() { - System.setProperty("gemfire.PoolImpl.honourServerGroupsInPRSingleHop", "True"); + System.setProperty(DistributionConfig.GEMFIRE_PREFIX + "PoolImpl.honourServerGroupsInPRSingleHop", "True"); } } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/70612010/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionTestHelper.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionTestHelper.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionTestHelper.java index d4b489a..b434565 100644 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionTestHelper.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionTestHelper.java @@ -16,28 +16,18 @@ */ package com.gemstone.gemfire.internal.cache; -import java.io.Serializable; -import java.util.Properties; - -import org.junit.Assert; - import com.gemstone.gemfire.LogWriter; -import com.gemstone.gemfire.cache.AttributesFactory; -import com.gemstone.gemfire.cache.Cache; -import com.gemstone.gemfire.cache.CacheExistsException; -import com.gemstone.gemfire.cache.CacheFactory; -import com.gemstone.gemfire.cache.DataPolicy; -import com.gemstone.gemfire.cache.EvictionAttributes; -import com.gemstone.gemfire.cache.PartitionAttributes; -import com.gemstone.gemfire.cache.PartitionAttributesFactory; -import com.gemstone.gemfire.cache.PartitionResolver; -import com.gemstone.gemfire.cache.Region; -import com.gemstone.gemfire.cache.RegionAttributes; -import com.gemstone.gemfire.cache.RegionExistsException; -import com.gemstone.gemfire.cache.Scope; -import com.gemstone.gemfire.distributed.DistributedSystem; +import com.gemstone.gemfire.cache.*; import com.gemstone.gemfire.cache.query.SelectResults; import com.gemstone.gemfire.cache.query.types.ObjectType; +import com.gemstone.gemfire.distributed.DistributedSystem; +import org.junit.Assert; + +import java.io.Serializable; +import java.util.Properties; + +import static com.gemstone.gemfire.distributed.SystemConfigurationProperties.LOCATORS; +import static com.gemstone.gemfire.distributed.SystemConfigurationProperties.MCAST_PORT; /** @@ -214,8 +204,8 @@ public class PartitionedRegionTestHelper { if (cache == null) { Properties dsp = new Properties(); - dsp.setProperty("mcast-port", "0"); - dsp.setProperty("locators", ""); + dsp.setProperty(MCAST_PORT, "0"); + dsp.setProperty(LOCATORS, ""); DistributedSystem sys = DistributedSystem.connect(dsp); try { cache = CacheFactory.create(sys);
