You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by hi...@apache.org on 2016/06/15 00:07:57 UTC
[41/94] [abbrv] [partial] incubator-geode git commit: GEODE-837:
update tests from JUnit3 to JUnit4
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXml80DUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXml80DUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXml80DUnitTest.java
index c7563e2..57aea3d 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXml80DUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXml80DUnitTest.java
@@ -20,6 +20,8 @@
*/
package com.gemstone.gemfire.cache30;
+import static org.junit.Assert.*;
+
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
@@ -29,6 +31,9 @@ import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
+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.DataPolicy;
@@ -48,15 +53,13 @@ import com.gemstone.gemfire.internal.cache.xmlcache.CacheXmlGenerator;
import com.gemstone.gemfire.internal.cache.xmlcache.DiskStoreAttributesCreation;
import com.gemstone.gemfire.internal.cache.xmlcache.RegionAttributesCreation;
import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
-/**
- *
- */
+@Category(DistributedTest.class)
public class CacheXml80DUnitTest extends CacheXml70DUnitTest {
- private static final long serialVersionUID = 225193925777688541L;
- public CacheXml80DUnitTest(String name) {
- super(name);
+ public CacheXml80DUnitTest() {
+ super();
}
protected String getGemFireVersion()
@@ -65,6 +68,7 @@ public class CacheXml80DUnitTest extends CacheXml70DUnitTest {
}
@SuppressWarnings("rawtypes")
+ @Test
public void testCompressor() {
final String regionName = "testCompressor";
@@ -91,6 +95,7 @@ public class CacheXml80DUnitTest extends CacheXml70DUnitTest {
* Restarts the cache with the new xml
* Makes sure the new cache has the 4 indexes
*/
+ @Test
public void testIndexXmlCreation() throws Exception {
CacheCreation cache = new CacheCreation();
RegionAttributesCreation attrs = new RegionAttributesCreation(cache);
@@ -176,6 +181,7 @@ public class CacheXml80DUnitTest extends CacheXml70DUnitTest {
observer.reset();
}
+ @Test
public void testCacheServerDisableTcpNoDelay()
throws CacheException
{
@@ -191,6 +197,7 @@ public class CacheXml80DUnitTest extends CacheXml70DUnitTest {
}
+ @Test
public void testCacheServerEnableTcpNoDelay()
throws CacheException
{
@@ -205,6 +212,7 @@ public class CacheXml80DUnitTest extends CacheXml70DUnitTest {
testXml(cache);
}
+ @Test
public void testDiskUsage() {
CacheCreation cache = new CacheCreation();
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXml81DUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXml81DUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXml81DUnitTest.java
index 1b39b2c..0ce5215 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXml81DUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXml81DUnitTest.java
@@ -16,8 +16,10 @@
*/
package com.gemstone.gemfire.cache30;
-import org.junit.Rule;
+import static org.junit.Assert.*;
+
import org.junit.Test;
+import org.junit.experimental.categories.Category;
import org.xml.sax.Locator;
import org.xml.sax.SAXParseException;
@@ -32,6 +34,7 @@ import com.gemstone.gemfire.internal.cache.xmlcache.CacheXml;
import com.gemstone.gemfire.internal.cache.xmlcache.RegionAttributesCreation;
import com.gemstone.gemfire.internal.cache.xmlcache.XmlParser;
import com.gemstone.gemfire.test.dunit.IgnoredException;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
/**
* Tests 8.1 schema based configuration. From this point all config test cases
@@ -40,11 +43,12 @@ import com.gemstone.gemfire.test.dunit.IgnoredException;
*
* @since GemFire 8.1
*/
+@Category(DistributedTest.class)
public class CacheXml81DUnitTest extends CacheXml80DUnitTest {
private static final long serialVersionUID = 1L;
- public CacheXml81DUnitTest(String name) {
- super(name);
+ public CacheXml81DUnitTest() {
+ super();
}
protected String getGemFireVersion() {
@@ -61,6 +65,7 @@ public class CacheXml81DUnitTest extends CacheXml80DUnitTest {
*
* @since GemFire 8.1
*/
+ @Test
public void testCacheExtension() {
final CacheCreation cache = new CacheCreation();
final MockCacheExtension extension = new MockCacheExtension("testCacheExtension");
@@ -93,6 +98,7 @@ public class CacheXml81DUnitTest extends CacheXml80DUnitTest {
*
* @since GemFire 8.1
*/
+ @Test
public void testRegionExtension() {
final String regionName = "testRegionExtension";
final CacheCreation cache = new CacheCreation();
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXmlGeode10DUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXmlGeode10DUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXmlGeode10DUnitTest.java
index be4c657..39376e7 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXmlGeode10DUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXmlGeode10DUnitTest.java
@@ -20,6 +20,15 @@
*/
package com.gemstone.gemfire.cache30;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+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.Declarable;
import com.gemstone.gemfire.cache.Region;
@@ -35,18 +44,15 @@ import com.gemstone.gemfire.internal.cache.xmlcache.RegionAttributesCreation;
import com.gemstone.gemfire.internal.cache.xmlcache.ResourceManagerCreation;
import com.gemstone.gemfire.internal.i18n.LocalizedStrings;
import com.gemstone.gemfire.test.dunit.IgnoredException;
-
-import java.util.List;
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
+@Category(DistributedTest.class)
public class CacheXmlGeode10DUnitTest extends CacheXml81DUnitTest {
private static final long serialVersionUID = -6437436147079728413L;
- public CacheXmlGeode10DUnitTest(String name) {
- super(name);
+ public CacheXmlGeode10DUnitTest() {
+ super();
}
@@ -58,6 +64,7 @@ public class CacheXmlGeode10DUnitTest extends CacheXml81DUnitTest {
}
@SuppressWarnings("rawtypes")
+ @Test
public void testEnableOffHeapMemory() {
try {
System.setProperty(DistributionConfig.GEMFIRE_PREFIX + OFF_HEAP_MEMORY_SIZE, "1m");
@@ -89,6 +96,7 @@ public class CacheXmlGeode10DUnitTest extends CacheXml81DUnitTest {
}
@SuppressWarnings("rawtypes")
+ @Test
public void testEnableOffHeapMemoryRootRegionWithoutOffHeapMemoryThrowsException() {
final String regionName = getUniqueName();
@@ -115,6 +123,7 @@ public class CacheXmlGeode10DUnitTest extends CacheXml81DUnitTest {
}
@SuppressWarnings({ "rawtypes", "deprecation", "unchecked" })
+ @Test
public void testEnableOffHeapMemorySubRegionWithoutOffHeapMemoryThrowsException() {
final String rootRegionName = getUniqueName();
final String subRegionName = "subRegion";
@@ -154,6 +163,7 @@ public class CacheXmlGeode10DUnitTest extends CacheXml81DUnitTest {
* eviction-off-heap-percentage attributes
* @throws Exception
*/
+ @Test
public void testResourceManagerThresholds() throws Exception {
CacheCreation cache = new CacheCreation();
final float low = 90.0f;
@@ -170,8 +180,8 @@ public class CacheXmlGeode10DUnitTest extends CacheXml81DUnitTest {
testXml(cache);
{
c = getCache();
- assertEquals(low, c.getResourceManager().getEvictionOffHeapPercentage());
- assertEquals(high, c.getResourceManager().getCriticalOffHeapPercentage());
+ assertEquals(low, c.getResourceManager().getEvictionOffHeapPercentage(),0);
+ assertEquals(high, c.getResourceManager().getCriticalOffHeapPercentage(),0);
}
closeCache();
@@ -183,8 +193,8 @@ public class CacheXmlGeode10DUnitTest extends CacheXml81DUnitTest {
testXml(cache);
{
c = getCache();
- assertEquals(low, c.getResourceManager().getEvictionOffHeapPercentage());
- assertEquals(low + 1, c.getResourceManager().getCriticalOffHeapPercentage());
+ assertEquals(low, c.getResourceManager().getEvictionOffHeapPercentage(),0);
+ assertEquals(low + 1, c.getResourceManager().getCriticalOffHeapPercentage(),0);
}
closeCache();
@@ -210,8 +220,8 @@ public class CacheXmlGeode10DUnitTest extends CacheXml81DUnitTest {
testXml(cache);
{
c = getCache();
- assertEquals(0f, c.getResourceManager().getEvictionOffHeapPercentage());
- assertEquals(low, c.getResourceManager().getCriticalOffHeapPercentage());
+ assertEquals(0f, c.getResourceManager().getEvictionOffHeapPercentage(),0);
+ assertEquals(low, c.getResourceManager().getCriticalOffHeapPercentage(),0);
}
closeCache();
@@ -223,8 +233,8 @@ public class CacheXmlGeode10DUnitTest extends CacheXml81DUnitTest {
testXml(cache);
{
c = getCache();
- assertEquals(low, c.getResourceManager().getEvictionOffHeapPercentage());
- assertEquals(0f, c.getResourceManager().getCriticalOffHeapPercentage());
+ assertEquals(low, c.getResourceManager().getEvictionOffHeapPercentage(),0);
+ assertEquals(0f, c.getResourceManager().getCriticalOffHeapPercentage(),0);
}
closeCache();
@@ -235,14 +245,15 @@ public class CacheXmlGeode10DUnitTest extends CacheXml81DUnitTest {
cache.setResourceManagerCreation(rmc);
testXml(cache);
c = getCache();
- assertEquals(0f, c.getResourceManager().getEvictionOffHeapPercentage());
- assertEquals(0f, c.getResourceManager().getCriticalOffHeapPercentage());
+ assertEquals(0f, c.getResourceManager().getEvictionOffHeapPercentage(),0);
+ assertEquals(0f, c.getResourceManager().getCriticalOffHeapPercentage(),0);
} finally {
System.clearProperty(DistributionConfig.GEMFIRE_PREFIX + OFF_HEAP_MEMORY_SIZE);
}
}
@SuppressWarnings("rawtypes")
+ @Test
public void testAsyncEventQueueIsEnableEvictionAndExpirationAttribute() {
final String regionName = "testAsyncEventQueueIsEnableEvictionAndExpirationAttribute";
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXmlTestCase.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXmlTestCase.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXmlTestCase.java
index 7e0d552..7942db4 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXmlTestCase.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXmlTestCase.java
@@ -16,20 +16,26 @@
*/
package com.gemstone.gemfire.cache30;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.util.Properties;
+
import com.gemstone.gemfire.cache.Cache;
import com.gemstone.gemfire.internal.cache.xmlcache.CacheCreation;
import com.gemstone.gemfire.internal.cache.xmlcache.CacheXml;
import com.gemstone.gemfire.internal.cache.xmlcache.CacheXmlGenerator;
import com.gemstone.gemfire.internal.cache.xmlcache.ClientCacheCreation;
import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
import com.gemstone.gemfire.util.test.TestUtil;
-import java.io.*;
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
-
-public class CacheXmlTestCase extends CacheTestCase {
+public class CacheXmlTestCase extends JUnit4CacheTestCase {
/** The file used by this test (method) to initialize the cache */
private File xmlFile;
@@ -37,10 +43,6 @@ public class CacheXmlTestCase extends CacheTestCase {
/** set this to false if a test needs a non-loner distributed system */
static boolean lonerDistributedSystem = true;
- public CacheXmlTestCase(String name) {
- super(name);
- }
-
@Override
public final void postSetUp() throws Exception {
disconnectAllFromDS();
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/CallbackArgDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/CallbackArgDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/CallbackArgDUnitTest.java
index 6b95b03..03b5124 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/CallbackArgDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/CallbackArgDUnitTest.java
@@ -16,6 +16,15 @@
*/
package com.gemstone.gemfire.cache30;
+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.Arrays;
import java.util.Iterator;
@@ -44,15 +53,16 @@ import com.gemstone.gemfire.test.dunit.VM;
*
* @since GemFire 5.0
*/
-public class CallbackArgDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class CallbackArgDUnitTest extends JUnit4CacheTestCase {
// private transient Region r;
// private transient DistributedMember otherId;
protected transient int invokeCount;
protected static String callbackArg;
- public CallbackArgDUnitTest(String name) {
- super(name);
+ public CallbackArgDUnitTest() {
+ super();
}
private VM getOtherVm() {
@@ -126,9 +136,11 @@ public class CallbackArgDUnitTest extends CacheTestCase {
/**
* make sure callback arg is NOT_AVAILABLE in all the places it should be
*/
+ @Test
public void testForNA_CA() throws CacheException {
doTest();
}
+ @Test
public void testForCA() throws Exception {
callbackArg = "cbArg";
getOtherVm().invoke(new SerializableCallable() {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClearMultiVmCallBkDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClearMultiVmCallBkDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClearMultiVmCallBkDUnitTest.java
index bfd32fc..6573ed5 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClearMultiVmCallBkDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClearMultiVmCallBkDUnitTest.java
@@ -22,26 +22,33 @@
*/
package com.gemstone.gemfire.cache30;
-import com.gemstone.gemfire.cache.*;
+import static com.gemstone.gemfire.test.dunit.Assert.*;
+
+import java.util.Properties;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.cache.AttributesFactory;
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.CacheListener;
+import com.gemstone.gemfire.cache.CacheTransactionManager;
+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.util.CacheListenerAdapter;
import com.gemstone.gemfire.distributed.DistributedSystem;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
import com.gemstone.gemfire.test.dunit.Host;
import com.gemstone.gemfire.test.dunit.LogWriterUtils;
import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
-import java.util.Properties;
+@Category(DistributedTest.class)
+public class ClearMultiVmCallBkDUnitTest extends JUnit4DistributedTestCase { // TODO: reformat
-/**
- *
- */
-public class ClearMultiVmCallBkDUnitTest extends DistributedTestCase{
-
- /** Creates a new instance of ClearMultiVmCallBkDUnitTest */
- public ClearMultiVmCallBkDUnitTest(String name) {
- super(name);
- }
-
static Cache cache;
static Properties props = new Properties();
static Properties propsWork = new Properties();
@@ -71,43 +78,30 @@ public class ClearMultiVmCallBkDUnitTest extends DistributedTestCase{
}
public static void createCache(){
- try{
- CacheListener aListener = new ListenerCallBk();
- // props.setProperty(DistributionConfig.SystemConfigurationProperties.MCAST_PORT, "1234");
-// ds = DistributedSystem.connect(props);
- ds = (new ClearMultiVmCallBkDUnitTest("temp")).getSystem(props);
-
- cache = CacheFactory.create(ds);
- AttributesFactory factory = new AttributesFactory();
- factory.setScope(Scope.DISTRIBUTED_ACK);
-
- // Set Cachelisterner : aListener
-
- factory.setCacheListener(aListener);
- RegionAttributes attr = factory.create();
-
- region = cache.createRegion("map", attr);
-
-
- } catch (Exception ex){
- ex.printStackTrace();
- }
+ CacheListener aListener = new ListenerCallBk();
+ ds = (new ClearMultiVmCallBkDUnitTest()).getSystem(props);
+
+ cache = CacheFactory.create(ds);
+ AttributesFactory factory = new AttributesFactory();
+ factory.setScope(Scope.DISTRIBUTED_ACK);
+
+ // Set Cachelisterner : aListener
+
+ factory.setCacheListener(aListener);
+ RegionAttributes attr = factory.create();
+
+ region = cache.createRegion("map", attr);
}
public static void closeCache(){
- try{
-
- cache.close();
- ds.disconnect();
-
- } catch (Exception ex){
- ex.printStackTrace();
- }
+ cache.close();
+ ds.disconnect();
}
//test methods
- public void testClearSingleVM(){
+ @Test
+ public void testClearSingleVM(){
Host host = Host.getHost(0);
VM vm0 = host.getVM(0);
@@ -135,7 +129,8 @@ public class ClearMultiVmCallBkDUnitTest extends DistributedTestCase{
}//end of test case1
- public void testClearMultiVM(){
+ @Test
+ public void testClearMultiVM(){
Host host = Host.getHost(0);
VM vm0 = host.getVM(0);
@@ -170,7 +165,7 @@ public class ClearMultiVmCallBkDUnitTest extends DistributedTestCase{
}
}catch(Exception ex){
ex.printStackTrace();
- fail("Failed while region.put");
+ fail("Failed while region.put", ex);
}
return obj;
}
@@ -180,7 +175,7 @@ public class ClearMultiVmCallBkDUnitTest extends DistributedTestCase{
try{
obj = region.get(ob);
} catch(Exception ex){
- fail("Failed while region.get");
+ fail("Failed while region.get", ex);
}
return obj;
}
@@ -190,7 +185,7 @@ public class ClearMultiVmCallBkDUnitTest extends DistributedTestCase{
try{
flag = region.containsValue(ob);
}catch(Exception ex){
- fail("Failed while region.containsValueMethod");
+ fail("Failed while region.containsValueMethod", ex);
}
return flag;
}
@@ -200,7 +195,7 @@ public class ClearMultiVmCallBkDUnitTest extends DistributedTestCase{
try{
i = region.size();
}catch(Exception ex){
- fail("Failed while region.size");
+ fail("Failed while region.size", ex);
}
return i;
}
@@ -209,7 +204,7 @@ public class ClearMultiVmCallBkDUnitTest extends DistributedTestCase{
try{
region.clear();
} catch(Exception ex){
- ex.printStackTrace();
+ fail("clearMethod failed", ex);
}
}
@@ -226,13 +221,8 @@ public class ClearMultiVmCallBkDUnitTest extends DistributedTestCase{
region.put(""+i, "inAfterClear");
afterClear = true;
}catch (Exception e){
- //
+ fail("afterRegionClear failed", e);
}
-
}
-
}
-
-
-
}//end of class
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClearMultiVmDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClearMultiVmDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClearMultiVmDUnitTest.java
index 42d7e4b..bf31151 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClearMultiVmDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClearMultiVmDUnitTest.java
@@ -22,8 +22,13 @@
*/
package com.gemstone.gemfire.cache30;
+import static org.junit.Assert.*;
+
import java.util.Properties;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
import com.gemstone.gemfire.cache.AttributesFactory;
import com.gemstone.gemfire.cache.Cache;
import com.gemstone.gemfire.cache.CacheException;
@@ -38,22 +43,16 @@ import com.gemstone.gemfire.cache.UnsupportedOperationInTransactionException;
import com.gemstone.gemfire.distributed.DistributedSystem;
import com.gemstone.gemfire.test.dunit.Assert;
import com.gemstone.gemfire.test.dunit.AsyncInvocation;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
import com.gemstone.gemfire.test.dunit.Host;
import com.gemstone.gemfire.test.dunit.Invoke;
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.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
-/**
- *
- */
-public class ClearMultiVmDUnitTest extends DistributedTestCase{
-
- /** Creates a new instance of ClearMultiVmDUnitTest */
- public ClearMultiVmDUnitTest(String name) {
- super(name);
- }
+@Category(DistributedTest.class)
+public class ClearMultiVmDUnitTest extends JUnit4DistributedTestCase { // TODO: reformat
static Cache cache;
static Properties props = new Properties();
@@ -86,7 +85,7 @@ public class ClearMultiVmDUnitTest extends DistributedTestCase{
public static void createCache(){
try{
- ds = (new ClearMultiVmDUnitTest("temp")).getSystem(props);
+ ds = (new ClearMultiVmDUnitTest()).getSystem(props);
cache = CacheFactory.create(ds);
AttributesFactory factory = new AttributesFactory();
factory.setScope(Scope.DISTRIBUTED_ACK);
@@ -116,7 +115,8 @@ public class ClearMultiVmDUnitTest extends DistributedTestCase{
//test methods
- public void testClearSimpleScenarios(){
+ @Test
+ public void testClearSimpleScenarios(){
Host host = Host.getHost(0);
VM vm0 = host.getVM(0);
@@ -195,7 +195,8 @@ public class ClearMultiVmDUnitTest extends DistributedTestCase{
}//end of test case
- public void testClearMultiVM() throws Throwable{
+ @Test
+ public void testClearMultiVM() throws Throwable{
Host host = Host.getHost(0);
VM vm0 = host.getVM(0);
VM vm1 = host.getVM(1);
@@ -240,7 +241,8 @@ public class ClearMultiVmDUnitTest extends DistributedTestCase{
}//end of testClearMultiVM
- public void testClearExceptions(){
+ @Test
+ public void testClearExceptions(){
Host host = Host.getHost(0);
VM vm0 = host.getVM(0);
VM vm1 = host.getVM(1);
@@ -271,7 +273,8 @@ public class ClearMultiVmDUnitTest extends DistributedTestCase{
}//end of testClearExceptions
- public void testGiiandClear() throws Throwable{
+ @Test
+ public void testGiiandClear() throws Throwable{
if (false) {
getSystem().getLogWriter().severe("testGiiandClear skipped because of bug 34963");
} else {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClientMembershipDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClientMembershipDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClientMembershipDUnitTest.java
index 27205c4..a4a6d42 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClientMembershipDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClientMembershipDUnitTest.java
@@ -16,6 +16,27 @@
*/
package com.gemstone.gemfire.cache30;
+import static com.gemstone.gemfire.test.dunit.Assert.*;
+
+import java.io.IOException;
+import java.net.InetAddress;
+import java.net.InetSocketAddress;
+import java.net.Socket;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+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.TimeUnit;
+
+import com.jayway.awaitility.Awaitility;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
import com.gemstone.gemfire.InternalGemFireException;
import com.gemstone.gemfire.Statistics;
import com.gemstone.gemfire.StatisticsType;
@@ -36,17 +57,17 @@ import com.gemstone.gemfire.internal.cache.tier.sockets.ServerConnection;
import com.gemstone.gemfire.management.membership.ClientMembership;
import com.gemstone.gemfire.management.membership.ClientMembershipEvent;
import com.gemstone.gemfire.management.membership.ClientMembershipListener;
-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.IgnoredException;
+import com.gemstone.gemfire.test.dunit.Invoke;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+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.junit.categories.DistributedTest;
import com.gemstone.gemfire.test.junit.categories.FlakyTest;
-import com.jayway.awaitility.Awaitility;
-import org.junit.experimental.categories.Category;
-
-import java.io.IOException;
-import java.net.InetAddress;
-import java.net.InetSocketAddress;
-import java.net.Socket;
-import java.util.*;
-import java.util.concurrent.TimeUnit;
import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.LOCATORS;
import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
@@ -56,6 +77,7 @@ import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties
*
* @since GemFire 4.2.1
*/
+@Category(DistributedTest.class)
public class ClientMembershipDUnitTest extends ClientServerTestCase {
protected static final boolean CLIENT = true;
@@ -67,10 +89,6 @@ public class ClientMembershipDUnitTest extends ClientServerTestCase {
private static Properties properties;
- public ClientMembershipDUnitTest(String name) {
- super(name);
- }
-
@Override
public final void postTearDownCacheTestCase() throws Exception {
Invoke.invokeInEveryVM((() -> cleanup()));
@@ -105,6 +123,7 @@ public class ClientMembershipDUnitTest extends ClientServerTestCase {
* test that a server times out waiting for a handshake that
* never arrives.
*/
+ @Test
public void testConnectionTimeout() throws Exception {
IgnoredException.addIgnoredException("failed accepting client connection");
final Host host = Host.getHost(0);
@@ -207,6 +226,7 @@ public class ClientMembershipDUnitTest extends ClientServerTestCase {
}
}
+ @Test
public void testSynchronousEvents() throws Exception {
getSystem();
InternalClientMembership.setForceSynchronous(true);
@@ -220,6 +240,7 @@ public class ClientMembershipDUnitTest extends ClientServerTestCase {
/**
* Tests event notification methods on ClientMembership.
*/
+ @Test
public void testBasicEvents() throws Exception {
getSystem();
doTestBasicEvents();
@@ -397,6 +418,7 @@ public class ClientMembershipDUnitTest extends ClientServerTestCase {
* Tests unregisterClientMembershipListener to ensure that no further events
* are delivered to unregistered listeners.
*/
+ @Test
public void testUnregisterClientMembershipListener() throws Exception {
final boolean[] fired = new boolean[1];
final DistributedMember[] member = new DistributedMember[1];
@@ -453,6 +475,7 @@ public class ClientMembershipDUnitTest extends ClientServerTestCase {
assertFalse(isClient[0]);
}
+ @Test
public void testMultipleListeners() throws Exception {
final int NUM_LISTENERS = 4;
final boolean[] fired = new boolean[NUM_LISTENERS];
@@ -721,6 +744,7 @@ public class ClientMembershipDUnitTest extends ClientServerTestCase {
* crashes or departs gracefully, the client will detect this as a crash.
*/
@Category(FlakyTest.class) // GEODE-1240: eats exceptions, random ports, time sensitive waits
+ @Test
public void testClientMembershipEventsInClient() throws Exception {
getSystem();
IgnoredException.addIgnoredException("IOException");
@@ -927,6 +951,7 @@ public class ClientMembershipDUnitTest extends ClientServerTestCase {
* Tests notification of events in server process. Bridge servers detect
* client joins when the client connects to the server.
*/
+ @Test
public void testClientMembershipEventsInServer() throws Exception {
final boolean[] fired = new boolean[3];
final DistributedMember[] member = new DistributedMember[3];
@@ -1182,6 +1207,7 @@ public class ClientMembershipDUnitTest extends ClientServerTestCase {
* Tests registration and event notification in conjunction with
* disconnecting and reconnecting to DistributedSystem.
*/
+ @Test
public void testLifecycle() throws Exception {
final boolean[] fired = new boolean[3];
final DistributedMember[] member = new DistributedMember[3];
@@ -1265,6 +1291,7 @@ public class ClientMembershipDUnitTest extends ClientServerTestCase {
* Starts up server in controller vm and 4 clients, then calls and tests
* ClientMembership.getConnectedClients().
*/
+ @Test
public void testGetConnectedClients() throws Exception {
final String name = this.getUniqueName();
final int[] ports = new int[1];
@@ -1350,6 +1377,7 @@ public class ClientMembershipDUnitTest extends ClientServerTestCase {
* Starts up 4 server and the controller vm as a client, then calls and tests
* ClientMembership.getConnectedServers().
*/
+ @Test
public void testGetConnectedServers() throws Exception {
final Host host = Host.getHost(0);
final String name = this.getUniqueName();
@@ -1454,6 +1482,7 @@ public class ClientMembershipDUnitTest extends ClientServerTestCase {
* Tests getConnectedClients(boolean onlyClientsNotifiedByThisServer) where
* onlyClientsNotifiedByThisServer is true.
*/
+ @Test
public void testGetNotifiedClients() throws Exception {
final Host host = Host.getHost(0);
final String name = this.getUniqueName();
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClientMembershipSelectorDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClientMembershipSelectorDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClientMembershipSelectorDUnitTest.java
index 79fd543..0971db3 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClientMembershipSelectorDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClientMembershipSelectorDUnitTest.java
@@ -16,15 +16,18 @@
*/
package com.gemstone.gemfire.cache30;
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
+
/**
* Same as parent but uses selector in server
*
* @since GemFire 5.1
*/
+@Category(DistributedTest.class)
public class ClientMembershipSelectorDUnitTest extends ClientMembershipDUnitTest {
- public ClientMembershipSelectorDUnitTest(String name) {
- super(name);
- }
+ @Override
protected int getMaxThreads() {
return 2;
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClientRegisterInterestDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClientRegisterInterestDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClientRegisterInterestDUnitTest.java
index b6cffa0..8d0eae7 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClientRegisterInterestDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClientRegisterInterestDUnitTest.java
@@ -16,31 +16,41 @@
*/
package com.gemstone.gemfire.cache30;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static com.gemstone.gemfire.test.dunit.Assert.*;
+
+import java.io.IOException;
+import java.util.Properties;
+
+import org.junit.Ignore;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
import com.gemstone.gemfire.cache.AttributesFactory;
import com.gemstone.gemfire.cache.CacheException;
+import com.gemstone.gemfire.cache.CacheLoaderException;
import com.gemstone.gemfire.cache.Region;
import com.gemstone.gemfire.cache.Scope;
import com.gemstone.gemfire.cache.client.SubscriptionNotEnabledException;
import com.gemstone.gemfire.cache.client.internal.PoolImpl;
-import com.gemstone.gemfire.test.dunit.*;
-
-import java.io.IOException;
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.LOCATORS;
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
/**
* Tests the client register interest
*
* @since GemFire 4.2.3
*/
+@Category(DistributedTest.class)
public class ClientRegisterInterestDUnitTest extends ClientServerTestCase {
- public ClientRegisterInterestDUnitTest(String name) {
- super(name);
- }
-
+ protected static int bridgeServerPort;
+
@Override
public final void postTearDownCacheTestCase() throws Exception {
disconnectAllFromDS(); // cleans up bridge server and client and lonerDS
@@ -50,6 +60,7 @@ public class ClientRegisterInterestDUnitTest extends ClientServerTestCase {
* Tests for Bug 35381 Calling register interest if
* establishCallbackConnection is not set causes bridge server NPE.
*/
+ @Test
public void testBug35381() throws Exception {
final Host host = Host.getHost(0);
final String name = this.getUniqueName();
@@ -73,7 +84,7 @@ public class ClientRegisterInterestDUnitTest extends ClientServerTestCase {
}
catch (IOException e) {
LogWriterUtils.getLogWriter().error("startBridgeServer threw IOException", e);
- fail("startBridgeServer threw IOException " + e.getMessage());
+ fail("startBridgeServer threw IOException ", e);
}
assertTrue(bridgeServerPort != 0);
@@ -107,7 +118,7 @@ public class ClientRegisterInterestDUnitTest extends ClientServerTestCase {
catch (SubscriptionNotEnabledException expected) {
}
}
- protected static int bridgeServerPort;
+
private static int getBridgeServerPort() {
return bridgeServerPort;
}
@@ -125,7 +136,9 @@ public class ClientRegisterInterestDUnitTest extends ClientServerTestCase {
* <p>Bug 35655 "a single failed re-registration causes all other pending
* re-registrations to be cancelled"
*/
- public void _testRegisterInterestFailover() throws Exception {
+ @Ignore("TODO")
+ @Test
+ public void testRegisterInterestFailover() throws Exception {
// controller is bridge client
final Host host = Host.getHost(0);
@@ -159,7 +172,7 @@ public class ClientRegisterInterestDUnitTest extends ClientServerTestCase {
}
catch (IOException e) {
LogWriterUtils.getLogWriter().error("startBridgeServer threw IOException", e);
- fail("startBridgeServer threw IOException " + e.getMessage());
+ fail("startBridgeServer threw IOException ", e);
}
assertTrue(bridgeServerPort != 0);
@@ -190,7 +203,7 @@ public class ClientRegisterInterestDUnitTest extends ClientServerTestCase {
}
catch (IOException e) {
LogWriterUtils.getLogWriter().error("startBridgeServer threw IOException", e);
- fail("startBridgeServer threw IOException " + e.getMessage());
+ fail("startBridgeServer threw IOException ", e);
}
assertTrue(bridgeServerPort != 0);
@@ -305,7 +318,7 @@ public class ClientRegisterInterestDUnitTest extends ClientServerTestCase {
}
catch (IOException e) {
LogWriterUtils.getLogWriter().error("startBridgeServer threw IOException", e);
- fail("startBridgeServer threw IOException " + e.getMessage());
+ fail("startBridgeServer threw IOException ", e);
}
}
});
@@ -331,7 +344,7 @@ public class ClientRegisterInterestDUnitTest extends ClientServerTestCase {
assertEquals(null, region2.get(key2));
fail("CacheLoaderException expected");
}
- catch (com.gemstone.gemfire.cache.CacheLoaderException e) {
+ catch (CacheLoaderException e) {
}
// region2 registration should be gone now
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClientRegisterInterestSelectorDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClientRegisterInterestSelectorDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClientRegisterInterestSelectorDUnitTest.java
index d4d44c5..0638c85 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClientRegisterInterestSelectorDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClientRegisterInterestSelectorDUnitTest.java
@@ -16,15 +16,18 @@
*/
package com.gemstone.gemfire.cache30;
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
+
/**
* Same as parent but uses selector in server
*
* @since GemFire 5.1
*/
+@Category(DistributedTest.class)
public class ClientRegisterInterestSelectorDUnitTest extends ClientRegisterInterestDUnitTest {
- public ClientRegisterInterestSelectorDUnitTest(String name) {
- super(name);
- }
+ @Override
protected int getMaxThreads() {
return 2;
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClientServerCCEDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClientServerCCEDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClientServerCCEDUnitTest.java
index 80f932e..63b621e 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClientServerCCEDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClientServerCCEDUnitTest.java
@@ -17,8 +17,24 @@
package com.gemstone.gemfire.cache30;
import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
-
-import com.gemstone.gemfire.cache.*;
+import static org.junit.Assert.*;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+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.cache.AttributesFactory;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.InterestResultPolicy;
+import com.gemstone.gemfire.cache.PartitionAttributesFactory;
+import com.gemstone.gemfire.cache.Scope;
import com.gemstone.gemfire.cache.client.ClientCache;
import com.gemstone.gemfire.cache.client.ClientCacheFactory;
import com.gemstone.gemfire.cache.client.ClientRegionFactory;
@@ -29,17 +45,25 @@ import com.gemstone.gemfire.internal.cache.LocalRegion;
import com.gemstone.gemfire.internal.cache.ha.HARegionQueue;
import com.gemstone.gemfire.internal.cache.tier.sockets.CacheClientNotifier;
import com.gemstone.gemfire.internal.cache.tier.sockets.CacheClientProxy;
-import com.gemstone.gemfire.test.dunit.*;
-import junit.framework.AssertionFailedError;
-
-import java.util.*;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.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;
/**
* concurrency-control tests for client/server
*
*
*/
-public class ClientServerCCEDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class ClientServerCCEDUnitTest extends JUnit4CacheTestCase {
public static LocalRegion TestRegion;
public void setup() {
@@ -53,18 +77,21 @@ public class ClientServerCCEDUnitTest extends CacheTestCase {
HARegionQueue.setMessageSyncInterval(HARegionQueue.DEFAULT_MESSAGE_SYNC_INTERVAL);
}
- public ClientServerCCEDUnitTest(String name) {
- super(name);
+ public ClientServerCCEDUnitTest() {
+ super();
}
+ @Test
public void testClientServerRRTombstoneGC() {
clientServerTombstoneGCTest(getUniqueName(), true);
}
+ @Test
public void testClientServerPRTombstoneGC() {
clientServerTombstoneGCTest(getUniqueName(), false);
}
+ @Test
public void testPutAllInNonCCEClient() {
Host host = Host.getHost(0);
VM vm0 = host.getVM(0);
@@ -111,10 +138,12 @@ public class ClientServerCCEDUnitTest extends CacheTestCase {
* registerInterest() to protect the client cache from stray putAll
* events sitting in backup queues on the server
*/
+ @Test
public void testClientRIGetsTombstonesRR() throws Exception {
clientRIGetsTombstoneTest(getUniqueName(),true);
}
+ @Test
public void testClientRIGetsTombstonesPR() throws Exception {
clientRIGetsTombstoneTest(getUniqueName(),false);
}
@@ -167,10 +196,12 @@ public class ClientServerCCEDUnitTest extends CacheTestCase {
ensureAllTombstonesPresent(vm2);
}
+ @Test
public void testClientRIGetsInvalidEntriesRR() throws Exception {
clientRIGetsInvalidEntriesTest(getUniqueName(),true);
}
+ @Test
public void testClientRIGetsInvalidEntriesPR() throws Exception {
clientRIGetsInvalidEntriesTest(getUniqueName(),false);
}
@@ -336,10 +367,12 @@ public class ClientServerCCEDUnitTest extends CacheTestCase {
// private void closeCache(VM vm) {
+ @Test
public void testClientServerRRQueueCleanup() { // see bug #50879 if this fails
clientServerTombstoneMessageTest(true);
}
+ @Test
public void testClientServerPRQueueCleanup() { // see bug #50879 if this fails
clientServerTombstoneMessageTest(false);
}
@@ -530,7 +563,7 @@ public class ClientServerCCEDUnitTest extends CacheTestCase {
if (TestRegion.getTombstoneCount() == 0) {
LogWriterUtils.getLogWriter().warning("region has no tombstones");
// TestRegion.dumpBackingMap();
- throw new AssertionFailedError("expected to find tombstones but region is empty");
+ throw new AssertionError("expected to find tombstones but region is empty");
}
return null;
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClientServerTestCase.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClientServerTestCase.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClientServerTestCase.java
index 8dba782..e251e93 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClientServerTestCase.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClientServerTestCase.java
@@ -16,6 +16,8 @@
*/
package com.gemstone.gemfire.cache30;
+import static com.gemstone.gemfire.test.dunit.Assert.*;
+
import java.io.IOException;
import java.util.Iterator;
import java.util.Properties;
@@ -34,12 +36,12 @@ import com.gemstone.gemfire.cache.server.CacheServer;
import com.gemstone.gemfire.distributed.DistributedMember;
import com.gemstone.gemfire.distributed.DistributedSystem;
import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem;
-import com.gemstone.gemfire.distributed.internal.LonerDistributionManager;
import com.gemstone.gemfire.internal.AvailablePortHelper;
import com.gemstone.gemfire.test.dunit.DistributedTestUtils;
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;
/**
* Provides helper methods for testing clients and servers. This
@@ -48,7 +50,7 @@ import com.gemstone.gemfire.test.dunit.WaitCriterion;
*
* @since GemFire 4.2.1
*/
-public class ClientServerTestCase extends CacheTestCase {
+public abstract class ClientServerTestCase extends JUnit4CacheTestCase {
public static String NON_EXISTENT_KEY = "NON_EXISTENT_KEY";
@@ -74,10 +76,6 @@ public class ClientServerTestCase extends CacheTestCase {
protected void preTearDownClientServerTestCase() throws Exception {
}
- public ClientServerTestCase(String name) {
- super(name);
- }
-
/**
* Starts a bridge server on the given port
*
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/ConcurrentLeaveDuringGIIDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/ConcurrentLeaveDuringGIIDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/ConcurrentLeaveDuringGIIDUnitTest.java
index c2f06c1..19e37eb 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/ConcurrentLeaveDuringGIIDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/ConcurrentLeaveDuringGIIDUnitTest.java
@@ -15,6 +15,15 @@
* limitations under the License.
*/
package com.gemstone.gemfire.cache30;
+
+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.cache.Region;
import com.gemstone.gemfire.cache.RegionShortcut;
@@ -35,12 +44,14 @@ import com.gemstone.gemfire.test.dunit.WaitCriterion;
import com.gemstone.gemfire.internal.cache.LocalRegion;
import com.gemstone.gemfire.internal.cache.RegionMap;
-public class ConcurrentLeaveDuringGIIDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class ConcurrentLeaveDuringGIIDUnitTest extends JUnit4CacheTestCase {
- public ConcurrentLeaveDuringGIIDUnitTest(String name) {
- super(name);
+ public ConcurrentLeaveDuringGIIDUnitTest() {
+ super();
}
+ @Test
public void testRemoveWhenBug50988IsFixed() {
// remove this placeholder
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/DiskDistributedNoAckAsyncOverflowRegionDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/DiskDistributedNoAckAsyncOverflowRegionDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/DiskDistributedNoAckAsyncOverflowRegionDUnitTest.java
index 32712d3..8e12961 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/DiskDistributedNoAckAsyncOverflowRegionDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/DiskDistributedNoAckAsyncOverflowRegionDUnitTest.java
@@ -16,6 +16,15 @@
*/
package com.gemstone.gemfire.cache30;
+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.io.File;
import com.gemstone.gemfire.cache.AttributesFactory;
@@ -30,25 +39,23 @@ import com.gemstone.gemfire.internal.OSProcess;
*
*
*/
+@Category(DistributedTest.class)
public class DiskDistributedNoAckAsyncOverflowRegionDUnitTest extends DiskDistributedNoAckRegionTestCase {
/** Creates a new instance of DiskDistributedNoAckSyncOverflowRegionTest */
- public DiskDistributedNoAckAsyncOverflowRegionDUnitTest(String name) {
- super(name);
+ public DiskDistributedNoAckAsyncOverflowRegionDUnitTest() {
+ super();
}
protected RegionAttributes getRegionAttributes() {
AttributesFactory factory = new AttributesFactory();
factory.setScope(Scope.DISTRIBUTED_NO_ACK);
- File[] diskDirs = new File[1];
- diskDirs[0] = new File("diskRegionDirs/" + OSProcess.getId());
- diskDirs[0].mkdirs();
factory.setDiskStoreName(getCache().createDiskStoreFactory()
- .setDiskDirs(diskDirs)
+ .setDiskDirs(getDiskDirs())
.setTimeInterval(1000)
.setQueueSize(0)
- .create("DiskDistributedNoAckAsyncOverflowRegionDUnitTest")
+ .create(getUniqueName())
.getName());
factory.setEvictionAttributes(EvictionAttributes
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/DiskDistributedNoAckAsyncRegionDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/DiskDistributedNoAckAsyncRegionDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/DiskDistributedNoAckAsyncRegionDUnitTest.java
index 4677985..2bd2caa 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/DiskDistributedNoAckAsyncRegionDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/DiskDistributedNoAckAsyncRegionDUnitTest.java
@@ -16,15 +16,25 @@
*/
package com.gemstone.gemfire.cache30;
+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.cache.*;
import java.io.*;
import com.gemstone.gemfire.internal.OSProcess;
+@Category(DistributedTest.class)
public class DiskDistributedNoAckAsyncRegionDUnitTest extends DiskDistributedNoAckRegionTestCase {
/** Creates a new instance of DiskDistributedNoAckSyncOverflowRegionTest */
- public DiskDistributedNoAckAsyncRegionDUnitTest(String name) {
- super(name);
+ public DiskDistributedNoAckAsyncRegionDUnitTest() {
+ super();
}
protected RegionAttributes getRegionAttributes() {
@@ -35,10 +45,10 @@ public class DiskDistributedNoAckAsyncRegionDUnitTest extends DiskDistributedNoA
diskDirs[0] = new File("diskRegionDirs/" + OSProcess.getId());
diskDirs[0].mkdirs();
factory.setDiskStoreName(getCache().createDiskStoreFactory()
- .setDiskDirs(diskDirs)
+ .setDiskDirs(getDiskDirs())
.setTimeInterval(1000)
.setQueueSize(0)
- .create("DiskDistributedNoAckAsyncRegionDUnitTest")
+ .create(getUniqueName())
.getName());
factory.setDiskSynchronous(false);
factory.setDataPolicy(DataPolicy.PERSISTENT_REPLICATE);
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/DiskDistributedNoAckRegionTestCase.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/DiskDistributedNoAckRegionTestCase.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/DiskDistributedNoAckRegionTestCase.java
index ff6bc67..232d44a 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/DiskDistributedNoAckRegionTestCase.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/DiskDistributedNoAckRegionTestCase.java
@@ -16,22 +16,25 @@
*/
package com.gemstone.gemfire.cache30;
-import com.gemstone.gemfire.cache.*;
+import org.junit.Test;
+
+import com.gemstone.gemfire.cache.CacheException;
public abstract class DiskDistributedNoAckRegionTestCase extends DistributedNoAckRegionDUnitTest {
- final protected DiskRegionTestImpl regionTestImpl;
+ protected DiskRegionTestImpl regionTestImpl;
- /** Creates a new instance of DiskDistributedNoAckRegionTest */
- public DiskDistributedNoAckRegionTestCase(String name) {
- super(name);
- regionTestImpl = new DiskRegionTestImpl(this);
+ @Override
+ public final void postSetUp() throws Exception {
+ this.regionTestImpl = new DiskRegionTestImpl(this);
}
+ @Test
public void testCreateDiskRegion() throws CacheException {
this.regionTestImpl.testCreateDiskRegion();
}
+ @Test
public void testBackupFillInValues() throws CacheException {
this.regionTestImpl.testBackupFillValues();
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/DiskDistributedNoAckSyncOverflowRegionDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/DiskDistributedNoAckSyncOverflowRegionDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/DiskDistributedNoAckSyncOverflowRegionDUnitTest.java
index 8c3ead3..75d4f20 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/DiskDistributedNoAckSyncOverflowRegionDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/DiskDistributedNoAckSyncOverflowRegionDUnitTest.java
@@ -18,37 +18,32 @@ package com.gemstone.gemfire.cache30;
import java.io.File;
+import org.junit.experimental.categories.Category;
+
import com.gemstone.gemfire.cache.AttributesFactory;
-import com.gemstone.gemfire.cache.DiskWriteAttributes;
+import com.gemstone.gemfire.cache.DataPolicy;
import com.gemstone.gemfire.cache.EvictionAction;
import com.gemstone.gemfire.cache.EvictionAttributes;
import com.gemstone.gemfire.cache.RegionAttributes;
import com.gemstone.gemfire.cache.Scope;
-import com.gemstone.gemfire.cache.*;
import com.gemstone.gemfire.internal.OSProcess;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
-/**
- *
- *
- */
+@Category(DistributedTest.class)
public class DiskDistributedNoAckSyncOverflowRegionDUnitTest extends DiskDistributedNoAckRegionTestCase {
/** Creates a new instance of DiskDistributedNoAckSyncOverflowRegionDUnitTest */
- public DiskDistributedNoAckSyncOverflowRegionDUnitTest(String name) {
- super(name);
+ public DiskDistributedNoAckSyncOverflowRegionDUnitTest() {
+ super();
}
protected RegionAttributes getRegionAttributes() {
AttributesFactory factory = new AttributesFactory();
factory.setScope(Scope.DISTRIBUTED_NO_ACK);
- File[] diskDirs = new File[1];
- diskDirs[0] = new File("diskRegionDirs/" + OSProcess.getId());
- diskDirs[0].mkdirs();
-
factory.setDiskStoreName(getCache().createDiskStoreFactory()
- .setDiskDirs(diskDirs)
- .create("DiskDistributedNoAckSyncOverflowRegionDUnitTest")
+ .setDiskDirs(getDiskDirs())
+ .create(getUniqueName())
.getName());
factory.setEvictionAttributes(EvictionAttributes
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/DiskRegionDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/DiskRegionDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/DiskRegionDUnitTest.java
index 0e7b193..a43950e 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/DiskRegionDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/DiskRegionDUnitTest.java
@@ -16,6 +16,15 @@
*/
package com.gemstone.gemfire.cache30;
+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.io.File;
import java.lang.reflect.Array;
import java.util.BitSet;
@@ -62,13 +71,14 @@ import com.gemstone.gemfire.test.dunit.WaitCriterion;
*
* @since GemFire 3.2
*/
-public class DiskRegionDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class DiskRegionDUnitTest extends JUnit4CacheTestCase {
/**
* Creates a new <code>DiskRegionDUnitTest</code>
*/
- public DiskRegionDUnitTest(String name) {
- super(name);
+ public DiskRegionDUnitTest() {
+ super();
}
// public RegionAttributes getRegionAttributes() {
@@ -100,6 +110,7 @@ public class DiskRegionDUnitTest extends CacheTestCase {
/**
* Tests that data overflows correctly to a disk region
*/
+ @Test
public void testDiskRegionOverflow() throws Exception {
final String name = this.getUniqueName();
AttributesFactory factory = new AttributesFactory();
@@ -183,6 +194,7 @@ public class DiskRegionDUnitTest extends CacheTestCase {
* Makes sure that updates from other VMs cause existing entries to
* be written to disk.
*/
+ @Test
public void testRemoteUpdates() throws Exception {
final String name = this.getUniqueName();
@@ -287,6 +299,7 @@ public class DiskRegionDUnitTest extends CacheTestCase {
* Overflows a region and makes sure that gets of recently-used
* objects do not cause faults.
*/
+ @Test
public void testNoFaults() throws Exception {
final String name = this.getUniqueName();
AttributesFactory factory = new AttributesFactory();
@@ -336,6 +349,7 @@ public class DiskRegionDUnitTest extends CacheTestCase {
* the data in the receiver VM, thus cause the two VMs to have
* different LRU eviction behavior.
*/
+ @Test
public void testOverflowMirror() throws Exception {
final String name = this.getUniqueName();
@@ -405,6 +419,7 @@ public class DiskRegionDUnitTest extends CacheTestCase {
/**
* Tests destroying entries in an overflow region
*/
+ @Test
public void testDestroy() throws Exception {
final String name = this.getUniqueName();
AttributesFactory factory = new AttributesFactory();
@@ -465,6 +480,7 @@ public class DiskRegionDUnitTest extends CacheTestCase {
* Tests cache listeners in an overflow region are invoked and that
* their events are reasonable.
*/
+ @Test
public void testCacheEvents() throws Exception {
final String name = this.getUniqueName();
AttributesFactory factory = new AttributesFactory();
@@ -573,6 +589,7 @@ public class DiskRegionDUnitTest extends CacheTestCase {
* Tests iterating over all of the values when some have been
* overflowed.
*/
+ @Test
public void testValues() throws Exception {
final String name = this.getUniqueName();
AttributesFactory factory = new AttributesFactory();
@@ -616,6 +633,7 @@ public class DiskRegionDUnitTest extends CacheTestCase {
/**
* Tests for region.evictValue().
*/
+ @Test
public void testRegionEvictValue() throws Exception {
final String name = this.getUniqueName()+ "testRegionEvictValue";
File d = new File("DiskRegions" + OSProcess.getId());
@@ -662,6 +680,7 @@ public class DiskRegionDUnitTest extends CacheTestCase {
/**
* Tests calling region.evictValue() on region with eviction-attribute set.
*/
+ @Test
public void testEvictValueOnRegionWithEvictionAttributes() throws Exception {
final String name = this.getUniqueName()+ "testRegionEvictValue";
File d = new File("DiskRegions" + OSProcess.getId());
@@ -699,6 +718,7 @@ public class DiskRegionDUnitTest extends CacheTestCase {
* Tests that the disk region statistics are updated correctly for
* persist backup regions.
*/
+ @Test
public void testBackupStatistics() throws CacheException {
final String name = this.getUniqueName();
AttributesFactory factory = new AttributesFactory();
@@ -765,6 +785,7 @@ public class DiskRegionDUnitTest extends CacheTestCase {
}
}
+ @Test
public void testBackup() throws Exception {
final String name = this.getUniqueName();
AttributesFactory factory = new AttributesFactory();
@@ -857,6 +878,7 @@ public class DiskRegionDUnitTest extends CacheTestCase {
* com.gemstone.gemfire.cache.Region.Entry#getValue values} of
* region entries that have been overflowed.
*/
+ @Test
public void testRegionEntryValues() throws Exception {
final String name = this.getUniqueName();
AttributesFactory factory = new AttributesFactory();
@@ -900,6 +922,7 @@ public class DiskRegionDUnitTest extends CacheTestCase {
* Tests that once an overflowed entry is {@linkplain
* Region#invalidate invalidated} its value is gone.
*/
+ @Test
public void testInvalidate() throws Exception {
final String name = this.getUniqueName();
AttributesFactory factory = new AttributesFactory();
@@ -934,6 +957,7 @@ public class DiskRegionDUnitTest extends CacheTestCase {
* Tests that invalidates and updates received from different VMs
* are handled appropriately by overflow regions.
*/
+ @Test
public void testDistributedInvalidate() throws Exception {
final String name = this.getUniqueName();
@@ -1030,6 +1054,7 @@ public class DiskRegionDUnitTest extends CacheTestCase {
/**
* Tests that the updated value gets overflowed
*/
+ @Test
public void testOverflowUpdatedValue() throws Exception {
final String name = this.getUniqueName();
AttributesFactory factory = new AttributesFactory();
@@ -1083,6 +1108,7 @@ public class DiskRegionDUnitTest extends CacheTestCase {
* Tests that the "test hook" {@link DiskRegionStats} work as
* advertised.
*/
+ @Test
public void testTestHookStatistics() throws Exception {
final String name = this.getUniqueName();
AttributesFactory factory = new AttributesFactory();
@@ -1169,6 +1195,7 @@ public class DiskRegionDUnitTest extends CacheTestCase {
* {@link LocalRegion#getValueOnDisk getValueOnDisk} methods that
* were added for testing.
*/
+ @Test
public void testLowLevelGetMethods() throws Exception {
final String name = this.getUniqueName();
AttributesFactory factory = new AttributesFactory();
@@ -1224,6 +1251,7 @@ public class DiskRegionDUnitTest extends CacheTestCase {
* Tests disk overflow with an entry-based {@link
* LRUCapacityController}.
*/
+ @Test
public void testLRUCapacityController() throws CacheException {
final String name = this.getUniqueName();
AttributesFactory factory = new AttributesFactory();
@@ -1301,6 +1329,7 @@ public class DiskRegionDUnitTest extends CacheTestCase {
* Tests a disk-based region with an {@link LRUCapacityController}
* with size 1 and an eviction action of "overflow".
*/
+ @Test
public void testLRUCCSizeOne() throws CacheException {
int threshold = 1;
@@ -1359,6 +1388,7 @@ public class DiskRegionDUnitTest extends CacheTestCase {
}
+ @Test
public void testPersistentReplicateB4NonPersistent() {
Host host = Host.getHost(0);
VM vm1 = host.getVM(0);
@@ -1399,6 +1429,7 @@ public class DiskRegionDUnitTest extends CacheTestCase {
});
}
+ @Test
public void testRRProxyWithPersistentReplicates() {
Host host = Host.getHost(0);
VM vm1 = host.getVM(0);
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/DiskRegionTestImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/DiskRegionTestImpl.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/DiskRegionTestImpl.java
index ec2a430..9179312 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/DiskRegionTestImpl.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/DiskRegionTestImpl.java
@@ -35,10 +35,14 @@ import com.gemstone.gemfire.test.dunit.VM;
* An instance of this class is delegated to by test classes that test
* disk regions.
*
- *
+ * Used by: DiskDistributedNoAckRegionTestCase
+ * TODO: move this content into DiskDistributedNoAckRegionTestCase
*/
public class DiskRegionTestImpl implements Serializable {
-
+
+ private static final int NUM_ENTRIES = 1000;
+ private static final int VALUE_SIZE = 2000;
+
final RegionTestCase rtc;
private CacheSerializableRunnable createRgnRunnable(final String name) {
@@ -64,12 +68,6 @@ public class DiskRegionTestImpl implements Serializable {
vm0.invoke(createRgnRunnable(name));
}
-
-
-
-
- private static final int NUM_ENTRIES = 1000;
- private static final int VALUE_SIZE = 2000;
/**
* Tests fillValues on backup regions.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistAckMapMethodsDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistAckMapMethodsDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistAckMapMethodsDUnitTest.java
index 71b3dd7..ffd3248 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistAckMapMethodsDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistAckMapMethodsDUnitTest.java
@@ -22,20 +22,41 @@
*/
package com.gemstone.gemfire.cache30;
-import com.gemstone.gemfire.cache.*;
-import com.gemstone.gemfire.cache.util.CacheListenerAdapter;
-import com.gemstone.gemfire.cache.util.CacheWriterAdapter;
-import com.gemstone.gemfire.distributed.DistributedSystem;
-import com.gemstone.gemfire.test.dunit.*;
+import static org.junit.Assert.*;
import java.util.HashSet;
import java.util.Properties;
import java.util.Set;
-/**
- *
- */
-public class DistAckMapMethodsDUnitTest extends DistributedTestCase{
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.cache.AttributesFactory;
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.CacheException;
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.CacheListener;
+import com.gemstone.gemfire.cache.CacheWriter;
+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.RegionDestroyedException;
+import com.gemstone.gemfire.cache.Scope;
+import com.gemstone.gemfire.cache.util.CacheListenerAdapter;
+import com.gemstone.gemfire.cache.util.CacheWriterAdapter;
+import com.gemstone.gemfire.distributed.DistributedSystem;
+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.VM;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
+
+@Category(DistributedTest.class)
+public class DistAckMapMethodsDUnitTest extends JUnit4DistributedTestCase { // TODO: reformat
+
static Cache cache;
static Properties props = new Properties();
static DistributedSystem ds = null;
@@ -48,11 +69,6 @@ public class DistAckMapMethodsDUnitTest extends DistributedTestCase{
//helper class referece objects
static Object afterDestroyObj;
- /** Creates a new instance of DistAckMapMethodsDUnitTest */
- public DistAckMapMethodsDUnitTest(String name) {
- super(name);
- }
-
@Override
public final void postSetUp() throws Exception {
Host host = Host.getHost(0);
@@ -77,7 +93,7 @@ public class DistAckMapMethodsDUnitTest extends DistributedTestCase{
try{
//props.setProperty(DistributionConfig.SystemConfigurationProperties.MCAST_PORT, "1234");
//ds = DistributedSystem.connect(props);
- ds = (new DistAckMapMethodsDUnitTest("temp")).getSystem(props);
+ ds = (new DistAckMapMethodsDUnitTest()).getSystem(props);
cache = CacheFactory.create(ds);
AttributesFactory factory = new AttributesFactory();
factory.setScope(Scope.DISTRIBUTED_ACK);
@@ -129,7 +145,8 @@ public class DistAckMapMethodsDUnitTest extends DistributedTestCase{
//testMethods
- public void testPutMethod(){
+ @Test
+ public void testPutMethod(){
Host host = Host.getHost(0);
VM vm0 = host.getVM(0);
VM vm1 = host.getVM(1);
@@ -158,7 +175,8 @@ public class DistAckMapMethodsDUnitTest extends DistributedTestCase{
}
}
- public void testRemoveMethod(){
+ @Test
+ public void testRemoveMethod(){
Host host = Host.getHost(0);
VM vm0 = host.getVM(0);
VM vm1 = host.getVM(1);
@@ -191,7 +209,8 @@ public class DistAckMapMethodsDUnitTest extends DistributedTestCase{
}
}
- public void testRemoveMethodDetails(){
+ @Test
+ public void testRemoveMethodDetails(){
Host host = Host.getHost(0);
VM vm0 = host.getVM(0);
VM vm1 = host.getVM(1);
@@ -214,7 +233,8 @@ public class DistAckMapMethodsDUnitTest extends DistributedTestCase{
);
}//end of testRemoveMethodDetails
- public void testIsEmptyMethod(){
+ @Test
+ public void testIsEmptyMethod(){
Host host = Host.getHost(0);
VM vm0 = host.getVM(0);
VM vm1 = host.getVM(1);
@@ -238,7 +258,8 @@ public class DistAckMapMethodsDUnitTest extends DistributedTestCase{
}
}
- public void testContainsValueMethod(){
+ @Test
+ public void testContainsValueMethod(){
Host host = Host.getHost(0);
VM vm0 = host.getVM(0);
VM vm1 = host.getVM(1);
@@ -262,7 +283,8 @@ public class DistAckMapMethodsDUnitTest extends DistributedTestCase{
}
}
- public void testKeySetMethod(){
+ @Test
+ public void testKeySetMethod(){
Host host = Host.getHost(0);
VM vm0 = host.getVM(0);
VM vm1 = host.getVM(1);
@@ -295,7 +317,8 @@ public class DistAckMapMethodsDUnitTest extends DistributedTestCase{
}
- public void testEntrySetMethod(){
+ @Test
+ public void testEntrySetMethod(){
Host host = Host.getHost(0);
VM vm0 = host.getVM(0);
VM vm1 = host.getVM(1);
@@ -327,7 +350,8 @@ public class DistAckMapMethodsDUnitTest extends DistributedTestCase{
}
}
- public void testSizeMethod(){
+ @Test
+ public void testSizeMethod(){
Host host = Host.getHost(0);
VM vm0 = host.getVM(0);
VM vm1 = host.getVM(1);
@@ -350,7 +374,8 @@ public class DistAckMapMethodsDUnitTest extends DistributedTestCase{
}
}
- public void testallMethodsArgs(){
+ @Test
+ public void testallMethodsArgs(){
Host host = Host.getHost(0);
VM vm0 = host.getVM(0);
vm0.invoke(() -> DistAckMapMethodsDUnitTest.allMethodsArgs());
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckOverflowRegionCCEDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckOverflowRegionCCEDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckOverflowRegionCCEDUnitTest.java
index 74661bc..d678ac0 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckOverflowRegionCCEDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckOverflowRegionCCEDUnitTest.java
@@ -16,6 +16,15 @@
*/
package com.gemstone.gemfire.cache30;
+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 org.junit.Ignore;
import org.junit.Test;
@@ -26,11 +35,12 @@ import com.gemstone.gemfire.cache.EvictionAttributes;
import com.gemstone.gemfire.cache.RegionAttributes;
import com.gemstone.gemfire.cache.Scope;
+@Category(DistributedTest.class)
public class DistributedAckOverflowRegionCCEDUnitTest extends
DistributedAckRegionCCEDUnitTest {
- public DistributedAckOverflowRegionCCEDUnitTest(String name) {
- super(name);
+ public DistributedAckOverflowRegionCCEDUnitTest() {
+ super();
}
@Override
@@ -61,8 +71,8 @@ public class DistributedAckOverflowRegionCCEDUnitTest extends
}
@Override
- @Test
@Ignore
+ @Test
public void testClearWithConcurrentEvents() throws Exception {
// TODO this test is disabled due to frequent failures. See bug #
// Remove this method from this class when the problem is fixed
@@ -70,8 +80,8 @@ public class DistributedAckOverflowRegionCCEDUnitTest extends
}
@Override
- @Test
@Ignore
+ @Test
public void testClearWithConcurrentEventsAsync() throws Exception {
// TODO this test is disabled due to frequent failures. See bug #
// Remove this method from this class when the problem is fixed
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckOverflowRegionCCEOffHeapDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckOverflowRegionCCEOffHeapDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckOverflowRegionCCEOffHeapDUnitTest.java
index 366acf1..5fc8cc9 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckOverflowRegionCCEOffHeapDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckOverflowRegionCCEOffHeapDUnitTest.java
@@ -16,15 +16,18 @@
*/
package com.gemstone.gemfire.cache30;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+
+import java.util.Properties;
+
+import org.junit.experimental.categories.Category;
+
import com.gemstone.gemfire.cache.AttributesFactory;
import com.gemstone.gemfire.cache.RegionAttributes;
import com.gemstone.gemfire.internal.cache.OffHeapTestUtil;
import com.gemstone.gemfire.test.dunit.Invoke;
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;
/**
* Tests Distributed Ack Overflow Region with ConcurrencyChecksEnabled and OffHeap memory.
@@ -32,10 +35,11 @@ import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties
* @since Geode 1.0
*/
@SuppressWarnings({ "deprecation", "serial" })
+@Category(DistributedTest.class)
public class DistributedAckOverflowRegionCCEOffHeapDUnitTest extends DistributedAckOverflowRegionCCEDUnitTest {
- public DistributedAckOverflowRegionCCEOffHeapDUnitTest(String name) {
- super(name);
+ public DistributedAckOverflowRegionCCEOffHeapDUnitTest() {
+ super();
}
@Override
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckPersistentRegionCCEDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckPersistentRegionCCEDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckPersistentRegionCCEDUnitTest.java
index 0acd2aa..3e62425 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckPersistentRegionCCEDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckPersistentRegionCCEDUnitTest.java
@@ -20,42 +20,23 @@
*/
package com.gemstone.gemfire.cache30;
+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.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.internal.AvailablePort;
-import com.gemstone.gemfire.internal.AvailablePortHelper;
-import com.gemstone.gemfire.internal.cache.DistributedCacheOperation;
-import com.gemstone.gemfire.internal.cache.DistributedRegion;
-import com.gemstone.gemfire.internal.cache.LocalRegion;
-import com.gemstone.gemfire.internal.cache.tier.sockets.Part;
import com.gemstone.gemfire.internal.cache.versions.VersionTag;
-import com.gemstone.gemfire.internal.i18n.LocalizedStrings;
-import com.gemstone.gemfire.test.dunit.AsyncInvocation;
-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.junit.categories.DistributedTest;
-import java.io.IOException;
-import java.util.Map;
-
-import junit.framework.Assert;
-
+@Category(DistributedTest.class)
public class DistributedAckPersistentRegionCCEDUnitTest extends DistributedAckRegionCCEDUnitTest {
- public DistributedAckPersistentRegionCCEDUnitTest(String name) {
- super(name);
- }
-
- /**
- * Returns region attributes for a <code>GLOBAL</code> region
- */
+ @Override
protected RegionAttributes getRegionAttributes() {
AttributesFactory factory = new AttributesFactory();
factory.setScope(Scope.DISTRIBUTED_ACK);
@@ -64,26 +45,27 @@ public class DistributedAckPersistentRegionCCEDUnitTest extends DistributedAckRe
return factory.create();
}
-// public void testClearWithConcurrentEventsAsync() throws Exception {
-// int end = 100;
-// for (int i=0; i<end; i++) {
-// System.out.println("Starting run #" + i);
-// super.testClearWithConcurrentEventsAsync();
-// if (i<(end-1)) {
-// tearDown();
-// setUp();
-// }
-// }
-// }
-
- public void testClearOnNonReplicateWithConcurrentEvents() {}
-
- public void testConcurrentEventsOnNonReplicatedRegion() {}
-
- public void testGetAllWithVersions() {}
+ @Ignore("Skip test for this configuration")
+ @Override
+ @Test
+ public void testClearOnNonReplicateWithConcurrentEvents() {
+ }
+
+ @Ignore("Skip test for this configuration")
+ @Override
+ @Test
+ public void testConcurrentEventsOnNonReplicatedRegion() {
+ }
+
+ @Ignore("Skip test for this configuration")
+ @Override
+ @Test
+ public void testGetAllWithVersions() {
+ }
private VersionTag getVersionTag(VM vm, final String key) {
SerializableCallable getVersionTag = new SerializableCallable("verify recovered entry") {
+ @Override
public Object call() {
VersionTag tag = CCRegion.getVersionTag(key);
return tag;
@@ -92,7 +74,8 @@ public class DistributedAckPersistentRegionCCEDUnitTest extends DistributedAckRe
};
return (VersionTag)vm.invoke(getVersionTag);
}
-
+
+ // TODO: resurrect dead test or delete the following dead code
// protected void do_version_recovery_if_necessary(final VM vm0, final VM vm1, final VM vm2, final Object[] params) {
// final String name = (String)params[0];
// final String hostName = (String)params[1];
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckPersistentRegionCCEOffHeapDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckPersistentRegionCCEOffHeapDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckPersistentRegionCCEOffHeapDUnitTest.java
index 905cafc..36e2893 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckPersistentRegionCCEOffHeapDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckPersistentRegionCCEOffHeapDUnitTest.java
@@ -16,14 +16,18 @@
*/
package com.gemstone.gemfire.cache30;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+
+import java.util.Properties;
+
+import org.junit.experimental.categories.Category;
+
import com.gemstone.gemfire.cache.AttributesFactory;
import com.gemstone.gemfire.cache.RegionAttributes;
import com.gemstone.gemfire.internal.cache.OffHeapTestUtil;
import com.gemstone.gemfire.test.dunit.Invoke;
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;
/**
@@ -32,10 +36,11 @@ import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties
* @since Geode 1.0
*/
@SuppressWarnings({ "deprecation", "serial" })
+@Category(DistributedTest.class)
public class DistributedAckPersistentRegionCCEOffHeapDUnitTest extends DistributedAckPersistentRegionCCEDUnitTest {
- public DistributedAckPersistentRegionCCEOffHeapDUnitTest(String name) {
- super(name);
+ public DistributedAckPersistentRegionCCEOffHeapDUnitTest() {
+ super();
}
@Override