You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by kl...@apache.org on 2016/06/07 20:55:08 UTC
[53/62] [abbrv] incubator-geode git commit: Merge remote-tracking
branch 'origin/develop' into feature/GEODE-837
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegionIllegalCacheXMLvaluesJUnitTest.java
----------------------------------------------------------------------
diff --cc geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegionIllegalCacheXMLvaluesJUnitTest.java
index 2697bd3,d2291f1..4bac646
--- 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,15 -16,6 +16,16 @@@
*/
package com.gemstone.gemfire.internal.cache;
++import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.io.File;
+import java.util.Properties;
+
+import org.junit.Ignore;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
import com.gemstone.gemfire.cache.CacheFactory;
import com.gemstone.gemfire.cache.CacheXmlException;
import com.gemstone.gemfire.distributed.DistributedSystem;
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegionTestingBase.java
----------------------------------------------------------------------
diff --cc geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegionTestingBase.java
index 0019270,edcc089..4c1434f
--- 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,7 -20,19 +20,8 @@@
*/
package com.gemstone.gemfire.internal.cache;
+ import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
-
-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.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 static org.junit.Assert.*;
import java.io.File;
import java.io.IOException;
@@@ -50,37 -48,40 +51,37 @@@ import com.gemstone.gemfire.internal.ca
* All disk region unit tests extend this base class , common method to be used in
* all tests are present here.
*
- * @since 5.1
+ * @since GemFire 5.1
- *
*/
-public class DiskRegionTestingBase
-{
- @Rule public TestName name = new TestName();
-
- boolean testFailed = false;
- String failureCause = "";
- protected static Cache cache = null;
+public abstract class DiskRegionTestingBase {
+
+ protected static final boolean debug = false;
+ protected static Cache cache = null;
protected static DistributedSystem ds = null;
protected static Properties props = new Properties();
-
protected static File[] dirs = null;
-
protected static int[] diskDirSize = null;
- protected Region region = null;
-
- protected static final boolean debug = false;
-
+ protected Region region;
protected LogWriter logWriter;
+ boolean testFailed;
+ String failureCause = "";
+
+ @Rule
+ public TestName name = new TestName();
@Before
- public void setUp() throws Exception
- {
+ public final void setUp() throws Exception {
+ preSetUp();
+
- 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(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");
File testingDirectory = new File("testingDirectory");
testingDirectory.mkdir();
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskStoreFactoryJUnitTest.java
----------------------------------------------------------------------
diff --cc geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskStoreFactoryJUnitTest.java
index ea18f59,7a8a3d5..8993d3d
--- 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,7 -16,13 +16,8 @@@
*/
package com.gemstone.gemfire.internal.cache;
-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 com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
import java.io.File;
import java.io.FilenameFilter;
@@@ -41,22 -34,25 +42,22 @@@ import com.gemstone.gemfire.test.junit.
/**
* Tests DiskStoreFactory
- *
- *
*/
@Category(IntegrationTest.class)
-public class DiskStoreFactoryJUnitTest
-{
+public class DiskStoreFactoryJUnitTest {
- protected static Cache cache = null;
+ private static Cache cache = null;
- protected static DistributedSystem ds = null;
- protected static Properties props = new Properties();
+ private static DistributedSystem ds = null;
+ private 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(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");
}
@Before
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DistrbutedRegionProfileOffHeapDUnitTest.java
----------------------------------------------------------------------
diff --cc geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DistrbutedRegionProfileOffHeapDUnitTest.java
index 318505e,7d78d69..a54218a
--- 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,38 -16,24 +16,30 @@@
*/
package com.gemstone.gemfire.internal.cache;
- import org.junit.experimental.categories.Category;
- import org.junit.Test;
-
-import com.gemstone.gemfire.cache.*;
++import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
- import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
- import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
- import com.gemstone.gemfire.test.junit.categories.DistributedTest;
-
+import java.util.Properties;
+
++import org.junit.Test;
++import org.junit.experimental.categories.Category;
++
+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.cache30.CacheSerializableRunnable;
--import com.gemstone.gemfire.cache30.CacheTestCase;
- import com.gemstone.gemfire.distributed.internal.DistributionConfig;
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.SerializableRunnable;
++import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
++import com.gemstone.gemfire.test.junit.categories.DistributedTest;
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
-
-public class DistrbutedRegionProfileOffHeapDUnitTest extends CacheTestCase {
- private static final long serialVersionUID = 1L;
-
- public DistrbutedRegionProfileOffHeapDUnitTest(String name) {
- super(name);
- }
+@Category(DistributedTest.class)
+public class DistrbutedRegionProfileOffHeapDUnitTest extends JUnit4CacheTestCase {
- private static final long serialVersionUID = 1L;
-
- public DistrbutedRegionProfileOffHeapDUnitTest() {
- super();
- }
@Override
public final void preTearDownAssertions() throws Exception {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DistributedCacheTestCase.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/EventTrackerDUnitTest.java
----------------------------------------------------------------------
diff --cc geode-core/src/test/java/com/gemstone/gemfire/internal/cache/EventTrackerDUnitTest.java
index c6df3a6,263b130..ee68866
--- 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,54 -16,28 +16,46 @@@
*/
package com.gemstone.gemfire.internal.cache;
- import org.junit.experimental.categories.Category;
- import org.junit.Test;
-
-import com.gemstone.gemfire.cache.*;
+import static org.junit.Assert.*;
+
- import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
- import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
- import com.gemstone.gemfire.test.junit.categories.DistributedTest;
-
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
- import java.util.Set;
+import java.util.concurrent.ConcurrentMap;
+
++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.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.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.*;
-
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.concurrent.ConcurrentMap;
+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.cache.internal.JUnit4CacheTestCase;
++import com.gemstone.gemfire.test.junit.categories.DistributedTest;
/**
* Tests <code>EventTracker</code> management.
*
-- *
- * @since 6.5
+ * @since GemFire 6.5
*/
-public class EventTrackerDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class EventTrackerDUnitTest extends JUnit4CacheTestCase {
/** The port on which the <code>CacheServer</code> was started in this VM */
private static int cacheServerPort;
@@@ -71,22 -45,22 +63,6 @@@
/** The <code>Cache</code>'s <code>ExpiryTask</code>'s ping interval */
private static final String MESSAGE_TRACKING_TIMEOUT = "5000";
-- /**
-- * Creates a new <code>EventTrackerDUnitTest</code>
-- */
- public EventTrackerDUnitTest() {
- super();
- public EventTrackerDUnitTest(String name) {
- super(name);
-- }
--
-- //////// Test Methods
-- public static void caseSetUp() throws Exception {
-- disconnectAllFromDS();
-- }
--
-- public static void caseTearDown() throws Exception {
-- disconnectAllFromDS();
-- }
--
@Override
public final void postTearDownCacheTestCase() throws Exception {
disconnectAllFromDS();
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/EvictionDUnitTest.java
----------------------------------------------------------------------
diff --cc geode-core/src/test/java/com/gemstone/gemfire/internal/cache/EvictionDUnitTest.java
index 7e161e6,2d19ba5..3b0a95b
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/EvictionDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/EvictionDUnitTest.java
@@@ -16,20 -16,11 +16,14 @@@
*/
package com.gemstone.gemfire.internal.cache;
- import org.junit.experimental.categories.Category;
- import org.junit.Test;
-
+import static org.junit.Assert.*;
+
- import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
- import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
- import com.gemstone.gemfire.test.junit.categories.DistributedTest;
-
import java.util.ArrayList;
import java.util.Iterator;
import java.util.Map;
import org.junit.Ignore;
++import org.junit.Test;
import org.junit.experimental.categories.Category;
import com.gemstone.gemfire.cache.EvictionAlgorithm;
@@@ -38,16 -29,15 +32,11 @@@ import com.gemstone.gemfire.internal.ca
import com.gemstone.gemfire.test.dunit.LogWriterUtils;
import com.gemstone.gemfire.test.junit.categories.DistributedTest;
- @Ignore("Test was disabled by renaming to DisabledTest")
@Category(DistributedTest.class)
-@Ignore("Test was disabled by renaming to DisabledTest")
++@Ignore("TODO: Test was disabled by renaming to DisabledTest")
public class EvictionDUnitTest extends EvictionTestBase {
-- private static final long serialVersionUID = 270073077723092256L;
- public EvictionDUnitTest() {
- super();
- public EvictionDUnitTest(String name) {
- super(name);
-- }
--
+ @Test
public void testDummyInlineNCentralizedEviction() {
prepareScenario1(EvictionAlgorithm.LRU_HEAP,0);
putData("PR1", 50, 1);
@@@ -118,9 -104,8 +107,8 @@@
assertEquals(extraEntries,((AbstractLRURegionMap)pr.entries)._getLruList().stats().getEvictions());
}
--
--
++
+ @Test
public void testEntryLru() {
createCache();
maxEnteries=12;
@@@ -185,9 -168,8 +173,8 @@@
putData("PR1", 60, 1);
validateNoOfEvictions("PR1", 20);
}
--
--
++
+ @Test
public void testMemLruForPRAndDR() {
createCache();
createPartitionedRegion(true, EvictionAlgorithm.LRU_MEMORY, "PR1", 4, 1, 1000,40);
@@@ -230,37 -211,37 +217,5 @@@
assertEquals(8, size.intValue());
}
}
--
-- /*
-- final PartitionedRegion pr1 = (PartitionedRegion)cache.getRegion("PR1");
-- final PartitionedRegion pr2 = (PartitionedRegion)cache.getRegion("PR2");
-- final PartitionedRegion pr3 = (PartitionedRegion)cache.getRegion("PR3");
-- final DistributedRegion dr1 = (DistributedRegion)cache.getRegion("DR1");
--
-- for (int counter = 1; counter <= 18; counter++) {
-- pr1.put(new Integer(counter), new byte[1 * 1024 * 1024]);
-- }
-- getLogWriter().info("Size of PR1 before eviction = "+ pr1.size());
--
-- for (int counter = 1; counter <= 30; counter++) {
-- pr2.put(new Integer(counter), new byte[1 * 1024 * 1024]);
-- }
-- getLogWriter().info("Size of PR2 before eviction = "+ pr2.size());
--
-- for (int counter = 1; counter <= 45; counter++) {
-- pr3.put(new Integer(counter), new byte[1 * 1024 * 1024]);
-- }
-- getLogWriter().info("Size of PR3 before eviction = "+ pr3.size());
--
-- for (int counter = 1; counter <= 150; counter++) {
-- dr1.put(new Integer(counter), new byte[1 * 1024 * 1024]);
-- }
-- getLogWriter().info("Size of DR1 before eviction = "+ dr1.size());
--
--
-- getLogWriter().info("Size of PR1 after eviction = "+ pr1.size());
-- getLogWriter().info("Size of PR2 after eviction = "+ pr2.size());
-- getLogWriter().info("Size of PR3 after eviction = "+ pr3.size());
-- getLogWriter().info("Size of PR4 after eviction = "+ dr1.size());*/
}
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/EvictionTestBase.java
----------------------------------------------------------------------
diff --cc geode-core/src/test/java/com/gemstone/gemfire/internal/cache/EvictionTestBase.java
index e72eba1,6bf8ec0..f262609
--- 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,36 -16,12 +16,31 @@@
*/
package com.gemstone.gemfire.internal.cache;
- import org.junit.experimental.categories.Category;
- import org.junit.Test;
-
-import com.gemstone.gemfire.cache.*;
+import static org.junit.Assert.*;
+
- import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
- import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
- import com.gemstone.gemfire.test.junit.categories.DistributedTest;
-
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
+
++import org.junit.experimental.categories.Category;
++
+import com.gemstone.gemfire.cache.AttributesFactory;
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.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.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;
@@@ -53,17 -29,12 +48,19 @@@ import com.gemstone.gemfire.internal.ca
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.*;
+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.cache.internal.JUnit4CacheTestCase;
++import com.gemstone.gemfire.test.junit.categories.DistributedTest;
-import java.io.File;
-import java.util.*;
-
-public class EvictionTestBase extends CacheTestCase {
+@Category(DistributedTest.class)
+public class EvictionTestBase extends JUnit4CacheTestCase {
protected static Cache cache = null;
@@@ -83,10 -54,10 +80,6 @@@
static int totalNoOfBuckets = 4;
- public EvictionTestBase() {
- super();
- public EvictionTestBase(String name) {
- super(name);
-- }
--
@Override
public final void postSetUp() throws Exception {
Host host = Host.getHost(0);
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/FixedPRSinglehopDUnitTest.java
----------------------------------------------------------------------
diff --cc geode-core/src/test/java/com/gemstone/gemfire/internal/cache/FixedPRSinglehopDUnitTest.java
index 57d7e63,cf279cc..4da2b61
--- 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,35 -16,15 +16,35 @@@
*/
package com.gemstone.gemfire.internal.cache;
-import com.gemstone.gemfire.cache.*;
++import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+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.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.FixedPartitionAttributes;
+import com.gemstone.gemfire.cache.PartitionAttributesFactory;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
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.server.CacheServer;
-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.internal.AvailablePort;
import com.gemstone.gemfire.internal.cache.partitioned.fixed.QuarterPartitionResolver;
import com.gemstone.gemfire.internal.cache.partitioned.fixed.SingleHopQuarterPartitionResolver;
@@@ -384,10 -363,11 +384,10 @@@ public class FixedPRSinglehopDUnitTest
public static int createServerWithLocator(String locator, boolean isAccessor,
List<FixedPartitionAttributes> fpaList, boolean simpleFPR) {
- CacheTestCase test = new FixedPRSinglehopDUnitTest(
- "FixedPRSinglehopDUnitTest");
+ FixedPRSinglehopDUnitTest test = new 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);
@@@ -479,9 -461,10 +479,9 @@@
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");
+ FixedPRSinglehopDUnitTest test = new FixedPRSinglehopDUnitTest();
DistributedSystem ds = test.getSystem(props);
cache = CacheFactory.create(ds);
assertNotNull(cache);
@@@ -504,9 -487,10 +504,9 @@@
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");
+ FixedPRSinglehopDUnitTest test = new FixedPRSinglehopDUnitTest();
DistributedSystem ds = test.getSystem(props);
cache = CacheFactory.create(ds);
assertNotNull(cache);
@@@ -529,9 -513,10 +529,9 @@@
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");
+ FixedPRSinglehopDUnitTest test = new FixedPRSinglehopDUnitTest();
DistributedSystem ds = test.getSystem(props);
cache = CacheFactory.create(ds);
assertNotNull(cache);
@@@ -553,9 -538,10 +553,9 @@@
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");
+ FixedPRSinglehopDUnitTest test = new FixedPRSinglehopDUnitTest();
DistributedSystem ds = test.getSystem(props);
cache = CacheFactory.create(ds);
assertNotNull(cache);
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/GIIDeltaDUnitTest.java
----------------------------------------------------------------------
diff --cc geode-core/src/test/java/com/gemstone/gemfire/internal/cache/GIIDeltaDUnitTest.java
index 084ff65,ce309a1..c92a436
--- 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
@@@ -19,26 -19,11 +19,20 @@@
*/
package com.gemstone.gemfire.internal.cache;
+import org.junit.experimental.categories.Category;
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
+
import com.gemstone.gemfire.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;
@@@ -81,12 -48,8 +57,9 @@@ 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 {
+@Category(DistributedTest.class)
+public class GIIDeltaDUnitTest extends JUnit4CacheTestCase {
VM P; // GII provider
VM R; // GII requester
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/GridAdvisorDUnitTest.java
----------------------------------------------------------------------
diff --cc geode-core/src/test/java/com/gemstone/gemfire/internal/cache/GridAdvisorDUnitTest.java
index 868fc84,4120fca..2c7d1d4
--- 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,17 -16,6 +16,18 @@@
*/
package com.gemstone.gemfire.internal.cache;
++import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Properties;
+
+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.server.CacheServer;
@@@ -50,10 -39,15 +50,10 @@@ import com.gemstone.gemfire.test.junit.
/**
* Tests the GridAdvisor
*
- * @since 5.7
+ * @since GemFire 5.7
*/
-public class GridAdvisorDUnitTest extends DistributedTestCase {
-
- public GridAdvisorDUnitTest(String name) {
- super(name);
- }
-
- //////// Test Methods
+@Category(DistributedTest.class)
+public class GridAdvisorDUnitTest extends JUnit4DistributedTestCase {
/**
* Tests 2 controllers and 2 bridge servers
@@@ -557,18 -550,18 +557,19 @@@
// now make sure controller saw all bridge servers stop
vm3.invoke(new SerializableRunnable("Verify locator stopped ") {
- public void run() {
- assertTrue(Locator.hasLocator());
- InternalLocator l = (InternalLocator)Locator.getLocator();
- DistributionAdvisee advisee = l.getServerLocatorAdvisee();
- ControllerAdvisor ca = (ControllerAdvisor)advisee.getDistributionAdvisor();
- assertEquals(0, ca.fetchControllers().size());
- assertEquals(0, ca.fetchBridgeServers().size());
- }
- });
+ public void run() {
+ assertTrue(Locator.hasLocator());
+ InternalLocator l = (InternalLocator) Locator.getLocator();
+ DistributionAdvisee advisee = l.getServerLocatorAdvisee();
+ ControllerAdvisor ca = (ControllerAdvisor) advisee.getDistributionAdvisor();
+ assertEquals(0, ca.fetchControllers().size());
+ assertEquals(0, ca.fetchBridgeServers().size());
+ }
+ });
vm3.invoke(stopLocator);
}
+
+ @Test
public void test2by2usingGroups() throws Exception {
disconnectAllFromDS();
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/HAOverflowMemObjectSizerDUnitTest.java
----------------------------------------------------------------------
diff --cc geode-core/src/test/java/com/gemstone/gemfire/internal/cache/HAOverflowMemObjectSizerDUnitTest.java
index 66e587c,b441ef1..05340a1
--- 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,22 -19,7 +19,23 @@@
*/
package com.gemstone.gemfire.internal.cache;
-import com.gemstone.gemfire.cache.*;
++import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.util.Iterator;
+import java.util.Properties;
+import java.util.Set;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.cache.AttributesFactory;
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.Scope;
import com.gemstone.gemfire.cache.server.CacheServer;
import com.gemstone.gemfire.cache30.ClientServerTestCase;
import com.gemstone.gemfire.distributed.DistributedSystem;
@@@ -52,10 -43,9 +53,10 @@@ import com.gemstone.gemfire.test.junit.
/**
* Tests the size of clientUpdateMessageImpl with the size calculated by
* {@link com.gemstone.gemfire.internal.cache.lru.MemLRUCapacityController} for HA overFlow
- * @since 5.7
+ * @since GemFire 5.7
*/
-public class HAOverflowMemObjectSizerDUnitTest extends DistributedTestCase {
+@Category(DistributedTest.class)
+public class HAOverflowMemObjectSizerDUnitTest extends JUnit4DistributedTestCase {
/* entry over head used by memCapacityController */
private static final int OVERHEAD_PER_ENTRY = 250;
@@@ -67,7 -57,7 +68,7 @@@
/** The distributedSystem instance */
static DistributedSystem ds = null;
-- static String regionName = "HAOverflowMemObjectSizerDUnitTest-region";
++ static String regionName = HAOverflowMemObjectSizerDUnitTest.class.getSimpleName() + "-region";
/* handler for LRU capacity controller */
private static EnableLRU cc = null;
@@@ -161,9 -156,9 +162,9 @@@
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);
+ new HAOverflowMemObjectSizerDUnitTest().createCache(props);
AttributesFactory factory = new AttributesFactory();
factory.setScope(Scope.DISTRIBUTED_ACK);
factory.setDataPolicy(DataPolicy.NORMAL);
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/IncrementalBackupDUnitTest.java
----------------------------------------------------------------------
diff --cc geode-core/src/test/java/com/gemstone/gemfire/internal/cache/IncrementalBackupDUnitTest.java
index 7b06175,b4f1c98..9b527e4
--- 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,40 -16,11 +16,36 @@@
*/
package com.gemstone.gemfire.internal.cache;
- import org.junit.experimental.categories.Category;
- import org.junit.Test;
-
-import com.gemstone.gemfire.admin.*;
++import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
- import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
- import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
- import com.gemstone.gemfire.test.junit.categories.DistributedTest;
-
+import java.io.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 org.junit.Test;
++import org.junit.experimental.categories.Category;
++
+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.internal.AdminDistributedSystemImpl;
-import com.gemstone.gemfire.cache.*;
+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.persistence.PersistentID;
--import com.gemstone.gemfire.cache30.CacheTestCase;
import com.gemstone.gemfire.distributed.DistributedMember;
import com.gemstone.gemfire.distributed.DistributedSystem;
import com.gemstone.gemfire.internal.ClassBuilder;
@@@ -59,20 -30,18 +55,22 @@@ import com.gemstone.gemfire.internal.Ja
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.*;
-
-import java.io.*;
-import java.util.*;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+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.cache.internal.JUnit4CacheTestCase;
++import com.gemstone.gemfire.test.junit.categories.DistributedTest;
/**
* Tests for the incremental backup feature.
*/
- @SuppressWarnings("serial")
+@Category(DistributedTest.class)
+ @SuppressWarnings("serial")
-public class IncrementalBackupDUnitTest extends CacheTestCase {
+public class IncrementalBackupDUnitTest extends JUnit4CacheTestCase {
/**
* Data load increment.
*/
@@@ -124,14 -93,14 +122,6 @@@
};
/**
-- * Creates a new IncrementalBackupDUnitTest.
-- * @param name test case name.
-- */
- public IncrementalBackupDUnitTest() {
- super();
- public IncrementalBackupDUnitTest(String name) {
- super(name);
-- }
--
-- /**
* Abstracts the logging mechanism.
* @param message a message to log.
*/
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/InterruptsConserveSocketsFalseDUnitTest.java
----------------------------------------------------------------------
diff --cc geode-core/src/test/java/com/gemstone/gemfire/internal/cache/InterruptsConserveSocketsFalseDUnitTest.java
index 09d2b67,d8d68f3..ef7d240
--- 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,32 -16,24 +16,25 @@@
*/
package com.gemstone.gemfire.internal.cache;
- import org.junit.experimental.categories.Category;
- import org.junit.Test;
+ import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
- import static org.junit.Assert.*;
+ import java.util.Properties;
- import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
- import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
- import com.gemstone.gemfire.test.junit.categories.DistributedTest;
-public class InterruptsConserveSocketsFalseDUnitTest extends
- InterruptsDUnitTest {
++import org.junit.experimental.categories.Category;
- import java.util.Properties;
- public InterruptsConserveSocketsFalseDUnitTest(String name) {
- super(name);
++import com.gemstone.gemfire.test.junit.categories.DistributedTest;
+
+@Category(DistributedTest.class)
- public class InterruptsConserveSocketsFalseDUnitTest extends
- InterruptsDUnitTest {
++public class InterruptsConserveSocketsFalseDUnitTest extends InterruptsDUnitTest {
+
+ public InterruptsConserveSocketsFalseDUnitTest() {
+ super();
}
@Override
public Properties getDistributedSystemProperties() {
Properties props = super.getDistributedSystemProperties();
- props.setProperty("conserve-sockets", "false");
+ props.setProperty(CONSERVE_SOCKETS, "false");
return props;
}
--
--
--
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/MapClearGIIDUnitTest.java
----------------------------------------------------------------------
diff --cc geode-core/src/test/java/com/gemstone/gemfire/internal/cache/MapClearGIIDUnitTest.java
index dc0c0d9,7c227d8..6a88662
--- 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,100 -21,76 +21,42 @@@
*/
package com.gemstone.gemfire.internal.cache;
- import org.junit.experimental.categories.Category;
- import org.junit.Test;
-
-import com.gemstone.gemfire.cache.*;
-import com.gemstone.gemfire.cache30.CacheSerializableRunnable;
-import com.gemstone.gemfire.cache30.CacheTestCase;
-import com.gemstone.gemfire.test.dunit.*;
+import static org.junit.Assert.*;
- import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
- import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
- import com.gemstone.gemfire.test.junit.categories.DistributedTest;
-
import java.util.Properties;
-/**
- *
- *
- */
-public class MapClearGIIDUnitTest extends CacheTestCase {
++import org.junit.Test;
++import org.junit.experimental.categories.Category;
+
- protected static boolean wasGIIInProgressDuringClear = false;
+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.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.cache.internal.JUnit4CacheTestCase;
++import com.gemstone.gemfire.test.junit.categories.DistributedTest;
- /**
- *
- *
- */
- public MapClearGIIDUnitTest(String name) {
- super(name);
- }
- volatile static Region region;
- /*
- public void setUp() {
- super.setUp();
- Host host = Host.getHost(0);
- VM vm0 = host.getVM(0);
- VM vm1 = host.getVM(1);
- vm0.invoke(() -> MapClearGIIDUnitTest.createCacheVM0());
- vm1.invoke(() -> MapClearGIIDUnitTest.createCacheVM1());
- System.out.println("Cache created in successfully");
- }*/
-/*
- public void tearDown() {
- Host host = Host.getHost(0);
- VM vm0 = host.getVM(0);
- VM vm1 = host.getVM(1);
- vm0.invoke(() -> MapClearGIIDUnitTest.closeCache());
- vm1.invoke(() -> MapClearGIIDUnitTest.closeCache());
- }*/
+@Category(DistributedTest.class)
+public class MapClearGIIDUnitTest extends JUnit4CacheTestCase {
-/* public static void createCacheVM0() throws Exception {
- InitialImageOperation.slowImageProcessing = 200;
- Properties mprops = new Properties();
- // mprops.setProperty(DistributionConfig.DistributedSystemConfigProperties.MCAST_PORT, "7777");
-
- ds = (new MapClearGIIDUnitTest("Clear")).getSystem(mprops);
- //ds = DistributedSystem.connect(props);
- cache = CacheFactory.create(ds);
- CacheObserverImpl observer = new CacheObserverImpl();
- CacheObserverHolder.setInstance(observer);
- LocalRegion.ISSUE_CALLBACKS_TO_CACHE_OBSERVER = true;
- } //end of create cache for VM0
+ protected static boolean wasGIIInProgressDuringClear = false;
- public MapClearGIIDUnitTest() {
- super();
- }
- public static void createCacheVM1() throws Exception {
- Properties mprops = new Properties();
- // mprops.setProperty(DistributionConfig.DistributedSystemConfigProperties.MCAST_PORT, "7777");
- ds = (new MapClearGIIDUnitTest("Clear")).getSystem(mprops);
- // ds = DistributedSystem.connect(null);
- cache = CacheFactory.create(ds);
- AttributesFactory factory = new AttributesFactory();
- factory.setScope(Scope.DISTRIBUTED_ACK);
- factory.setDataPolicy(DataPolicy.REPLICATE);
- RegionAttributes attr = factory.create();
- region = cache.createRegion("map", attr);
- //region = region.createSubregion("map",attr);
- for (int i = 0; i < 10000; ++i) {
- region.put("" + i, "" + i);
- }
- }*/
+ volatile static Region region;
- /*
- public void setUp() {
- super.setUp();
- Host host = Host.getHost(0);
- VM vm0 = host.getVM(0);
- VM vm1 = host.getVM(1);
- vm0.invoke(() -> MapClearGIIDUnitTest.createCacheVM0());
- vm1.invoke(() -> MapClearGIIDUnitTest.createCacheVM1());
- System.out.println("Cache created in successfully");
- }*/
- /*
- public void tearDown() {
- Host host = Host.getHost(0);
- VM vm0 = host.getVM(0);
- VM vm1 = host.getVM(1);
- vm0.invoke(() -> MapClearGIIDUnitTest.closeCache());
- vm1.invoke(() -> MapClearGIIDUnitTest.closeCache());
- }*/
-
- /* public static void createCacheVM0() throws Exception {
- InitialImageOperation.slowImageProcessing = 200;
- Properties mprops = new Properties();
- // mprops.setProperty("mcast-port", "7777");
-
- ds = (new MapClearGIIDUnitTest()).getSystem(mprops);
- //ds = DistributedSystem.connect(props);
- cache = CacheFactory.create(ds);
- CacheObserverImpl observer = new CacheObserverImpl();
- CacheObserverHolder.setInstance(observer);
- LocalRegion.ISSUE_CALLBACKS_TO_CACHE_OBSERVER = true;
- } //end of create cache for VM0
-
- public static void createCacheVM1() throws Exception {
- Properties mprops = new Properties();
- // mprops.setProperty("mcast-port", "7777");
- ds = (new MapClearGIIDUnitTest()).getSystem(mprops);
- // ds = DistributedSystem.connect(null);
- cache = CacheFactory.create(ds);
- AttributesFactory factory = new AttributesFactory();
- factory.setScope(Scope.DISTRIBUTED_ACK);
- factory.setDataPolicy(DataPolicy.REPLICATE);
- RegionAttributes attr = factory.create();
- region = cache.createRegion("map", attr);
- //region = region.createSubregion("map",attr);
- for (int i = 0; i < 10000; ++i) {
- region.put("" + i, "" + i);
- }
- }*/
public static boolean checkImageStateFlag() throws Exception {
- Region rgn = new MapClearGIIDUnitTest("dumb object to get cache").getCache().getRegion("/map");
+ Region rgn = new MapClearGIIDUnitTest().getCache().getRegion("/map");
if (rgn == null) {
fail("Map region not yet created");
}
@@@ -148,21 -124,21 +90,10 @@@
factory.setConcurrencyChecksEnabled(true);
RegionAttributes attr = factory.create();
- region = new MapClearGIIDUnitTest("dumb object to get cache").getCache().createRegion("map", attr);
+ region = new MapClearGIIDUnitTest().getCache().createRegion("map", attr);
-- // region = region.createSubregion("map",attr);
LogWriterUtils.getLogWriter().info("Region in VM0 created ");
}
--/*
-- public static void closeCache() {
-- try {
-- cache.close();
-- ds.disconnect();
-- }
-- catch (Exception ex) {
-- ex.printStackTrace();
-- }
-- }*/
public static void clearRegionInVm1() {
// wait for profile of getInitialImage cache to show up
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/MapInterfaceJUnitTest.java
----------------------------------------------------------------------
diff --cc geode-core/src/test/java/com/gemstone/gemfire/internal/cache/MapInterfaceJUnitTest.java
index b648efd,7b24f96..911f6ca
--- 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,7 -16,13 +16,8 @@@
*/
package com.gemstone.gemfire.internal.cache;
-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 com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
import java.util.HashMap;
import java.util.Map;
@@@ -41,6 -36,6 +42,11 @@@ import com.gemstone.gemfire.test.junit.
@Category(IntegrationTest.class)
public class MapInterfaceJUnitTest {
++ protected boolean hasBeenNotified = false;
++
++ protected Region region2 = null;
++ protected int counter = 0;
++
@Test
public void testLocalClear() {
Properties props = new Properties();
@@@ -150,14 -145,14 +156,11 @@@
ds.disconnect();
}
-- protected boolean hasBeenNotified = false;
--
@Test
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;
@@@ -168,6 -163,6 +171,7 @@@
factory.setScope(Scope.LOCAL);
factory.setCacheWriter(new CacheWriterAdapter() {
++ @Override
public void beforeRegionClear(RegionEvent event) throws CacheWriterException {
synchronized (this) {
this.notify();
@@@ -222,14 -217,14 +226,11 @@@
ds.disconnect();
}
-- protected Region region2 = null;
-- protected int counter = 0;
@Test
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;
@@@ -240,6 -235,6 +241,7 @@@
factory.setScope(Scope.LOCAL);
factory.setCacheWriter(new CacheWriterAdapter() {
++ @Override
public void beforeUpdate(EntryEvent event) throws CacheWriterException {
synchronized (this) {
this.notify();
@@@ -264,12 -259,12 +266,11 @@@
fail(" beforeCreate call back did not come");
}
- Assert.assertEquals(counter,1);
+ assertEquals(counter,1);
}
catch (Exception e) {
- fail(" failed due to " + e);
+ throw new AssertionError(" failed due to ", e);
}
--
}
class DoesClear implements Runnable {
@@@ -280,6 -275,6 +281,7 @@@
this.region = reg;
}
++ @Override
public void run() {
this.region.clear();
}
@@@ -287,10 -282,10 +289,10 @@@
class DoesPut implements Runnable {
--
DoesPut() {
}
++ @Override
public void run() {
((Map.Entry)(MapInterfaceJUnitTest.this.region2.entrySet().iterator().next())).setValue(new Integer(8));
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/MultipleOplogsRollingFeatureJUnitTest.java
----------------------------------------------------------------------
diff --cc geode-core/src/test/java/com/gemstone/gemfire/internal/cache/MultipleOplogsRollingFeatureJUnitTest.java
index c7e5d30,4a5967e..825dd3f
--- 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
@@@ -21,32 -23,32 +21,34 @@@ import static org.junit.Assert.*
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.distributed.internal.DistributionConfig;
+import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
/**
* The test will verify <br>
* 1. Multiple oplogs are being rolled at once <br>
* 2. The Number of entries getting logged to the HTree are taking care of creation
- *
*/
@Category(IntegrationTest.class)
-public class MultipleOplogsRollingFeatureJUnitTest extends
- DiskRegionTestingBase
-{
+public class MultipleOplogsRollingFeatureJUnitTest extends DiskRegionTestingBase {
- protected Object mutex = new Object();
+ private volatile boolean FLAG = false;
- protected boolean CALLBACK_SET = false;
+ private Object mutex = new Object();
- protected volatile boolean FLAG = false;
+ private boolean CALLBACK_SET = false;
- DiskRegionProperties diskProps = new DiskRegionProperties();
+ private DiskRegionProperties diskProps = new DiskRegionProperties();
- @After
- public void tearDown() throws Exception
- {
+ @Override
+ protected final void preTearDown() throws Exception {
LocalRegion.ISSUE_CALLBACKS_TO_CACHE_OBSERVER = false;
- super.tearDown();
+ }
+
+ @Override
+ protected final void postTearDown() throws Exception {
++ System.clearProperty(DistributionConfig.GEMFIRE_PREFIX + "MAX_OPLOGS_PER_COMPACTION");
diskProps.setDiskDirs(dirs);
}
@@@ -56,20 -58,21 +58,21 @@@
* 2. The Number of entries are properly conflated
*/
@Test
- public void testMultipleRolling() {
- System.setProperty("gemfire.MAX_OPLOGS_PER_COMPACTION", "17");
- public void testMultipleRolling()
- {
++ public void testMultipleRolling() throws Exception {
+ System.setProperty(DistributionConfig.GEMFIRE_PREFIX + "MAX_OPLOGS_PER_COMPACTION", "17");
++
++ deleteFiles();
++ diskProps.setMaxOplogSize(450);
++ diskProps.setCompactionThreshold(100);
++ region = DiskRegionHelperFactory.getSyncPersistOnlyRegion(cache,
++ diskProps, Scope.LOCAL);
++ assertNotNull(region);
++ DiskRegion diskRegion = ((LocalRegion)region).getDiskRegion();
++ assertNotNull(diskRegion);
++ LocalRegion.ISSUE_CALLBACKS_TO_CACHE_OBSERVER = true;
++ CacheObserverHolder.setInstance(getCacheObserver());
++
try {
-- deleteFiles();
-- diskProps.setMaxOplogSize(450);
-- diskProps.setCompactionThreshold(100);
-- region = DiskRegionHelperFactory.getSyncPersistOnlyRegion(cache,
-- diskProps, Scope.LOCAL);
-- assertNotNull(region);
-- DiskRegion diskRegion = ((LocalRegion)region).getDiskRegion();
-- assertNotNull(diskRegion);
-- LocalRegion.ISSUE_CALLBACKS_TO_CACHE_OBSERVER = true;
-- CacheObserverHolder.setInstance(getCacheObserver());
-- try {
CALLBACK_SET = true;
@@@ -82,7 -85,7 +85,7 @@@
waitForCompactor(3000/*wait for forceRolling to finish */);
logWriter.info("testMultipleRolling after waitForCompactor");
// the compactor copied two tombstone and 1 entry to oplog #2
-- // The total oplog size will become 429, that why we need to
++ // The total oplog size will become 429, that why we need to
// set oplogmaxsize to be 450. After compaction, the size become 151
// the compactor thread is now stuck waiting for mutex.notify
@@@ -124,41 -127,42 +127,33 @@@
region.forceRolling();
assertEquals(3, diskRegion.getOplogToBeCompacted().length);
-- } finally {
++ } finally {
synchronized (mutex) {
// let the compactor go
CALLBACK_SET = false;
FLAG = false;
logWriter.info("testMultipleRolling letting compactor go");
mutex.notify();
--
-- }
}
--
-- // let the main thread sleep so that rolling gets over
-- waitForCompactor(5000);
--
-- assertTrue(
-- "Number of Oplogs to be rolled is not null : this is unexpected",
-- diskRegion.getOplogToBeCompacted() == null);
-- cache.close();
-- cache = createCache();
-- region = DiskRegionHelperFactory.getSyncPersistOnlyRegion(cache,
-- diskProps, Scope.LOCAL);
-- assertTrue("Recreated region size is not 1 ", region.size() == 1);
--
-- closeDown();
-- deleteFiles();
-- }
-- catch (Exception ex) {
-- 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");
}
++
++ // let the main thread sleep so that rolling gets over
++ waitForCompactor(5000);
++
++ assertTrue(
++ "Number of Oplogs to be rolled is not null : this is unexpected",
++ diskRegion.getOplogToBeCompacted() == null);
++ cache.close();
++ cache = createCache();
++ region = DiskRegionHelperFactory.getSyncPersistOnlyRegion(cache,
++ diskProps, Scope.LOCAL);
++ assertTrue("Recreated region size is not 1 ", region.size() == 1);
++
++ closeDown();
++ deleteFiles();
}
- private void waitForCompactor(long maxWaitingTime)
- {
+ private void waitForCompactor(long maxWaitingTime) {
long maxWaitTime = maxWaitingTime;
long start = System.currentTimeMillis();
while (!FLAG) { // wait until
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/OffHeapEvictionDUnitTest.java
----------------------------------------------------------------------
diff --cc geode-core/src/test/java/com/gemstone/gemfire/internal/cache/OffHeapEvictionDUnitTest.java
index 1c8e366,3d094a0..7c16568
--- 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,41 -16,26 +16,34 @@@
*/
package com.gemstone.gemfire.internal.cache;
- import org.junit.experimental.categories.Category;
- import org.junit.Test;
-
++import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
- import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
- import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
- import com.gemstone.gemfire.test.junit.categories.DistributedTest;
-
+import java.util.Properties;
+
++import org.junit.experimental.categories.Category;
++
import com.gemstone.gemfire.cache.CacheException;
import com.gemstone.gemfire.cache.CacheFactory;
import com.gemstone.gemfire.cache30.CacheSerializableRunnable;
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.*;
-
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+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.junit.categories.DistributedTest;
/**
* Performs eviction dunit tests for off-heap memory.
*/
+@Category(DistributedTest.class)
public class OffHeapEvictionDUnitTest extends EvictionDUnitTest {
- public OffHeapEvictionDUnitTest() {
- super();
- public OffHeapEvictionDUnitTest(String name) {
- super(name);
-- }
--
++
@Override
public final void preTearDownAssertions() throws Exception {
SerializableRunnable checkOrphans = new SerializableRunnable() {
@@@ -74,6 -59,6 +67,7 @@@
return properties;
}
++ @Override
public void createCache() {
try {
Properties props = new Properties();
@@@ -95,6 -80,6 +89,7 @@@
}
}
++ @Override
public void raiseFakeNotification(VM vm, final String prName,
final int noOfExpectedEvictions) {
vm.invoke(new CacheSerializableRunnable("fakeNotification") {
@@@ -132,12 -117,12 +127,14 @@@
@Override
public boolean getOffHeapEnabled() {
return true;
-- }
++ }
++ @Override
public HeapEvictor getEvictor() {
return ((GemFireCacheImpl)cache).getOffHeapEvictor();
-- }
++ }
++ @Override
public ResourceType getResourceType() {
return ResourceType.OFFHEAP_MEMORY;
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/OffHeapEvictionStatsDUnitTest.java
----------------------------------------------------------------------
diff --cc geode-core/src/test/java/com/gemstone/gemfire/internal/cache/OffHeapEvictionStatsDUnitTest.java
index 6148a52,7ac1a9a..35697d8
--- 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,37 -16,28 +16,29 @@@
*/
package com.gemstone.gemfire.internal.cache;
- import org.junit.experimental.categories.Category;
- import org.junit.Test;
-
++import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
- import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
- import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
- import com.gemstone.gemfire.test.junit.categories.DistributedTest;
-
+import java.util.Properties;
+
++import org.junit.experimental.categories.Category;
++
import com.gemstone.gemfire.cache.CacheFactory;
import com.gemstone.gemfire.distributed.DistributedSystem;
- import com.gemstone.gemfire.distributed.internal.DistributionConfig;
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 java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
++import com.gemstone.gemfire.test.junit.categories.DistributedTest;
/**
* Performs eviction stat dunit tests for off-heap regions.
- * @since 9.0
++ *
+ * @since Geode 1.0
*/
+@Category(DistributedTest.class)
public class OffHeapEvictionStatsDUnitTest extends EvictionStatsDUnitTest {
- public OffHeapEvictionStatsDUnitTest() {
- super();
- public OffHeapEvictionStatsDUnitTest(String name) {
- super(name);
-- // TODO Auto-generated constructor stub
-- }
--
@Override
public final void preTearDownAssertions() throws Exception {
SerializableRunnable checkOrphans = new SerializableRunnable() {
@@@ -70,6 -61,6 +62,7 @@@
return properties;
}
++ @Override
public void createCache() {
try {
Properties props = new Properties();
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/OfflineSnapshotJUnitTest.java
----------------------------------------------------------------------
diff --cc geode-core/src/test/java/com/gemstone/gemfire/internal/cache/OfflineSnapshotJUnitTest.java
index bab336b,748588f..639d7ea
--- 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,18 -16,8 +16,20 @@@
*/
package com.gemstone.gemfire.internal.cache;
++import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
++
+import java.io.File;
+import java.io.FilenameFilter;
+import java.util.HashMap;
+import java.util.Map;
+
import com.examples.snapshot.MyObject;
import com.examples.snapshot.MyPdxSerializer;
+import org.junit.After;
+import org.junit.Before;
+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.DiskStore;
@@@ -118,10 -118,10 +120,10 @@@ public class OfflineSnapshotJUnitTest
}
}
- public void reset() {
+ private void reset() {
CacheFactory cf = new CacheFactory()
- .set("mcast-port", "0")
- .set("log-level", "error")
+ .set(MCAST_PORT, "0")
+ .set(LOG_LEVEL, "error")
.setPdxSerializer(new MyPdxSerializer())
.setPdxPersistent(true);
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/P2PDeltaPropagationDUnitTest.java
----------------------------------------------------------------------
diff --cc geode-core/src/test/java/com/gemstone/gemfire/internal/cache/P2PDeltaPropagationDUnitTest.java
index 1607c7b,d9260a6..28ddd12
--- 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,40 -16,29 +16,40 @@@
*/
package com.gemstone.gemfire.internal.cache;
++import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.util.Properties;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
import com.gemstone.gemfire.DeltaTestImpl;
-import com.gemstone.gemfire.cache.*;
+import com.gemstone.gemfire.cache.AttributesFactory;
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.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.client.internal.PoolImpl;
import com.gemstone.gemfire.cache.server.CacheServer;
import com.gemstone.gemfire.cache.util.CacheListenerAdapter;
import com.gemstone.gemfire.distributed.DistributedSystem;
- import com.gemstone.gemfire.distributed.internal.DistributionConfig;
import com.gemstone.gemfire.internal.AvailablePort;
import com.gemstone.gemfire.internal.tcp.ConnectionTable;
-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;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
/**
- *
* Tests the P2P delta propagation functionality.
- *
*/
-public class P2PDeltaPropagationDUnitTest extends DistributedTestCase
-{
+@Category(DistributedTest.class)
+public class P2PDeltaPropagationDUnitTest extends JUnit4DistributedTestCase {
static VM server1 = null;
@@@ -452,10 -436,10 +452,10 @@@
public static void createServerCache(Boolean flag, DataPolicy policy,
Scope scope, Boolean listener, Boolean interestPolicyAll,
Integer port) throws Exception {
- P2PDeltaPropagationDUnitTest test = new P2PDeltaPropagationDUnitTest("temp");
+ P2PDeltaPropagationDUnitTest test = new P2PDeltaPropagationDUnitTest();
Properties props = new Properties();
if (!flag) {
- props.setProperty(DistributionConfig.DELTA_PROPAGATION_PROP_NAME, "false");
+ props.setProperty(DELTA_PROPAGATION, "false");
}
cache = test.createCache(props);
AttributesFactory factory = new AttributesFactory();
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PRDataStoreMemoryJUnitTest.java
----------------------------------------------------------------------
diff --cc geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PRDataStoreMemoryJUnitTest.java
index 563644c,c28a54d..fe2ca3f
--- 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,23 -16,18 +16,23 @@@
*/
package com.gemstone.gemfire.internal.cache;
-import com.gemstone.gemfire.cache.*;
-import com.gemstone.gemfire.distributed.DistributedSystem;
-import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
++import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.util.Properties;
+
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.experimental.categories.Category;
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
-import static org.junit.Assert.assertEquals;
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.PartitionAttributes;
+import com.gemstone.gemfire.cache.PartitionAttributesFactory;
+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;
/**
* Tests memory allocation operations on a PartitionedRegion on a single node.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionAPIConserveSocketsFalseDUnitTest.java
----------------------------------------------------------------------
diff --cc geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionAPIConserveSocketsFalseDUnitTest.java
index e2e2191,8882238..b53aa5a
--- 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
@@@ -27,28 -20,25 +20,23 @@@ import static com.gemstone.gemfire.dist
import java.util.Properties;
- import com.gemstone.gemfire.distributed.internal.DistributionConfig;
++import org.junit.experimental.categories.Category;
++
++import com.gemstone.gemfire.test.junit.categories.DistributedTest;
+
/**
* Test all the PartitionedRegion api calls when ConserveSockets is set to false
- * @since 5.0
++ *
+ * @since GemFire 5.0
* @see com.gemstone.gemfire.distributed.DistributedSystem#setThreadsSocketPolicy(boolean)
*/
-public class PartitionedRegionAPIConserveSocketsFalseDUnitTest extends
- PartitionedRegionAPIDUnitTest
-{
+@Category(DistributedTest.class)
- public class PartitionedRegionAPIConserveSocketsFalseDUnitTest extends
- PartitionedRegionAPIDUnitTest
- {
-
- public PartitionedRegionAPIConserveSocketsFalseDUnitTest() {
- super();
- }
-
++public class PartitionedRegionAPIConserveSocketsFalseDUnitTest extends PartitionedRegionAPIDUnitTest {
- public PartitionedRegionAPIConserveSocketsFalseDUnitTest(String name) {
- super(name);
- }
-
-
-- public Properties getDistributedSystemProperties()
-- {
++ @Override
++ public Properties getDistributedSystemProperties() {
Properties ret = new Properties();
- ret.setProperty(DistributionConfig.CONSERVE_SOCKETS_NAME, "false");
+ ret.setProperty(CONSERVE_SOCKETS, "false");
return ret;
}
--
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionBucketCreationDistributionDUnitTest.java
----------------------------------------------------------------------
diff --cc geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionBucketCreationDistributionDUnitTest.java
index 78e5481,bb41d50..f451b01
--- 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,58 -16,25 +16,53 @@@
*/
package com.gemstone.gemfire.internal.cache;
- import org.junit.Ignore;
- import org.junit.experimental.categories.Category;
- import org.junit.Test;
-
-import com.gemstone.gemfire.cache.*;
++import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
- import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
- import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
- import com.gemstone.gemfire.test.junit.categories.DistributedTest;
-
+import java.util.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 org.junit.Ignore;
++import org.junit.Test;
++import org.junit.experimental.categories.Category;
++
+import com.gemstone.gemfire.cache.AttributesFactory;
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.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.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.*;
-
-import java.util.*;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.AsyncInvocation;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.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.junit.categories.DistributedTest;
/**
-- *
* This class tests bucket Creation and distribution for the multiple Partition
* regions.
*/
-public class PartitionedRegionBucketCreationDistributionDUnitTest extends
- PartitionedRegionDUnitTestCase
-{
+@Category(DistributedTest.class)
- public class PartitionedRegionBucketCreationDistributionDUnitTest extends
- PartitionedRegionDUnitTestCase
- {
++public class PartitionedRegionBucketCreationDistributionDUnitTest extends PartitionedRegionDUnitTestCase {
/** Prefix is used in name of Partition Region */
protected static String prPrefix = null;
@@@ -87,11 -54,11 +82,6 @@@
/** to store references of 4 vms */
VM vm[] = new VM[4];
-- /** constructor */
- public PartitionedRegionBucketCreationDistributionDUnitTest() {
- super();
- public PartitionedRegionBucketCreationDistributionDUnitTest(String name) {
- super(name);
-- }
--
/**
* This test performs following operations <br>
* 1. Validate bucket2Node region of the partition regions.</br><br>
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionCacheXMLExampleDUnitTest.java
----------------------------------------------------------------------
diff --cc geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionCacheXMLExampleDUnitTest.java
index d0e996a,a480b4c..63c46f1
--- 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,40 -16,31 +16,33 @@@
*/
package com.gemstone.gemfire.internal.cache;
- import org.junit.experimental.categories.Category;
- import org.junit.Test;
-
++import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
- import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
- import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
- import com.gemstone.gemfire.test.junit.categories.DistributedTest;
-
+import java.util.Properties;
+
++import org.junit.Test;
++import org.junit.experimental.categories.Category;
++
+ import com.gemstone.gemfire.cache.Cache;
import com.gemstone.gemfire.cache.CacheException;
+ import com.gemstone.gemfire.cache.Region;
import com.gemstone.gemfire.cache30.CacheSerializableRunnable;
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.test.junit.categories.DistributedTest;
import com.gemstone.gemfire.util.test.TestUtil;
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
-
-import java.util.Properties;
-
/**
* This class tests regions created by xml files
*/
-public class PartitionedRegionCacheXMLExampleDUnitTest extends
- PartitionedRegionDUnitTestCase {
+@Category(DistributedTest.class)
- public class PartitionedRegionCacheXMLExampleDUnitTest extends
- PartitionedRegionDUnitTestCase {
++public class PartitionedRegionCacheXMLExampleDUnitTest extends PartitionedRegionDUnitTestCase {
protected static Cache cache;
- public PartitionedRegionCacheXMLExampleDUnitTest() {
- super();
- public PartitionedRegionCacheXMLExampleDUnitTest(String name) {
- super(name);
-- }
--
- public void testExampleWithBothRootRegion() {
+ @Test
+ public void testExampleWithBothRootRegion() {
Host host = Host.getHost(0);
VM vm0 = host.getVM(0);
VM vm1 = host.getVM(1);
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionDUnitTestCase.java
----------------------------------------------------------------------
diff --cc geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionDUnitTestCase.java
index f6627f0,d964e5d..0cbab39
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionDUnitTestCase.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionDUnitTestCase.java
@@@ -16,17 -16,6 +16,12 @@@
*/
package com.gemstone.gemfire.internal.cache;
++import static org.junit.Assert.*;
++
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.experimental.categories.Category;
- import org.junit.Test;
-
- import static org.junit.Assert.*;
-
- import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
- import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
- import com.gemstone.gemfire.test.junit.categories.DistributedTest;
+
import com.gemstone.gemfire.LogWriter;
import com.gemstone.gemfire.cache.CacheException;
import com.gemstone.gemfire.cache.EvictionAction;
@@@ -44,16 -33,15 +39,18 @@@ import com.gemstone.gemfire.internal.lo
import com.gemstone.gemfire.test.dunit.Host;
import com.gemstone.gemfire.test.dunit.Invoke;
import com.gemstone.gemfire.test.dunit.SerializableRunnable;
++import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
import com.gemstone.gemfire.test.dunit.standalone.DUnitLauncher;
++import com.gemstone.gemfire.test.junit.categories.DistributedTest;
/**
* This class is extended by some PartitionedRegion related DUnit test cases
-- *
*/
-public class PartitionedRegionDUnitTestCase extends CacheTestCase
-{
+@Category(DistributedTest.class)
- public class PartitionedRegionDUnitTestCase extends JUnit4CacheTestCase
- {
++public class PartitionedRegionDUnitTestCase extends JUnit4CacheTestCase {
++
static int oldLogLevel;
++
public void setVMInfoLogLevel() {
SerializableRunnable runnable = new SerializableRunnable() {
public void run() {
@@@ -75,6 -63,6 +72,7 @@@
Host.getHost(0).getVM(i).invoke(runnable);
}
}
++
/**
* Sets the loglevel for the provided log writer
* @param l the {@link LogWriter}
@@@ -96,10 -84,10 +94,6 @@@
return ret;
}
- public PartitionedRegionDUnitTestCase() {
- super();
- public PartitionedRegionDUnitTestCase(String name) {
- super(name);
-- }
--
/**
* Tear down a PartitionedRegionTestCase by cleaning up the existing cache (mainly
* because we want to destroy any existing PartitionedRegions)
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionEvictionDUnitTest.java
----------------------------------------------------------------------
diff --cc geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionEvictionDUnitTest.java
index 70ea3b5,4e36ea8..c960332
--- 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,57 -16,30 +16,55 @@@
*/
package com.gemstone.gemfire.internal.cache;
- import org.junit.experimental.categories.Category;
- import org.junit.Test;
-
-import com.gemstone.gemfire.cache.*;
+import static org.junit.Assert.*;
+
- import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
- import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
- import com.gemstone.gemfire.test.junit.categories.DistributedTest;
-
+import java.io.File;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Properties;
+import java.util.concurrent.TimeUnit;
+
++import org.junit.Test;
++import org.junit.experimental.categories.Category;
++
+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.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.*;
-
-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) {
- super(name);
- }
-
+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.cache.internal.JUnit4CacheTestCase;
++import com.gemstone.gemfire.test.junit.categories.DistributedTest;
+
+@Category(DistributedTest.class)
+public class PartitionedRegionEvictionDUnitTest extends JUnit4CacheTestCase {
+
+ @Test
public void testHeapLRUWithOverflowToDisk() {
final Host host = Host.getHost(0);
final VM vm2 = host.getVM(2);
@@@ -210,10 -183,9 +208,10 @@@
protected void cleanUpAfterFakeNotification() {
((GemFireCacheImpl) getCache()).getHeapEvictor().testAbortAfterLoopCount = Integer.MAX_VALUE;
HeapMemoryMonitor.setTestDisableMemoryUpdates(false);
- System.clearProperty("gemfire.memoryEventTolerance");
+ System.clearProperty(DistributionConfig.GEMFIRE_PREFIX + "memoryEventTolerance");
}
+ @Test
public void testHeapLRUWithLocalDestroy() {
final Host host = Host.getHost(0);
final VM vm2 = host.getVM(2);