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/01/26 01:49:26 UTC
[16/27] incubator-geode git commit: GEODE 773 rough draft
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/EvictionObjectSizerDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/EvictionObjectSizerDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/EvictionObjectSizerDUnitTest.java
index dbc1f3f..8d588b6 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/EvictionObjectSizerDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/EvictionObjectSizerDUnitTest.java
@@ -37,6 +37,7 @@ import com.gemstone.gemfire.internal.SharedLibrary;
import com.gemstone.gemfire.internal.cache.lru.HeapLRUCapacityController;
import com.gemstone.gemfire.internal.cache.lru.Sizeable;
import com.gemstone.gemfire.internal.size.ReflectionSingleObjectSizer;
+import com.gemstone.gemfire.test.dunit.Assert;
public class EvictionObjectSizerDUnitTest extends CacheTestCase {
@@ -62,8 +63,8 @@ public class EvictionObjectSizerDUnitTest extends CacheTestCase {
}
@Override
- public void tearDown2() throws Exception {
- super.tearDown2();
+ public void tearDownBeforeDisconnect() throws Exception {
+ super.tearDownBeforeDisconnect();
}
/**
@@ -215,7 +216,7 @@ public class EvictionObjectSizerDUnitTest extends CacheTestCase {
cache.getResourceManager().setEvictionHeapPercentage(50);
}
catch (Exception e) {
- fail("Failed while creating the cache", e);
+ Assert.fail("Failed while creating the cache", e);
}
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/EvictionStatsDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/EvictionStatsDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/EvictionStatsDUnitTest.java
index 189d0d2..445d479 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/EvictionStatsDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/EvictionStatsDUnitTest.java
@@ -40,6 +40,7 @@ import com.gemstone.gemfire.internal.cache.control.InternalResourceManager;
import com.gemstone.gemfire.internal.cache.control.InternalResourceManager.ResourceType;
import com.gemstone.gemfire.internal.cache.lru.HeapEvictor;
import com.gemstone.gemfire.internal.cache.lru.HeapLRUCapacityController;
+import com.gemstone.gemfire.test.dunit.Assert;
import com.gemstone.gemfire.test.dunit.Host;
import com.gemstone.gemfire.test.dunit.SerializableRunnable;
import com.gemstone.gemfire.test.dunit.VM;
@@ -415,7 +416,7 @@ public class EvictionStatsDUnitTest extends CacheTestCase {
cache.getResourceManager().setEvictionHeapPercentage(20);
}
catch (Exception e) {
- fail("Failed while creating the cache", e);
+ Assert.fail("Failed while creating the cache", e);
}
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/EvictionTestBase.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/EvictionTestBase.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/EvictionTestBase.java
index cbd2f65..2ab1e51 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/EvictionTestBase.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/EvictionTestBase.java
@@ -44,11 +44,13 @@ import com.gemstone.gemfire.internal.cache.control.InternalResourceManager.Resou
import com.gemstone.gemfire.internal.cache.control.MemoryEvent;
import com.gemstone.gemfire.internal.cache.control.MemoryThresholds.MemoryState;
import com.gemstone.gemfire.internal.cache.lru.HeapEvictor;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
+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;
public class EvictionTestBase extends CacheTestCase {
@@ -85,8 +87,8 @@ public class EvictionTestBase extends CacheTestCase {
dataStore4 = host.getVM(3);
}
- public void tearDown2() throws Exception {
- super.tearDown2();
+ public void tearDownBeforeDisconnect() throws Exception {
+ super.tearDownBeforeDisconnect();
/*
* dataStore1.invoke(EvictionTestBase.class, "destroyObjects", new Object[] {
* setEvictionOn, evictionAlgorithm, regionName, totalNoOfBuckets,
@@ -138,7 +140,7 @@ public class EvictionTestBase extends CacheTestCase {
.getEvictions();
}
};
- DistributedTestCase.waitForCriterion(wc, 60000, 1000, true);
+ Wait.waitForCriterion(wc, 60000, 1000, true);
}
});
}
@@ -297,7 +299,7 @@ public class EvictionTestBase extends CacheTestCase {
getLogWriter().info("critical= "+cache.getResourceManager().getCriticalHeapPercentage());
}
catch (Exception e) {
- fail("Failed while creating the cache", e);
+ Assert.fail("Failed while creating the cache", e);
}
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/FixedPRSinglehopDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/FixedPRSinglehopDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/FixedPRSinglehopDUnitTest.java
index 6a96948..8916aa2 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/FixedPRSinglehopDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/FixedPRSinglehopDUnitTest.java
@@ -40,10 +40,12 @@ import com.gemstone.gemfire.internal.cache.partitioned.fixed.QuarterPartitionRes
import com.gemstone.gemfire.internal.cache.partitioned.fixed.SingleHopQuarterPartitionResolver;
import com.gemstone.gemfire.internal.cache.partitioned.fixed.FixedPartitioningTestBase.Q1_Months;
import com.gemstone.gemfire.internal.cache.tier.sockets.CacheServerTestUtil;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
+import com.gemstone.gemfire.test.dunit.Assert;
import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.NetworkSupport;
import com.gemstone.gemfire.test.dunit.VM;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
import java.io.DataInput;
import java.io.DataOutput;
@@ -281,7 +283,7 @@ public class FixedPRSinglehopDUnitTest extends CacheTestCase {
VM server4 = host.getVM(3);
Boolean simpleFPR = false;
final int portLocator = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
- final String hostLocator = getServerHostName(server1.getHost());
+ final String hostLocator = NetworkSupport.getServerHostName(server1.getHost());
final String locator = hostLocator + "[" + portLocator + "]";
server3.invoke(FixedPRSinglehopDUnitTest.class,
"startLocatorInVM", new Object[] { portLocator });
@@ -308,7 +310,7 @@ public class FixedPRSinglehopDUnitTest extends CacheTestCase {
putIntoPartitionedRegionsThreeQs();
getFromPartitionedRegionsFor3Qs();
- pause(2000);
+ Wait.pause(2000);
// TODO: Verify that all the fpa's are in the map
server1.invoke(FixedPRSinglehopDUnitTest.class, "printView");
server2.invoke(FixedPRSinglehopDUnitTest.class, "printView");
@@ -331,13 +333,13 @@ public class FixedPRSinglehopDUnitTest extends CacheTestCase {
FixedPRSinglehopDUnitTest.class, "createServerWithLocator", new Object[] { locator, false,
fpaList, simpleFPR });
- pause(2000);
+ Wait.pause(2000);
putIntoPartitionedRegions();
// Client should get the new partition
// TODO: Verify that
getFromPartitionedRegions();
- pause(2000);
+ Wait.pause(2000);
server1.invoke(FixedPRSinglehopDUnitTest.class, "printView");
server2.invoke(FixedPRSinglehopDUnitTest.class, "printView");
server4.invoke(FixedPRSinglehopDUnitTest.class, "printView");
@@ -367,7 +369,7 @@ public class FixedPRSinglehopDUnitTest extends CacheTestCase {
server.start();
}
catch (IOException e) {
- fail("Failed to start server ", e);
+ Assert.fail("Failed to start server ", e);
}
if (!fpaList.isEmpty() || isAccessor) {
@@ -412,7 +414,7 @@ public class FixedPRSinglehopDUnitTest extends CacheTestCase {
server.start();
}
catch (IOException e) {
- fail("Failed to start server ", e);
+ Assert.fail("Failed to start server ", e);
}
if (!fpaList.isEmpty() || isAccessor) {
@@ -859,7 +861,7 @@ public class FixedPRSinglehopDUnitTest extends CacheTestCase {
return "expected no metadata to be refreshed";
}
};
- DistributedTestCase.waitForCriterion(wc, 60000, 1000, true);
+ Wait.waitForCriterion(wc, 60000, 1000, true);
assertTrue(regionMetaData.containsKey(region.getFullPath()));
final ClientPartitionAdvisor prMetaData = regionMetaData
@@ -873,7 +875,7 @@ public class FixedPRSinglehopDUnitTest extends CacheTestCase {
return "expected no metadata to be refreshed";
}
};
- DistributedTestCase.waitForCriterion(wc, 60000, 1000, true);
+ Wait.waitForCriterion(wc, 60000, 1000, true);
for (Entry entry : prMetaData.getBucketServerLocationsMap_TEST_ONLY()
.entrySet()) {
assertEquals(currentRedundancy, ((List)entry.getValue()).size());
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/GIIDeltaDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/GIIDeltaDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/GIIDeltaDUnitTest.java
index 9f318fb..3a51d4e 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/GIIDeltaDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/GIIDeltaDUnitTest.java
@@ -55,12 +55,16 @@ import com.gemstone.gemfire.internal.cache.persistence.DiskStoreID;
import com.gemstone.gemfire.internal.cache.versions.RegionVersionVector;
import com.gemstone.gemfire.internal.cache.versions.VersionTag;
import com.gemstone.gemfire.internal.i18n.LocalizedStrings;
+import com.gemstone.gemfire.test.dunit.Assert;
import com.gemstone.gemfire.test.dunit.AsyncInvocation;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
+import com.gemstone.gemfire.test.dunit.IgnoredException;
import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.Invoke;
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 java.io.ByteArrayInputStream;
import java.io.DataInputStream;
@@ -83,7 +87,7 @@ public class GIIDeltaDUnitTest extends CacheTestCase {
// protected static String REGION_NAME = GIIDeltaDUnitTest.class.getSimpleName()+"_Region";
protected static String REGION_NAME = "_Region";
final String expectedExceptions = GemFireIOException.class.getName();
- protected ExpectedException expectedEx;
+ protected IgnoredException expectedEx;
static Object giiSyncObject = new Object();
/**
@@ -95,7 +99,7 @@ public class GIIDeltaDUnitTest extends CacheTestCase {
public void setUp() throws Exception {
super.setUp();
- invokeInEveryVM(GIIDeltaDUnitTest.class,"setRegionName", new Object[]{getUniqueName()});
+ Invoke.invokeInEveryVM(GIIDeltaDUnitTest.class,"setRegionName", new Object[]{getUniqueName()});
setRegionName(getUniqueName());
}
@@ -103,7 +107,7 @@ public class GIIDeltaDUnitTest extends CacheTestCase {
REGION_NAME = testName + "_Region";
}
- public void tearDown2() throws Exception {
+ public void tearDownBeforeDisconnect() throws Exception {
P.invoke(GIIDeltaDUnitTest.class, "resetSlowGII");
R.invoke(GIIDeltaDUnitTest.class, "resetSlowGII");
P.invoke(InitialImageOperation.class, "resetAllGIITestHooks");
@@ -113,7 +117,7 @@ public class GIIDeltaDUnitTest extends CacheTestCase {
changeForceFullGII(P, false, false);
P = null;
R = null;
- super.tearDown2();
+ super.tearDownBeforeDisconnect();
// clean up the test hook, which can be moved to CacheTestCase
DistributedCacheOperation.SLOW_DISTRIBUTION_MS = 0;
@@ -152,7 +156,7 @@ public class GIIDeltaDUnitTest extends CacheTestCase {
createDistributedRegion(vm1);
assignVMsToPandR(vm0, vm1);
// from now on, use P and R as vmhttps://wiki.gemstone.com/display/gfepersistence/DeltaGII+Spec+for+8.0
- expectedEx = addExpectedException(expectedExceptions);
+ expectedEx = IgnoredException.addIgnoredException(expectedExceptions);
}
// these steps are shared by all test cases
@@ -516,7 +520,7 @@ public class GIIDeltaDUnitTest extends CacheTestCase {
// force tombstone GC to let RVVGC to become P4:R0
changeTombstoneTimout(R, MAX_WAIT);
changeTombstoneTimout(P, MAX_WAIT);
- pause((int)MAX_WAIT);
+ Wait.pause((int)MAX_WAIT);
forceGC(P, 2);
waitForToVerifyRVV(P, memberP, 6, null, 4); // P's rvv=p6, gc=4
@@ -1244,7 +1248,7 @@ public class GIIDeltaDUnitTest extends CacheTestCase {
}
};
- DistributedTestCase.waitForCriterion(ev, 30000, 200, true);
+ Wait.waitForCriterion(ev, 30000, 200, true);
int count = getDeltaGIICount(P);
assertEquals(2, count);
@@ -1253,7 +1257,7 @@ public class GIIDeltaDUnitTest extends CacheTestCase {
changeTombstoneTimout(R, MAX_WAIT);
changeTombstoneTimout(P, MAX_WAIT);
changeTombstoneTimout(T, MAX_WAIT);
- pause((int)MAX_WAIT);
+ Wait.pause((int)MAX_WAIT);
forceGC(P, 2);
waitForToVerifyRVV(P, memberP, 7, null, 0); // P's rvv=p7, gc=0
@@ -1270,7 +1274,7 @@ public class GIIDeltaDUnitTest extends CacheTestCase {
return null;
}
};
- DistributedTestCase.waitForCriterion(ev2, 30000, 200, true);
+ Wait.waitForCriterion(ev2, 30000, 200, true);
count = getDeltaGIICount(P);
assertEquals(0, count);
verifyTombstoneExist(P, "key2", true, true); // expect key2 is still tombstone during and after GIIs
@@ -1372,7 +1376,7 @@ public class GIIDeltaDUnitTest extends CacheTestCase {
}
};
- DistributedTestCase.waitForCriterion(ev, 30000, 200, true);
+ Wait.waitForCriterion(ev, 30000, 200, true);
int count = getDeltaGIICount(P);
assertEquals(1, count);
@@ -1380,7 +1384,7 @@ public class GIIDeltaDUnitTest extends CacheTestCase {
// Wait for tombstone is GCed at R, but still exists in P
changeTombstoneTimout(R, MAX_WAIT);
changeTombstoneTimout(P, MAX_WAIT);
- pause((int)MAX_WAIT);
+ Wait.pause((int)MAX_WAIT);
forceGC(R, 3);
forceGC(P, 3);
@@ -1432,7 +1436,7 @@ public class GIIDeltaDUnitTest extends CacheTestCase {
forceAddGIICount(P);
changeTombstoneTimout(R, MAX_WAIT);
changeTombstoneTimout(P, MAX_WAIT);
- pause((int)MAX_WAIT);
+ Wait.pause((int)MAX_WAIT);
forceGC(R, 3);
waitForToVerifyRVV(P, memberR, 6, null, 0); // P's rvv=r6, gc=0
waitForToVerifyRVV(P, memberR, 6, null, 0); // P's rvv=r6, gc=0
@@ -2003,7 +2007,7 @@ public class GIIDeltaDUnitTest extends CacheTestCase {
try {
future.join(MAX_WAIT);
} catch (InterruptedException e) {
- fail("Create region is interrupted", e);
+ Assert.fail("Create region is interrupted", e);
}
if(future.isAlive()) {
fail("Region not created within" + MAX_WAIT);
@@ -2025,7 +2029,7 @@ public class GIIDeltaDUnitTest extends CacheTestCase {
getLogWriter().info("In createDistributedRegion, using hydra.getLogWriter()");
getLogWriter().fine("Unfinished Op limit="+InitialImageOperation.MAXIMUM_UNFINISHED_OPERATIONS);
} catch (CacheException ex) {
- fail("While creating region", ex);
+ Assert.fail("While creating region", ex);
}
}
};
@@ -2233,7 +2237,7 @@ public class GIIDeltaDUnitTest extends CacheTestCase {
}
};
- DistributedTestCase.waitForCriterion(ev, 10 * 1000, 200, true);
+ Wait.waitForCriterion(ev, 10 * 1000, 200, true);
RegionVersionVector rvv = ((LocalRegion)getCache().getRegion(REGION_NAME)).getVersionVector().getCloneForTransmission();
long regionversion = getRegionVersionForMember(rvv, member, false);
long gcversion = getRegionVersionForMember(rvv, member, true);
@@ -2265,7 +2269,7 @@ public class GIIDeltaDUnitTest extends CacheTestCase {
}
};
- DistributedTestCase.waitForCriterion(ev, 30000, 200, true);
+ Wait.waitForCriterion(ev, 30000, 200, true);
if (callback == null || !callback.isRunning) {
fail("GII tesk hook is not started yet");
}
@@ -2303,7 +2307,7 @@ public class GIIDeltaDUnitTest extends CacheTestCase {
}
};
- DistributedTestCase.waitForCriterion(ev, 10 * 1000, 200, true);
+ Wait.waitForCriterion(ev, 10 * 1000, 200, true);
String value = (String)((LocalRegion)getCache().getRegion(REGION_NAME)).get(key);
assertEquals(expect_value, value);
}
@@ -2367,9 +2371,9 @@ public class GIIDeltaDUnitTest extends CacheTestCase {
try {
remote_rvv = DataSerializer.readObject(new DataInputStream(bais));
} catch (IOException e) {
- fail("Unexpected exception", e);
+ Assert.fail("Unexpected exception", e);
} catch (ClassNotFoundException e) {
- fail("Unexpected exception", e);
+ Assert.fail("Unexpected exception", e);
}
RequestImageMessage rim = new RequestImageMessage();
rim.setSender(R_ID);
@@ -2499,7 +2503,7 @@ public class GIIDeltaDUnitTest extends CacheTestCase {
}
};
- DistributedTestCase.waitForCriterion(ev, 10 * 1000, 200, true);
+ Wait.waitForCriterion(ev, 10 * 1000, 200, true);
assertTrue(doneVerify());
}
};
@@ -2521,10 +2525,10 @@ public class GIIDeltaDUnitTest extends CacheTestCase {
try {
async.join(30000);
if (async.exceptionOccurred()) {
- fail("Test failed", async.getException());
+ Assert.fail("Test failed", async.getException());
}
} catch (InterruptedException e1) {
- fail("Test failed", e1);
+ Assert.fail("Test failed", e1);
}
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/GIIFlowControlDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/GIIFlowControlDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/GIIFlowControlDUnitTest.java
index d478b8b..f7d11ea 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/GIIFlowControlDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/GIIFlowControlDUnitTest.java
@@ -30,10 +30,15 @@ import com.gemstone.gemfire.distributed.internal.DistributionManager;
import com.gemstone.gemfire.distributed.internal.DistributionMessage;
import com.gemstone.gemfire.distributed.internal.DistributionMessageObserver;
import com.gemstone.gemfire.internal.cache.InitialImageOperation.ImageReplyMessage;
+import com.gemstone.gemfire.test.dunit.Assert;
import com.gemstone.gemfire.test.dunit.AsyncInvocation;
+import com.gemstone.gemfire.test.dunit.IgnoredException;
import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.Invoke;
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;
/**
* @author dsmith
@@ -54,21 +59,21 @@ public class GIIFlowControlDUnitTest extends CacheTestCase {
}
@Override
- public void tearDown2() throws Exception {
- invokeInEveryVM(new SerializableRunnable("reset chunk size") {
+ public void tearDownBeforeDisconnect() throws Exception {
+ Invoke.invokeInEveryVM(new SerializableRunnable("reset chunk size") {
public void run() {
InitialImageOperation.CHUNK_SIZE_IN_BYTES = origChunkSize;
InitialImageOperation.CHUNK_PERMITS = origNumChunks;
}
});
- super.tearDown2();
+ super.tearDownBeforeDisconnect();
}
public void testLotsOfChunks() throws Throwable {
Host host = Host.getHost(0);
VM vm0 = host.getVM(0);
VM vm1 = host.getVM(1);
- invokeInEveryVM(new SerializableRunnable("reset chunk size") {
+ Invoke.invokeInEveryVM(new SerializableRunnable("reset chunk size") {
public void run() {
InitialImageOperation.CHUNK_SIZE_IN_BYTES = 10;
InitialImageOperation.CHUNK_PERMITS = 2;
@@ -89,7 +94,7 @@ public class GIIFlowControlDUnitTest extends CacheTestCase {
Host host = Host.getHost(0);
VM vm0 = host.getVM(0);
VM vm1 = host.getVM(1);
- invokeInEveryVM(new SerializableRunnable("set chunk size") {
+ Invoke.invokeInEveryVM(new SerializableRunnable("set chunk size") {
public void run() {
InitialImageOperation.CHUNK_SIZE_IN_BYTES = 10;
InitialImageOperation.CHUNK_PERMITS = 2;
@@ -118,7 +123,7 @@ public class GIIFlowControlDUnitTest extends CacheTestCase {
vm1.invoke(new SerializableRunnable("Wait for chunks") {
public void run() {
- waitForCriterion(new WaitCriterion(){
+ Wait.waitForCriterion(new WaitCriterion(){
public String description() {
return "Waiting for messages to be at least 2: " + observer.messageCount.get();
@@ -134,7 +139,7 @@ public class GIIFlowControlDUnitTest extends CacheTestCase {
try {
Thread.sleep(500);
} catch (InterruptedException e) {
- fail("interrupted", e);
+ Assert.fail("interrupted", e);
}
assertEquals(2, observer.messageCount.get());
observer.allowMessages.countDown();
@@ -158,7 +163,7 @@ public class GIIFlowControlDUnitTest extends CacheTestCase {
Host host = Host.getHost(0);
VM vm0 = host.getVM(0);
VM vm1 = host.getVM(1);
- invokeInEveryVM(new SerializableRunnable("set chunk size") {
+ Invoke.invokeInEveryVM(new SerializableRunnable("set chunk size") {
public void run() {
InitialImageOperation.CHUNK_SIZE_IN_BYTES = 10;
InitialImageOperation.CHUNK_PERMITS = 2;
@@ -185,7 +190,7 @@ public class GIIFlowControlDUnitTest extends CacheTestCase {
vm1.invoke(new SerializableRunnable("Wait to flow control messages") {
public void run() {
- waitForCriterion(new WaitCriterion(){
+ Wait.waitForCriterion(new WaitCriterion(){
public String description() {
return "Waiting for messages to be at least 2: " + observer.messageCount.get();
@@ -201,7 +206,7 @@ public class GIIFlowControlDUnitTest extends CacheTestCase {
try {
Thread.sleep(500);
} catch (InterruptedException e) {
- fail("interrupted", e);
+ Assert.fail("interrupted", e);
}
assertEquals(2, observer.messageCount.get());
}
@@ -237,7 +242,7 @@ public class GIIFlowControlDUnitTest extends CacheTestCase {
Host host = Host.getHost(0);
VM vm0 = host.getVM(0);
VM vm1 = host.getVM(1);
- invokeInEveryVM(new SerializableRunnable("set chunk size") {
+ Invoke.invokeInEveryVM(new SerializableRunnable("set chunk size") {
public void run() {
InitialImageOperation.CHUNK_SIZE_IN_BYTES = 10;
InitialImageOperation.CHUNK_PERMITS = 2;
@@ -257,7 +262,7 @@ public class GIIFlowControlDUnitTest extends CacheTestCase {
}
});
- ExpectedException expectedEx = null;
+ IgnoredException expectedEx = null;
try {
createRegion(vm0);
@@ -268,7 +273,7 @@ public class GIIFlowControlDUnitTest extends CacheTestCase {
vm1.invoke(new SerializableRunnable("Wait to flow control messages") {
public void run() {
- waitForCriterion(new WaitCriterion(){
+ Wait.waitForCriterion(new WaitCriterion(){
public String description() {
return "Waiting for messages to be at least 2: " + observer.messageCount.get();
@@ -284,7 +289,7 @@ public class GIIFlowControlDUnitTest extends CacheTestCase {
try {
Thread.sleep(500);
} catch (InterruptedException e) {
- fail("interrupted", e);
+ Assert.fail("interrupted", e);
}
assertEquals(2, observer.messageCount.get());
}
@@ -306,7 +311,7 @@ public class GIIFlowControlDUnitTest extends CacheTestCase {
throw e;
}
- expectedEx = addExpectedException(InterruptedException.class.getName(),
+ expectedEx = IgnoredException.addIgnoredException(InterruptedException.class.getName(),
vm1);
if(disconnect) {
disconnect(vm1);
@@ -325,7 +330,7 @@ public class GIIFlowControlDUnitTest extends CacheTestCase {
public void run() {
final DMStats stats = getSystem().getDMStats();
- waitForCriterion(new WaitCriterion() {
+ Wait.waitForCriterion(new WaitCriterion() {
public boolean done() {
return stats.getInitialImageMessagesInFlight() == 0;
@@ -437,7 +442,7 @@ public class GIIFlowControlDUnitTest extends CacheTestCase {
try {
allowMessages.await();
} catch (InterruptedException e) {
- fail("Interrupted", e);
+ Assert.fail("Interrupted", e);
}
}
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/GridAdvisorDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/GridAdvisorDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/GridAdvisorDUnitTest.java
index 9a6b3e4..8d3a177 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/GridAdvisorDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/GridAdvisorDUnitTest.java
@@ -33,8 +33,11 @@ import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem;
import com.gemstone.gemfire.distributed.internal.InternalLocator;
import com.gemstone.gemfire.internal.AvailablePort.Keeper;
import com.gemstone.gemfire.internal.AvailablePortHelper;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.DUnitEnv;
import com.gemstone.gemfire.test.dunit.DistributedTestCase;
import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.NetworkSupport;
import com.gemstone.gemfire.test.dunit.SerializableRunnable;
import com.gemstone.gemfire.test.dunit.VM;
@@ -78,14 +81,14 @@ public class GridAdvisorDUnitTest extends DistributedTestCase {
final Keeper bsKeeper4 = freeTCPPorts.get(5);
final int bsPort4 = bsKeeper4.getPort();
- final String host0 = getServerHostName(host);
+ final String host0 = NetworkSupport.getServerHostName(host);
final String locators = host0 + "[" + port1 + "]" + ","
+ host0 + "[" + port2 + "]";
final Properties dsProps = new Properties();
dsProps.setProperty("locators", locators);
dsProps.setProperty("mcast-port", "0");
- dsProps.setProperty("log-level", getDUnitLogLevel());
+ dsProps.setProperty("log-level", DUnitEnv.getDUnitLogLevel());
dsProps.setProperty(DistributionConfig.ENABLE_CLUSTER_CONFIGURATION_NAME, "false");
keeper1.release();
@@ -96,7 +99,7 @@ public class GridAdvisorDUnitTest extends DistributedTestCase {
try {
Locator.startLocatorAndDS(port1, logFile, null, dsProps, true, true, null);
} catch (IOException ex) {
- fail("While starting locator on port " + port1, ex);
+ Assert.fail("While starting locator on port " + port1, ex);
}
}
});
@@ -112,7 +115,7 @@ public class GridAdvisorDUnitTest extends DistributedTestCase {
Locator.startLocatorAndDS(port2, logFile, null, dsProps, true, true, "locator2HNFC");
} catch (IOException ex) {
- fail("While starting locator on port " + port2, ex);
+ Assert.fail("While starting locator on port " + port2, ex);
}
}
});
@@ -123,7 +126,7 @@ public class GridAdvisorDUnitTest extends DistributedTestCase {
Properties props = new Properties();
props.setProperty("mcast-port", "0");
props.setProperty("locators", locators);
- dsProps.setProperty("log-level", getDUnitLogLevel());
+ dsProps.setProperty("log-level", DUnitEnv.getDUnitLogLevel());
CacheFactory.create(DistributedSystem.connect(props));
}
};
@@ -587,14 +590,14 @@ public class GridAdvisorDUnitTest extends DistributedTestCase {
final Keeper bsKeeper4 = freeTCPPorts.get(5);
final int bsPort4 = bsKeeper4.getPort();
- final String host0 = getServerHostName(host);
+ final String host0 = NetworkSupport.getServerHostName(host);
final String locators = host0 + "[" + port1 + "]" + ","
+ host0 + "[" + port2 + "]";
final Properties dsProps = new Properties();
dsProps.setProperty("locators", locators);
dsProps.setProperty("mcast-port", "0");
- dsProps.setProperty("log-level", getDUnitLogLevel());
+ dsProps.setProperty("log-level", DUnitEnv.getDUnitLogLevel());
dsProps.setProperty(DistributionConfig.ENABLE_CLUSTER_CONFIGURATION_NAME, "false");
keeper1.release();
@@ -605,7 +608,7 @@ public class GridAdvisorDUnitTest extends DistributedTestCase {
try {
Locator.startLocatorAndDS(port1, logFile, null, dsProps, true, true, null);
} catch (IOException ex) {
- fail("While starting locator on port " + port1, ex);
+ Assert.fail("While starting locator on port " + port1, ex);
}
}
});
@@ -621,7 +624,7 @@ public class GridAdvisorDUnitTest extends DistributedTestCase {
Locator.startLocatorAndDS(port2, logFile, null, dsProps, true, true, "locator2HNFC");
} catch (IOException ex) {
- fail("While starting locator on port " + port2, ex);
+ Assert.fail("While starting locator on port " + port2, ex);
}
}
});
@@ -632,7 +635,7 @@ public class GridAdvisorDUnitTest extends DistributedTestCase {
props.setProperty("mcast-port", "0");
props.setProperty("locators", locators);
props.setProperty("groups", "bs1Group1, bs1Group2");
- props.setProperty("log-level", getDUnitLogLevel());
+ props.setProperty("log-level", DUnitEnv.getDUnitLogLevel());
CacheFactory.create(DistributedSystem.connect(props));
}
});
@@ -642,7 +645,7 @@ public class GridAdvisorDUnitTest extends DistributedTestCase {
props.setProperty("mcast-port", "0");
props.setProperty("locators", locators);
props.setProperty("groups", "bs2Group1, bs2Group2");
- props.setProperty("log-level", getDUnitLogLevel());
+ props.setProperty("log-level", DUnitEnv.getDUnitLogLevel());
CacheFactory.create(DistributedSystem.connect(props));
}
});
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/HABug36773DUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/HABug36773DUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/HABug36773DUnitTest.java
index 54da4b6..b7df438 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/HABug36773DUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/HABug36773DUnitTest.java
@@ -38,8 +38,10 @@ import com.gemstone.gemfire.cache30.ClientServerTestCase;
import com.gemstone.gemfire.cache30.CacheSerializableRunnable;
import com.gemstone.gemfire.distributed.DistributedSystem;
import com.gemstone.gemfire.internal.AvailablePort;
+import com.gemstone.gemfire.test.dunit.Assert;
import com.gemstone.gemfire.test.dunit.DistributedTestCase;
import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.NetworkSupport;
import com.gemstone.gemfire.test.dunit.VM;
/**
@@ -234,7 +236,7 @@ public class HABug36773DUnitTest extends DistributedTestCase
Thread.sleep(700);
}
catch (InterruptedException ie) {
- fail("Interrupted while waiting ", ie);
+ Assert.fail("Interrupted while waiting ", ie);
}
}
}
@@ -260,7 +262,7 @@ public class HABug36773DUnitTest extends DistributedTestCase
assertEquals(r1.getEntry(KEY2).getValue(), "key-2");
}
catch (Exception ex) {
- fail("failed while createEntriesK1andK2()", ex);
+ Assert.fail("failed while createEntriesK1andK2()", ex);
}
}
@@ -280,7 +282,7 @@ public class HABug36773DUnitTest extends DistributedTestCase
new HABug36773DUnitTest("temp").createCache(props);
AttributesFactory factory = new AttributesFactory();
factory.setScope(Scope.DISTRIBUTED_ACK);
- ClientServerTestCase.configureConnectionPool(factory, DistributedTestCase.getIPLiteral(), new int[] {PORT1,PORT2}, true, -1, 2, null);
+ ClientServerTestCase.configureConnectionPool(factory, NetworkSupport.getIPLiteral(), new int[] {PORT1,PORT2}, true, -1, 2, null);
RegionAttributes attrs = factory.create();
cache.createRegion(REGION_NAME, attrs);
}
@@ -320,7 +322,7 @@ public class HABug36773DUnitTest extends DistributedTestCase
}
catch (Exception ex) {
- fail("failed while registering interest", ex);
+ Assert.fail("failed while registering interest", ex);
}
}
@@ -358,7 +360,7 @@ public class HABug36773DUnitTest extends DistributedTestCase
}
- public void tearDown2() throws Exception
+ public void tearDownBeforeDisconnect() throws Exception
{
//close client
client1.invoke(HABug36773DUnitTest.class, "closeCache");
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/HAOverflowMemObjectSizerDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/HAOverflowMemObjectSizerDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/HAOverflowMemObjectSizerDUnitTest.java
index 2819790..e236676 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/HAOverflowMemObjectSizerDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/HAOverflowMemObjectSizerDUnitTest.java
@@ -40,6 +40,7 @@ import com.gemstone.gemfire.internal.cache.tier.sockets.ClientUpdateMessageImpl;
import com.gemstone.gemfire.internal.cache.tier.sockets.ConflationDUnitTest;
import com.gemstone.gemfire.test.dunit.DistributedTestCase;
import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.NetworkSupport;
import com.gemstone.gemfire.test.dunit.VM;
/**
@@ -93,8 +94,8 @@ public class HAOverflowMemObjectSizerDUnitTest extends DistributedTestCase {
serverVM = host.getVM(3);
}
- public void tearDown2() throws Exception {
- super.tearDown2();
+ public void tearDownBeforeDisconnect() throws Exception {
+ super.tearDownBeforeDisconnect();
serverVM.invoke(ConflationDUnitTest.class, "unsetIsSlowStart");
client.invoke(HAOverflowMemObjectSizerDUnitTest.class, "closeCache");
serverVM.invoke(HAOverflowMemObjectSizerDUnitTest.class, "closeCache");
@@ -193,7 +194,7 @@ public class HAOverflowMemObjectSizerDUnitTest extends DistributedTestCase {
client.invoke(HAOverflowMemObjectSizerDUnitTest.class,
"createCacheClient",
new Object[] { port1,
- getServerHostName(client.getHost()) });
+ NetworkSupport.getServerHostName(client.getHost()) });
serverVM.invoke(HAOverflowMemObjectSizerDUnitTest.class, "performPut",
new Object[] { new Long(0L), new Long(100L) });
@@ -219,7 +220,7 @@ public class HAOverflowMemObjectSizerDUnitTest extends DistributedTestCase {
client.invoke(HAOverflowMemObjectSizerDUnitTest.class,
"createCacheClient",
new Object[] { port2,
- getServerHostName(client.getHost()) });
+ NetworkSupport.getServerHostName(client.getHost()) });
serverVM.invoke(HAOverflowMemObjectSizerDUnitTest.class, "performPut",
new Object[] { new Long(101L), new Long(200L) });
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/IncrementalBackupDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/IncrementalBackupDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/IncrementalBackupDUnitTest.java
index 9c42a1f..d8b9e8e 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/IncrementalBackupDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/IncrementalBackupDUnitTest.java
@@ -50,11 +50,13 @@ import com.gemstone.gemfire.internal.JarDeployer;
import com.gemstone.gemfire.internal.cache.persistence.BackupManager;
import com.gemstone.gemfire.internal.util.IOUtils;
import com.gemstone.gemfire.internal.util.TransformUtils;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
+import com.gemstone.gemfire.test.dunit.DUnitEnv;
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;
/**
* Tests for the incremental backup feature.
@@ -88,7 +90,7 @@ public class IncrementalBackupDUnitTest extends CacheTestCase {
private final SerializableRunnable createRegions = new SerializableRunnable() {
@Override
public void run() {
- Cache cache = getCache(new CacheFactory().set("log-level", getDUnitLogLevel()));
+ Cache cache = getCache(new CacheFactory().set("log-level", DUnitEnv.getDUnitLogLevel()));
cache.createDiskStoreFactory().setDiskDirs(getDiskDirs()).create("fooStore");
cache.createDiskStoreFactory().setDiskDirs(getDiskDirs()).create("barStore");
getRegionFactory(cache).setDiskStoreName("fooStore").create("fooRegion");
@@ -366,7 +368,7 @@ public class IncrementalBackupDUnitTest extends CacheTestCase {
});
final Set<PersistentID> missingMembers = new HashSet<PersistentID>();
- DistributedTestCase.waitForCriterion(new WaitCriterion() {
+ Wait.waitForCriterion(new WaitCriterion() {
@Override
public boolean done() {
missingMembers.clear();
@@ -667,12 +669,12 @@ public class IncrementalBackupDUnitTest extends CacheTestCase {
* Removes backup directories (and all backup data).
*/
@Override
- public void tearDown2() throws Exception {
+ public void tearDownBeforeDisconnect() throws Exception {
FileUtil.delete(getIncremental2Dir());
FileUtil.delete(getIncrementalDir());
FileUtil.delete(getBaselineDir());
- super.tearDown2();
+ super.tearDownBeforeDisconnect();
}
/**
@@ -838,7 +840,7 @@ public class IncrementalBackupDUnitTest extends CacheTestCase {
* member is back online.
*/
final Set<PersistentID> missingMembers = new HashSet<PersistentID>();
- DistributedTestCase.waitForCriterion(new WaitCriterion() {
+ Wait.waitForCriterion(new WaitCriterion() {
@Override
public boolean done() {
missingMembers.clear();
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/InterruptClientServerDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/InterruptClientServerDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/InterruptClientServerDUnitTest.java
index 03d9edd..93c7826 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/InterruptClientServerDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/InterruptClientServerDUnitTest.java
@@ -34,6 +34,8 @@ import com.gemstone.gemfire.internal.AvailablePortHelper;
import com.gemstone.gemfire.internal.cache.UpdateOperation.UpdateMessage;
import com.gemstone.gemfire.test.dunit.AsyncInvocation;
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.SerializableCallable;
import com.gemstone.gemfire.test.dunit.VM;
@@ -54,8 +56,8 @@ public class InterruptClientServerDUnitTest extends CacheTestCase {
@Override
- public void tearDown2() throws Exception {
- invokeInEveryVM(new SerializableCallable() {
+ public void tearDownBeforeDisconnect() throws Exception {
+ Invoke.invokeInEveryVM(new SerializableCallable() {
@Override
public Object call() throws Exception {
@@ -63,7 +65,7 @@ public class InterruptClientServerDUnitTest extends CacheTestCase {
return null;
}
});
- super.tearDown2();
+ super.tearDownBeforeDisconnect();
}
public void _testLoop() throws Throwable {
@@ -83,7 +85,7 @@ public class InterruptClientServerDUnitTest extends CacheTestCase {
* @throws Throwable
*/
public void testClientPutWithInterrupt() throws Throwable {
- addExpectedException("InterruptedException");
+ IgnoredException.addIgnoredException("InterruptedException");
Host host = Host.getHost(0);
final VM vm0 = host.getVM(0);
VM vm1 = host.getVM(1);
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/InterruptsDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/InterruptsDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/InterruptsDUnitTest.java
index 416dff9..ae12dec 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/InterruptsDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/InterruptsDUnitTest.java
@@ -30,6 +30,7 @@ import com.gemstone.gemfire.distributed.internal.DistributionMessageObserver;
import com.gemstone.gemfire.internal.cache.UpdateOperation.UpdateMessage;
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.SerializableCallable;
import com.gemstone.gemfire.test.dunit.VM;
@@ -50,8 +51,8 @@ public class InterruptsDUnitTest extends CacheTestCase {
@Override
- public void tearDown2() throws Exception {
- invokeInEveryVM(new SerializableCallable() {
+ public void tearDownBeforeDisconnect() throws Exception {
+ Invoke.invokeInEveryVM(new SerializableCallable() {
@Override
public Object call() throws Exception {
@@ -59,7 +60,7 @@ public class InterruptsDUnitTest extends CacheTestCase {
return null;
}
});
- super.tearDown2();
+ super.tearDownBeforeDisconnect();
}
public void _testLoop() throws Throwable {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/MapClearGIIDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/MapClearGIIDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/MapClearGIIDUnitTest.java
index 3910c3c..be057e5 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/MapClearGIIDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/MapClearGIIDUnitTest.java
@@ -32,11 +32,14 @@ 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.DistributedTestCase;
import com.gemstone.gemfire.test.dunit.Host;
import com.gemstone.gemfire.test.dunit.SerializableRunnable;
+import com.gemstone.gemfire.test.dunit.Threads;
import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
/**
* @author ashahid
@@ -166,7 +169,7 @@ public class MapClearGIIDUnitTest extends CacheTestCase {
return null;
}
};
- DistributedTestCase.waitForCriterion(ev, 10 * 1000, 200, true);
+ Wait.waitForCriterion(ev, 10 * 1000, 200, true);
region.clear();
assertEquals(0, region.size());
}
@@ -230,28 +233,28 @@ public class MapClearGIIDUnitTest extends CacheTestCase {
return null;
}
};
- DistributedTestCase.waitForCriterion(ev, 30 * 1000, 200, true);
+ Wait.waitForCriterion(ev, 30 * 1000, 200, true);
}
});
// now that the gii has received some entries do the clear
vm1.invoke(MapClearGIIDUnitTest.class, "clearRegionInVm1");
// wait for GII to complete
- DistributedTestCase.join(asyncGII, 30 * 1000, getLogWriter());
+ Threads.join(asyncGII, 30 * 1000);
if (asyncGII.exceptionOccurred()) {
Throwable t = asyncGII.getException();
- fail("createRegionInVM0 failed", t);
+ Assert.fail("createRegionInVM0 failed", t);
}
assertTrue(vm0
.invokeBoolean(MapClearGIIDUnitTest.class, "checkImageStateFlag"));
if (asyncGII.exceptionOccurred()) {
- fail("asyncGII failed", asyncGII.getException());
+ Assert.fail("asyncGII failed", asyncGII.getException());
}
}
catch (Exception e) {
- fail("Test failed", e);
+ Assert.fail("Test failed", e);
}
finally {
vm0.invoke(new SerializableRunnable("Set fast image processing") {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/MapInterface2JUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/MapInterface2JUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/MapInterface2JUnitTest.java
index 91fea15..c05c90d 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/MapInterface2JUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/MapInterface2JUnitTest.java
@@ -41,7 +41,7 @@ import com.gemstone.gemfire.cache.query.CacheUtils;
import com.gemstone.gemfire.cache.query.data.Portfolio;
import com.gemstone.gemfire.cache.util.CacheListenerAdapter;
import com.gemstone.gemfire.internal.util.StopWatch;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
+import com.gemstone.gemfire.test.dunit.Threads;
import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
/**
@@ -221,7 +221,7 @@ public class MapInterface2JUnitTest {
callbackSync.notify();
}
}
- DistributedTestCase.join(th, 30 * 1000, null);
+ Threads.join(th, 30 * 1000);
}
@@ -274,7 +274,7 @@ public class MapInterface2JUnitTest {
}catch (Exception cwe) {
fail("The test experienced exception "+cwe);
}
- DistributedTestCase.join(th, 30 * 1000, null);
+ Threads.join(th, 30 * 1000);
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/NetSearchMessagingDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/NetSearchMessagingDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/NetSearchMessagingDUnitTest.java
index b1375a8..f2593dc 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/NetSearchMessagingDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/NetSearchMessagingDUnitTest.java
@@ -39,6 +39,8 @@ 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;
/**
* @author dsmith
@@ -353,7 +355,7 @@ public class NetSearchMessagingDUnitTest extends CacheTestCase {
}
private void waitForReceivedMessages(final VM vm, final long expected) {
- waitForCriterion(new WaitCriterion() {
+ Wait.waitForCriterion(new WaitCriterion() {
@Override
public boolean done() {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/OffHeapEvictionDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/OffHeapEvictionDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/OffHeapEvictionDUnitTest.java
index 4482533..78904b6 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/OffHeapEvictionDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/OffHeapEvictionDUnitTest.java
@@ -25,9 +25,12 @@ 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.DistributedTestCase;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.Invoke;
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;
/**
* Performs eviction dunit tests for off-heap memory.
@@ -39,7 +42,7 @@ public class OffHeapEvictionDUnitTest extends EvictionDUnitTest {
}
@Override
- public void tearDown2() throws Exception {
+ public void tearDownBeforeDisconnect() throws Exception {
SerializableRunnable checkOrphans = new SerializableRunnable() {
@Override
@@ -49,11 +52,11 @@ public class OffHeapEvictionDUnitTest extends EvictionDUnitTest {
}
}
};
- invokeInEveryVM(checkOrphans);
+ Invoke.invokeInEveryVM(checkOrphans);
try {
checkOrphans.run();
} finally {
- super.tearDown2();
+ super.tearDownBeforeDisconnect();
}
}
@@ -82,7 +85,7 @@ public class OffHeapEvictionDUnitTest extends EvictionDUnitTest {
getLogWriter().info("critical= "+cache.getResourceManager().getCriticalOffHeapPercentage());
}
catch (Exception e) {
- fail("Failed while creating the cache", e);
+ Assert.fail("Failed while creating the cache", e);
}
}
@@ -115,7 +118,7 @@ public class OffHeapEvictionDUnitTest extends EvictionDUnitTest {
.getEvictions();
}
};
- DistributedTestCase.waitForCriterion(wc, 60000, 1000, true);
+ Wait.waitForCriterion(wc, 60000, 1000, true);
}
});
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/OffHeapEvictionStatsDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/OffHeapEvictionStatsDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/OffHeapEvictionStatsDUnitTest.java
index a2d0555..ac26198 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/OffHeapEvictionStatsDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/OffHeapEvictionStatsDUnitTest.java
@@ -21,6 +21,8 @@ import java.util.Properties;
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.SerializableRunnable;
/**
@@ -36,7 +38,7 @@ public class OffHeapEvictionStatsDUnitTest extends EvictionStatsDUnitTest {
}
@Override
- public void tearDown2() throws Exception {
+ public void tearDownBeforeDisconnect() throws Exception {
SerializableRunnable checkOrphans = new SerializableRunnable() {
@Override
@@ -46,11 +48,11 @@ public class OffHeapEvictionStatsDUnitTest extends EvictionStatsDUnitTest {
}
}
};
- invokeInEveryVM(checkOrphans);
+ Invoke.invokeInEveryVM(checkOrphans);
try {
checkOrphans.run();
} finally {
- super.tearDown2();
+ super.tearDownBeforeDisconnect();
}
}
@@ -78,7 +80,7 @@ public class OffHeapEvictionStatsDUnitTest extends EvictionStatsDUnitTest {
getLogWriter().info("critical= "+cache.getResourceManager().getCriticalOffHeapPercentage());
}
catch (Exception e) {
- fail("Failed while creating the cache", e);
+ Assert.fail("Failed while creating the cache", e);
}
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/OplogJUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/OplogJUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/OplogJUnitTest.java
index 9daf69f..e8ccf9b 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/OplogJUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/OplogJUnitTest.java
@@ -57,8 +57,9 @@ import com.gemstone.gemfire.cache.Scope;
import com.gemstone.gemfire.cache.util.CacheWriterAdapter;
import com.gemstone.gemfire.internal.InternalDataSerializer;
import com.gemstone.gemfire.internal.cache.Oplog.OPLOG_TYPE;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.Threads;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
import com.jayway.awaitility.Awaitility;
@@ -1677,7 +1678,7 @@ public class OplogJUnitTest extends DiskRegionTestingBase
});
assertNull(conflated);
th.start();
- DistributedTestCase.join(th, 30 * 1000, null);
+ Threads.join(th, 30 * 1000);
LocalRegion.ISSUE_CALLBACKS_TO_CACHE_OBSERVER = false;
}
@@ -2093,7 +2094,7 @@ public class OplogJUnitTest extends DiskRegionTestingBase
finally {
((LocalRegion)region).getDiskRegion().releaseWriteLock();
}
- DistributedTestCase.join(th, 30 * 1000, null);
+ Threads.join(th, 30 * 1000);
region.close();
region = DiskRegionHelperFactory.getSyncPersistOnlyRegion(cache,
diskProps, Scope.LOCAL);
@@ -2710,16 +2711,16 @@ public class OplogJUnitTest extends DiskRegionTestingBase
assertEquals(0, dss.getQueueSize());
put100Int();
- DistributedTestCase.waitForCriterion(evFull, 2 * 1000, 200, true);
+ Wait.waitForCriterion(evFull, 2 * 1000, 200, true);
assertEquals(0, dss.getFlushes());
region.writeToDisk();
- DistributedTestCase.waitForCriterion(ev, 2 * 1000, 200, true);
- DistributedTestCase.waitForCriterion(ev2, 1000, 200, true);
+ Wait.waitForCriterion(ev, 2 * 1000, 200, true);
+ Wait.waitForCriterion(ev2, 1000, 200, true);
put100Int();
- DistributedTestCase.waitForCriterion(evFull, 2 * 1000, 200, true);
+ Wait.waitForCriterion(evFull, 2 * 1000, 200, true);
region.writeToDisk();
- DistributedTestCase.waitForCriterion(ev, 2 * 1000, 200, true);
- DistributedTestCase.waitForCriterion(ev3, 1000, 200, true);
+ Wait.waitForCriterion(ev, 2 * 1000, 200, true);
+ Wait.waitForCriterion(ev3, 1000, 200, true);
closeDown();
}
@@ -3169,7 +3170,7 @@ public class OplogJUnitTest extends DiskRegionTestingBase
}
});
try {
- DistributedTestCase.join(clearOp, 30 * 1000, null);
+ Threads.join(clearOp, 30 * 1000);
}
catch (Exception e) {
testFailed = true;
@@ -3236,7 +3237,7 @@ public class OplogJUnitTest extends DiskRegionTestingBase
});
clearTh.start();
try {
- DistributedTestCase.join(clearTh, 120 * 1000, null);
+ Threads.join(clearTh, 120 * 1000);
failure = clearTh.isAlive();
failureCause = "Clear Thread still running !";
} catch(Exception e) {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/P2PDeltaPropagationDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/P2PDeltaPropagationDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/P2PDeltaPropagationDUnitTest.java
index 508347d..3e3bc7f 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/P2PDeltaPropagationDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/P2PDeltaPropagationDUnitTest.java
@@ -510,9 +510,9 @@ public class P2PDeltaPropagationDUnitTest extends DistributedTestCase
}
}
- public void tearDown2() throws Exception
+ public void tearDownBeforeDisconnect() throws Exception
{
- super.tearDown2();
+ super.tearDownBeforeDisconnect();
closeCache();
server1.invoke(P2PDeltaPropagationDUnitTest.class, "closeCache");
server2.invoke(P2PDeltaPropagationDUnitTest.class, "closeCache");
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PRBadToDataDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PRBadToDataDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PRBadToDataDUnitTest.java
index f1e7988..8249d2b 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PRBadToDataDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PRBadToDataDUnitTest.java
@@ -24,6 +24,7 @@ import com.gemstone.gemfire.cache.CacheException;
import com.gemstone.gemfire.cache.PartitionAttributesFactory;
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.Host;
import com.gemstone.gemfire.test.dunit.SerializableCallable;
import com.gemstone.gemfire.test.dunit.SerializableRunnable;
@@ -76,7 +77,7 @@ public class PRBadToDataDUnitTest extends CacheTestCase {
assertNotNull(pr);
}
catch (final CacheException ex) {
- fail("While creating Partitioned region", ex);
+ Assert.fail("While creating Partitioned region", ex);
}
}
};
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionBucketCreationDistributionDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionBucketCreationDistributionDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionBucketCreationDistributionDUnitTest.java
index d5e7f9c..ba85fe3 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionBucketCreationDistributionDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionBucketCreationDistributionDUnitTest.java
@@ -35,10 +35,12 @@ import com.gemstone.gemfire.cache.RegionAttributes;
import com.gemstone.gemfire.cache.Scope;
import com.gemstone.gemfire.cache30.CacheSerializableRunnable;
import com.gemstone.gemfire.internal.cache.PartitionedRegionDataStore.BucketVisitor;
+import com.gemstone.gemfire.test.dunit.Assert;
import com.gemstone.gemfire.test.dunit.AsyncInvocation;
-import com.gemstone.gemfire.test.dunit.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.Threads;
import com.gemstone.gemfire.test.dunit.VM;
/**
@@ -421,7 +423,7 @@ public class PartitionedRegionBucketCreationDistributionDUnitTest extends
Host host = Host.getHost(0);
createVMs(host);
- invokeInEveryVM(new SerializableRunnable("Create PR") {
+ Invoke.invokeInEveryVM(new SerializableRunnable("Create PR") {
public void run() {
getCache().createRegion(regionName, createRegionAttrs(0, 10, maxBuckets));
@@ -512,12 +514,12 @@ public class PartitionedRegionBucketCreationDistributionDUnitTest extends
/** main thread is waiting for the other threads to complete */
for (int count = 0; count < AsyncInvocationArrSize; count++) {
- DistributedTestCase.join(async[count], 30 * 1000, getLogWriter());
+ Threads.join(async[count], 30 * 1000);
}
for (int count = 0; count < AsyncInvocationArrSize; count++) {
if (async[count].exceptionOccurred()) {
- fail("Exception during " + count, async[count].getException());
+ Assert.fail("Exception during " + count, async[count].getException());
}
}
}
@@ -554,11 +556,11 @@ public class PartitionedRegionBucketCreationDistributionDUnitTest extends
/** main thread is waiting for the other threads to complete */
for (int count = 0; count < AsyncInvocationArrSize; count++) {
- DistributedTestCase.join(async[count], 30 * 1000, getLogWriter());
+ Threads.join(async[count], 30 * 1000);
}
for (int count = 0; count < AsyncInvocationArrSize; count++) {
if (async[count].exceptionOccurred()) {
- fail("Exception during " + count, async[count].getException());
+ Assert.fail("Exception during " + count, async[count].getException());
}
}
}
@@ -587,12 +589,12 @@ public class PartitionedRegionBucketCreationDistributionDUnitTest extends
/** main thread is waiting for the other threads to complete */
for (int count = 0; count < AsyncInvocationArrSize; count++) {
- DistributedTestCase.join(async[count], 30 * 1000, getLogWriter());
+ Threads.join(async[count], 30 * 1000);
}
for (int count = 0; count < AsyncInvocationArrSize; count++) {
if (async[count].exceptionOccurred()) {
- fail("exception during" + count, async[count].getException());
+ Assert.fail("exception during" + count, async[count].getException());
}
}
}
@@ -625,12 +627,12 @@ public class PartitionedRegionBucketCreationDistributionDUnitTest extends
/** main thread is waiting for the other threads to complete */
for (int count = 0; count < AsyncInvocationArrSize; count++) {
- DistributedTestCase.join(async[count], 30 * 1000, getLogWriter());
+ Threads.join(async[count], 30 * 1000);
}
for (int count = 0; count < AsyncInvocationArrSize; count++) {
if (async[count].exceptionOccurred()) {
- fail("exception during " + count, async[count].getException());
+ Assert.fail("exception during " + count, async[count].getException());
}
}
}
@@ -697,12 +699,12 @@ public class PartitionedRegionBucketCreationDistributionDUnitTest extends
/** main thread is waiting for the other threads to complete */
for (int count = 0; count < AsyncInvocationArrSize; count++) {
- DistributedTestCase.join(async[count], 30 * 1000, getLogWriter());
+ Threads.join(async[count], 30 * 1000);
}
for (int count = 0; count < AsyncInvocationArrSize; count++) {
if (async[count].exceptionOccurred()) {
- fail("exception during " + count, async[count].getException());
+ Assert.fail("exception during " + count, async[count].getException());
}
}
}
@@ -742,12 +744,12 @@ public class PartitionedRegionBucketCreationDistributionDUnitTest extends
/** main thread is waiting for the other threads to complete */
for (int count = 0; count < AsyncInvocationArrSize; count++) {
- DistributedTestCase.join(async[count], 30 * 1000, getLogWriter());
+ Threads.join(async[count], 30 * 1000);
}
for (int count = 0; count < AsyncInvocationArrSize; count++) {
if (async[count].exceptionOccurred()) {
- fail("exception during " + count, async[count].getException());
+ Assert.fail("exception during " + count, async[count].getException());
}
}
}
@@ -778,7 +780,7 @@ public class PartitionedRegionBucketCreationDistributionDUnitTest extends
startIndexForRegion, endIndexForRegion));
/** main thread is waiting for the other threads to complete */
for (int count = 0; count < AsyncInvocationArrSize; count++) {
- DistributedTestCase.join(async[count], 30 * 1000, getLogWriter());
+ Threads.join(async[count], 30 * 1000);
}
for (int count = 0; count < AsyncInvocationArrSize; count++) {
@@ -821,12 +823,12 @@ public class PartitionedRegionBucketCreationDistributionDUnitTest extends
/** main thread is waiting for the other threads to complete */
for (int count = 0; count < 4; count++) {
- DistributedTestCase.join(async[count], 30 * 1000, getLogWriter());
+ Threads.join(async[count], 30 * 1000);
}
for (int count = 0; count < 4; count++) {
if (async[count].exceptionOccurred()) {
- fail("got exception on " + count, async[count].getException());
+ Assert.fail("got exception on " + count, async[count].getException());
}
}
@@ -842,7 +844,7 @@ public class PartitionedRegionBucketCreationDistributionDUnitTest extends
/** main thread is waiting for the other threads to complete */
for (int count = 4; count < AsyncInvocationArrSize; count++) {
- DistributedTestCase.join(async[count], 30 * 1000, getLogWriter());
+ Threads.join(async[count], 30 * 1000);
}
for (int count = 4; count < AsyncInvocationArrSize; count++) {
@@ -883,12 +885,12 @@ public class PartitionedRegionBucketCreationDistributionDUnitTest extends
/** main thread is waiting for the other threads to complete */
for (int count = 0; count < AsyncInvocationArrSize; count++) {
- DistributedTestCase.join(async[count], 30 * 1000, getLogWriter());
+ Threads.join(async[count], 30 * 1000);
}
for (int count = 0; count < AsyncInvocationArrSize; count++) {
if (async[count].exceptionOccurred()) {
- fail("Validation of bucket distribution failed on " + count,
+ Assert.fail("Validation of bucket distribution failed on " + count,
async[count].getException());
}
}
@@ -1533,7 +1535,7 @@ public class PartitionedRegionBucketCreationDistributionDUnitTest extends
/** main thread is waiting for the other threads to complete */
for (int count = 0; count < AsyncInvocationArrSize; count++) {
- DistributedTestCase.join(async[count], 30 * 1000, getLogWriter());
+ Threads.join(async[count], 30 * 1000);
}
/** testing whether exception occurred */
for (int count = 0; count < AsyncInvocationArrSize; count++) {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionCacheCloseDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionCacheCloseDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionCacheCloseDUnitTest.java
index d458947..e33c448 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionCacheCloseDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionCacheCloseDUnitTest.java
@@ -27,10 +27,13 @@ import com.gemstone.gemfire.cache.PartitionAttributesFactory;
import com.gemstone.gemfire.cache.Region;
import com.gemstone.gemfire.cache.RegionAttributes;
import com.gemstone.gemfire.cache30.CacheSerializableRunnable;
+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.Threads;
import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
/**
* Test to verify the meta-data cleanUp done at the time of cache close Op. This
@@ -125,11 +128,11 @@ public class PartitionedRegionCacheCloseDUnitTest extends
}
}
});
- DistributedTestCase.join(async0, 30 * 1000, getLogWriter());
- DistributedTestCase.join(async1, 30 * 1000, getLogWriter());
+ Threads.join(async0, 30 * 1000);
+ Threads.join(async1, 30 * 1000);
if(async0.exceptionOccurred()) {
- fail("Exception during async0", async0.getException());
+ Assert.fail("Exception during async0", async0.getException());
}
// Here we would close cache on one of the vms.
@@ -200,7 +203,7 @@ public class PartitionedRegionCacheCloseDUnitTest extends
for (int j = 0; j < MAX_REGIONS; j++) {
final String regionName = "#" + rName + j;
- waitForCriterion(new WaitCriterion() {
+ Wait.waitForCriterion(new WaitCriterion() {
private Set<Node> nodes;
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionCreationDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionCreationDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionCreationDUnitTest.java
index 367782a..6d8db75 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionCreationDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionCreationDUnitTest.java
@@ -34,10 +34,12 @@ import com.gemstone.gemfire.cache.RegionAttributes;
import com.gemstone.gemfire.cache.Scope;
import com.gemstone.gemfire.cache30.CacheSerializableRunnable;
import com.gemstone.gemfire.internal.i18n.LocalizedStrings;
+import com.gemstone.gemfire.test.dunit.Assert;
import com.gemstone.gemfire.test.dunit.AsyncInvocation;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.IgnoredException;
import com.gemstone.gemfire.test.dunit.SerializableRunnable;
+import com.gemstone.gemfire.test.dunit.Threads;
import com.gemstone.gemfire.test.dunit.VM;
@SuppressWarnings("serial")
@@ -121,12 +123,12 @@ public class PartitionedRegionCreationDUnitTest extends
/** main thread is waiting for the other threads to complete */
for (int count = 0; count < AsyncInvocationArrSize; count++) {
- DistributedTestCase.join(async[count], 30 * 1000, getLogWriter());
+ Threads.join(async[count], 30 * 1000);
}
for (int count = 0; count < AsyncInvocationArrSize; count++) {
if (async[count].exceptionOccurred()) {
- fail("exception during " + count, async[count].getException());
+ Assert.fail("exception during " + count, async[count].getException());
}
}
@@ -251,13 +253,13 @@ public class PartitionedRegionCreationDUnitTest extends
/** main thread is waiting for the other threads to complete */
for (int count = 0; count < AsyncInvocationArrSize; count++) {
- DistributedTestCase.join(async[count], 30 * 1000, getLogWriter());
+ Threads.join(async[count], 30 * 1000);
}
th.join(30 * 1000);
for (int count = 0; count < AsyncInvocationArrSize; count++) {
if (async[count].exceptionOccurred()) {
- fail("exception during " + count, async[count].getException());
+ Assert.fail("exception during " + count, async[count].getException());
}
}
@@ -438,12 +440,12 @@ public class PartitionedRegionCreationDUnitTest extends
/** main thread is waiting for the other threads to complete */
for (int count = 0; count < 4; count++) {
- DistributedTestCase.join(async[count], 30 * 1000, getLogWriter());
+ Threads.join(async[count], 30 * 1000);
}
for (int count = 0; count < 4; count++) {
if (async[count].exceptionOccurred()) {
- fail("exception during " + count, async[count].getException());
+ Assert.fail("exception during " + count, async[count].getException());
}
}
@@ -454,12 +456,12 @@ public class PartitionedRegionCreationDUnitTest extends
/** main thread is waiting for the other threads to complete */
for (int count = 4; count < AsyncInvocationArrSize; count++) {
- DistributedTestCase.join(async[count], 30 * 1000, getLogWriter());
+ Threads.join(async[count], 30 * 1000);
}
for (int count = 4; count < AsyncInvocationArrSize; count++) {
if (async[count].exceptionOccurred()) {
- fail("exception during " + count, async[count].getException());
+ Assert.fail("exception during " + count, async[count].getException());
}
}
getLogWriter().info("*****INITIALIZATION TEST ENDED*****");
@@ -494,12 +496,12 @@ public class PartitionedRegionCreationDUnitTest extends
/** main thread is waiting for the other threads to complete */
for (int count = 0; count < 4; count++) {
- DistributedTestCase.join(async[count], 30 * 1000, getLogWriter());
+ Threads.join(async[count], 30 * 1000);
}
for (int count = 0; count < 4; count++) {
if (async[count].exceptionOccurred()) {
- fail("exception during " + count, async[count].getException());
+ Assert.fail("exception during " + count, async[count].getException());
}
}
@@ -514,12 +516,12 @@ public class PartitionedRegionCreationDUnitTest extends
/** main thread is waiting for the other threads to complete */
for (int count = 4; count < AsyncInvocationArrSize; count++) {
- DistributedTestCase.join(async[count], 30 * 1000, getLogWriter());
+ Threads.join(async[count], 30 * 1000);
}
for (int count = 4; count < AsyncInvocationArrSize; count++) {
if (async[count].exceptionOccurred()) {
- fail("exception during " + count, async[count].getException());
+ Assert.fail("exception during " + count, async[count].getException());
}
}
getLogWriter().info("*****REGISTRATION TEST ENDED*****");
@@ -532,7 +534,7 @@ public class PartitionedRegionCreationDUnitTest extends
*/
public void testPartitionRegionPersistenceConflicts() throws Throwable
{
- addExpectedException("IllegalStateException");
+ IgnoredException.addIgnoredException("IllegalStateException");
final String name = getUniqueName();
// Cache cache = getCache();
Host host = Host.getHost(0);
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionDUnitTestCase.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionDUnitTestCase.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionDUnitTestCase.java
index d81e686..c7d7056 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionDUnitTestCase.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionDUnitTestCase.java
@@ -31,6 +31,7 @@ import com.gemstone.gemfire.internal.logging.InternalLogWriter;
import com.gemstone.gemfire.internal.logging.LogWriterImpl;
import com.gemstone.gemfire.internal.logging.PureLogWriter;
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.standalone.DUnitLauncher;
@@ -91,13 +92,13 @@ public class PartitionedRegionDUnitTestCase extends CacheTestCase
* Tear down a PartitionedRegionTestCase by cleaning up the existing cache (mainly
* because we want to destroy any existing PartitionedRegions)
*/
- public void tearDown2() throws Exception
+ public void tearDownBeforeDisconnect() throws Exception
{
try {
closeCache();
- invokeInEveryVM(CacheTestCase.class, "closeCache");
+ Invoke.invokeInEveryVM(CacheTestCase.class, "closeCache");
} finally {
- super.tearDown2();
+ super.tearDownBeforeDisconnect();
}
}
public static void caseSetUp() {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionDelayedRecoveryDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionDelayedRecoveryDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionDelayedRecoveryDUnitTest.java
index 1d89967..136a98e 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionDelayedRecoveryDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionDelayedRecoveryDUnitTest.java
@@ -26,7 +26,9 @@ import com.gemstone.gemfire.cache.Region;
import com.gemstone.gemfire.cache30.CacheTestCase;
import com.gemstone.gemfire.internal.cache.control.InternalResourceManager;
import com.gemstone.gemfire.internal.cache.control.InternalResourceManager.ResourceObserverAdapter;
+import com.gemstone.gemfire.test.dunit.Assert;
import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.Invoke;
import com.gemstone.gemfire.test.dunit.SerializableCallable;
import com.gemstone.gemfire.test.dunit.SerializableRunnable;
import com.gemstone.gemfire.test.dunit.VM;
@@ -44,9 +46,9 @@ public class PartitionedRegionDelayedRecoveryDUnitTest extends CacheTestCase {
@Override
- public void tearDown2() throws Exception {
- super.tearDown2();
- invokeInEveryVM(new SerializableRunnable() {
+ public void tearDownBeforeDisconnect() throws Exception {
+ super.tearDownBeforeDisconnect();
+ Invoke.invokeInEveryVM(new SerializableRunnable() {
public void run() {
InternalResourceManager.setResourceObserver(null);
}
@@ -156,7 +158,7 @@ public class PartitionedRegionDelayedRecoveryDUnitTest extends CacheTestCase {
fail("Redundancy recovery did not happen within 60 seconds");
}
} catch (InterruptedException e) {
- fail("interrupted", e);
+ Assert.fail("interrupted", e);
} finally {
InternalResourceManager.setResourceObserver(null);
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionDestroyDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionDestroyDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionDestroyDUnitTest.java
index 4733fff..b79292d 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionDestroyDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionDestroyDUnitTest.java
@@ -28,11 +28,13 @@ import com.gemstone.gemfire.cache.Region;
import com.gemstone.gemfire.cache.RegionAttributes;
import com.gemstone.gemfire.cache.RegionDestroyedException;
import com.gemstone.gemfire.cache30.CacheSerializableRunnable;
+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.SerializableRunnable;
+import com.gemstone.gemfire.test.dunit.Threads;
import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
/**
* This test aims to test the destroyRegion functionality.
@@ -164,14 +166,14 @@ public class PartitionedRegionDestroyDUnitTest extends
}
});
- DistributedTestCase.join(async1, 30 * 1000, getLogWriter());
+ Threads.join(async1, 30 * 1000);
if(async1.exceptionOccurred()) {
- fail("async1 failed", async1.getException());
+ Assert.fail("async1 failed", async1.getException());
}
final String expectedExceptions = "com.gemstone.gemfire.distributed.internal.ReplyException";
addExceptionTag(expectedExceptions);
- pause(1000); // give async a chance to grab the regions...
+ Wait.pause(1000); // give async a chance to grab the regions...
vm0.invoke(new CacheSerializableRunnable("destroyPRRegions") {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionEntryCountDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionEntryCountDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionEntryCountDUnitTest.java
index dbaa433..985656d 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionEntryCountDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionEntryCountDUnitTest.java
@@ -23,6 +23,7 @@ import com.gemstone.gemfire.cache.EvictionAttributes;
import com.gemstone.gemfire.cache.PartitionAttributesFactory;
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.Host;
import com.gemstone.gemfire.test.dunit.SerializableCallable;
import com.gemstone.gemfire.test.dunit.SerializableRunnable;
@@ -85,7 +86,7 @@ public class PartitionedRegionEntryCountDUnitTest extends CacheTestCase {
assertNotNull(pr);
}
catch (final CacheException ex) {
- fail("While creating Partitioned region", ex);
+ Assert.fail("While creating Partitioned region", ex);
}
}
};