http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/70612010/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ClientServerInvalidAndDestroyedEntryDUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ClientServerInvalidAndDestroyedEntryDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ClientServerInvalidAndDestroyedEntryDUnitTest.java index 7846723..5881066 100755 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ClientServerInvalidAndDestroyedEntryDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ClientServerInvalidAndDestroyedEntryDUnitTest.java @@ -16,20 +16,8 @@ */ package com.gemstone.gemfire.internal.cache; -import java.io.IOException; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; - import com.gemstone.gemfire.LogWriter; -import com.gemstone.gemfire.cache.Cache; -import com.gemstone.gemfire.cache.EntryEvent; -import com.gemstone.gemfire.cache.InterestResultPolicy; -import com.gemstone.gemfire.cache.Operation; -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.ClientCache; import com.gemstone.gemfire.cache.client.ClientCacheFactory; import com.gemstone.gemfire.cache.client.ClientRegionShortcut; @@ -39,13 +27,12 @@ import com.gemstone.gemfire.cache30.CacheTestCase; import com.gemstone.gemfire.distributed.internal.DistributionConfig; import com.gemstone.gemfire.internal.AvailablePortHelper; import com.gemstone.gemfire.internal.cache.tier.InterestType; -import com.gemstone.gemfire.test.dunit.Assert; -import com.gemstone.gemfire.test.dunit.Host; -import com.gemstone.gemfire.test.dunit.LogWriterUtils; -import com.gemstone.gemfire.test.dunit.SerializableCallable; -import com.gemstone.gemfire.test.dunit.SerializableCallableIF; -import com.gemstone.gemfire.test.dunit.SerializableRunnable; -import com.gemstone.gemfire.test.dunit.VM; +import com.gemstone.gemfire.test.dunit.*; + +import java.io.IOException; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; /** * This tests the fix for bug #43407 under a variety of configurations and
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/70612010/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ClientServerTransactionDUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ClientServerTransactionDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ClientServerTransactionDUnitTest.java index 672c5e6..d49b116 100644 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ClientServerTransactionDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ClientServerTransactionDUnitTest.java @@ -16,68 +16,16 @@ */ package com.gemstone.gemfire.internal.cache; -import static com.gemstone.gemfire.test.dunit.LogWriterUtils.*; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Properties; -import java.util.Set; -import java.util.concurrent.CountDownLatch; -import java.util.concurrent.TimeUnit; - -import javax.naming.Context; -import javax.transaction.UserTransaction; - -import com.gemstone.gemfire.cache.AttributesFactory; -import com.gemstone.gemfire.cache.Cache; -import com.gemstone.gemfire.cache.CacheFactory; -import com.gemstone.gemfire.cache.CacheListener; -import com.gemstone.gemfire.cache.CacheLoader; -import com.gemstone.gemfire.cache.CacheLoaderException; -import com.gemstone.gemfire.cache.CacheTransactionManager; -import com.gemstone.gemfire.cache.CacheWriterException; -import com.gemstone.gemfire.cache.CommitConflictException; -import com.gemstone.gemfire.cache.DataPolicy; -import com.gemstone.gemfire.cache.EntryEvent; -import com.gemstone.gemfire.cache.InterestPolicy; -import com.gemstone.gemfire.cache.LoaderHelper; -import com.gemstone.gemfire.cache.Region; +import com.gemstone.gemfire.cache.*; import com.gemstone.gemfire.cache.Region.Entry; -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.TransactionDataNodeHasDepartedException; -import com.gemstone.gemfire.cache.TransactionDataNotColocatedException; -import com.gemstone.gemfire.cache.TransactionEvent; -import com.gemstone.gemfire.cache.TransactionException; -import com.gemstone.gemfire.cache.TransactionId; -import com.gemstone.gemfire.cache.TransactionInDoubtException; -import com.gemstone.gemfire.cache.TransactionWriter; -import com.gemstone.gemfire.cache.TransactionWriterException; -import com.gemstone.gemfire.cache.UnsupportedOperationInTransactionException; -import com.gemstone.gemfire.cache.client.ClientCache; -import com.gemstone.gemfire.cache.client.ClientCacheFactory; -import com.gemstone.gemfire.cache.client.ClientRegionFactory; -import com.gemstone.gemfire.cache.client.ClientRegionShortcut; -import com.gemstone.gemfire.cache.client.PoolFactory; -import com.gemstone.gemfire.cache.client.PoolManager; -import com.gemstone.gemfire.cache.execute.Execution; -import com.gemstone.gemfire.cache.execute.FunctionAdapter; -import com.gemstone.gemfire.cache.execute.FunctionContext; -import com.gemstone.gemfire.cache.execute.FunctionException; -import com.gemstone.gemfire.cache.execute.FunctionService; -import com.gemstone.gemfire.cache.execute.RegionFunctionContext; +import com.gemstone.gemfire.cache.client.*; +import com.gemstone.gemfire.cache.execute.*; import com.gemstone.gemfire.cache.server.CacheServer; import com.gemstone.gemfire.cache.util.CacheListenerAdapter; import com.gemstone.gemfire.cache.util.CacheWriterAdapter; import com.gemstone.gemfire.cache.util.TransactionListenerAdapter; import com.gemstone.gemfire.distributed.DistributedMember; -import com.gemstone.gemfire.distributed.DistributedSystem; +import com.gemstone.gemfire.distributed.internal.DistributionConfig; import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem; import com.gemstone.gemfire.distributed.internal.membership.InternalDistributedMember; import com.gemstone.gemfire.internal.AvailablePort; @@ -86,13 +34,18 @@ 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.tx.ClientTXStateStub; -import com.gemstone.gemfire.test.dunit.Host; -import com.gemstone.gemfire.test.dunit.IgnoredException; -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 javax.naming.Context; +import javax.transaction.UserTransaction; +import java.util.*; +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.gemstone.gemfire.test.dunit.LogWriterUtils.getDUnitLogLevel; +import static com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter; /** * Tests the basic client-server transaction functionality @@ -151,8 +104,8 @@ public class ClientServerTransactionDUnitTest extends RemoteTransactionDUnitTest af.setScope(Scope.DISTRIBUTED_ACK); af.setDataPolicy(DataPolicy.REPLICATE); Properties props = getDistributedSystemProperties(); - props.put("mcast-port", "0"); - props.remove("locators"); + props.put(MCAST_PORT, "0"); + props.remove(LOCATORS); InternalDistributedSystem system = getSystem(props); Cache cache = CacheFactory.create(system); cache.createRegion(OTHER_REGION,af.create()); @@ -194,7 +147,7 @@ public class ClientServerTransactionDUnitTest extends RemoteTransactionDUnitTest ClientCacheFactory ccf = new ClientCacheFactory(); ccf.addPoolServer("localhost"/*getServerHostName(Host.getHost(0))*/, port); ccf.setPoolSubscriptionEnabled(false); - ccf.set("log-level", getDUnitLogLevel()); + ccf.set(DistributionConfig.LOG_LEVEL_NAME, getDUnitLogLevel()); // these settings were used to manually check that tx operation stats were being updated //ccf.set(DistributionConfig.STATISTIC_SAMPLING_ENABLED_NAME, "true"); //ccf.set(DistributionConfig.STATISTIC_ARCHIVE_FILE_NAME, "clientStats.gfs"); @@ -249,12 +202,12 @@ public class ClientServerTransactionDUnitTest extends RemoteTransactionDUnitTest disconnectAllFromDS(); // some other VMs seem to be hanging around and have the region this tests uses final int port1 = createRegionsAndStartServer(datastore1, false); - System.setProperty("gemfire.bridge.disableShufflingOfEndpoints", "true"); + System.setProperty(DistributionConfig.GEMFIRE_PREFIX + "bridge.disableShufflingOfEndpoints", "true"); ClientCacheFactory ccf = new ClientCacheFactory(); ccf.addPoolServer("localhost"/*getServerHostName(Host.getHost(0))*/, port1); ccf.setPoolSubscriptionEnabled(false); - ccf.set("log-level", getDUnitLogLevel()); + ccf.set(DistributionConfig.LOG_LEVEL_NAME, getDUnitLogLevel()); ClientCache cCache = getClientCache(ccf); @@ -321,11 +274,11 @@ public class ClientServerTransactionDUnitTest extends RemoteTransactionDUnitTest final int port1 = createRegionsAndStartServer(accessor, true); createRegionOnServer(datastore, false, false); - System.setProperty("gemfire.bridge.disableShufflingOfEndpoints", "true"); + System.setProperty(DistributionConfig.GEMFIRE_PREFIX + "bridge.disableShufflingOfEndpoints", "true"); ClientCacheFactory ccf = new ClientCacheFactory(); ccf.addPoolServer("localhost"/*getServerHostName(Host.getHost(0))*/, port1); ccf.setPoolSubscriptionEnabled(false); - ccf.set("log-level", getDUnitLogLevel()); + ccf.set(DistributionConfig.LOG_LEVEL_NAME, getDUnitLogLevel()); ClientCache cCache = getClientCache(ccf); ClientRegionFactory<CustId, Customer> custrf = cCache .createClientRegionFactory(cachingProxy ? ClientRegionShortcut.CACHING_PROXY : ClientRegionShortcut.PROXY); @@ -1380,7 +1333,7 @@ public void testClientCommitAndDataStoreGetsEvent() throws Exception { ClientCacheFactory ccf = new ClientCacheFactory(); ccf.addPoolServer("localhost"/*getServerHostName(Host.getHost(0))*/, port1); ccf.setPoolSubscriptionEnabled(false); - ccf.set("log-level", getDUnitLogLevel()); + ccf.set(DistributionConfig.LOG_LEVEL_NAME, getDUnitLogLevel()); ClientCache cCache = getClientCache(ccf); ClientRegionFactory<CustId, Customer> custrf = cCache .createClientRegionFactory(ClientRegionShortcut.PROXY); @@ -1476,7 +1429,7 @@ public void testClientCommitAndDataStoreGetsEvent() throws Exception { ccf.addPoolServer("localhost", port2); ccf.setPoolLoadConditioningInterval(1); ccf.setPoolSubscriptionEnabled(false); - ccf.set("log-level", getDUnitLogLevel()); + ccf.set(DistributionConfig.LOG_LEVEL_NAME, getDUnitLogLevel()); ClientCache cCache = getClientCache(ccf); ClientRegionFactory<CustId, Customer> custrf = cCache .createClientRegionFactory(ClientRegionShortcut.PROXY); @@ -1587,13 +1540,13 @@ public void testClientCommitAndDataStoreGetsEvent() throws Exception { /*final TXId txid = (TXId) */client.invoke(new SerializableCallable() { public Object call() throws Exception { - System.setProperty("gemfire.bridge.disableShufflingOfEndpoints", "true"); + System.setProperty(DistributionConfig.GEMFIRE_PREFIX + "bridge.disableShufflingOfEndpoints", "true"); ClientCacheFactory ccf = new ClientCacheFactory(); ccf.addPoolServer("localhost"/*getServerHostName(Host.getHost(0))*/, port1); if (port2 != 0) ccf.addPoolServer("localhost", port2); if (port3 != 0) ccf.addPoolServer("localhost", port3); ccf.setPoolSubscriptionEnabled(false); - ccf.set("log-level", getDUnitLogLevel()); + ccf.set(DistributionConfig.LOG_LEVEL_NAME, getDUnitLogLevel()); ClientCache cCache = getClientCache(ccf); ClientRegionFactory<CustId, Customer> custrf = cCache .createClientRegionFactory(cachingProxy ? ClientRegionShortcut.CACHING_PROXY : ClientRegionShortcut.PROXY); @@ -2105,7 +2058,7 @@ public void testClientCommitAndDataStoreGetsEvent() throws Exception { ccf.addPoolServer("localhost", port2); ccf.setPoolSubscriptionEnabled(false); ccf.setPoolLoadConditioningInterval(1); - ccf.set("log-level", getDUnitLogLevel()); + ccf.set(DistributionConfig.LOG_LEVEL_NAME, getDUnitLogLevel()); ClientCache cCache = getClientCache(ccf); ClientRegionFactory<CustId, Customer> custrf = cCache .createClientRegionFactory(ClientRegionShortcut.PROXY); @@ -2491,14 +2444,14 @@ public void testClientCommitAndDataStoreGetsEvent() throws Exception { client.invoke(new SerializableCallable() { public Object call() throws Exception { disconnectFromDS(); - System.setProperty("gemfire.bridge.disableShufflingOfEndpoints", "true"); + System.setProperty(DistributionConfig.GEMFIRE_PREFIX + "bridge.disableShufflingOfEndpoints", "true"); ClientCacheFactory ccf = new ClientCacheFactory(); ccf.addPoolServer("localhost"/*getServerHostName(Host.getHost(0))*/, port1); ccf.addPoolServer("localhost", port2); ccf.setPoolMinConnections(5); ccf.setPoolLoadConditioningInterval(-1); ccf.setPoolSubscriptionEnabled(false); - ccf.set("log-level", getDUnitLogLevel()); + ccf.set(DistributionConfig.LOG_LEVEL_NAME, getDUnitLogLevel()); ClientCache cCache = getClientCache(ccf); Region r1 = cCache.createClientRegionFactory(ClientRegionShortcut.CACHING_PROXY).create("r1"); Region r2 = cCache.createClientRegionFactory(ClientRegionShortcut.CACHING_PROXY).create("r2"); @@ -2541,12 +2494,12 @@ public void testClientCommitAndDataStoreGetsEvent() throws Exception { txState.setAfterSend(new Runnable() { public void run() { getCache().getLogger().info("SWAP:closing cache"); - System.setProperty("gemfire.no-flush-on-close", "true"); + System.setProperty(DistributionConfig.GEMFIRE_PREFIX + "no-flush-on-close", "true"); try { mgr.removeHostedTXState((TXId) txState.getTransactionId()); getCache().close(); } finally { - System.getProperties().remove("gemfire.no-flush-on-close"); + System.getProperties().remove(DistributionConfig.GEMFIRE_PREFIX + "no-flush-on-close"); } } }); @@ -2726,12 +2679,12 @@ public void testClientCommitAndDataStoreGetsEvent() throws Exception { try { client.invoke(new SerializableCallable() { public Object call() throws Exception { - System.setProperty("gemfire.bridge.disableShufflingOfEndpoints", "true"); + System.setProperty(DistributionConfig.GEMFIRE_PREFIX + "bridge.disableShufflingOfEndpoints", "true"); ClientCacheFactory ccf = new ClientCacheFactory(); ccf.addPoolServer("localhost"/*getServerHostName(Host.getHost(0))*/, port); ccf.addPoolServer("localhost", port2); ccf.setPoolSubscriptionEnabled(false); - ccf.set("log-level", getDUnitLogLevel()); + ccf.set(DistributionConfig.LOG_LEVEL_NAME, getDUnitLogLevel()); // these settings were used to manually check that tx operation stats were being updated //ccf.set(DistributionConfig.STATISTIC_SAMPLING_ENABLED_NAME, "true"); //ccf.set(DistributionConfig.STATISTIC_ARCHIVE_FILE_NAME, "clientStats.gfs"); @@ -3028,12 +2981,12 @@ public void testClientCommitAndDataStoreGetsEvent() throws Exception { final TXId txid = (TXId) client.invoke(new SerializableCallable() { @Override public Object call() throws Exception { - System.setProperty("gemfire.bridge.disableShufflingOfEndpoints", "true"); + System.setProperty(DistributionConfig.GEMFIRE_PREFIX + "bridge.disableShufflingOfEndpoints", "true"); ClientCacheFactory ccf = new ClientCacheFactory(); ccf.addPoolServer("localhost"/*getServerHostName(Host.getHost(0))*/, port1); if (port2 != 0) ccf.addPoolServer("localhost", port2); ccf.setPoolSubscriptionEnabled(false); - ccf.set("log-level", getDUnitLogLevel()); + ccf.set(DistributionConfig.LOG_LEVEL_NAME, getDUnitLogLevel()); ClientCache cCache = getClientCache(ccf); ClientRegionFactory<CustId, Customer> custrf = cCache .createClientRegionFactory(ClientRegionShortcut.CACHING_PROXY); @@ -3168,13 +3121,13 @@ public void testClientCommitAndDataStoreGetsEvent() throws Exception { /*final TXId txid = (TXId) */client.invoke(new SerializableCallable() { public Object call() throws Exception { - System.setProperty("gemfire.bridge.disableShufflingOfEndpoints", "true"); + System.setProperty(DistributionConfig.GEMFIRE_PREFIX + "bridge.disableShufflingOfEndpoints", "true"); ClientCacheFactory ccf = new ClientCacheFactory(); ccf.addPoolServer("localhost"/*getServerHostName(Host.getHost(0))*/, port1); ccf.addPoolServer("localhost", port2); ccf.setPoolMinConnections(0); ccf.setPoolSubscriptionEnabled(false); - ccf.set("log-level", getDUnitLogLevel()); + ccf.set(DistributionConfig.LOG_LEVEL_NAME, getDUnitLogLevel()); ClientCache cCache = getClientCache(ccf); ClientRegionFactory<CustId, Customer> custrf = cCache .createClientRegionFactory(ClientRegionShortcut.CACHING_PROXY); @@ -3257,12 +3210,12 @@ public void testClientCommitAndDataStoreGetsEvent() throws Exception { /*final TXId txid = (TXId) */client.invoke(new SerializableCallable() { public Object call() throws Exception { - System.setProperty("gemfire.bridge.disableShufflingOfEndpoints", "true"); + System.setProperty(DistributionConfig.GEMFIRE_PREFIX + "bridge.disableShufflingOfEndpoints", "true"); ClientCacheFactory ccf = new ClientCacheFactory(); ccf.addPoolServer("localhost"/*getServerHostName(Host.getHost(0))*/, port1); ccf.setPoolMinConnections(0); ccf.setPoolSubscriptionEnabled(false); - ccf.set("log-level", getDUnitLogLevel()); + ccf.set(DistributionConfig.LOG_LEVEL_NAME, getDUnitLogLevel()); ClientCache cCache = getClientCache(ccf); ClientRegionFactory<CustId, Customer> custrf = cCache .createClientRegionFactory(ClientRegionShortcut.CACHING_PROXY); @@ -3346,13 +3299,13 @@ public void testClientCommitAndDataStoreGetsEvent() throws Exception { client2.invoke(new SerializableCallable() { @Override public Object call() throws Exception { - System.setProperty("gemfire.bridge.disableShufflingOfEndpoints", "true"); + System.setProperty(DistributionConfig.GEMFIRE_PREFIX + "bridge.disableShufflingOfEndpoints", "true"); ClientCacheFactory ccf = new ClientCacheFactory(); ccf.addPoolServer("localhost"/*getServerHostName(Host.getHost(0))*/, port2); ccf.setPoolMinConnections(0); ccf.setPoolSubscriptionEnabled(true); ccf.setPoolSubscriptionRedundancy(0); - ccf.set("log-level", getDUnitLogLevel()); + ccf.set(DistributionConfig.LOG_LEVEL_NAME, getDUnitLogLevel()); ClientCache cCache = getClientCache(ccf); Region r = cCache.createClientRegionFactory(ClientRegionShortcut.CACHING_PROXY).addCacheListener(new ClientListener()).create(regionName); r.registerInterestRegex(".*"); @@ -3363,12 +3316,12 @@ public void testClientCommitAndDataStoreGetsEvent() throws Exception { client1.invoke(new SerializableCallable() { @Override public Object call() throws Exception { - System.setProperty("gemfire.bridge.disableShufflingOfEndpoints", "true"); + System.setProperty(DistributionConfig.GEMFIRE_PREFIX + "bridge.disableShufflingOfEndpoints", "true"); ClientCacheFactory ccf = new ClientCacheFactory(); ccf.addPoolServer("localhost"/*getServerHostName(Host.getHost(0))*/, port1); ccf.setPoolMinConnections(0); ccf.setPoolSubscriptionEnabled(true); - ccf.set("log-level", getDUnitLogLevel()); + ccf.set(DistributionConfig.LOG_LEVEL_NAME, getDUnitLogLevel()); ClientCache cCache = getClientCache(ccf); Region r = cCache.createClientRegionFactory(ClientRegionShortcut.CACHING_PROXY).create(regionName); getCache().getCacheTransactionManager().begin(); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/70612010/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ConcurrentMapLocalJUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ConcurrentMapLocalJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ConcurrentMapLocalJUnitTest.java index 587aa55..4aabc5c 100644 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ConcurrentMapLocalJUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ConcurrentMapLocalJUnitTest.java @@ -16,26 +16,17 @@ */ package com.gemstone.gemfire.internal.cache; -import java.util.Properties; - +import com.gemstone.gemfire.cache.*; +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 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.RegionShortcut; -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.test.junit.categories.IntegrationTest; - -import junit.framework.TestCase; +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 ConcurrentMapLocalJUnitTest { @@ -44,7 +35,7 @@ public class ConcurrentMapLocalJUnitTest { @Before public void setUp() throws Exception { - this.cache = new CacheFactory().set("mcast-port", "0").set("locators", "").create(); + this.cache = new CacheFactory().set(MCAST_PORT, "0").set(LOCATORS, "").create(); } @After http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/70612010/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ConcurrentMapOpsDUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ConcurrentMapOpsDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ConcurrentMapOpsDUnitTest.java index da2cc95..8a1586c 100644 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ConcurrentMapOpsDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ConcurrentMapOpsDUnitTest.java @@ -19,24 +19,9 @@ */ package com.gemstone.gemfire.internal.cache; -import java.io.DataInput; -import java.io.DataOutput; -import java.io.IOException; -import java.io.Serializable; -import java.util.HashSet; -import java.util.Set; -import java.util.concurrent.atomic.AtomicInteger; - -import junit.framework.AssertionFailedError; - import com.gemstone.gemfire.Delta; import com.gemstone.gemfire.InvalidDeltaException; -import com.gemstone.gemfire.cache.CacheListener; -import com.gemstone.gemfire.cache.EntryEvent; -import com.gemstone.gemfire.cache.Operation; -import com.gemstone.gemfire.cache.Region; -import com.gemstone.gemfire.cache.RegionEvent; -import com.gemstone.gemfire.cache.RegionShortcut; +import com.gemstone.gemfire.cache.*; import com.gemstone.gemfire.cache.client.ClientCache; import com.gemstone.gemfire.cache.client.ClientCacheFactory; import com.gemstone.gemfire.cache.client.ClientRegionFactory; @@ -46,17 +31,20 @@ import com.gemstone.gemfire.cache.server.CacheServer; import com.gemstone.gemfire.cache.util.CacheListenerAdapter; import com.gemstone.gemfire.cache30.CacheTestCase; import com.gemstone.gemfire.distributed.DistributedMember; +import com.gemstone.gemfire.distributed.internal.DistributionConfig; import com.gemstone.gemfire.distributed.internal.membership.MembershipManager; import com.gemstone.gemfire.distributed.internal.membership.gms.MembershipManagerHelper; import com.gemstone.gemfire.internal.AvailablePort; -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 junit.framework.AssertionFailedError; + +import java.io.DataInput; +import java.io.DataOutput; +import java.io.IOException; +import java.io.Serializable; +import java.util.HashSet; +import java.util.Set; +import java.util.concurrent.atomic.AtomicInteger; /** * tests for the concurrentMapOperations. there are more tests in ClientServerMiscDUnitTest @@ -147,7 +135,7 @@ public class ConcurrentMapOpsDUnitTest extends CacheTestCase { ccf.addPoolServer("localhost", port2); } ccf.setPoolSubscriptionEnabled(true); - ccf.set("log-level", LogWriterUtils.getDUnitLogLevel()); + ccf.set(DistributionConfig.LOG_LEVEL_NAME, LogWriterUtils.getDUnitLogLevel()); ClientCache cCache = getClientCache(ccf); ClientRegionFactory<Integer, String> crf = cCache .createClientRegionFactory(isEmpty ? ClientRegionShortcut.PROXY http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/70612010/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ConnectDisconnectDUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ConnectDisconnectDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ConnectDisconnectDUnitTest.java index 680fa84..b6d5a12 100755 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ConnectDisconnectDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ConnectDisconnectDUnitTest.java @@ -16,35 +16,14 @@ */ package com.gemstone.gemfire.internal.cache; -import java.io.File; -import java.io.IOException; -import java.net.InetAddress; -import java.util.List; -import java.util.Properties; - -import org.jgroups.protocols.UDP; - -import com.gemstone.gemfire.cache.TimeoutException; -import com.gemstone.gemfire.cache30.CacheSerializableRunnable; import com.gemstone.gemfire.cache30.CacheTestCase; -import com.gemstone.gemfire.distributed.DistributedSystem; -import com.gemstone.gemfire.distributed.Locator; import com.gemstone.gemfire.distributed.internal.DistributionConfig; -import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem; -import com.gemstone.gemfire.distributed.internal.membership.MembershipManager; -import com.gemstone.gemfire.distributed.internal.membership.gms.MembershipManagerHelper; -import com.gemstone.gemfire.distributed.internal.membership.gms.messenger.JGroupsMessenger; -import com.gemstone.gemfire.distributed.internal.membership.gms.mgr.GMSMembershipManager; -import com.gemstone.gemfire.internal.AvailablePort; -import com.gemstone.gemfire.internal.AvailablePortHelper; -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.SerializableRunnable; -import com.gemstone.gemfire.test.dunit.VM; -import com.gemstone.gemfire.test.dunit.IgnoredException; -import com.gemstone.gemfire.test.dunit.LogWriterUtils; +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.START_LOCATOR; /** A test of 46438 - missing response to an update attributes message */ public class ConnectDisconnectDUnitTest extends CacheTestCase { @@ -172,11 +151,11 @@ public class ConnectDisconnectDUnitTest extends CacheTestCase { @Override public Properties getDistributedSystemProperties() { Properties props = super.getDistributedSystemProperties(); - props.setProperty("log-level", "info"); - props.setProperty("conserve-sockets", "false"); + props.setProperty(DistributionConfig.LOG_LEVEL_NAME, "info"); + props.setProperty(DistributionConfig.CONSERVE_SOCKETS_NAME, "false"); if (LOCATOR_PORT > 0) { - props.setProperty("start-locator", "localhost["+LOCATOR_PORT+"]"); - props.setProperty("locators", LOCATORS_STRING); + props.setProperty(START_LOCATOR, "localhost[" + LOCATOR_PORT + "]"); + props.setProperty(LOCATORS, LOCATORS_STRING); } return props; } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/70612010/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DeltaPropagationDUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DeltaPropagationDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DeltaPropagationDUnitTest.java index 48f994b..7624d12 100755 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DeltaPropagationDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DeltaPropagationDUnitTest.java @@ -19,27 +19,10 @@ */ package com.gemstone.gemfire.internal.cache; -import java.io.File; -import java.util.Properties; - import com.gemstone.gemfire.DeltaTestImpl; import com.gemstone.gemfire.InvalidDeltaException; import com.gemstone.gemfire.LogWriter; -import com.gemstone.gemfire.cache.AttributesFactory; -import com.gemstone.gemfire.cache.Cache; -import com.gemstone.gemfire.cache.CacheFactory; -import com.gemstone.gemfire.cache.CacheListener; -import com.gemstone.gemfire.cache.DataPolicy; -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.ExpirationAttributes; -import com.gemstone.gemfire.cache.Operation; -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.PoolFactory; import com.gemstone.gemfire.cache.client.PoolManager; @@ -59,12 +42,13 @@ import com.gemstone.gemfire.internal.cache.lru.EnableLRU; import com.gemstone.gemfire.internal.cache.tier.sockets.CacheServerTestUtil; import com.gemstone.gemfire.internal.cache.tier.sockets.ConflationDUnitTest; import com.gemstone.gemfire.internal.tcp.ConnectionTable; -import com.gemstone.gemfire.test.dunit.DistributedTestCase; -import com.gemstone.gemfire.test.dunit.Host; -import com.gemstone.gemfire.test.dunit.SerializableRunnable; -import com.gemstone.gemfire.test.dunit.VM; -import com.gemstone.gemfire.test.dunit.Wait; -import com.gemstone.gemfire.test.dunit.WaitCriterion; +import com.gemstone.gemfire.test.dunit.*; + +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; /** * @since GemFire 6.1 @@ -663,8 +647,8 @@ public class DeltaPropagationDUnitTest extends DistributedTestCase { ((PoolFactoryImpl)pf).getPoolAttributes(); 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, String.valueOf(60)); @@ -736,8 +720,8 @@ public class DeltaPropagationDUnitTest extends DistributedTestCase { ((PoolFactoryImpl)pf).getPoolAttributes(); 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, String.valueOf(60)); @@ -1328,8 +1312,8 @@ public class DeltaPropagationDUnitTest extends DistributedTestCase { CacheServerTestUtil.disableShufflingOfEndpoints(); Properties props = new Properties(); - props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0"); - props.setProperty(DistributionConfig.LOCATORS_NAME, ""); + props.setProperty(MCAST_PORT, "0"); + props.setProperty(LOCATORS, ""); props.setProperty(DistributionConfig.CLIENT_CONFLATION_PROP_NAME, conflate); new DeltaPropagationDUnitTest("temp").createCache(props); AttributesFactory factory = new AttributesFactory(); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/70612010/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DeltaPropagationStatsDUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DeltaPropagationStatsDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DeltaPropagationStatsDUnitTest.java index dd97ab6..5469948 100755 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DeltaPropagationStatsDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DeltaPropagationStatsDUnitTest.java @@ -19,18 +19,9 @@ */ package com.gemstone.gemfire.internal.cache; -import java.util.Properties; - import com.gemstone.gemfire.DeltaTestImpl; import com.gemstone.gemfire.InvalidDeltaException; -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.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; @@ -42,12 +33,12 @@ import com.gemstone.gemfire.internal.AvailablePort; import com.gemstone.gemfire.internal.cache.tier.sockets.CacheClientNotifier; import com.gemstone.gemfire.internal.cache.tier.sockets.CacheClientProxy; import com.gemstone.gemfire.internal.tcp.ConnectionTable; -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; /** * @@ -522,8 +513,8 @@ public class DeltaPropagationStatsDUnitTest extends DistributedTestCase { public static void createClientCache(String host, Integer port) 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, ""); cache = new DeltaPropagationStatsDUnitTest("temp").createCache(props); pool = PoolManager.createFactory().addServer(host, port) .setThreadLocalConnections(true).setMinConnections(1) http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/70612010/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskOfflineCompactionJUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskOfflineCompactionJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskOfflineCompactionJUnitTest.java index 4ab4544..d57f706 100644 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskOfflineCompactionJUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskOfflineCompactionJUnitTest.java @@ -16,38 +16,26 @@ */ package com.gemstone.gemfire.internal.cache; -import java.io.File; -import java.io.IOException; -import java.util.Properties; - -import org.junit.After; -import org.junit.Before; -import org.junit.Test; +import com.gemstone.gemfire.cache.*; +import com.gemstone.gemfire.distributed.DistributedSystem; +import com.gemstone.gemfire.distributed.internal.DistributionConfig; +import com.gemstone.gemfire.internal.HeapDataOutputStream; +import com.gemstone.gemfire.internal.InternalDataSerializer; +import com.gemstone.gemfire.internal.Version; +import com.gemstone.gemfire.internal.cache.versions.RegionVersionHolder; +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 static org.junit.Assert.*; - -import com.gemstone.gemfire.internal.Version; - -import junit.framework.TestCase; +import java.io.File; +import java.io.IOException; +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.DiskStore; -import com.gemstone.gemfire.cache.DiskStoreFactory; -import com.gemstone.gemfire.cache.Region; -import com.gemstone.gemfire.distributed.DistributedSystem; -import com.gemstone.gemfire.internal.HeapDataOutputStream; -import com.gemstone.gemfire.internal.InternalDataSerializer; -import com.gemstone.gemfire.internal.cache.versions.RegionVersionHolder; -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; /** * Tests offline compaction @@ -74,12 +62,12 @@ public class DiskOfflineCompactionJUnitTest private void connectDSandCache() throws Exception { 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); } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/70612010/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskOldAPIsJUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskOldAPIsJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskOldAPIsJUnitTest.java index 7d2cc99..316813d 100644 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskOldAPIsJUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskOldAPIsJUnitTest.java @@ -16,22 +16,23 @@ */ package com.gemstone.gemfire.internal.cache; -import java.io.*; -import java.util.*; - +import com.gemstone.gemfire.cache.*; +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.Test; import org.junit.experimental.categories.Category; -import static org.junit.Assert.*; - -import com.gemstone.gemfire.cache.*; -import com.gemstone.gemfire.internal.Assert; -import com.gemstone.gemfire.distributed.*; -import com.gemstone.gemfire.test.junit.categories.IntegrationTest; +import java.io.File; +import java.util.Properties; +import java.util.Set; -import junit.framework.TestCase; +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.assertTrue; /** * Tests the old disk apis to make sure they do the correct thing. @@ -49,12 +50,12 @@ public class DiskOldAPIsJUnitTest protected static Properties props = new Properties(); static { - 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"); } @Before http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/70612010/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegCacheXmlJUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegCacheXmlJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegCacheXmlJUnitTest.java index 9669ef6..b1a67e3 100644 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegCacheXmlJUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegCacheXmlJUnitTest.java @@ -16,24 +16,25 @@ */ package com.gemstone.gemfire.internal.cache; -import java.io.File; -import java.util.*; - -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.*; - import com.gemstone.gemfire.SystemFailure; import com.gemstone.gemfire.cache.*; import com.gemstone.gemfire.distributed.DistributedSystem; +import com.gemstone.gemfire.distributed.SystemConfigurationProperties; import com.gemstone.gemfire.distributed.internal.DistributionConfig; -import com.gemstone.gemfire.util.test.TestUtil; import com.gemstone.gemfire.test.junit.categories.IntegrationTest; +import com.gemstone.gemfire.util.test.TestUtil; +import org.junit.After; +import org.junit.Test; +import org.junit.experimental.categories.Category; + +import java.io.File; +import java.util.Arrays; +import java.util.Iterator; +import java.util.Properties; + +import static com.gemstone.gemfire.distributed.SystemConfigurationProperties.MCAST_PORT; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; /** * This test is for testing Disk attributes set via xml. @@ -69,10 +70,10 @@ public class DiskRegCacheXmlJUnitTest dirs[2] = file3; // Connect to the GemFire distributed system Properties props = new Properties(); - props.setProperty(DistributionConfig.NAME_NAME, "test"); + props.setProperty(SystemConfigurationProperties.NAME, "test"); String path = TestUtil.getResourcePath(getClass(), "DiskRegCacheXmlJUnitTest.xml"); - props.setProperty("mcast-port", "0"); - props.setProperty("cache-xml-file", path); + props.setProperty(MCAST_PORT, "0"); + props.setProperty(DistributionConfig.CACHE_XML_FILE_NAME, path); ds = DistributedSystem.connect(props); try { // Create the cache which causes the cache-xml-file to be parsed http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/70612010/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegCachexmlGeneratorJUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegCachexmlGeneratorJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegCachexmlGeneratorJUnitTest.java index c0f269f..a71be75 100644 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegCachexmlGeneratorJUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegCachexmlGeneratorJUnitTest.java @@ -16,24 +16,26 @@ */ package com.gemstone.gemfire.internal.cache; -import java.io.File; -import java.io.FileWriter; -import java.io.PrintWriter; -import java.util.Properties; - +import com.gemstone.gemfire.cache.CacheFactory; +import com.gemstone.gemfire.cache.Region; +import com.gemstone.gemfire.cache.Scope; +import com.gemstone.gemfire.distributed.DistributedSystem; +import com.gemstone.gemfire.distributed.SystemConfigurationProperties; +import com.gemstone.gemfire.distributed.internal.DistributionConfig; +import com.gemstone.gemfire.internal.cache.xmlcache.CacheXmlGenerator; +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 java.io.File; +import java.io.FileWriter; +import java.io.PrintWriter; +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.AvailablePort; -import com.gemstone.gemfire.internal.cache.xmlcache.*; -import com.gemstone.gemfire.test.junit.categories.IntegrationTest; +import static com.gemstone.gemfire.distributed.SystemConfigurationProperties.MCAST_PORT; +import static org.junit.Assert.fail; /** * This test is for testing Disk attributes set programmatically @@ -241,10 +243,10 @@ public class DiskRegCachexmlGeneratorJUnitTest extends DiskRegionTestingBase ds.disconnect(); // Connect to the GemFire distributed system Properties props = new Properties(); - props.setProperty(DistributionConfig.NAME_NAME, "DiskRegCachexmlGeneratorJUnitTest"); - props.setProperty("mcast-port", "0"); + props.setProperty(SystemConfigurationProperties.NAME, "DiskRegCachexmlGeneratorJUnitTest"); + props.setProperty(MCAST_PORT, "0"); String path = "DiskRegCachexmlGeneratorJUnitTest.xml"; - props.setProperty("cache-xml-file", path); + props.setProperty(DistributionConfig.CACHE_XML_FILE_NAME, path); ds = DistributedSystem.connect(props); // Create the cache which causes the cache-xml-file to be parsed cache = CacheFactory.create(ds); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/70612010/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegionClearJUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegionClearJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegionClearJUnitTest.java index 7e58329..dee130f 100644 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegionClearJUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegionClearJUnitTest.java @@ -16,36 +16,24 @@ */ package com.gemstone.gemfire.internal.cache; -import java.util.Iterator; -import java.util.Properties; - +import com.gemstone.gemfire.SystemFailure; +import com.gemstone.gemfire.cache.*; +import com.gemstone.gemfire.distributed.DistributedSystem; +import com.gemstone.gemfire.test.dunit.ThreadUtils; +import com.gemstone.gemfire.test.junit.categories.IntegrationTest; +import junit.framework.Assert; 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.Assert; -import junit.framework.TestCase; +import java.util.Iterator; +import java.util.Properties; -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.CacheTransactionManager; -import com.gemstone.gemfire.cache.DataPolicy; -import com.gemstone.gemfire.cache.DiskStore; -import com.gemstone.gemfire.cache.DiskStoreFactory; -import com.gemstone.gemfire.cache.EntryEvent; -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.distributed.DistributedSystem; -import com.gemstone.gemfire.internal.cache.versions.VersionStamp; -import com.gemstone.gemfire.test.dunit.ThreadUtils; -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; // @TODO: use DiskRegionTestingBase and DiskRegionHelperFactory /** @@ -74,8 +62,8 @@ public class DiskRegionClearJUnitTest { @Before public void setUp() throws Exception { Properties properties = new Properties(); - properties.setProperty("mcast-port", "0"); - properties.setProperty("locators", ""); + properties.setProperty(MCAST_PORT, "0"); + properties.setProperty(LOCATORS, ""); distributedSystem = DistributedSystem .connect(properties); cache = CacheFactory.create(distributedSystem); @@ -202,8 +190,8 @@ public class DiskRegionClearJUnitTest { cache.close(); distributedSystem.disconnect(); Properties properties = new Properties(); - properties.setProperty("mcast-port", "0"); - properties.setProperty("locators", ""); + properties.setProperty(MCAST_PORT, "0"); + properties.setProperty(LOCATORS, ""); distributedSystem = DistributedSystem.connect(properties); cache = CacheFactory.create(distributedSystem); AttributesFactory factory = new AttributesFactory(); @@ -235,8 +223,8 @@ public class DiskRegionClearJUnitTest { cache.close(); distributedSystem.disconnect(); Properties properties = new Properties(); - properties.setProperty("mcast-port", "0"); - properties.setProperty("locators", ""); + properties.setProperty(MCAST_PORT, "0"); + properties.setProperty(LOCATORS, ""); distributedSystem = DistributedSystem.connect(properties); cache = CacheFactory.create(distributedSystem); AttributesFactory factory = new AttributesFactory(); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/70612010/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegionIllegalArguementsJUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegionIllegalArguementsJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegionIllegalArguementsJUnitTest.java index b9bfa17..09f95f8 100755 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegionIllegalArguementsJUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegionIllegalArguementsJUnitTest.java @@ -16,21 +16,24 @@ */ package com.gemstone.gemfire.internal.cache; -import java.io.File; -import java.util.Properties; - +import com.gemstone.gemfire.cache.Cache; +import com.gemstone.gemfire.cache.CacheFactory; +import com.gemstone.gemfire.cache.DiskStoreFactory; +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.Test; import org.junit.experimental.categories.Category; -import static org.junit.Assert.*; - -import junit.framework.TestCase; +import java.io.File; +import java.util.Properties; -import com.gemstone.gemfire.cache.*; -import com.gemstone.gemfire.distributed.*; -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; /** * This test tests Illegal arguements being passed to create disk regions. The @@ -49,12 +52,12 @@ public class DiskRegionIllegalArguementsJUnitTest protected static Properties props = new Properties(); static { - 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"); } @Before http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/70612010/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegionIllegalCacheXMLvaluesJUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegionIllegalCacheXMLvaluesJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegionIllegalCacheXMLvaluesJUnitTest.java index 6787d10..cac5087 100755 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegionIllegalCacheXMLvaluesJUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegionIllegalCacheXMLvaluesJUnitTest.java @@ -16,24 +16,20 @@ */ package com.gemstone.gemfire.internal.cache; -import java.io.File; -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.cache.CacheFactory; import com.gemstone.gemfire.cache.CacheXmlException; import com.gemstone.gemfire.distributed.DistributedSystem; -import com.gemstone.gemfire.internal.AvailablePort; -import com.gemstone.gemfire.util.test.TestUtil; +import com.gemstone.gemfire.distributed.internal.DistributionConfig; import com.gemstone.gemfire.test.junit.categories.IntegrationTest; +import com.gemstone.gemfire.util.test.TestUtil; +import org.junit.Test; +import org.junit.experimental.categories.Category; + +import java.io.File; +import java.util.Properties; + +import static com.gemstone.gemfire.distributed.SystemConfigurationProperties.MCAST_PORT; +import static org.junit.Assert.fail; /** * This test tests Illegal arguements being passed to @@ -55,8 +51,8 @@ public class DiskRegionIllegalCacheXMLvaluesJUnitTest dir.mkdir(); dir.deleteOnExit(); Properties props = new Properties(); - props.setProperty("mcast-port", "0"); - props.setProperty("cache-xml-file", TestUtil.getResourcePath(getClass(), path)); + props.setProperty(MCAST_PORT, "0"); + props.setProperty(DistributionConfig.CACHE_XML_FILE_NAME, TestUtil.getResourcePath(getClass(), path)); ds = DistributedSystem.connect(props); try { http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/70612010/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegionTestingBase.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegionTestingBase.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegionTestingBase.java index bf6267b..08772a4 100644 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegionTestingBase.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegionTestingBase.java @@ -20,9 +20,18 @@ */ package com.gemstone.gemfire.internal.cache; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; +import com.gemstone.gemfire.LogWriter; +import com.gemstone.gemfire.SystemFailure; +import com.gemstone.gemfire.cache.*; +import com.gemstone.gemfire.distributed.DistributedSystem; +import com.gemstone.gemfire.distributed.internal.DistributionConfig; +import com.gemstone.gemfire.internal.FileUtil; +import com.gemstone.gemfire.internal.cache.LocalRegion.NonTXEntry; +import com.gemstone.gemfire.internal.cache.versions.VersionTag; +import org.junit.After; +import org.junit.Before; +import org.junit.Rule; +import org.junit.rules.TestName; import java.io.File; import java.io.IOException; @@ -30,24 +39,9 @@ import java.util.HashMap; import java.util.Iterator; import java.util.Properties; -import org.junit.After; -import org.junit.Before; -import org.junit.Rule; -import org.junit.rules.TestName; - -import com.gemstone.gemfire.LogWriter; -import com.gemstone.gemfire.SystemFailure; -import com.gemstone.gemfire.cache.Cache; -import com.gemstone.gemfire.cache.CacheFactory; -import com.gemstone.gemfire.cache.CacheTransactionManager; -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.distributed.DistributedSystem; -import com.gemstone.gemfire.internal.FileUtil; -import com.gemstone.gemfire.internal.cache.LocalRegion.NonTXEntry; -import com.gemstone.gemfire.internal.cache.versions.VersionTag; +import static com.gemstone.gemfire.distributed.SystemConfigurationProperties.LOCATORS; +import static com.gemstone.gemfire.distributed.SystemConfigurationProperties.MCAST_PORT; +import static org.junit.Assert.*; /** * All disk region unit tests extend this base class , common method to be used in @@ -81,12 +75,12 @@ public class DiskRegionTestingBase @Before public void setUp() throws Exception { - 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"); File testingDirectory = new File("testingDirectory"); testingDirectory.mkdir(); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/70612010/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskStoreFactoryJUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskStoreFactoryJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskStoreFactoryJUnitTest.java index 38a1c5f..f2685f6 100644 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskStoreFactoryJUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskStoreFactoryJUnitTest.java @@ -16,22 +16,23 @@ */ package com.gemstone.gemfire.internal.cache; -import java.io.*; -import java.util.*; - +import com.gemstone.gemfire.cache.*; +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.Test; import org.junit.experimental.categories.Category; -import static org.junit.Assert.*; - -import com.gemstone.gemfire.cache.*; -import com.gemstone.gemfire.internal.Assert; -import com.gemstone.gemfire.distributed.*; -import com.gemstone.gemfire.test.junit.categories.IntegrationTest; +import java.io.File; +import java.io.FilenameFilter; +import java.util.Arrays; +import java.util.Properties; -import junit.framework.TestCase; +import static com.gemstone.gemfire.distributed.SystemConfigurationProperties.LOCATORS; +import static com.gemstone.gemfire.distributed.SystemConfigurationProperties.MCAST_PORT; +import static org.junit.Assert.*; /** * Tests DiskStoreFactory @@ -48,12 +49,12 @@ public class DiskStoreFactoryJUnitTest protected static Properties props = new Properties(); static { - 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"); } @Before http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/70612010/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DistrbutedRegionProfileOffHeapDUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DistrbutedRegionProfileOffHeapDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DistrbutedRegionProfileOffHeapDUnitTest.java index 33513b9..5f4f4da 100644 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DistrbutedRegionProfileOffHeapDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DistrbutedRegionProfileOffHeapDUnitTest.java @@ -16,14 +16,7 @@ */ package com.gemstone.gemfire.internal.cache; -import java.util.Properties; - -import com.gemstone.gemfire.cache.CacheException; -import com.gemstone.gemfire.cache.PartitionAttributes; -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.cache30.CacheSerializableRunnable; import com.gemstone.gemfire.cache30.CacheTestCase; import com.gemstone.gemfire.distributed.internal.DistributionConfig; @@ -32,6 +25,8 @@ import com.gemstone.gemfire.test.dunit.IgnoredException; import com.gemstone.gemfire.test.dunit.Invoke; import com.gemstone.gemfire.test.dunit.SerializableRunnable; +import java.util.Properties; + public class DistrbutedRegionProfileOffHeapDUnitTest extends CacheTestCase { private static final long serialVersionUID = 1L; http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/70612010/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/EventTrackerDUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/EventTrackerDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/EventTrackerDUnitTest.java index 38cad55..263b130 100755 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/EventTrackerDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/EventTrackerDUnitTest.java @@ -16,36 +16,20 @@ */ package com.gemstone.gemfire.internal.cache; -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; -import java.util.Set; -import java.util.concurrent.ConcurrentMap; - -import com.gemstone.gemfire.cache.AttributesFactory; -import com.gemstone.gemfire.cache.Cache; -import com.gemstone.gemfire.cache.CacheException; -import com.gemstone.gemfire.cache.DataPolicy; -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.Scope; +import com.gemstone.gemfire.cache.*; import com.gemstone.gemfire.cache.server.CacheServer; -import com.gemstone.gemfire.cache30.ClientServerTestCase; import com.gemstone.gemfire.cache30.CacheSerializableRunnable; import com.gemstone.gemfire.cache30.CacheTestCase; -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.cache30.ClientServerTestCase; +import com.gemstone.gemfire.distributed.internal.DistributionConfig; import com.gemstone.gemfire.internal.cache.EventTracker.BulkOpHolder; import com.gemstone.gemfire.internal.cache.ha.ThreadIdentifier; -import com.gemstone.gemfire.test.dunit.Assert; -import com.gemstone.gemfire.test.dunit.Host; -import com.gemstone.gemfire.test.dunit.NetworkUtils; -import com.gemstone.gemfire.test.dunit.SerializableRunnable; -import com.gemstone.gemfire.test.dunit.VM; -import com.gemstone.gemfire.test.dunit.Wait; +import com.gemstone.gemfire.test.dunit.*; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.ConcurrentMap; /** * Tests <code>EventTracker</code> management. @@ -204,7 +188,7 @@ public class EventTrackerDUnitTest extends CacheTestCase { serverVM.invoke(new CacheSerializableRunnable("Create server") { public void run2() throws CacheException { // Set the message tracking timeout - System.setProperty("gemfire.messageTrackingTimeout", MESSAGE_TRACKING_TIMEOUT); + System.setProperty(DistributionConfig.GEMFIRE_PREFIX + "messageTrackingTimeout", MESSAGE_TRACKING_TIMEOUT); // Create a distributed Region AttributesFactory factory = new AttributesFactory(); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/70612010/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/EvictionTestBase.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/EvictionTestBase.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/EvictionTestBase.java index ec8d46c..6bf8ec0 100755 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/EvictionTestBase.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/EvictionTestBase.java @@ -16,27 +16,12 @@ */ package com.gemstone.gemfire.internal.cache; -import java.io.File; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.Map; -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.CacheFactory; -import com.gemstone.gemfire.cache.DataPolicy; -import com.gemstone.gemfire.cache.EvictionAction; -import com.gemstone.gemfire.cache.EvictionAlgorithm; -import com.gemstone.gemfire.cache.EvictionAttributes; -import com.gemstone.gemfire.cache.PartitionAttributesFactory; -import com.gemstone.gemfire.cache.Region; +import com.gemstone.gemfire.cache.*; import com.gemstone.gemfire.cache.util.ObjectSizerImpl; import com.gemstone.gemfire.cache30.CacheSerializableRunnable; import com.gemstone.gemfire.cache30.CacheTestCase; import com.gemstone.gemfire.distributed.DistributedSystem; +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; @@ -44,14 +29,10 @@ import com.gemstone.gemfire.internal.cache.control.InternalResourceManager.Resou import com.gemstone.gemfire.internal.cache.control.MemoryEvent; import com.gemstone.gemfire.internal.cache.control.MemoryThresholds.MemoryState; import com.gemstone.gemfire.internal.cache.lru.HeapEvictor; -import com.gemstone.gemfire.test.dunit.Assert; -import com.gemstone.gemfire.test.dunit.Host; -import com.gemstone.gemfire.test.dunit.LogWriterUtils; -import com.gemstone.gemfire.test.dunit.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.*; public class EvictionTestBase extends CacheTestCase { @@ -211,7 +192,7 @@ public class EvictionTestBase extends CacheTestCase { public static void setTolerance() { - System.setProperty("gemfire.memoryEventTolerance", Integer.toString(0)); + System.setProperty(DistributionConfig.GEMFIRE_PREFIX + "memoryEventTolerance", Integer.toString(0)); } public void createDistributedRegion() { @@ -270,7 +251,7 @@ public class EvictionTestBase extends CacheTestCase { public void createCache() { try { HeapMemoryMonitor.setTestDisableMemoryUpdates(true); - System.setProperty("gemfire.memoryEventTolerance", "0"); + System.setProperty(DistributionConfig.GEMFIRE_PREFIX + "memoryEventTolerance", "0"); Properties props = new Properties(); DistributedSystem ds = getSystem(props); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/70612010/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/FixedPRSinglehopDUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/FixedPRSinglehopDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/FixedPRSinglehopDUnitTest.java index 8f3fc2d..c97ac23 100644 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/FixedPRSinglehopDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/FixedPRSinglehopDUnitTest.java @@ -16,24 +16,7 @@ */ package com.gemstone.gemfire.internal.cache; -import java.io.File; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; -import java.util.Map; -import java.util.Properties; - -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.FixedPartitionAttributes; -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; @@ -47,17 +30,16 @@ import com.gemstone.gemfire.internal.AvailablePort; import com.gemstone.gemfire.internal.cache.partitioned.fixed.QuarterPartitionResolver; import com.gemstone.gemfire.internal.cache.partitioned.fixed.SingleHopQuarterPartitionResolver; import com.gemstone.gemfire.internal.cache.tier.sockets.CacheServerTestUtil; -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.SerializableCallableIF; -import com.gemstone.gemfire.test.dunit.SerializableRunnableIF; -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; + +import java.io.File; +import java.io.IOException; +import java.util.*; + +import static com.gemstone.gemfire.distributed.SystemConfigurationProperties.LOCATORS; +import static com.gemstone.gemfire.distributed.SystemConfigurationProperties.MCAST_PORT; public class FixedPRSinglehopDUnitTest extends CacheTestCase { @@ -387,7 +369,7 @@ public class FixedPRSinglehopDUnitTest extends CacheTestCase { "FixedPRSinglehopDUnitTest"); Properties props = new Properties(); props = new Properties(); - props.setProperty("locators", locator); + props.setProperty(LOCATORS, locator); DistributedSystem ds = test.getSystem(props); cache = new CacheFactory(props).create(ds); @@ -481,8 +463,8 @@ public class FixedPRSinglehopDUnitTest 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 FixedPRSinglehopDUnitTest( "FixedPRSinglehopDUnitTest"); DistributedSystem ds = test.getSystem(props); @@ -507,8 +489,8 @@ public class FixedPRSinglehopDUnitTest 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 FixedPRSinglehopDUnitTest( "FixedPRSinglehopDUnitTest"); DistributedSystem ds = test.getSystem(props); @@ -533,8 +515,8 @@ public class FixedPRSinglehopDUnitTest 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 FixedPRSinglehopDUnitTest( "FixedPRSinglehopDUnitTest"); DistributedSystem ds = test.getSystem(props); @@ -558,8 +540,8 @@ public class FixedPRSinglehopDUnitTest 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 FixedPRSinglehopDUnitTest( "FixedPRSinglehopDUnitTest"); 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/GIIDeltaDUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/GIIDeltaDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/GIIDeltaDUnitTest.java index feac209..ce309a1 100644 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/GIIDeltaDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/GIIDeltaDUnitTest.java @@ -21,60 +21,33 @@ package com.gemstone.gemfire.internal.cache; import com.gemstone.gemfire.DataSerializer; 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.DataPolicy; -import com.gemstone.gemfire.cache.Region; -import com.gemstone.gemfire.cache.RegionAttributes; -import com.gemstone.gemfire.cache.RegionFactory; -import com.gemstone.gemfire.cache.Scope; +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.distributed.internal.membership.InternalDistributedMember; import com.gemstone.gemfire.internal.HeapDataOutputStream; import com.gemstone.gemfire.internal.Version; -import com.gemstone.gemfire.internal.cache.CachePerfStats; import com.gemstone.gemfire.internal.cache.DestroyOperation.DestroyMessage; -import com.gemstone.gemfire.internal.cache.DistributedCacheOperation; -import com.gemstone.gemfire.internal.cache.DistributedRegion; import com.gemstone.gemfire.internal.cache.DistributedTombstoneOperation.TombstoneMessage; -import com.gemstone.gemfire.internal.cache.GemFireCacheImpl; -import com.gemstone.gemfire.internal.cache.InitialImageOperation; import com.gemstone.gemfire.internal.cache.InitialImageOperation.GIITestHook; import com.gemstone.gemfire.internal.cache.InitialImageOperation.GIITestHookType; import com.gemstone.gemfire.internal.cache.InitialImageOperation.RequestImageMessage; -import com.gemstone.gemfire.internal.cache.InitialImageOperation.RequestRVVMessage; -import com.gemstone.gemfire.internal.cache.LocalRegion; import com.gemstone.gemfire.internal.cache.LocalRegion.NonTXEntry; -import com.gemstone.gemfire.internal.cache.TombstoneService; import com.gemstone.gemfire.internal.cache.UpdateOperation.UpdateMessage; import com.gemstone.gemfire.internal.cache.persistence.DiskStoreID; import com.gemstone.gemfire.internal.cache.versions.RegionVersionVector; import com.gemstone.gemfire.internal.cache.versions.VersionTag; -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.IgnoredException; -import com.gemstone.gemfire.test.dunit.Invoke; -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 com.gemstone.gemfire.test.junit.categories.FlakyTest; +import org.junit.experimental.categories.Category; import java.io.ByteArrayInputStream; import java.io.DataInputStream; import java.io.IOException; import java.util.concurrent.CountDownLatch; -import java.util.concurrent.TimeUnit; - -import org.junit.experimental.categories.Category; public class GIIDeltaDUnitTest extends CacheTestCase { @@ -2027,7 +2000,7 @@ public class GIIDeltaDUnitTest extends CacheTestCase { SerializableRunnable createRegion = new SerializableRunnable("Create Region") { public void run() { try { - String value = System.getProperty("gemfire.no-flush-on-close"); + String value = System.getProperty(DistributionConfig.GEMFIRE_PREFIX + "no-flush-on-close"); assertNull(value); RegionFactory f = getCache().createRegionFactory(getRegionAttributes()); // CCRegion = (LocalRegion)f.create(REGION_NAME); @@ -2047,10 +2020,10 @@ public class GIIDeltaDUnitTest extends CacheTestCase { public void run() { try { Cache cache = getCache(); - System.setProperty("gemfire.no-flush-on-close", "true"); + System.setProperty(DistributionConfig.GEMFIRE_PREFIX + "no-flush-on-close", "true"); cache.close(); } finally { - System.getProperties().remove("gemfire.no-flush-on-close"); + System.getProperties().remove(DistributionConfig.GEMFIRE_PREFIX + "no-flush-on-close"); } } };
