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/02/02 21:21:31 UTC
[24/44] incubator-geode git commit: Refactor dunit
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/76e324b5/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HADuplicateDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HADuplicateDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HADuplicateDUnitTest.java
index 9821af8..dd7a5b9 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HADuplicateDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HADuplicateDUnitTest.java
@@ -41,6 +41,7 @@ import com.gemstone.gemfire.internal.cache.CacheServerImpl;
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.NetworkSupport;
import com.gemstone.gemfire.test.dunit.VM;
/**
@@ -161,8 +162,8 @@ public class HADuplicateDUnitTest extends DistributedTestCase
public void testSample() throws Exception
{
- IgnoredException.addExpectedException("IOException");
- IgnoredException.addExpectedException("Connection reset");
+ IgnoredException.addIgnoredException("IOException");
+ IgnoredException.addIgnoredException("Connection reset");
createClientServerConfiguration();
server1.invoke(new CacheSerializableRunnable("putKey") {
@@ -226,7 +227,7 @@ public class HADuplicateDUnitTest extends DistributedTestCase
PORT2 = ((Integer)server2.invoke(HADuplicateDUnitTest.class,
"createServerCache")).intValue();
client1.invoke(HADuplicateDUnitTest.class, "createClientCache",
- new Object[] { getServerHostName(Host.getHost(0)), new Integer(PORT1), new Integer(PORT2) });
+ new Object[] { NetworkSupport.getServerHostName(Host.getHost(0)), new Integer(PORT1), new Integer(PORT2) });
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/76e324b5/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAEventIdPropagationDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAEventIdPropagationDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAEventIdPropagationDUnitTest.java
index 802193e..c07359e 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAEventIdPropagationDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAEventIdPropagationDUnitTest.java
@@ -49,7 +49,11 @@ import com.gemstone.gemfire.internal.cache.tier.sockets.ConflationDUnitTest;
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.LogWriterSupport;
+import com.gemstone.gemfire.test.dunit.NetworkSupport;
import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
/**
*
@@ -124,7 +128,7 @@ public class HAEventIdPropagationDUnitTest extends DistributedTestCase
int PORT1 = ((Integer)server1.invoke(HAEventIdPropagationDUnitTest.class,
"createServerCache")).intValue();
client1.invoke(HAEventIdPropagationDUnitTest.class, "createClientCache",
- new Object[] { getServerHostName(server1.getHost()), new Integer(PORT1) });
+ new Object[] { NetworkSupport.getServerHostName(server1.getHost()), new Integer(PORT1) });
}
/** create the server * */
@@ -213,9 +217,9 @@ public class HAEventIdPropagationDUnitTest extends DistributedTestCase
return null;
}
};
- DistributedTestCase.waitForCriterion(ev, 10 * 1000, 200, true);
+ Wait.waitForCriterion(ev, 10 * 1000, 200, true);
synchronized(map) {
- getLogWriter().info("assertThreadIdToSequenceIdMapisNotNullButEmpty: map size is " + map.size());
+ LogWriterSupport.getLogWriter().info("assertThreadIdToSequenceIdMapisNotNullButEmpty: map size is " + map.size());
assertTrue(map.size() == 1);
}
@@ -684,7 +688,7 @@ public class HAEventIdPropagationDUnitTest extends DistributedTestCase
public void afterCreate(EntryEvent event)
{
- getLogWriter().fine(" entered after created with " + event.getKey());
+ LogWriterSupport.getLogWriter().fine(" entered after created with " + event.getKey());
boolean shouldNotify = false;
Object key = event.getKey();
if (key.equals(PUTALL_KEY1)) {
@@ -777,7 +781,7 @@ public class HAEventIdPropagationDUnitTest extends DistributedTestCase
public void afterCreate(EntryEvent event)
{
- getLogWriter().fine(" entered after created with " + event.getKey());
+ LogWriterSupport.getLogWriter().fine(" entered after created with " + event.getKey());
boolean shouldNotify = false;
Object key = event.getKey();
if (key.equals(PUTALL_KEY1)) {
@@ -853,14 +857,14 @@ public class HAEventIdPropagationDUnitTest extends DistributedTestCase
public void afterRegionDestroy(RegionEvent event)
{
- getLogWriter().info("Before Regionestroy in Server");
+ LogWriterSupport.getLogWriter().info("Before Regionestroy in Server");
eventId = ((RegionEventImpl)event).getEventId();
assertNotNull(eventId);
synchronized (lockObject) {
receivedOperation = true;
lockObject.notify();
}
- getLogWriter().info("After RegionDestroy in Server");
+ LogWriterSupport.getLogWriter().info("After RegionDestroy in Server");
}
public void afterRegionClear(RegionEvent event)
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/76e324b5/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAExpiryDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAExpiryDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAExpiryDUnitTest.java
index 3d3eb0a..4bc6abc 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAExpiryDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAExpiryDUnitTest.java
@@ -36,8 +36,11 @@ import com.gemstone.gemfire.internal.cache.HARegion;
import com.gemstone.gemfire.internal.cache.RegionQueue;
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.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
/**
* This test checks Expiration of events in the regionqueue.
@@ -101,7 +104,7 @@ public class HAExpiryDUnitTest extends DistributedTestCase
vm2.invoke(HAExpiryDUnitTest.class, "closeCache");
vm3.invoke(HAExpiryDUnitTest.class, "closeCache");
cache = null;
- invokeInEveryVM(new SerializableRunnable() { public void run() { cache = null; } });
+ Invoke.invokeInEveryVM(new SerializableRunnable() { public void run() { cache = null; } });
}
@@ -155,7 +158,7 @@ public class HAExpiryDUnitTest extends DistributedTestCase
vm2.invoke(HAExpiryDUnitTest.class, "checkSizeBeforeExpiration");
vm3.invoke(HAExpiryDUnitTest.class, "checkSizeBeforeExpiration");
- pause(5000); // wait for some time to make sure that we give sufficient time
+ Wait.pause(5000); // wait for some time to make sure that we give sufficient time
// to expiry
// in spite of giving time the events should not expire, and queue should be
// same as before expiration
@@ -187,7 +190,7 @@ public class HAExpiryDUnitTest extends DistributedTestCase
return null;
}
};
- DistributedTestCase.waitForCriterion(ev, 60 * 1000, 200, true);
+ Wait.waitForCriterion(ev, 60 * 1000, 200, true);
/*
* if (regionqueue.size() < 1) fail("RegionQueue size canot be less than 1
* before expiration");
@@ -216,7 +219,7 @@ public class HAExpiryDUnitTest extends DistributedTestCase
return null;
}
};
- DistributedTestCase.waitForCriterion(ev, 60 * 1000, 200, true);
+ Wait.waitForCriterion(ev, 60 * 1000, 200, true);
/*
* if (regionqueue.size() > regionQueueSize) fail("RegionQueue size should
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/76e324b5/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAGIIBugDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAGIIBugDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAGIIBugDUnitTest.java
index cc21b6f..64abc9f 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAGIIBugDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAGIIBugDUnitTest.java
@@ -41,7 +41,10 @@ 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.LogWriterSupport;
import com.gemstone.gemfire.test.dunit.SerializableRunnable;
+import com.gemstone.gemfire.test.dunit.Threads;
import com.gemstone.gemfire.test.dunit.VM;
/**
@@ -121,7 +124,7 @@ public class HAGIIBugDUnitTest extends DistributedTestCase
vm2.invoke(HAGIIBugDUnitTest.class, "closeCache");
vm3.invoke(HAGIIBugDUnitTest.class, "closeCache");
cache = null;
- invokeInEveryVM(new SerializableRunnable() { public void run() { cache = null; } });
+ Invoke.invokeInEveryVM(new SerializableRunnable() { public void run() { cache = null; } });
}
protected void createCache(Properties props) throws Exception
@@ -137,7 +140,7 @@ public class HAGIIBugDUnitTest extends DistributedTestCase
public void testDummy() throws Exception
{
- getLogWriter().info("This is Dummy test for the GII");
+ LogWriterSupport.getLogWriter().info("This is Dummy test for the GII");
}
@@ -159,7 +162,7 @@ public class HAGIIBugDUnitTest extends DistributedTestCase
factory.setCacheListener(regionListener);
RegionAttributes attrs = factory.create();
Region region = cache.createRegion(REGION_NAME, attrs);
- getLogWriter().info(
+ LogWriterSupport.getLogWriter().info(
"Name of the region is : " + region.getFullPath());
HARegionQueueAttributes hattr = new HARegionQueueAttributes();
@@ -184,12 +187,12 @@ public class HAGIIBugDUnitTest extends DistributedTestCase
AsyncInvocation[] async = new AsyncInvocation[4];
async[0] = vm0.invokeAsync(putFrmVm("vm0_2"));
t1.start();
- DistributedTestCase.join(t1, 30 * 1000, getLogWriter());
+ Threads.join(t1, 30 * 1000, LogWriterSupport.getLogWriter());
if (isTestFailed)
fail("HARegionQueue can not be created");
for (int count = 0; count < 1; count++) {
- DistributedTestCase.join(async[count], 30 * 1000, getLogWriter());
+ Threads.join(async[count], 30 * 1000, LogWriterSupport.getLogWriter());
if (async[count].exceptionOccurred()) {
Assert.fail("Got exception on " + count, async[count].getException());
}
@@ -205,7 +208,7 @@ public class HAGIIBugDUnitTest extends DistributedTestCase
validationFlag = true;
validateResults(validationFlag);
- getLogWriter().info(
+ LogWriterSupport.getLogWriter().info(
"No. of keys that are missed by HARegion Queue during GII "
+ keys_set_after_gii.size());
@@ -219,7 +222,7 @@ public class HAGIIBugDUnitTest extends DistributedTestCase
// int k = 0;
for (int i = 0; i < 1; i++) {
long totalPuts = ((Long)total_no_puts[i]).longValue() - 3 * NO_OF_PUTS;
- getLogWriter().info("Total no of puts expectesd " + totalPuts);
+ LogWriterSupport.getLogWriter().info("Total no of puts expectesd " + totalPuts);
for (int j = 0; j < totalPuts; j++) {
keys_set_after_gii.add("vm" + i + "_2" + j);
@@ -240,7 +243,7 @@ public class HAGIIBugDUnitTest extends DistributedTestCase
{
HARegion regionForQueue = (HARegion)cache.getRegion(Region.SEPARATOR
+ HARegionQueue.createRegionName(HAExpiryDUnitTest.regionQueueName));
- getLogWriter().info(
+ LogWriterSupport.getLogWriter().info(
"Region Queue size : " + regionForQueue.keys().size());
Iterator itr = regionForQueue.entries(false).iterator();
while (itr.hasNext()) {
@@ -316,7 +319,7 @@ public class HAGIIBugDUnitTest extends DistributedTestCase
}
TOTAL_NO_OF_PUTS = TOTAL_NO_OF_PUTS + NO_OF_PUTS;
}
- getLogWriter().info("Total no of puts : " + TOTAL_NO_OF_PUTS);
+ LogWriterSupport.getLogWriter().info("Total no of puts : " + TOTAL_NO_OF_PUTS);
}
};
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/76e324b5/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAGIIDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAGIIDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAGIIDUnitTest.java
index a08eea3..b3da598 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAGIIDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAGIIDUnitTest.java
@@ -50,8 +50,12 @@ import com.gemstone.gemfire.internal.cache.versions.VersionSource;
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.Invoke;
+import com.gemstone.gemfire.test.dunit.NetworkSupport;
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;
/**
* Client is connected to S1 which has a slow dispatcher. Puts are made on S1. Then S2 is started
@@ -147,7 +151,7 @@ public class HAGIIDUnitTest extends DistributedTestCase
PORT2 = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
//Start the client
client0.invoke(HAGIIDUnitTest.class, "createClientCache",
- new Object[] { getServerHostName(host), new Integer(PORT1),new Integer(PORT2)});
+ new Object[] { NetworkSupport.getServerHostName(host), new Integer(PORT1),new Integer(PORT2)});
}
public void testGIIRegionQueue()
@@ -160,7 +164,7 @@ public class HAGIIDUnitTest extends DistributedTestCase
client0.invoke(HAGIIDUnitTest.class, "verifyEntries");
server1.invoke(HAGIIDUnitTest.class, "createServer2Cache" ,new Object[] {new Integer(PORT2)});
- pause(6000);
+ Wait.pause(6000);
server0.invoke(HAGIIDUnitTest.class, "stopServer");
//pause(10000);
client0.invoke(HAGIIDUnitTest.class, "verifyEntriesAfterGiiViaListener");
@@ -327,7 +331,7 @@ public class HAGIIDUnitTest extends DistributedTestCase
return null;
}
};
- DistributedTestCase.waitForCriterion(ev, 60 * 1000, 200, true);
+ Wait.waitForCriterion(ev, 60 * 1000, 200, true);
// assertEquals( "key-2",r.getEntry("key-2").getValue());
// wait until we
@@ -341,7 +345,7 @@ public class HAGIIDUnitTest extends DistributedTestCase
return null;
}
};
- DistributedTestCase.waitForCriterion(ev, 60 * 1000, 200, true);
+ Wait.waitForCriterion(ev, 60 * 1000, 200, true);
// assertEquals( "key-3",r.getEntry("key-3").getValue());
}
catch (Exception ex) {
@@ -360,7 +364,7 @@ public class HAGIIDUnitTest extends DistributedTestCase
return null;
}
};
- DistributedTestCase.waitForCriterion(ev, 90 * 1000, 200, true);
+ Wait.waitForCriterion(ev, 90 * 1000, 200, true);
ev = new WaitCriterion() {
public boolean done() {
@@ -370,7 +374,7 @@ public class HAGIIDUnitTest extends DistributedTestCase
return null;
}
};
- DistributedTestCase.waitForCriterion(ev, 60 * 1000, 200, true);
+ Wait.waitForCriterion(ev, 60 * 1000, 200, true);
ev = new WaitCriterion() {
public boolean done() {
@@ -380,7 +384,7 @@ public class HAGIIDUnitTest extends DistributedTestCase
return null;
}
};
- DistributedTestCase.waitForCriterion(ev, 60 * 1000, 200, true);
+ Wait.waitForCriterion(ev, 60 * 1000, 200, true);
assertEquals(3, HAGIIDUnitTest.checker.getUpdates());
}
@@ -401,7 +405,7 @@ public class HAGIIDUnitTest extends DistributedTestCase
return null;
}
};
- DistributedTestCase.waitForCriterion(ev, 60 * 1000, 200, true);
+ Wait.waitForCriterion(ev, 60 * 1000, 200, true);
// wait until
// we have a
@@ -414,7 +418,7 @@ public class HAGIIDUnitTest extends DistributedTestCase
return null;
}
};
- DistributedTestCase.waitForCriterion(ev, 60 * 1000, 200, true);
+ Wait.waitForCriterion(ev, 60 * 1000, 200, true);
// assertEquals( "key-2",r.getEntry("key-2").getValue());
@@ -429,7 +433,7 @@ public class HAGIIDUnitTest extends DistributedTestCase
return null;
}
};
- DistributedTestCase.waitForCriterion(ev, 60 * 1000, 200, true);
+ Wait.waitForCriterion(ev, 60 * 1000, 200, true);
/*
* assertEquals( "value-1",r.getEntry("key-1").getValue()); assertEquals(
@@ -451,7 +455,7 @@ public class HAGIIDUnitTest extends DistributedTestCase
{
super.tearDown2();
ConflationDUnitTest.unsetIsSlowStart();
- invokeInEveryVM(ConflationDUnitTest.class, "unsetIsSlowStart");
+ Invoke.invokeInEveryVM(ConflationDUnitTest.class, "unsetIsSlowStart");
// close the clients first
client0.invoke(HAGIIDUnitTest.class, "closeCache");
// then close the servers
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/76e324b5/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARQAddOperationJUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARQAddOperationJUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARQAddOperationJUnitTest.java
index 205ba4a..88dbd54 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARQAddOperationJUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARQAddOperationJUnitTest.java
@@ -47,7 +47,7 @@ import com.gemstone.gemfire.distributed.DistributedSystem;
import com.gemstone.gemfire.internal.cache.Conflatable;
import com.gemstone.gemfire.internal.cache.EventID;
import com.gemstone.gemfire.internal.logging.LogService;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
+import com.gemstone.gemfire.test.dunit.Threads;
import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
/**
@@ -470,8 +470,8 @@ public class HARQAddOperationJUnitTest
t1.start();
t2.start();
- DistributedTestCase.join(t1, 180 * 1000, null);
- DistributedTestCase.join(t2, 180 * 1000, null);
+ Threads.join(t1, 180 * 1000, null);
+ Threads.join(t2, 180 * 1000, null);
if (testFailed)
fail("Test failed due to " + message);
@@ -528,8 +528,8 @@ public class HARQAddOperationJUnitTest
t2.start();
t1.start();
- DistributedTestCase.join(t1, 180 * 1000, null);
- DistributedTestCase.join(t2, 180 * 1000, null);
+ Threads.join(t1, 180 * 1000, null);
+ Threads.join(t2, 180 * 1000, null);
if (testFailed)
fail("Test failed due to " + message);
@@ -628,7 +628,7 @@ public class HARQAddOperationJUnitTest
}
for (int k = 0; k < numOfThreads; k++) {
- DistributedTestCase.join(threads[k], 180 * 1000, null);
+ Threads.join(threads[k], 180 * 1000, null);
}
this.logWriter
@@ -711,7 +711,7 @@ public class HARQAddOperationJUnitTest
}
for (int k = 0; k < numOfThreads; k++) {
- DistributedTestCase.join(threads[k], 180 * 1000, null);
+ Threads.join(threads[k], 180 * 1000, null);
}
if (testFailed)
@@ -779,7 +779,7 @@ public class HARQAddOperationJUnitTest
}
for (int k = 0; k < numOfThreads; k++) {
- DistributedTestCase.join(threads[k], 180 * 1000, null);
+ Threads.join(threads[k], 180 * 1000, null);
}
if (testFailed)
@@ -853,7 +853,7 @@ public class HARQAddOperationJUnitTest
}
for (int k = 0; k < numOfThreads; k++) {
- DistributedTestCase.join(threads[k], 180 * 1000, null);
+ Threads.join(threads[k], 180 * 1000, null);
}
if (testFailed)
@@ -902,7 +902,7 @@ public class HARQAddOperationJUnitTest
}
for (int k = 0; k < numOfPuts; k++) {
- DistributedTestCase.join(threads_peek_remove[k], 180 * 1000, null);
+ Threads.join(threads_peek_remove[k], 180 * 1000, null);
}
if (testFailed)
@@ -965,7 +965,7 @@ public class HARQAddOperationJUnitTest
}
for (int k = 0; k < numOfThreads; k++) {
- DistributedTestCase.join(threads[k], 180 * 1000, null);
+ Threads.join(threads[k], 180 * 1000, null);
}
if (testFailed)
@@ -1013,7 +1013,7 @@ public class HARQAddOperationJUnitTest
}
for (int k = 0; k < numOfPuts - 1; k++) {
- DistributedTestCase.join(threads_peek_remove[k], 180 * 1000, null);
+ Threads.join(threads_peek_remove[k], 180 * 1000, null);
}
if (testFailed)
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/76e324b5/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARQueueNewImplDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARQueueNewImplDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARQueueNewImplDUnitTest.java
index 6e34675..cd6b891 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARQueueNewImplDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARQueueNewImplDUnitTest.java
@@ -55,7 +55,10 @@ import com.gemstone.gemfire.internal.cache.tier.sockets.HAEventWrapper;
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;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
import util.TestException;
@@ -351,11 +354,11 @@ public class HARQueueNewImplDUnitTest extends DistributedTestCase {
serverVM1.invoke(ConflationDUnitTest.class, "setIsSlowStart",
new Object[] { "30000" });
- createClientCache(getServerHostName(Host.getHost(0)), new Integer(PORT1), new Integer(PORT2), "1");
- final String client1Host = getServerHostName(clientVM1.getHost());
+ createClientCache(NetworkSupport.getServerHostName(Host.getHost(0)), new Integer(PORT1), new Integer(PORT2), "1");
+ final String client1Host = NetworkSupport.getServerHostName(clientVM1.getHost());
clientVM1.invoke(HARQueueNewImplDUnitTest.class, "createClientCache",
new Object[] { client1Host, new Integer(PORT1), new Integer(PORT2), "1" });
- final String client2Host = getServerHostName(clientVM2.getHost());
+ final String client2Host = NetworkSupport.getServerHostName(clientVM2.getHost());
clientVM2.invoke(HARQueueNewImplDUnitTest.class, "createClientCache",
new Object[] { client2Host, new Integer(PORT1), new Integer(PORT2), "1" });
@@ -389,11 +392,11 @@ public class HARQueueNewImplDUnitTest extends DistributedTestCase {
serverVM1.invoke(ConflationDUnitTest.class, "setIsSlowStart",
new Object[] { "30000" });
- createClientCache(getServerHostName(Host.getHost(0)), new Integer(PORT1), new Integer(PORT2), "1");
- final String client1Host = getServerHostName(clientVM1.getHost());
+ createClientCache(NetworkSupport.getServerHostName(Host.getHost(0)), new Integer(PORT1), new Integer(PORT2), "1");
+ final String client1Host = NetworkSupport.getServerHostName(clientVM1.getHost());
clientVM1.invoke(HARQueueNewImplDUnitTest.class, "createClientCache",
new Object[] { client1Host, new Integer(PORT1), new Integer(PORT2), "1" });
- final String client2Host = getServerHostName(clientVM2.getHost());
+ final String client2Host = NetworkSupport.getServerHostName(clientVM2.getHost());
clientVM2.invoke(HARQueueNewImplDUnitTest.class, "createClientCache",
new Object[] { client2Host, new Integer(PORT1), new Integer(PORT2), "1" });
@@ -428,11 +431,11 @@ public class HARQueueNewImplDUnitTest extends DistributedTestCase {
serverVM0.invoke(ConflationDUnitTest.class, "setIsSlowStart",
new Object[] { "30000" });
- createClientCache(getServerHostName(Host.getHost(0)), new Integer(PORT1), new Integer(PORT2), "1");
- final String client1Host = getServerHostName(clientVM1.getHost());
+ createClientCache(NetworkSupport.getServerHostName(Host.getHost(0)), new Integer(PORT1), new Integer(PORT2), "1");
+ final String client1Host = NetworkSupport.getServerHostName(clientVM1.getHost());
clientVM1.invoke(HARQueueNewImplDUnitTest.class, "createClientCache",
new Object[] { client1Host, new Integer(PORT1), new Integer(PORT2), "1" });
- final String client2Host = getServerHostName(clientVM2.getHost());
+ final String client2Host = NetworkSupport.getServerHostName(clientVM2.getHost());
clientVM2.invoke(HARQueueNewImplDUnitTest.class, "createClientCache",
new Object[] { client2Host, new Integer(PORT1), new Integer(PORT2), "1" });
@@ -465,11 +468,11 @@ public class HARQueueNewImplDUnitTest extends DistributedTestCase {
serverVM0.invoke(ConflationDUnitTest.class, "setIsSlowStart",
new Object[] { "30000" });
- createClientCache(getServerHostName(Host.getHost(0)), new Integer(PORT1), new Integer(PORT2), "1");
- final String client1Host = getServerHostName(clientVM1.getHost());
+ createClientCache(NetworkSupport.getServerHostName(Host.getHost(0)), new Integer(PORT1), new Integer(PORT2), "1");
+ final String client1Host = NetworkSupport.getServerHostName(clientVM1.getHost());
clientVM1.invoke(HARQueueNewImplDUnitTest.class, "createClientCache",
new Object[] { client1Host, new Integer(PORT1), new Integer(PORT2), "1" });
- final String client2Host = getServerHostName(clientVM2.getHost());
+ final String client2Host = NetworkSupport.getServerHostName(clientVM2.getHost());
clientVM2.invoke(HARQueueNewImplDUnitTest.class, "createClientCache",
new Object[] { client2Host, new Integer(PORT1), new Integer(PORT2), "1" });
@@ -507,11 +510,11 @@ public class HARQueueNewImplDUnitTest extends DistributedTestCase {
serverVM1.invoke(ConflationDUnitTest.class, "setIsSlowStart",
new Object[] { "30000" });
- createClientCache(getServerHostName(Host.getHost(0)), new Integer(PORT1), new Integer(PORT2), "1");
- final String client1Host = getServerHostName(clientVM1.getHost());
+ createClientCache(NetworkSupport.getServerHostName(Host.getHost(0)), new Integer(PORT1), new Integer(PORT2), "1");
+ final String client1Host = NetworkSupport.getServerHostName(clientVM1.getHost());
clientVM1.invoke(HARQueueNewImplDUnitTest.class, "createClientCache",
new Object[] { client1Host, new Integer(PORT1), new Integer(PORT2), "1" });
- final String client2Host = getServerHostName(clientVM2.getHost());
+ final String client2Host = NetworkSupport.getServerHostName(clientVM2.getHost());
clientVM2.invoke(HARQueueNewImplDUnitTest.class, "createClientCache",
new Object[] { client2Host, new Integer(PORT1), new Integer(PORT2), "1" });
@@ -562,11 +565,11 @@ public class HARQueueNewImplDUnitTest extends DistributedTestCase {
serverVM1.invoke(ConflationDUnitTest.class, "setIsSlowStart",
new Object[] { "40000" });
- createClientCache(getServerHostName(Host.getHost(0)), new Integer(PORT1), new Integer(PORT2), "1");
- final String client1Host = getServerHostName(clientVM1.getHost());
+ createClientCache(NetworkSupport.getServerHostName(Host.getHost(0)), new Integer(PORT1), new Integer(PORT2), "1");
+ final String client1Host = NetworkSupport.getServerHostName(clientVM1.getHost());
clientVM1.invoke(HARQueueNewImplDUnitTest.class, "createClientCache",
new Object[] { client1Host, new Integer(PORT1), new Integer(PORT2), "1" });
- final String client2Host = getServerHostName(clientVM2.getHost());
+ final String client2Host = NetworkSupport.getServerHostName(clientVM2.getHost());
clientVM2.invoke(HARQueueNewImplDUnitTest.class, "createClientCache",
new Object[] { client2Host, new Integer(PORT1), new Integer(PORT2), "1" });
@@ -618,11 +621,11 @@ public class HARQueueNewImplDUnitTest extends DistributedTestCase {
Integer port3 = (Integer)serverVM0.invoke(HARQueueNewImplDUnitTest.class,
"createOneMoreBridgeServer", new Object[] { Boolean.TRUE });
- createClientCache(getServerHostName(Host.getHost(0)), new Integer(PORT1), port3, "0");
- final String client1Host = getServerHostName(clientVM1.getHost());
+ createClientCache(NetworkSupport.getServerHostName(Host.getHost(0)), new Integer(PORT1), port3, "0");
+ final String client1Host = NetworkSupport.getServerHostName(clientVM1.getHost());
clientVM1.invoke(HARQueueNewImplDUnitTest.class, "createClientCache",
new Object[] { client1Host, new Integer(PORT1), new Integer(PORT2), "1" });
- final String client2Host = getServerHostName(clientVM2.getHost());
+ final String client2Host = NetworkSupport.getServerHostName(clientVM2.getHost());
clientVM2.invoke(HARQueueNewImplDUnitTest.class, "createClientCache",
new Object[] { client2Host, new Integer(PORT1), new Integer(PORT2), "1" });
@@ -649,8 +652,8 @@ public class HARQueueNewImplDUnitTest extends DistributedTestCase {
Integer port3 = (Integer)serverVM0.invoke(HARQueueNewImplDUnitTest.class,
"createOneMoreBridgeServer", new Object[] { Boolean.FALSE });
- createClientCache(getServerHostName(Host.getHost(0)), new Integer(PORT1), new Integer(PORT2), "1", Boolean.TRUE);
- final String client1Host = getServerHostName(clientVM1.getHost());
+ createClientCache(NetworkSupport.getServerHostName(Host.getHost(0)), new Integer(PORT1), new Integer(PORT2), "1", Boolean.TRUE);
+ final String client1Host = NetworkSupport.getServerHostName(clientVM1.getHost());
clientVM1.invoke(HARQueueNewImplDUnitTest.class, "createClientCache",
new Object[] { client1Host, port3, new Integer(PORT2), "1", Boolean.TRUE });
@@ -687,11 +690,11 @@ public class HARQueueNewImplDUnitTest extends DistributedTestCase {
serverVM0.invoke(ConflationDUnitTest.class, "setIsSlowStart",
new Object[] { "30000" });
- createClientCache(getServerHostName(Host.getHost(0)), new Integer(PORT1), new Integer(PORT2), "1");
- final String client1Host = getServerHostName(clientVM1.getHost());
+ createClientCache(NetworkSupport.getServerHostName(Host.getHost(0)), new Integer(PORT1), new Integer(PORT2), "1");
+ final String client1Host = NetworkSupport.getServerHostName(clientVM1.getHost());
clientVM1.invoke(HARQueueNewImplDUnitTest.class, "createClientCache",
new Object[] { client1Host, new Integer(PORT1), new Integer(PORT2), "1" });
- final String client2Host = getServerHostName(clientVM2.getHost());
+ final String client2Host = NetworkSupport.getServerHostName(clientVM2.getHost());
clientVM2.invoke(HARQueueNewImplDUnitTest.class, "createClientCache",
new Object[] { client2Host, new Integer(PORT1), new Integer(PORT2), "1" });
@@ -737,11 +740,11 @@ public class HARQueueNewImplDUnitTest extends DistributedTestCase {
serverVM0.invoke(ConflationDUnitTest.class, "setIsSlowStart",
new Object[] { "30000" });
- createClientCache(getServerHostName(Host.getHost(0)), new Integer(PORT1), new Integer(PORT2), "1");
- final String client1Host = getServerHostName(clientVM1.getHost());
+ createClientCache(NetworkSupport.getServerHostName(Host.getHost(0)), new Integer(PORT1), new Integer(PORT2), "1");
+ final String client1Host = NetworkSupport.getServerHostName(clientVM1.getHost());
clientVM1.invoke(HARQueueNewImplDUnitTest.class, "createClientCache",
new Object[] { client1Host, new Integer(PORT1), new Integer(PORT2), "1" });
- final String client2Host = getServerHostName(clientVM2.getHost());
+ final String client2Host = NetworkSupport.getServerHostName(clientVM2.getHost());
clientVM2.invoke(HARQueueNewImplDUnitTest.class, "createClientCache",
new Object[] { client2Host, new Integer(PORT1), new Integer(PORT2), "1" });
@@ -781,11 +784,11 @@ public class HARQueueNewImplDUnitTest extends DistributedTestCase {
serverVM0.invoke(ConflationDUnitTest.class, "setIsSlowStart",
new Object[] { "30000" });
- createClientCache(getServerHostName(Host.getHost(0)), new Integer(PORT1), new Integer(PORT2), "1");
- final String client1Host = getServerHostName(clientVM1.getHost());
+ createClientCache(NetworkSupport.getServerHostName(Host.getHost(0)), new Integer(PORT1), new Integer(PORT2), "1");
+ final String client1Host = NetworkSupport.getServerHostName(clientVM1.getHost());
clientVM1.invoke(HARQueueNewImplDUnitTest.class, "createClientCache",
new Object[] { client1Host, new Integer(PORT1), new Integer(PORT2), "1" });
- final String client2Host = getServerHostName(clientVM1.getHost());
+ final String client2Host = NetworkSupport.getServerHostName(clientVM1.getHost());
clientVM2.invoke(HARQueueNewImplDUnitTest.class, "createClientCache",
new Object[] { client2Host, new Integer(PORT1), new Integer(PORT2), "1" });
@@ -819,11 +822,11 @@ public class HARQueueNewImplDUnitTest extends DistributedTestCase {
*/
public void testCMRNotReturnedByRootRegionsMethod() throws Exception {
- createClientCache(getServerHostName(Host.getHost(0)), new Integer(PORT1), new Integer(PORT2), "1");
- final String client1Host = getServerHostName(clientVM1.getHost());
+ createClientCache(NetworkSupport.getServerHostName(Host.getHost(0)), new Integer(PORT1), new Integer(PORT2), "1");
+ final String client1Host = NetworkSupport.getServerHostName(clientVM1.getHost());
clientVM1.invoke(HARQueueNewImplDUnitTest.class, "createClientCache",
new Object[] { client1Host, new Integer(PORT1), new Integer(PORT2), "1" });
- final String client2Host = getServerHostName(clientVM2.getHost());
+ final String client2Host = NetworkSupport.getServerHostName(clientVM2.getHost());
clientVM2.invoke(HARQueueNewImplDUnitTest.class, "createClientCache",
new Object[] { client2Host, new Integer(PORT1), new Integer(PORT2), "1" });
@@ -868,11 +871,11 @@ public class HARQueueNewImplDUnitTest extends DistributedTestCase {
serverVM1.invoke(ConflationDUnitTest.class, "setIsSlowStart",
new Object[] { "60000" });
- createClientCache(getServerHostName(Host.getHost(0)), new Integer(PORT1), new Integer(PORT2), "1");
- final String client1Host = getServerHostName(clientVM1.getHost());
+ createClientCache(NetworkSupport.getServerHostName(Host.getHost(0)), new Integer(PORT1), new Integer(PORT2), "1");
+ final String client1Host = NetworkSupport.getServerHostName(clientVM1.getHost());
clientVM1.invoke(HARQueueNewImplDUnitTest.class, "createClientCache",
new Object[] { client1Host, new Integer(PORT1), new Integer(PORT2), "1" });
- final String client2Host = getServerHostName(clientVM2.getHost());
+ final String client2Host = NetworkSupport.getServerHostName(clientVM2.getHost());
clientVM2.invoke(HARQueueNewImplDUnitTest.class, "createClientCache",
new Object[] { client2Host, new Integer(PORT1), new Integer(PORT2), "1" });
@@ -1074,7 +1077,7 @@ public class HARQueueNewImplDUnitTest extends DistributedTestCase {
return excuse;
}
};
- DistributedTestCase.waitForCriterion(wc, 60 * 1000, 1000, true);
+ Wait.waitForCriterion(wc, 60 * 1000, 1000, true);
Set entries = msgsRegion.entrySet();
Iterator iter = entries.iterator();
@@ -1207,7 +1210,7 @@ public class HARQueueNewImplDUnitTest extends DistributedTestCase {
return excuse;
}
};
- DistributedTestCase.waitForCriterion(wc, 120 * 1000, 1000, true);
+ Wait.waitForCriterion(wc, 120 * 1000, 1000, true);
}
public static void verifyRegionSize(final Integer regionSize,
@@ -1245,7 +1248,7 @@ public class HARQueueNewImplDUnitTest extends DistributedTestCase {
return excuse;
}
};
- DistributedTestCase.waitForCriterion(wc, 120 * 1000, 1000, true);
+ Wait.waitForCriterion(wc, 120 * 1000, 1000, true);
}
public static void verifyHaContainerType(Boolean isRegion, Integer port) {
@@ -1309,7 +1312,7 @@ public class HARQueueNewImplDUnitTest extends DistributedTestCase {
return null;
}
};
- DistributedTestCase.waitForCriterion(ev, waitLimit.longValue(), 200, true);
+ Wait.waitForCriterion(ev, waitLimit.longValue(), 200, true);
}
else {
WaitCriterion ev = new WaitCriterion() {
@@ -1320,7 +1323,7 @@ public class HARQueueNewImplDUnitTest extends DistributedTestCase {
return null;
}
};
- DistributedTestCase.waitForCriterion(ev, waitLimit.longValue(), 200, true);
+ Wait.waitForCriterion(ev, waitLimit.longValue(), 200, true);
}
}
catch (Exception e) {
@@ -1352,7 +1355,7 @@ public class HARQueueNewImplDUnitTest extends DistributedTestCase {
return null;
}
};
- DistributedTestCase.waitForCriterion(ev, waitLimit.longValue(), 200, true);
+ Wait.waitForCriterion(ev, waitLimit.longValue(), 200, true);
}
catch (Exception e) {
fail("failed in waitTillMessagesAreDispatched()" + e);
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/76e324b5/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARegionQueueDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARegionQueueDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARegionQueueDUnitTest.java
index 88a65d0..5bebaf3 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARegionQueueDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARegionQueueDUnitTest.java
@@ -45,7 +45,10 @@ import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
import com.gemstone.gemfire.internal.cache.HARegion;
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;
/**
*
@@ -294,7 +297,7 @@ public class HARegionQueueDUnitTest extends DistributedTestCase
return null;
}
};
- DistributedTestCase.waitForCriterion(ev, 60 * 1000, 200, true);
+ Wait.waitForCriterion(ev, 60 * 1000, 200, true);
}
});
@@ -403,7 +406,7 @@ public class HARegionQueueDUnitTest extends DistributedTestCase
return null;
}
};
- DistributedTestCase.waitForCriterion(ev, 60 * 1000, 200, true);
+ Wait.waitForCriterion(ev, 60 * 1000, 200, true);
/*
* if (region.get(new Long(0)) != null) { fail("Expected message to have
@@ -851,7 +854,7 @@ public class HARegionQueueDUnitTest extends DistributedTestCase
if (opThreads[i].isInterrupted()) {
fail("Test failed because thread encountered exception");
}
- DistributedTestCase.join(opThreads[i], 30 * 1000, getLogWriter());
+ Threads.join(opThreads[i], 30 * 1000, com.gemstone.gemfire.test.dunit.LogWriterSupport.getLogWriter());
}
}
};
@@ -965,8 +968,8 @@ public class HARegionQueueDUnitTest extends DistributedTestCase
return null;
}
};
- DistributedTestCase.waitForCriterion(ev, 30 * 1000, 200, true);
- DistributedTestCase.join(createQueuesThread, 300 * 1000, getLogWriter());
+ Wait.waitForCriterion(ev, 30 * 1000, 200, true);
+ Threads.join(createQueuesThread, 300 * 1000, com.gemstone.gemfire.test.dunit.LogWriterSupport.getLogWriter());
}
};
@@ -980,7 +983,7 @@ public class HARegionQueueDUnitTest extends DistributedTestCase
if (opThreads[0].isInterrupted()) {
fail("The test has failed as it encountered interrupts in puts & takes");
}
- DistributedTestCase.join(opThreads[0], 30 * 1000, getLogWriter());
+ Threads.join(opThreads[0], 30 * 1000, com.gemstone.gemfire.test.dunit.LogWriterSupport.getLogWriter());
}
};
vm0.invoke(joinWithThread);
@@ -1106,7 +1109,7 @@ public class HARegionQueueDUnitTest extends DistributedTestCase
return null;
}
};
- DistributedTestCase.waitForCriterion(ev, 60 * 1000, 200, true);
+ Wait.waitForCriterion(ev, 60 * 1000, 200, true);
// assertEquals(0, hrq.getAvalaibleIds().size());
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/76e324b5/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARegionQueueJUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARegionQueueJUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARegionQueueJUnitTest.java
index f73a5a6..8f9ba9c 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARegionQueueJUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARegionQueueJUnitTest.java
@@ -54,7 +54,7 @@ import com.gemstone.gemfire.distributed.DistributedSystem;
import com.gemstone.gemfire.internal.cache.Conflatable;
import com.gemstone.gemfire.internal.cache.EventID;
import com.gemstone.gemfire.internal.cache.RegionQueue;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
+import com.gemstone.gemfire.test.dunit.Threads;
import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
/**
@@ -292,7 +292,7 @@ public class HARegionQueueJUnitTest
// call join on the put-threads so that this thread waits till they complete
// before doing verfication
for (i = 0; i < TOTAL_PUT_THREADS; i++) {
- DistributedTestCase.join(putThreads[i], 30 * 1000, null);
+ Threads.join(putThreads[i], 30 * 1000, null);
}
assertFalse(encounteredException);
@@ -384,7 +384,7 @@ public class HARegionQueueJUnitTest
long startTime = System.currentTimeMillis();
for (int k = 0; k < threads.length; k++) {
- DistributedTestCase.join(threads[k], 60 * 1000, null);
+ Threads.join(threads[k], 60 * 1000, null);
}
long totalTime = System.currentTimeMillis() - startTime;
@@ -1252,8 +1252,8 @@ public class HARegionQueueJUnitTest
};
thread1.start();
thread2.start();
- DistributedTestCase.join(thread1, 30 * 1000, null);
- DistributedTestCase.join(thread2, 30 * 1000, null);
+ Threads.join(thread1, 30 * 1000, null);
+ Threads.join(thread2, 30 * 1000, null);
List list2 = HARegionQueue.createMessageListForTesting();
Iterator iterator = list1.iterator();
boolean doOnce = false;
@@ -1363,8 +1363,8 @@ public class HARegionQueueJUnitTest
};
thread1.start();
thread2.start();
- DistributedTestCase.join(thread1, 30 * 1000, null);
- DistributedTestCase.join(thread2, 30 * 1000, null);
+ Threads.join(thread1, 30 * 1000, null);
+ Threads.join(thread2, 30 * 1000, null);
List list2 = HARegionQueue.createMessageListForTesting();
Iterator iterator = list1.iterator();
boolean doOnce = false;
@@ -1483,8 +1483,8 @@ public class HARegionQueueJUnitTest
};
thread1.start();
thread2.start();
- DistributedTestCase.join(thread1, 30 * 1000, null);
- DistributedTestCase.join(thread2, 30 * 1000, null);
+ Threads.join(thread1, 30 * 1000, null);
+ Threads.join(thread2, 30 * 1000, null);
List list2 = HARegionQueue.createMessageListForTesting();
Iterator iterator = list1.iterator();
boolean doOnce = true;
@@ -1649,8 +1649,8 @@ public class HARegionQueueJUnitTest
};
thread1.start();
thread2.start();
- DistributedTestCase.join(thread1, 30 * 1000, null);
- DistributedTestCase.join(thread2, 30 * 1000, null);
+ Threads.join(thread1, 30 * 1000, null);
+ Threads.join(thread2, 30 * 1000, null);
List list2 = HARegionQueue.createMessageListForTesting();
Iterator iterator = list1.iterator();
boolean doOnce = true;
@@ -1769,7 +1769,7 @@ public class HARegionQueueJUnitTest
long startTime = System.currentTimeMillis();
for (int k = 0; k < 3; k++) {
- DistributedTestCase.join(threads[k], 180 * 1000, null);
+ Threads.join(threads[k], 180 * 1000, null);
}
long totalTime = System.currentTimeMillis() - startTime;
@@ -1848,7 +1848,7 @@ public class HARegionQueueJUnitTest
long startTime = System.currentTimeMillis();
for (int k = 0; k < 3; k++) {
- DistributedTestCase.join(threads[k], 60 * 1000, null);
+ Threads.join(threads[k], 60 * 1000, null);
}
long totalTime = System.currentTimeMillis() - startTime;
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/76e324b5/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HASlowReceiverDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HASlowReceiverDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HASlowReceiverDUnitTest.java
index 2186cd1..15c16af 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HASlowReceiverDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HASlowReceiverDUnitTest.java
@@ -40,8 +40,11 @@ import com.gemstone.gemfire.internal.cache.tier.sockets.CacheServerTestUtil;
import com.gemstone.gemfire.test.dunit.Assert;
import com.gemstone.gemfire.test.dunit.DistributedTestCase;
import com.gemstone.gemfire.test.dunit.IgnoredException;
+import com.gemstone.gemfire.test.dunit.NetworkSupport;
import com.gemstone.gemfire.test.dunit.Host;
import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
public class HASlowReceiverDUnitTest extends DistributedTestCase {
protected static Cache cache = null;
@@ -241,20 +244,20 @@ public class HASlowReceiverDUnitTest extends DistributedTestCase {
+ ") to become " + redundantServers.intValue();
}
};
- DistributedTestCase.waitForCriterion(wc, 200 * 1000, 1000, true);
+ Wait.waitForCriterion(wc, 200 * 1000, 1000, true);
}
// Test slow client
public void testSlowClient() throws Exception {
setBridgeObeserverForAfterQueueDestroyMessage();
clientVM.invoke(HASlowReceiverDUnitTest.class, "createClientCache",
- new Object[] { getServerHostName(Host.getHost(0)), new Integer(PORT0),
+ new Object[] { NetworkSupport.getServerHostName(Host.getHost(0)), new Integer(PORT0),
new Integer(PORT1), new Integer(PORT2), new Integer(2) });
clientVM.invoke(HASlowReceiverDUnitTest.class, "registerInterest");
// add expected socket exception string
- final IgnoredException ex1 = IgnoredException.addExpectedException(SocketException.class
+ final IgnoredException ex1 = IgnoredException.addIgnoredException(SocketException.class
.getName());
- final IgnoredException ex2 = IgnoredException.addExpectedException(InterruptedException.class
+ final IgnoredException ex2 = IgnoredException.addIgnoredException(InterruptedException.class
.getName());
putEntries();
Thread.sleep(20000);// wait for put to block and allow server to remove
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/76e324b5/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/OperationsPropagationDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/OperationsPropagationDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/OperationsPropagationDUnitTest.java
index fd96840..1e13192 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/OperationsPropagationDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/OperationsPropagationDUnitTest.java
@@ -36,7 +36,10 @@ import com.gemstone.gemfire.internal.cache.CacheServerImpl;
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;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
/**
*
@@ -115,7 +118,7 @@ public class OperationsPropagationDUnitTest extends DistributedTestCase
PORT2 = ((Integer)server2.invoke(OperationsPropagationDUnitTest.class,
"createServerCache")).intValue();
client1.invoke(OperationsPropagationDUnitTest.class, "createClientCache",
- new Object[] { getServerHostName(host), new Integer(PORT2) });
+ new Object[] { NetworkSupport.getServerHostName(host), new Integer(PORT2) });
}
@@ -327,7 +330,7 @@ public class OperationsPropagationDUnitTest extends DistributedTestCase
return excuse;
}
};
- DistributedTestCase.waitForCriterion(wc, 60 * 1000, 1000, true);
+ Wait.waitForCriterion(wc, 60 * 1000, 1000, true);
/*
* if (!(region.get(UPDATE_KEY).equals(UPDATE_VALUE1))) { fail(" Expected
@@ -344,7 +347,7 @@ public class OperationsPropagationDUnitTest extends DistributedTestCase
return excuse;
}
};
- DistributedTestCase.waitForCriterion(wc, 60 * 1000, 1000, true);
+ Wait.waitForCriterion(wc, 60 * 1000, 1000, true);
/*
* if (!(region.get(INVALIDATE_KEY).equals(INVALIDATE_VALUE))) { fail("
@@ -361,7 +364,7 @@ public class OperationsPropagationDUnitTest extends DistributedTestCase
return excuse;
}
};
- DistributedTestCase.waitForCriterion(wc, 60 * 1000, 1000, true);
+ Wait.waitForCriterion(wc, 60 * 1000, 1000, true);
/*
* if (!(region.get(DESTROY_KEY).equals(DESTROY_VALUE))) { fail(" Expected
@@ -395,7 +398,7 @@ public class OperationsPropagationDUnitTest extends DistributedTestCase
return excuse;
}
};
- DistributedTestCase.waitForCriterion(wc, 60 * 1000, 1000, true);
+ Wait.waitForCriterion(wc, 60 * 1000, 1000, true);
/*if (!(region.get(CREATE_KEY).equals(CREATE_VALUE))) {
fail("CREATE operation did not propagate to client : Expected value to be "
@@ -411,7 +414,7 @@ public class OperationsPropagationDUnitTest extends DistributedTestCase
return excuse;
}
};
- DistributedTestCase.waitForCriterion(wc, 60 * 1000, 1000, true);
+ Wait.waitForCriterion(wc, 60 * 1000, 1000, true);
/*if (!(region.get(UPDATE_KEY).equals(UPDATE_VALUE2))) {
fail(" UPDATE operation did not propagate to Client : Expected value to be "
@@ -426,7 +429,7 @@ public class OperationsPropagationDUnitTest extends DistributedTestCase
return excuse;
}
};
- DistributedTestCase.waitForCriterion(wc, 60 * 1000, 1000, true);
+ Wait.waitForCriterion(wc, 60 * 1000, 1000, true);
/*if (region.containsKey(DESTROY_KEY)) {
@@ -443,7 +446,7 @@ public class OperationsPropagationDUnitTest extends DistributedTestCase
return excuse;
}
};
- DistributedTestCase.waitForCriterion(wc, 60 * 1000, 1000, true);
+ Wait.waitForCriterion(wc, 60 * 1000, 1000, true);
/*if (!(region.get(INVALIDATE_KEY) == null)) {
fail(" INVALIDATE operation did not propagate to Client : Expected value to be null but it is "
@@ -459,7 +462,7 @@ public class OperationsPropagationDUnitTest extends DistributedTestCase
return excuse;
}
};
- DistributedTestCase.waitForCriterion(wc, 60 * 1000, 1000, true);
+ Wait.waitForCriterion(wc, 60 * 1000, 1000, true);
/*
* if (!(region.get(PUTALL_KEY).equals(PUTALL_VALUE))) { fail("PUTALL
@@ -476,7 +479,7 @@ public class OperationsPropagationDUnitTest extends DistributedTestCase
return excuse;
}
};
- DistributedTestCase.waitForCriterion(wc, 60 * 1000, 1000, true);
+ Wait.waitForCriterion(wc, 60 * 1000, 1000, true);
}
catch (Exception e) {
Assert.fail(" Test failed due to " + e, e);
@@ -498,6 +501,6 @@ public class OperationsPropagationDUnitTest extends DistributedTestCase
return excuse;
}
};
- DistributedTestCase.waitForCriterion(wc, 60 * 1000, 1000, true);
+ Wait.waitForCriterion(wc, 60 * 1000, 1000, true);
}
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/76e324b5/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/PutAllDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/PutAllDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/PutAllDUnitTest.java
index ef82f7a..ab72a18 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/PutAllDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/PutAllDUnitTest.java
@@ -44,6 +44,8 @@ import com.gemstone.gemfire.internal.cache.EntryEventImpl;
import com.gemstone.gemfire.internal.cache.EventID;
import com.gemstone.gemfire.test.dunit.DistributedTestCase;
import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.LogWriterSupport;
+import com.gemstone.gemfire.test.dunit.NetworkSupport;
import com.gemstone.gemfire.test.dunit.VM;
/**
@@ -134,11 +136,11 @@ public class PutAllDUnitTest extends DistributedTestCase
PORT2 = ((Integer)server2.invoke(PutAllDUnitTest.class,
"createServerCache")).intValue();
client1.invoke(PutAllDUnitTest.class, "createClientCache1",
- new Object[] { getServerHostName(server1.getHost()), new Integer(PORT1) });
+ new Object[] { NetworkSupport.getServerHostName(server1.getHost()), new Integer(PORT1) });
client2.invoke(PutAllDUnitTest.class, "createClientCache2",
- new Object[] { getServerHostName(server1.getHost()), new Integer(PORT2) });
+ new Object[] { NetworkSupport.getServerHostName(server1.getHost()), new Integer(PORT2) });
try {
- createClientCache2(getServerHostName(server1.getHost()), new Integer(PORT2));
+ createClientCache2(NetworkSupport.getServerHostName(server1.getHost()), new Integer(PORT2));
}
catch (Exception e) {
fail(" test failed due to "+e);
@@ -548,7 +550,7 @@ public class PutAllDUnitTest extends DistributedTestCase
public void afterCreate(EntryEvent event)
{
- getLogWriter().fine(" entered after created with "+event.getKey());
+ LogWriterSupport.getLogWriter().fine(" entered after created with "+event.getKey());
boolean shouldNotify = false;
Object key = event.getKey();
if (key.equals(PUTALL_KEY1)) {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/76e324b5/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/StatsBugDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/StatsBugDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/StatsBugDUnitTest.java
index 788692f..9c2a67c 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/StatsBugDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/StatsBugDUnitTest.java
@@ -36,7 +36,10 @@ import com.gemstone.gemfire.distributed.DistributedSystem;
import com.gemstone.gemfire.internal.AvailablePort;
import com.gemstone.gemfire.test.dunit.DistributedTestCase;
import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.LogWriterSupport;
+import com.gemstone.gemfire.test.dunit.NetworkSupport;
import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
import com.gemstone.gemfire.test.junit.categories.DistributedTest;
/**
@@ -176,13 +179,13 @@ public class StatsBugDUnitTest extends DistributedTestCase
*/
public void testBug36109() throws Exception
{
- getLogWriter().info("testBug36109 : BEGIN");
+ LogWriterSupport.getLogWriter().info("testBug36109 : BEGIN");
client1.invoke(StatsBugDUnitTest.class, "createClientCacheForInvalidates", new Object[] {
- getServerHostName(Host.getHost(0)), new Integer(PORT1), new Integer(PORT2) });
+ NetworkSupport.getServerHostName(Host.getHost(0)), new Integer(PORT1), new Integer(PORT2) });
client1.invoke(StatsBugDUnitTest.class, "prepopulateClient");
primary.invoke(StatsBugDUnitTest.class, "doEntryOperations",
new Object[] { primaryPrefix });
- pause(3000);
+ Wait.pause(3000);
primary.invoke(StatsBugDUnitTest.class, "stopServer");
try {
Thread.sleep(5000);
@@ -201,7 +204,7 @@ public class StatsBugDUnitTest extends DistributedTestCase
}
client1.invoke(StatsBugDUnitTest.class, "verifyNumInvalidates");
- getLogWriter().info("testBug36109 : END");
+ LogWriterSupport.getLogWriter().info("testBug36109 : END");
}
/**
@@ -229,7 +232,7 @@ public class StatsBugDUnitTest extends DistributedTestCase
server.setNotifyBySubscription(false);
server.setSocketBufferSize(32768);
server.start();
- getLogWriter().info("Server started at PORT = " + port);
+ LogWriterSupport.getLogWriter().info("Server started at PORT = " + port);
return new Integer(port);
}
@@ -254,7 +257,7 @@ public class StatsBugDUnitTest extends DistributedTestCase
RegionAttributes attrs = factory.create();
Region region = cache.createRegion(REGION_NAME, attrs);
region.registerInterest("ALL_KEYS");
- getLogWriter().info("Client cache created");
+ LogWriterSupport.getLogWriter().info("Client cache created");
}
/**
@@ -278,7 +281,7 @@ public class StatsBugDUnitTest extends DistributedTestCase
RegionAttributes attrs = factory.create();
Region region = cache.createRegion(REGION_NAME, attrs);
region.registerInterest("ALL_KEYS", false, false);
- getLogWriter().info("Client cache created");
+ LogWriterSupport.getLogWriter().info("Client cache created");
}
/**
@@ -289,11 +292,11 @@ public class StatsBugDUnitTest extends DistributedTestCase
public static void verifyNumInvalidates()
{
long invalidatesRecordedByStats = pool.getInvalidateCount();
- getLogWriter().info(
+ LogWriterSupport.getLogWriter().info(
"invalidatesRecordedByStats = " + invalidatesRecordedByStats);
int expectedInvalidates = TOTAL_SERVERS * PUTS_PER_SERVER;
- getLogWriter().info("expectedInvalidates = " + expectedInvalidates);
+ LogWriterSupport.getLogWriter().info("expectedInvalidates = " + expectedInvalidates);
if (invalidatesRecordedByStats != expectedInvalidates) {
fail("Invalidates received by client(" + invalidatesRecordedByStats
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/76e324b5/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/locks/TXLockServiceDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/locks/TXLockServiceDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/locks/TXLockServiceDUnitTest.java
index 6d60816..473dc32 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/locks/TXLockServiceDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/locks/TXLockServiceDUnitTest.java
@@ -37,7 +37,10 @@ import com.gemstone.gemfire.distributed.internal.membership.InternalDistributedM
import com.gemstone.gemfire.internal.cache.TXRegionLockRequestImpl;
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.LogWriterSupport;
import com.gemstone.gemfire.test.dunit.SerializableRunnable;
+import com.gemstone.gemfire.test.dunit.Threads;
/**
* This class tests distributed ownership via the DistributedLockService api.
@@ -89,7 +92,7 @@ public class TXLockServiceDUnitTest extends DistributedTestCase {
// invokeInEveryVM(TXLockServiceDUnitTest.class,
// "remoteDumpAllDLockServices");
- invokeInEveryVM(TXLockServiceDUnitTest.class,
+ Invoke.invokeInEveryVM(TXLockServiceDUnitTest.class,
"destroyServices");
destroyServices();
@@ -123,7 +126,7 @@ public class TXLockServiceDUnitTest extends DistributedTestCase {
}
public void disable_testTXRecoverGrantorMessageProcessor() throws Exception {
- getLogWriter().info("[testTXOriginatorRecoveryProcessor]");
+ LogWriterSupport.getLogWriter().info("[testTXOriginatorRecoveryProcessor]");
TXLockService.createDTLS();
checkDLockRecoverGrantorMessageProcessor();
@@ -173,7 +176,7 @@ public class TXLockServiceDUnitTest extends DistributedTestCase {
dtls.release(txLockId);
// check results to verify no locks were provided in reply
- DistributedTestCase.join(thread, 30 * 1000, getLogWriter());
+ Threads.join(thread, 30 * 1000, LogWriterSupport.getLogWriter());
assertEquals("testTXRecoverGrantor_replyCode_PASS is false", true,
testTXRecoverGrantor_replyCode_PASS);
assertEquals("testTXRecoverGrantor_heldLocks_PASS is false", true,
@@ -182,7 +185,7 @@ public class TXLockServiceDUnitTest extends DistributedTestCase {
protected static volatile TXLockId testTXLock_TXLockId;
public void testTXLock() {
- getLogWriter().info("[testTXLock]");
+ LogWriterSupport.getLogWriter().info("[testTXLock]");
final int grantorVM = 0;
final int clientA = 1;
final int clientB = 2;
@@ -200,7 +203,7 @@ public class TXLockServiceDUnitTest extends DistributedTestCase {
));
// create grantor
- getLogWriter().info("[testTXLock] create grantor");
+ LogWriterSupport.getLogWriter().info("[testTXLock] create grantor");
Host.getHost(0).getVM(grantorVM).invoke(new SerializableRunnable() {
public void run() {
@@ -210,7 +213,7 @@ public class TXLockServiceDUnitTest extends DistributedTestCase {
sleep(20);
// create client and request txLock
- getLogWriter().info("[testTXLock] create clientA and request txLock");
+ LogWriterSupport.getLogWriter().info("[testTXLock] create clientA and request txLock");
Host.getHost(0).getVM(clientA).invoke(new SerializableRunnable() {
public void run() {
@@ -228,7 +231,7 @@ public class TXLockServiceDUnitTest extends DistributedTestCase {
});
// create nuther client and request overlapping txLock... verify fails
- getLogWriter().info("[testTXLock] create clientB and fail txLock");
+ LogWriterSupport.getLogWriter().info("[testTXLock] create clientB and fail txLock");
Host.getHost(0).getVM(clientB).invoke(new SerializableRunnable() {
public void run() {
@@ -258,7 +261,7 @@ public class TXLockServiceDUnitTest extends DistributedTestCase {
*/
// release txLock
- getLogWriter().info("[testTXLock] clientA releases txLock");
+ LogWriterSupport.getLogWriter().info("[testTXLock] clientA releases txLock");
Host.getHost(0).getVM(clientA).invoke(
new SerializableRunnable("[testTXLock] clientA releases txLock") {
@@ -270,7 +273,7 @@ public class TXLockServiceDUnitTest extends DistributedTestCase {
sleep(20);
// try nuther client again and verify success
- getLogWriter().info("[testTXLock] clientB requests txLock");
+ LogWriterSupport.getLogWriter().info("[testTXLock] clientB requests txLock");
Host.getHost(0).getVM(clientB).invoke(
new SerializableRunnable("[testTXLock] clientB requests txLock") {
@@ -282,7 +285,7 @@ public class TXLockServiceDUnitTest extends DistributedTestCase {
});
// release txLock
- getLogWriter().info("[testTXLock] clientB releases txLock");
+ LogWriterSupport.getLogWriter().info("[testTXLock] clientB releases txLock");
Host.getHost(0).getVM(clientB).invoke(
new SerializableRunnable("[testTXLock] clientB releases txLock") {
@@ -295,7 +298,7 @@ public class TXLockServiceDUnitTest extends DistributedTestCase {
protected static volatile TXLockId testTXOriginatorRecoveryProcessor_TXLockId;
public void testTXOriginatorRecoveryProcessor() {
- getLogWriter().info("[testTXOriginatorRecoveryProcessor]");
+ LogWriterSupport.getLogWriter().info("[testTXOriginatorRecoveryProcessor]");
final int originatorVM = 0;
final int grantorVM = 1;
final int particpantA = 2;
@@ -321,7 +324,7 @@ public class TXLockServiceDUnitTest extends DistributedTestCase {
}
// create grantor
- getLogWriter().info("[testTXOriginatorRecoveryProcessor] grantorVM becomes grantor");
+ LogWriterSupport.getLogWriter().info("[testTXOriginatorRecoveryProcessor] grantorVM becomes grantor");
Host.getHost(0).getVM(grantorVM).invoke(new SerializableRunnable() {
public void run() {
@@ -338,7 +341,7 @@ public class TXLockServiceDUnitTest extends DistributedTestCase {
Boolean.TRUE, isGrantor);
// have a originatorVM get a txLock with three participants including grantor
- getLogWriter().info("[testTXOriginatorRecoveryProcessor] originatorVM requests txLock");
+ LogWriterSupport.getLogWriter().info("[testTXOriginatorRecoveryProcessor] originatorVM requests txLock");
Host.getHost(0).getVM(originatorVM).invoke(new SerializableRunnable() {
public void run() {
@@ -422,14 +425,14 @@ public class TXLockServiceDUnitTest extends DistributedTestCase {
}
public void testDTLSIsDistributed() {
- getLogWriter().info("[testDTLSIsDistributed]");
+ LogWriterSupport.getLogWriter().info("[testDTLSIsDistributed]");
// have all vms lock and hold the same LTLS lock simultaneously
final Host host = Host.getHost(0);
int vmCount = host.getVMCount();
for (int vm = 0; vm < vmCount; vm++) {
final int finalvm = vm;
- getLogWriter().info("[testDTLSIsDistributed] testing vm " + finalvm);
+ LogWriterSupport.getLogWriter().info("[testDTLSIsDistributed] testing vm " + finalvm);
Host.getHost(0).getVM(finalvm).invoke(new SerializableRunnable() {
public void run() {
@@ -442,21 +445,21 @@ public class TXLockServiceDUnitTest extends DistributedTestCase {
TXLockServiceDUnitTest.class, "isDistributed_DTLS", new Object[] {});
assertEquals("isDistributed should be true for DTLS",
Boolean.TRUE, isDistributed);
- getLogWriter().info("[testDTLSIsDistributed] isDistributed=" + isDistributed);
+ LogWriterSupport.getLogWriter().info("[testDTLSIsDistributed] isDistributed=" + isDistributed);
// lock a key...
Boolean gotLock = (Boolean)host.getVM(finalvm).invoke(
TXLockServiceDUnitTest.class, "lock_DTLS", new Object[] {"KEY"});
assertEquals("gotLock is false after calling lock_DTLS",
Boolean.TRUE, gotLock);
- getLogWriter().info("[testDTLSIsDistributed] gotLock=" + gotLock);
+ LogWriterSupport.getLogWriter().info("[testDTLSIsDistributed] gotLock=" + gotLock);
// unlock it...
Boolean unlock = (Boolean)host.getVM(finalvm).invoke(
TXLockServiceDUnitTest.class, "unlock_DTLS", new Object[] {"KEY"});
assertEquals("unlock is false after calling unlock_DTLS",
Boolean.TRUE, unlock);
- getLogWriter().info("[testDTLSIsDistributed] unlock=" + unlock);
+ LogWriterSupport.getLogWriter().info("[testDTLSIsDistributed] unlock=" + unlock);
}
}
@@ -667,14 +670,14 @@ public class TXLockServiceDUnitTest extends DistributedTestCase {
Host host = Host.getHost(0);
int vmCount = host.getVMCount();
for (int i=0; i<vmCount; i++) {
- getLogWriter().info("Invoking " + methodName + "on VM#" + i);
+ LogWriterSupport.getLogWriter().info("Invoking " + methodName + "on VM#" + i);
host.getVM(i).invoke(this.getClass(), methodName, args);
}
}
public Properties getDistributedSystemProperties() {
Properties props = super.getDistributedSystemProperties();
- props.setProperty("log-level", getDUnitLogLevel());
+ props.setProperty("log-level", LogWriterSupport.getDUnitLogLevel());
return props;
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/76e324b5/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/Bug39356DUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/Bug39356DUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/Bug39356DUnitTest.java
index 13adb98..80f5df5 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/Bug39356DUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/Bug39356DUnitTest.java
@@ -44,6 +44,7 @@ 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;
/**
@@ -110,7 +111,7 @@ public class Bug39356DUnitTest extends CacheTestCase {
SerializableRunnable verifyBuckets = new SerializableRunnable("Verify buckets") {
public void run() {
- LogWriter log = getLogWriter();
+ LogWriter log = com.gemstone.gemfire.test.dunit.LogWriterSupport.getLogWriter();
Cache cache = getCache();
PartitionedRegion r = (PartitionedRegion) cache.getRegion(REGION_NAME);
for(int i = 0; i < r.getAttributes().getPartitionAttributes().getTotalNumBuckets(); i++) {
@@ -120,7 +121,7 @@ public class Bug39356DUnitTest extends CacheTestCase {
owners = r.getBucketOwnersForValidation(i);
} catch (ForceReattemptException e) {
log.info(Bug39356DUnitTest.class + " verify buckets Caught a ForceReattemptException");
- pause(1000);
+ Wait.pause(1000);
}
}
if(owners.isEmpty()) {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/76e324b5/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/Bug43684DUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/Bug43684DUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/Bug43684DUnitTest.java
index b1f0316..d6657e2 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/Bug43684DUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/Bug43684DUnitTest.java
@@ -36,6 +36,7 @@ import com.gemstone.gemfire.internal.cache.LocalRegion;
import com.gemstone.gemfire.internal.cache.RegionEntry;
import com.gemstone.gemfire.internal.i18n.LocalizedStrings;
import com.gemstone.gemfire.test.dunit.DistributedTestCase;
+import com.gemstone.gemfire.test.dunit.DistributedTestSupport;
import com.gemstone.gemfire.test.dunit.Host;
import com.gemstone.gemfire.test.dunit.IgnoredException;
import com.gemstone.gemfire.test.dunit.VM;
@@ -77,7 +78,7 @@ public class Bug43684DUnitTest extends DistributedTestCase {
server2 = host.getVM(1);
server3 = host.getVM(2);
client1 = host.getVM(3);
- IgnoredException.addExpectedException("Connection refused: connect");
+ IgnoredException.addIgnoredException("Connection refused: connect");
}
public void tearDown2() throws Exception {
@@ -236,7 +237,7 @@ public class Bug43684DUnitTest extends DistributedTestCase {
public static Integer createServerCache(Boolean isReplicated, Boolean isPrimaryEmpty) throws Exception {
DistributedTestCase.disconnectFromDS();
Properties props = new Properties();
- props.setProperty("locators", "localhost["+getDUnitLocatorPort()+"]");
+ props.setProperty("locators", "localhost["+DistributedTestSupport.getDUnitLocatorPort()+"]");
// props.setProperty("log-file", "server_" + OSProcess.getId() + ".log");
// props.setProperty("log-level", "fine");
props.setProperty("statistic-archive-file", "server_" + OSProcess.getId()
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/76e324b5/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/Bug47388DUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/Bug47388DUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/Bug47388DUnitTest.java
index 3512385..b372fb7 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/Bug47388DUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/Bug47388DUnitTest.java
@@ -44,6 +44,8 @@ import com.gemstone.gemfire.internal.cache.tier.sockets.CacheClientProxy;
import com.gemstone.gemfire.test.dunit.DistributedTestCase;
import com.gemstone.gemfire.test.dunit.Host;
import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
/**
* The test creates two datastores with a partitioned region, and also running a
@@ -244,7 +246,7 @@ public class Bug47388DUnitTest extends DistributedTestCase {
}
};
- DistributedTestCase.waitForCriterion(wc, 60 * 1000, 500, true);
+ Wait.waitForCriterion(wc, 60 * 1000, 500, true);
}
public static void waitForLastKeyDestroyed() throws Exception {
@@ -261,7 +263,7 @@ public class Bug47388DUnitTest extends DistributedTestCase {
};
- DistributedTestCase.waitForCriterion(wc, 60 * 1000, 500, true);
+ Wait.waitForCriterion(wc, 60 * 1000, 500, true);
}
public void bug51931_testQRMOfExpiredEventsProcessedSuccessfully() throws Exception {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/76e324b5/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/Bug51400DUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/Bug51400DUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/Bug51400DUnitTest.java
index 9234db4..057a2a3 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/Bug51400DUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/Bug51400DUnitTest.java
@@ -37,7 +37,9 @@ import com.gemstone.gemfire.internal.cache.tier.sockets.CacheClientProxy;
import com.gemstone.gemfire.internal.cache.tier.sockets.CacheClientProxyStats;
import com.gemstone.gemfire.test.dunit.AsyncInvocation;
import com.gemstone.gemfire.test.dunit.DistributedTestCase;
+import com.gemstone.gemfire.test.dunit.DistributedTestSupport;
import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.NetworkSupport;
import com.gemstone.gemfire.test.dunit.VM;
/**
@@ -92,7 +94,7 @@ public class Bug51400DUnitTest extends DistributedTestCase {
public static Integer createServerCache(Integer mcastPort,
Integer maxMessageCount) throws Exception {
Properties props = new Properties();
- props.setProperty("locators", "localhost["+getDUnitLocatorPort()+"]");
+ props.setProperty("locators", "localhost["+DistributedTestSupport.getDUnitLocatorPort()+"]");
// props.setProperty("log-file", "server_" + OSProcess.getId() + ".log");
// props.setProperty("log-level", "fine");
// props.setProperty("statistic-archive-file", "server_" + OSProcess.getId()
@@ -175,7 +177,7 @@ public class Bug51400DUnitTest extends DistributedTestCase {
"createServerCache", new Object[] { maxQSize });
client1.invoke(Bug51400DUnitTest.class, "createClientCache",
- new Object[] { getServerHostName(Host.getHost(0)), new Integer[]{port1}, ackInterval});
+ new Object[] { NetworkSupport.getServerHostName(Host.getHost(0)), new Integer[]{port1}, ackInterval});
// Do puts from server as well as from client on the same key.
AsyncInvocation ai1 = server0.invokeAsync(Bug51400DUnitTest.class,
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/76e324b5/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/PartitionedRegionMetaDataCleanupDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/PartitionedRegionMetaDataCleanupDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/PartitionedRegionMetaDataCleanupDUnitTest.java
index ff6c112..99b4ba2 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/PartitionedRegionMetaDataCleanupDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/PartitionedRegionMetaDataCleanupDUnitTest.java
@@ -27,6 +27,7 @@ import com.gemstone.gemfire.test.dunit.Host;
import com.gemstone.gemfire.test.dunit.RMIException;
import com.gemstone.gemfire.test.dunit.SerializableRunnable;
import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
/**
* @author dsmith
@@ -45,7 +46,7 @@ public class PartitionedRegionMetaDataCleanupDUnitTest extends CacheTestCase {
createPR(vm0, "region1", 5);
createPR(vm1, "region2", 10);
//This should fail
- IgnoredException ex = IgnoredException.addExpectedException( "IllegalStateException", vm1);
+ IgnoredException ex = IgnoredException.addIgnoredException( "IllegalStateException", vm1);
try {
createPR(vm1, "region1", 10);
fail("Should have received an exception");
@@ -65,7 +66,7 @@ public class PartitionedRegionMetaDataCleanupDUnitTest extends CacheTestCase {
createPR(vm0, "region1", 5);
createPR(vm1, "region2", 10);
//This should fail
- IgnoredException ex = IgnoredException.addExpectedException( "IllegalStateException", vm1);
+ IgnoredException ex = IgnoredException.addIgnoredException( "IllegalStateException", vm1);
try {
createPR(vm1, "region1", 10);
fail("Should have received an exception");
@@ -85,7 +86,7 @@ public class PartitionedRegionMetaDataCleanupDUnitTest extends CacheTestCase {
createPR(vm0, "region1", 5);
createPR(vm1, "region2", 10);
//This should fail
- IgnoredException ex = IgnoredException.addExpectedException("IllegalStateException", vm1);
+ IgnoredException ex = IgnoredException.addIgnoredException("IllegalStateException", vm1);
try {
createPR(vm1, "region1", 10);
fail("Should have received an exception");
@@ -95,7 +96,7 @@ public class PartitionedRegionMetaDataCleanupDUnitTest extends CacheTestCase {
ex.remove();
}
- ex = IgnoredException.addExpectedException("DistributedSystemDisconnectedException", vm0);
+ ex = IgnoredException.addIgnoredException("DistributedSystemDisconnectedException", vm0);
try {
fakeCrash(vm0);
} finally {
@@ -163,7 +164,7 @@ public class PartitionedRegionMetaDataCleanupDUnitTest extends CacheTestCase {
.setEntryTimeToLive(new ExpirationAttributes(expirationTime));
//We may log an exception if the create fails. Ignore thse.
- IgnoredException ex = IgnoredException.addExpectedException("IllegalStateException");
+ IgnoredException ex = IgnoredException.addIgnoredException("IllegalStateException");
try {
int i= 0;
//Loop until a successful create
@@ -180,7 +181,7 @@ public class PartitionedRegionMetaDataCleanupDUnitTest extends CacheTestCase {
}
//wait a bit before the next attempt.
- pause(500);
+ Wait.pause(500);
}
}
} finally {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/76e324b5/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/PersistPRKRFDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/PersistPRKRFDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/PersistPRKRFDUnitTest.java
index 2a7ea11..56ced6c 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/PersistPRKRFDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/PersistPRKRFDUnitTest.java
@@ -28,10 +28,12 @@ import com.gemstone.gemfire.cache30.CacheSerializableRunnable;
import com.gemstone.gemfire.internal.cache.DiskStoreImpl;
import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
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.LogWriterSupport;
+import com.gemstone.gemfire.test.dunit.Threads;
import com.gemstone.gemfire.test.dunit.Host;
import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
/**
* Tests the basic use cases for PR persistence.
@@ -74,7 +76,7 @@ public class PersistPRKRFDUnitTest extends PersistentPartitionedRegionTestBase {
AsyncInvocation async1 = vm0.invokeAsync(new CacheSerializableRunnable(title+"async create") {
public void run2() throws CacheException {
Region region = getRootRegion(PR_REGION_NAME);
- IgnoredException expect = IgnoredException.addExpectedException("CacheClosedException");
+ IgnoredException expect = IgnoredException.addIgnoredException("CacheClosedException");
try {
region.put(10, "b");
fail("Expect CacheClosedException here");
@@ -93,14 +95,14 @@ public class PersistPRKRFDUnitTest extends PersistentPartitionedRegionTestBase {
vm0.invoke(new CacheSerializableRunnable(title+"close disk store") {
public void run2() throws CacheException {
GemFireCacheImpl gfc = (GemFireCacheImpl)getCache();
- pause(500);
+ Wait.pause(500);
gfc.closeDiskStores();
synchronized(lockObject) {
lockObject.notify();
}
}
});
- DistributedTestCase.join(async1, MAX_WAIT, getLogWriter());
+ Threads.join(async1, MAX_WAIT, LogWriterSupport.getLogWriter());
closeCache(vm0);
// update
@@ -117,7 +119,7 @@ public class PersistPRKRFDUnitTest extends PersistentPartitionedRegionTestBase {
async1 = vm0.invokeAsync(new CacheSerializableRunnable(title+"async update") {
public void run2() throws CacheException {
Region region = getRootRegion(PR_REGION_NAME);
- IgnoredException expect = IgnoredException.addExpectedException("CacheClosedException");
+ IgnoredException expect = IgnoredException.addIgnoredException("CacheClosedException");
try {
region.put(1, "b");
fail("Expect CacheClosedException here");
@@ -136,14 +138,14 @@ public class PersistPRKRFDUnitTest extends PersistentPartitionedRegionTestBase {
vm0.invoke(new CacheSerializableRunnable(title+"close disk store") {
public void run2() throws CacheException {
GemFireCacheImpl gfc = (GemFireCacheImpl)getCache();
- pause(500);
+ Wait.pause(500);
gfc.closeDiskStores();
synchronized(lockObject) {
lockObject.notify();
}
}
});
- DistributedTestCase.join(async1, MAX_WAIT, getLogWriter());
+ Threads.join(async1, MAX_WAIT, LogWriterSupport.getLogWriter());
closeCache(vm0);
// destroy
@@ -160,7 +162,7 @@ public class PersistPRKRFDUnitTest extends PersistentPartitionedRegionTestBase {
async1 = vm0.invokeAsync(new CacheSerializableRunnable(title+"async destroy") {
public void run2() throws CacheException {
Region region = getRootRegion(PR_REGION_NAME);
- IgnoredException expect = IgnoredException.addExpectedException("CacheClosedException");
+ IgnoredException expect = IgnoredException.addIgnoredException("CacheClosedException");
try {
region.destroy(2, "b");
fail("Expect CacheClosedException here");
@@ -179,14 +181,14 @@ public class PersistPRKRFDUnitTest extends PersistentPartitionedRegionTestBase {
vm0.invoke(new CacheSerializableRunnable(title+"close disk store") {
public void run2() throws CacheException {
GemFireCacheImpl gfc = (GemFireCacheImpl)getCache();
- pause(500);
+ Wait.pause(500);
gfc.closeDiskStores();
synchronized(lockObject) {
lockObject.notify();
}
}
});
- DistributedTestCase.join(async1, MAX_WAIT, getLogWriter());
+ Threads.join(async1, MAX_WAIT, LogWriterSupport.getLogWriter());
checkData(vm0, 0, 10, "a");
checkData(vm0, 10, 11, null);