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:31 UTC
[21/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/cache30/CertifiableTestCacheListener.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/CertifiableTestCacheListener.java b/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/CertifiableTestCacheListener.java
index c1f53c7..65dd6a2 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/CertifiableTestCacheListener.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/CertifiableTestCacheListener.java
@@ -26,8 +26,8 @@ import java.util.*;
import com.gemstone.gemfire.LogWriter;
import com.gemstone.gemfire.cache.EntryEvent;
import com.gemstone.gemfire.internal.cache.xmlcache.Declarable2;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
public class CertifiableTestCacheListener extends TestCacheListener implements Declarable2 {
final public Set destroys = Collections.synchronizedSet(new HashSet());
@@ -100,7 +100,7 @@ public class CertifiableTestCacheListener extends TestCacheListener implements D
return "Waiting for key creation: " + key;
}
};
- DistributedTestCase.waitForCriterion(ev, MAX_TIME, 200, true);
+ Wait.waitForCriterion(ev, MAX_TIME, 200, true);
return true;
}
@@ -113,7 +113,7 @@ public class CertifiableTestCacheListener extends TestCacheListener implements D
return "Waiting for key destroy: " + key;
}
};
- DistributedTestCase.waitForCriterion(ev, MAX_TIME, 200, true);
+ Wait.waitForCriterion(ev, MAX_TIME, 200, true);
return true;
}
@@ -126,7 +126,7 @@ public class CertifiableTestCacheListener extends TestCacheListener implements D
return "Waiting for key invalidate: " + key;
}
};
- DistributedTestCase.waitForCriterion(ev, MAX_TIME, 200, true);
+ Wait.waitForCriterion(ev, MAX_TIME, 200, true);
return true;
}
@@ -139,7 +139,7 @@ public class CertifiableTestCacheListener extends TestCacheListener implements D
return "Waiting for key update: " + key;
}
};
- DistributedTestCase.waitForCriterion(ev, MAX_TIME, 200, true);
+ Wait.waitForCriterion(ev, MAX_TIME, 200, true);
return true;
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/ClearMultiVmCallBkDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/ClearMultiVmCallBkDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/ClearMultiVmCallBkDUnitTest.java
index 849768a..d73884a 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/ClearMultiVmCallBkDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/ClearMultiVmCallBkDUnitTest.java
@@ -71,7 +71,7 @@ public class ClearMultiVmCallBkDUnitTest extends DistributedTestCase{
getLogWriter().fine("Cache created in successfully");
}
- public void tearDown2(){
+ public void tearDownBeforeDisconnect(){
Host host = Host.getHost(0);
VM vm0 = host.getVM(0);
VM vm1 = host.getVM(1);
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/ClearMultiVmDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/ClearMultiVmDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/ClearMultiVmDUnitTest.java
index 5a87127..ebc17e0 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/ClearMultiVmDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/ClearMultiVmDUnitTest.java
@@ -36,10 +36,13 @@ import com.gemstone.gemfire.cache.RegionDestroyedException;
import com.gemstone.gemfire.cache.Scope;
import com.gemstone.gemfire.cache.UnsupportedOperationInTransactionException;
import com.gemstone.gemfire.distributed.DistributedSystem;
+import com.gemstone.gemfire.test.dunit.Assert;
import com.gemstone.gemfire.test.dunit.AsyncInvocation;
import com.gemstone.gemfire.test.dunit.DistributedTestCase;
import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.Invoke;
import com.gemstone.gemfire.test.dunit.SerializableRunnable;
+import com.gemstone.gemfire.test.dunit.Threads;
import com.gemstone.gemfire.test.dunit.VM;
/**
@@ -72,14 +75,14 @@ public class ClearMultiVmDUnitTest extends DistributedTestCase{
vm1.invoke(ClearMultiVmDUnitTest.class, "createCache");
}
- public void tearDown2(){
+ public void tearDownBeforeDisconnect(){
Host host = Host.getHost(0);
VM vm0 = host.getVM(0);
VM vm1 = host.getVM(1);
vm0.invoke(ClearMultiVmDUnitTest.class, "closeCache");
vm1.invoke(ClearMultiVmDUnitTest.class, "closeCache");
cache = null;
- invokeInEveryVM(new SerializableRunnable() { public void run() { cache = null; } });
+ Invoke.invokeInEveryVM(new SerializableRunnable() { public void run() { cache = null; } });
}
@@ -211,15 +214,15 @@ public class ClearMultiVmDUnitTest extends DistributedTestCase{
AsyncInvocation as1 = vm0.invokeAsync(ClearMultiVmDUnitTest.class, "firstVM");
AsyncInvocation as2 = vm1.invokeAsync(ClearMultiVmDUnitTest.class, "secondVM");
- DistributedTestCase.join(as1, 30 * 1000, getLogWriter());
- DistributedTestCase.join(as2, 30 * 1000, getLogWriter());
+ Threads.join(as1, 30 * 1000);
+ Threads.join(as2, 30 * 1000);
if(as1.exceptionOccurred()){
- fail("as1 failed", as1.getException());
+ Assert.fail("as1 failed", as1.getException());
}
if(as2.exceptionOccurred()){
- fail("as2 failed", as2.getException());
+ Assert.fail("as2 failed", as2.getException());
}
int j = vm0.invokeInt(ClearMultiVmDUnitTest.class, "sizeMethod");
@@ -327,9 +330,9 @@ public class ClearMultiVmDUnitTest extends DistributedTestCase{
}
});
- 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());
}
SerializableRunnable validate = new
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/ClientMembershipDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/ClientMembershipDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/ClientMembershipDUnitTest.java
index 5589453..2fd3478 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/ClientMembershipDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/ClientMembershipDUnitTest.java
@@ -53,11 +53,14 @@ import com.gemstone.gemfire.internal.logging.InternalLogWriter;
import com.gemstone.gemfire.management.membership.ClientMembership;
import com.gemstone.gemfire.management.membership.ClientMembershipEvent;
import com.gemstone.gemfire.management.membership.ClientMembershipListener;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
+import com.gemstone.gemfire.test.dunit.Assert;
import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.IgnoredException;
+import com.gemstone.gemfire.test.dunit.NetworkSupport;
import com.gemstone.gemfire.test.dunit.SerializableRunnable;
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;
/**
* Tests the ClientMembership API including ClientMembershipListener.
@@ -83,8 +86,8 @@ public class ClientMembershipDUnitTest extends ClientServerTestCase {
getSystem();
}
- public void tearDown2() throws Exception {
- super.tearDown2();
+ public void tearDownBeforeDisconnect() throws Exception {
+ super.tearDownBeforeDisconnect();
InternalClientMembership.unregisterAllListeners();
}
@@ -104,7 +107,7 @@ public class ClientMembershipDUnitTest extends ClientServerTestCase {
return excuse;
}
};
- DistributedTestCase.waitForCriterion(ev, 60 * 1000, 200, true);
+ Wait.waitForCriterion(ev, 60 * 1000, 200, true);
}
protected int getAcceptsInProgress() {
@@ -119,9 +122,9 @@ public class ClientMembershipDUnitTest extends ClientServerTestCase {
never arrives.
*/
public void testConnectionTimeout() throws Exception {
- addExpectedException("failed accepting client connection");
+ IgnoredException.addIgnoredException("failed accepting client connection");
final Host host = Host.getHost(0);
- final String hostName = getServerHostName(host);
+ final String hostName = NetworkSupport.getServerHostName(host);
final VM vm0 = host.getVM(0);
System.setProperty(AcceptorImpl.ACCEPT_TIMEOUT_PROPERTY_NAME, "1000");
try {
@@ -727,7 +730,7 @@ public class ClientMembershipDUnitTest extends ClientServerTestCase {
* crashes or departs gracefully, the client will detect this as a crash.
*/
public void testClientMembershipEventsInClient() throws Exception {
- addExpectedException("IOException");
+ IgnoredException.addIgnoredException("IOException");
final boolean[] fired = new boolean[3];
final DistributedMember[] member = new DistributedMember[3];
final String[] memberId = new String[3];
@@ -845,12 +848,12 @@ public class ClientMembershipDUnitTest extends ClientServerTestCase {
getCache();
AttributesFactory factory = new AttributesFactory();
factory.setScope(Scope.LOCAL);
- ClientServerTestCase.configureConnectionPool(factory, getServerHostName(Host.getHost(0)), ports, true, -1, -1, null);
+ ClientServerTestCase.configureConnectionPool(factory, NetworkSupport.getServerHostName(Host.getHost(0)), ports, true, -1, -1, null);
createRegion(name, factory.create());
assertNotNull(getRootRegion().getSubregion(name));
}
catch (CacheException ex) {
- fail("While creating Region on Edge", ex);
+ Assert.fail("While creating Region on Edge", ex);
}
synchronized(listener) {
if (!fired[JOINED] && !fired[CRASHED]) {
@@ -1060,7 +1063,7 @@ public class ClientMembershipDUnitTest extends ClientServerTestCase {
getSystem(config);
AttributesFactory factory = new AttributesFactory();
factory.setScope(Scope.LOCAL);
- ClientServerTestCase.configureConnectionPool(factory, getServerHostName(host), ports, true, -1, 2, null);
+ ClientServerTestCase.configureConnectionPool(factory, NetworkSupport.getServerHostName(host), ports, true, -1, 2, null);
createRegion(name, factory.create());
assertNotNull(getRootRegion().getSubregion(name));
}
@@ -1210,7 +1213,7 @@ public class ClientMembershipDUnitTest extends ClientServerTestCase {
* timeout.
*/
private void pauseForClientToJoin() {
- pause(2000);
+ Wait.pause(2000);
}
/**
@@ -1301,7 +1304,7 @@ public class ClientMembershipDUnitTest extends ClientServerTestCase {
final String name = this.getUniqueName();
final int[] ports = new int[1];
- addExpectedException("ConnectException");
+ IgnoredException.addIgnoredException("ConnectException");
// create BridgeServer in controller vm...
getLogWriter().info("[testGetConnectedClients] Create BridgeServer");
@@ -1333,7 +1336,7 @@ public class ClientMembershipDUnitTest extends ClientServerTestCase {
getSystem(config);
AttributesFactory factory = new AttributesFactory();
factory.setScope(Scope.LOCAL);
- Pool p = ClientServerTestCase.configureConnectionPool(factory, getServerHostName(host), ports, true, -1, -1, null);
+ Pool p = ClientServerTestCase.configureConnectionPool(factory, NetworkSupport.getServerHostName(host), ports, true, -1, -1, null);
createRegion(name, factory.create());
assertNotNull(getRootRegion().getSubregion(name));
assertTrue(p.getServers().size() > 0);
@@ -1369,7 +1372,7 @@ public class ClientMembershipDUnitTest extends ClientServerTestCase {
return true;
}
};
- waitForCriterion(wc, 30000, 100, false);
+ Wait.waitForCriterion(wc, 30000, 100, false);
}
Map connectedClients = InternalClientMembership.getConnectedClients(false);
@@ -1443,9 +1446,9 @@ public class ClientMembershipDUnitTest extends ClientServerTestCase {
for (int i = 0; i < ports.length; i++) {
getLogWriter().info("[testGetConnectedServers] creating connectionpool for " +
- getServerHostName(host) + " " + ports[i]);
+ NetworkSupport.getServerHostName(host) + " " + ports[i]);
int[] thisServerPorts = new int[] { ports[i] };
- ClientServerTestCase.configureConnectionPoolWithName(factory, getServerHostName(host), thisServerPorts, false, -1, -1, null,"pooly"+i);
+ ClientServerTestCase.configureConnectionPoolWithName(factory, NetworkSupport.getServerHostName(host), thisServerPorts, false, -1, -1, null,"pooly"+i);
Region region = createRegion(name+"_"+i, factory.create());
assertNotNull(getRootRegion().getSubregion(name+"_"+i));
region.get("KEY-1");
@@ -1471,7 +1474,7 @@ public class ClientMembershipDUnitTest extends ClientServerTestCase {
return true;
}
};
- waitForCriterion(wc, 60000, 100, false);
+ Wait.waitForCriterion(wc, 60000, 100, false);
}
{
@@ -1549,7 +1552,7 @@ public class ClientMembershipDUnitTest extends ClientServerTestCase {
factory.setScope(Scope.LOCAL);
getLogWriter().info("[testGetNotifiedClients] creating connection pool");
- ClientServerTestCase.configureConnectionPool(factory, getServerHostName(host), ports, true, -1, -1, null);
+ ClientServerTestCase.configureConnectionPool(factory, NetworkSupport.getServerHostName(host), ports, true, -1, -1, null);
Region region = createRegion(name, factory.create());
assertNotNull(getRootRegion().getSubregion(name));
region.registerInterest("KEY-1");
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/ClientRegisterInterestDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/ClientRegisterInterestDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/ClientRegisterInterestDUnitTest.java
index 958b863..588f3bd 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/ClientRegisterInterestDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/ClientRegisterInterestDUnitTest.java
@@ -25,9 +25,11 @@ import com.gemstone.gemfire.cache.Region;
import com.gemstone.gemfire.cache.Scope;
import com.gemstone.gemfire.cache.client.internal.PoolImpl;
import com.gemstone.gemfire.distributed.internal.DistributionConfig;
-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 com.gemstone.gemfire.cache.client.SubscriptionNotEnabledException;
/**
@@ -42,8 +44,8 @@ public class ClientRegisterInterestDUnitTest extends ClientServerTestCase {
super(name);
}
- public void tearDown2() throws Exception {
- super.tearDown2();
+ public void tearDownBeforeDisconnect() throws Exception {
+ super.tearDownBeforeDisconnect();
disconnectAllFromDS(); // cleans up bridge server and client and lonerDS
}
@@ -99,7 +101,7 @@ public class ClientRegisterInterestDUnitTest extends ClientServerTestCase {
getLogWriter().info("[testBug35381] creating connection pool");
boolean establishCallbackConnection = false; // SOURCE OF BUG 35381
- ClientServerTestCase.configureConnectionPool(factory, getServerHostName(host), ports, establishCallbackConnection, -1, -1, null);
+ ClientServerTestCase.configureConnectionPool(factory, NetworkSupport.getServerHostName(host), ports, establishCallbackConnection, -1, -1, null);
Region region = createRegion(name, factory.create());
assertNotNull(getRootRegion().getSubregion(name));
try {
@@ -233,7 +235,7 @@ public class ClientRegisterInterestDUnitTest extends ClientServerTestCase {
getLogWriter().info("[testRegisterInterestFailover] creating connection pool");
boolean establishCallbackConnection = true;
- final PoolImpl p = (PoolImpl)ClientServerTestCase.configureConnectionPool(factory, getServerHostName(host), ports, establishCallbackConnection, -1, -1, null);
+ final PoolImpl p = (PoolImpl)ClientServerTestCase.configureConnectionPool(factory, NetworkSupport.getServerHostName(host), ports, establishCallbackConnection, -1, -1, null);
final Region region1 = createRootRegion(regionName1, factory.create());
final Region region2 = createRootRegion(regionName2, factory.create());
@@ -264,7 +266,7 @@ public class ClientRegisterInterestDUnitTest extends ClientServerTestCase {
return "primary port remained invalid";
}
};
- DistributedTestCase.waitForCriterion(ev, 10 * 1000, 200, true);
+ Wait.waitForCriterion(ev, 10 * 1000, 200, true);
assertEquals(ports[firstServerIdx], p.getPrimaryPort());
// assert intial values
@@ -296,7 +298,7 @@ public class ClientRegisterInterestDUnitTest extends ClientServerTestCase {
return null;
}
};
- DistributedTestCase.waitForCriterion(ev, 10 * 1000, 200, true);
+ Wait.waitForCriterion(ev, 10 * 1000, 200, true);
assertEquals("VAL-1-1", region1.get(key1));
assertEquals("VAL-1-1", region2.get(key2));
assertEquals("VAL-1-1", region3.get(key3));
@@ -329,7 +331,7 @@ public class ClientRegisterInterestDUnitTest extends ClientServerTestCase {
return "primary port never became " + ports[secondServerIdx];
}
};
- DistributedTestCase.waitForCriterion(ev, 100 * 1000, 200, true);
+ Wait.waitForCriterion(ev, 100 * 1000, 200, true);
try {
assertEquals(null, region2.get(key2));
@@ -377,7 +379,7 @@ public class ClientRegisterInterestDUnitTest extends ClientServerTestCase {
return null;
}
};
- DistributedTestCase.waitForCriterion(ev, 100 * 1000, 200, true);
+ Wait.waitForCriterion(ev, 100 * 1000, 200, true);
assertEquals("VAL-2-2", region1.get(key1));
assertEquals("VAL-0", region2.get(key2));
assertEquals("VAL-2-2", region3.get(key3));
@@ -413,7 +415,7 @@ public class ClientRegisterInterestDUnitTest extends ClientServerTestCase {
return null;
}
};
- DistributedTestCase.waitForCriterion(ev, 100 * 1000, 200, true);
+ Wait.waitForCriterion(ev, 100 * 1000, 200, true);
assertEquals("VAL-2-3", region1.get(key1));
assertEquals("VAL-2-2", region2.get(key2));
assertEquals("VAL-2-3", region3.get(key3));
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/ClientServerCCEDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/ClientServerCCEDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/ClientServerCCEDUnitTest.java
index 181fea7..3cef35c 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/ClientServerCCEDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/ClientServerCCEDUnitTest.java
@@ -44,10 +44,15 @@ import com.gemstone.gemfire.internal.cache.TombstoneService;
import com.gemstone.gemfire.internal.cache.ha.HARegionQueue;
import com.gemstone.gemfire.internal.cache.tier.sockets.CacheClientNotifier;
import com.gemstone.gemfire.internal.cache.tier.sockets.CacheClientProxy;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.DUnitEnv;
import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.NetworkSupport;
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;
/**
* concurrency-control tests for client/server
@@ -63,7 +68,7 @@ public class ClientServerCCEDUnitTest extends CacheTestCase {
HARegionQueue.setMessageSyncInterval(5);
}
- public void tearDown2() {
+ public void tearDownBeforeDisconnect() {
disconnectAllFromDS();
HARegionQueue.setMessageSyncInterval(HARegionQueue.DEFAULT_MESSAGE_SYNC_INTERVAL);
}
@@ -383,7 +388,7 @@ public class ClientServerCCEDUnitTest extends CacheTestCase {
//other bucket might be in vm1
forceGC(vm1);
}
- pause(5000); // better chance that WaitCriteria will succeed 1st time if we pause a bit
+ Wait.pause(5000); // better chance that WaitCriteria will succeed 1st time if we pause a bit
checkClientReceivedGC(vm2);
checkClientReceivedGC(vm3);
checkServerQueuesEmpty(vm0);
@@ -440,7 +445,7 @@ public class ClientServerCCEDUnitTest extends CacheTestCase {
assertTrue("expected key object_"+i+" to be in the cache but it isn't", TestRegion.containsKey("object_"+i));
}
} catch (NullPointerException e) {
- fail("caught NPE", e);
+ Assert.fail("caught NPE", e);
}
}
});
@@ -486,7 +491,7 @@ public class ClientServerCCEDUnitTest extends CacheTestCase {
return "waiting for garbage collection to occur";
}
};
- waitForCriterion(wc, 60000, 2000, true);
+ Wait.waitForCriterion(wc, 60000, 2000, true);
return null;
}
});
@@ -532,7 +537,7 @@ public class ClientServerCCEDUnitTest extends CacheTestCase {
return "waiting for queue removal messages to clear client queues";
}
};
- waitForCriterion(wc, 60000, 2000, true);
+ Wait.waitForCriterion(wc, 60000, 2000, true);
return null;
}
});
@@ -584,9 +589,9 @@ public class ClientServerCCEDUnitTest extends CacheTestCase {
SerializableCallable createRegion = new SerializableCallable() {
public Object call() throws Exception {
ClientCacheFactory cf = new ClientCacheFactory();
- cf.addPoolServer(getServerHostName(vm.getHost()), port);
+ cf.addPoolServer(NetworkSupport.getServerHostName(vm.getHost()), port);
cf.setPoolSubscriptionEnabled(true);
- cf.set("log-level", getDUnitLogLevel());
+ cf.set("log-level", DUnitEnv.getDUnitLogLevel());
ClientCache cache = getClientCache(cf);
ClientRegionFactory crf = cache.createClientRegionFactory(ClientRegionShortcut.CACHING_PROXY);
crf.setConcurrencyChecksEnabled(ccEnabled);
@@ -605,14 +610,14 @@ public class ClientServerCCEDUnitTest extends CacheTestCase {
SerializableCallable createRegion = new SerializableCallable() {
public Object call() throws Exception {
ClientCacheFactory cf = new ClientCacheFactory();
- cf.addPoolServer(getServerHostName(vm.getHost()), port1);
- cf.addPoolServer(getServerHostName(vm.getHost()), port2);
+ cf.addPoolServer(NetworkSupport.getServerHostName(vm.getHost()), port1);
+ cf.addPoolServer(NetworkSupport.getServerHostName(vm.getHost()), port2);
cf.setPoolSubscriptionEnabled(true);
cf.setPoolSubscriptionRedundancy(1);
// bug #50683 - secondary durable queue retains all GC messages
cf.set("durable-client-id", ""+vm.getPid());
cf.set("durable-client-timeout", "" + 200);
- cf.set("log-level", getDUnitLogLevel());
+ cf.set("log-level", DUnitEnv.getDUnitLogLevel());
ClientCache cache = getClientCache(cf);
ClientRegionFactory crf = cache.createClientRegionFactory(ClientRegionShortcut.CACHING_PROXY);
crf.setConcurrencyChecksEnabled(ccEnabled);
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/ClientServerTestCase.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/ClientServerTestCase.java b/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/ClientServerTestCase.java
index 6a3c5e0..2f71e84 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/ClientServerTestCase.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/ClientServerTestCase.java
@@ -35,7 +35,10 @@ import com.gemstone.gemfire.distributed.DistributedMember;
import com.gemstone.gemfire.distributed.DistributedSystem;
import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem;
import com.gemstone.gemfire.internal.AvailablePortHelper;
+import com.gemstone.gemfire.test.dunit.DUnitEnv;
import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
/**
* Provides helper methods for testing clients and servers. This
@@ -59,7 +62,7 @@ public class ClientServerTestCase extends CacheTestCase {
}
@Override
- public void tearDown2() throws Exception {
+ public void tearDownBeforeDisconnect() throws Exception {
// this makes sure we don't leave anything for the next tests
disconnectAllFromDS();
}
@@ -201,7 +204,7 @@ public class ClientServerTestCase extends CacheTestCase {
boolean threadLocalCnxs, int lifetimeTimeout, int statisticInterval) {
if(AUTO_LOAD_BALANCE) {
- pf.addLocator(host,getDUnitLocatorPort());
+ pf.addLocator(host,DUnitEnv.getDUnitLocatorPort());
} else {
for(int z=0;z<ports.length;z++) {
pf.addServer(host,ports[z]);
@@ -299,7 +302,7 @@ public class ClientServerTestCase extends CacheTestCase {
int waitMillis = 10000;
int interval = 100;
boolean throwException = true;
- waitForCriterion(w, waitMillis, interval, throwException);
+ Wait.waitForCriterion(w, waitMillis, interval, throwException);
return system.getMemberId();
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/ConcurrentLeaveDuringGIIDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/ConcurrentLeaveDuringGIIDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/ConcurrentLeaveDuringGIIDUnitTest.java
index 9ec99a2..613ee10 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/ConcurrentLeaveDuringGIIDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/ConcurrentLeaveDuringGIIDUnitTest.java
@@ -29,6 +29,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;
import com.gemstone.gemfire.internal.cache.LocalRegion;
import com.gemstone.gemfire.internal.cache.RegionMap;
@@ -101,7 +103,7 @@ public class ConcurrentLeaveDuringGIIDUnitTest extends CacheTestCase {
return "waiting for GII test hook to be invoked";
}
};
- waitForCriterion(wc, 20000, 500, true);
+ Wait.waitForCriterion(wc, 20000, 500, true);
return getCache().getDistributedSystem().getDistributedMember();
}
};
@@ -128,7 +130,7 @@ public class ConcurrentLeaveDuringGIIDUnitTest extends CacheTestCase {
return "waiting for region " + regionName + " to contain keyFromX";
}
};
- waitForCriterion(wc, 20000, 1000, true);
+ Wait.waitForCriterion(wc, 20000, 1000, true);
}
});
@@ -150,7 +152,7 @@ public class ConcurrentLeaveDuringGIIDUnitTest extends CacheTestCase {
return "waiting for region " + regionName + " to initialize";
}
};
- waitForCriterion(wc, 20000, 1000, true);
+ Wait.waitForCriterion(wc, 20000, 1000, true);
// ensure that the RVV has recorded the event
DistributedRegion r = (DistributedRegion)getCache().getRegion(regionName);
if (!r.getVersionVector().contains(Xid, 1)) {
@@ -177,7 +179,7 @@ public class ConcurrentLeaveDuringGIIDUnitTest extends CacheTestCase {
}
};
// if the test fails here then a sync from B to A was not performed
- waitForCriterion(wc, 20000, 500, true);
+ Wait.waitForCriterion(wc, 20000, 500, true);
// if the test fails here something is odd because the sync was done
// but the RVV doesn't know about it
assertTrue(((LocalRegion)r).getVersionVector().contains(Xid, 1));
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/DiskRegionDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/DiskRegionDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/DiskRegionDUnitTest.java
index 6247ee1..7ea2b2f 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/DiskRegionDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/DiskRegionDUnitTest.java
@@ -47,11 +47,12 @@ import com.gemstone.gemfire.internal.cache.DiskRegionStats;
import com.gemstone.gemfire.internal.cache.LocalRegion;
import com.gemstone.gemfire.internal.cache.lru.LRUCapacityController;
import com.gemstone.gemfire.internal.cache.lru.LRUStatistics;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
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 the functionality of cache regions whose contents may be
@@ -249,7 +250,7 @@ public class DiskRegionDUnitTest extends CacheTestCase {
return "waiting for evictions to exceed 6";
}
};
- DistributedTestCase.waitForCriterion(ev, 5 * 1000, 200, true);
+ Wait.waitForCriterion(ev, 5 * 1000, 200, true);
//DiskRegionStats diskStats = dr.getStats();
//assertTrue(diskStats.getWrites() > 6);
}
@@ -997,7 +998,7 @@ public class DiskRegionDUnitTest extends CacheTestCase {
return "value for key remains: " + key;
}
};
- DistributedTestCase.waitForCriterion(ev, 500, 200, true);
+ Wait.waitForCriterion(ev, 500, 200, true);
}
});
@@ -1021,7 +1022,7 @@ public class DiskRegionDUnitTest extends CacheTestCase {
return "verify update";
}
};
- DistributedTestCase.waitForCriterion(ev, 500, 200, true);
+ Wait.waitForCriterion(ev, 500, 200, true);
}
});
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/DistAckMapMethodsDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/DistAckMapMethodsDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/DistAckMapMethodsDUnitTest.java
index 216cdb8..034ba62 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/DistAckMapMethodsDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/DistAckMapMethodsDUnitTest.java
@@ -43,6 +43,7 @@ import com.gemstone.gemfire.cache.util.CacheWriterAdapter;
import com.gemstone.gemfire.distributed.DistributedSystem;
import com.gemstone.gemfire.test.dunit.DistributedTestCase;
import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.Invoke;
import com.gemstone.gemfire.test.dunit.SerializableRunnable;
import com.gemstone.gemfire.test.dunit.VM;
@@ -78,14 +79,14 @@ public class DistAckMapMethodsDUnitTest extends DistributedTestCase{
vm1.invoke(DistAckMapMethodsDUnitTest.class, "createCache");
}
- public void tearDown2(){
+ public void tearDownBeforeDisconnect(){
Host host = Host.getHost(0);
VM vm0 = host.getVM(0);
VM vm1 = host.getVM(1);
vm0.invoke(DistAckMapMethodsDUnitTest.class, "closeCache");
vm1.invoke(DistAckMapMethodsDUnitTest.class, "closeCache");
cache = null;
- invokeInEveryVM(new SerializableRunnable() { public void run() { cache = null; } });
+ Invoke.invokeInEveryVM(new SerializableRunnable() { public void run() { cache = null; } });
}
public static void createCache(){
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckOverflowRegionCCEOffHeapDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckOverflowRegionCCEOffHeapDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckOverflowRegionCCEOffHeapDUnitTest.java
index 5971d5c..d16e650 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckOverflowRegionCCEOffHeapDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckOverflowRegionCCEOffHeapDUnitTest.java
@@ -22,6 +22,7 @@ import com.gemstone.gemfire.cache.AttributesFactory;
import com.gemstone.gemfire.cache.RegionAttributes;
import com.gemstone.gemfire.distributed.internal.DistributionConfig;
import com.gemstone.gemfire.internal.cache.OffHeapTestUtil;
+import com.gemstone.gemfire.test.dunit.Invoke;
import com.gemstone.gemfire.test.dunit.SerializableRunnable;
/**
@@ -38,7 +39,7 @@ public class DistributedAckOverflowRegionCCEOffHeapDUnitTest extends Distributed
}
@Override
- public void tearDown2() throws Exception {
+ public void tearDownBeforeDisconnect() throws Exception {
SerializableRunnable checkOrphans = new SerializableRunnable() {
@Override
@@ -49,8 +50,8 @@ public class DistributedAckOverflowRegionCCEOffHeapDUnitTest extends Distributed
}
};
checkOrphans.run();
- invokeInEveryVM(checkOrphans);
- super.tearDown2();
+ Invoke.invokeInEveryVM(checkOrphans);
+ super.tearDownBeforeDisconnect();
}
@Override
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckPersistentRegionCCEDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckPersistentRegionCCEDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckPersistentRegionCCEDUnitTest.java
index aec7c8b..aaae52b 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckPersistentRegionCCEDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckPersistentRegionCCEDUnitTest.java
@@ -41,7 +41,6 @@ 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.DistributedTestCase.WaitCriterion;
import java.io.IOException;
import java.util.Map;
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckPersistentRegionCCEOffHeapDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckPersistentRegionCCEOffHeapDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckPersistentRegionCCEOffHeapDUnitTest.java
index 24c386a..34ec5dc 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckPersistentRegionCCEOffHeapDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckPersistentRegionCCEOffHeapDUnitTest.java
@@ -22,6 +22,7 @@ import com.gemstone.gemfire.cache.AttributesFactory;
import com.gemstone.gemfire.cache.RegionAttributes;
import com.gemstone.gemfire.distributed.internal.DistributionConfig;
import com.gemstone.gemfire.internal.cache.OffHeapTestUtil;
+import com.gemstone.gemfire.test.dunit.Invoke;
import com.gemstone.gemfire.test.dunit.SerializableRunnable;
/**
@@ -38,7 +39,7 @@ public class DistributedAckPersistentRegionCCEOffHeapDUnitTest extends Distribut
}
@Override
- public void tearDown2() throws Exception {
+ public void tearDownBeforeDisconnect() throws Exception {
SerializableRunnable checkOrphans = new SerializableRunnable() {
@Override
@@ -48,11 +49,11 @@ public class DistributedAckPersistentRegionCCEOffHeapDUnitTest extends Distribut
}
}
};
- invokeInEveryVM(checkOrphans);
+ Invoke.invokeInEveryVM(checkOrphans);
try {
checkOrphans.run();
} finally {
- super.tearDown2();
+ super.tearDownBeforeDisconnect();
}
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckRegionCCEDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckRegionCCEDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckRegionCCEDUnitTest.java
index 0ba2e27..a29a569 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckRegionCCEDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckRegionCCEDUnitTest.java
@@ -66,7 +66,9 @@ import com.gemstone.gemfire.test.dunit.DistributedTestCase;
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.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
/**
* @author Bruce Schuchardt
@@ -252,7 +254,7 @@ public class DistributedAckRegionCCEDUnitTest extends DistributedAckRegionDUnitT
"fake_id", "fake_id_ustring", DistributionManager.NORMAL_DM_TYPE, null, null);
tag.setMemberID(mbr);
} catch (UnknownHostException e) {
- fail("could not create member id", e);
+ com.gemstone.gemfire.test.dunit.Assert.fail("could not create member id", e);
}
// generate an event to distribute that contains the fake version tag
@@ -269,7 +271,7 @@ public class DistributedAckRegionCCEDUnitTest extends DistributedAckRegionDUnitT
try {
partialCreate.getResult();
} catch (Throwable e) {
- fail("async invocation in vm2 failed", e);
+ com.gemstone.gemfire.test.dunit.Assert.fail("async invocation in vm2 failed", e);
}
}
@@ -322,7 +324,7 @@ public class DistributedAckRegionCCEDUnitTest extends DistributedAckRegionDUnitT
CCRegion.put("cckey0", "ccvalue");
CCRegion.put("cckey0", "ccvalue"); // version number will end up at 4
} catch (CacheException ex) {
- fail("While creating region", ex);
+ com.gemstone.gemfire.test.dunit.Assert.fail("While creating region", ex);
}
}
};
@@ -342,7 +344,7 @@ public class DistributedAckRegionCCEDUnitTest extends DistributedAckRegionDUnitT
try {
entry.makeTombstone(CCRegion, tag);
} catch (RegionClearedException e) {
- fail("region was mysteriously cleared during unit testing", e);
+ com.gemstone.gemfire.test.dunit.Assert.fail("region was mysteriously cleared during unit testing", e);
}
}
});
@@ -401,12 +403,12 @@ public class DistributedAckRegionCCEDUnitTest extends DistributedAckRegionDUnitT
return "waiting for GC to occur";
}
};
- waitForCriterion(waitForGC, 20000, 1000, true);
- pause(5000);
+ Wait.waitForCriterion(waitForGC, 20000, 1000, true);
+ Wait.pause(5000);
long gcCount = CCRegion.getCachePerfStats().getTombstoneGCCount();
assertTrue("expected a few GCs, but not " + (gcCount - initialCount), gcCount < (initialCount + 20));
} catch (CacheException ex) {
- fail("While creating region", ex);
+ com.gemstone.gemfire.test.dunit.Assert.fail("While creating region", ex);
} finally {
TombstoneService.EXPIRED_TOMBSTONE_LIMIT = saveExpiredTombstoneLimit;
TombstoneService.FORCE_GC_MEMORY_EVENTS = false;
@@ -460,7 +462,7 @@ public class DistributedAckRegionCCEDUnitTest extends DistributedAckRegionDUnitT
}
assertEquals("expected no conflated events", 0, CCRegion.getCachePerfStats().getConflatedEventsCount());
} catch (CacheException ex) {
- fail("While creating region", ex);
+ com.gemstone.gemfire.test.dunit.Assert.fail("While creating region", ex);
}
}
};
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckRegionCCEOffHeapDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckRegionCCEOffHeapDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckRegionCCEOffHeapDUnitTest.java
index 4b7e49d..e490f65 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckRegionCCEOffHeapDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckRegionCCEOffHeapDUnitTest.java
@@ -22,6 +22,7 @@ import com.gemstone.gemfire.cache.AttributesFactory;
import com.gemstone.gemfire.cache.RegionAttributes;
import com.gemstone.gemfire.distributed.internal.DistributionConfig;
import com.gemstone.gemfire.internal.cache.OffHeapTestUtil;
+import com.gemstone.gemfire.test.dunit.Invoke;
import com.gemstone.gemfire.test.dunit.SerializableRunnable;
/**
@@ -38,7 +39,7 @@ public class DistributedAckRegionCCEOffHeapDUnitTest extends DistributedAckRegio
}
@Override
- public void tearDown2() throws Exception {
+ public void tearDownBeforeDisconnect() throws Exception {
SerializableRunnable checkOrphans = new SerializableRunnable() {
@Override
@@ -48,11 +49,11 @@ public class DistributedAckRegionCCEOffHeapDUnitTest extends DistributedAckRegio
}
}
};
- invokeInEveryVM(checkOrphans);
+ Invoke.invokeInEveryVM(checkOrphans);
try {
checkOrphans.run();
} finally {
- super.tearDown2();
+ super.tearDownBeforeDisconnect();
}
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckRegionDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckRegionDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckRegionDUnitTest.java
index 27da3d6..3dec38e 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckRegionDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckRegionDUnitTest.java
@@ -25,6 +25,8 @@ import com.gemstone.gemfire.cache.Region;
import com.gemstone.gemfire.cache.RegionAttributes;
import com.gemstone.gemfire.cache.Scope;
import com.gemstone.gemfire.distributed.internal.DistributionConfig;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.DUnitEnv;
import com.gemstone.gemfire.test.dunit.Host;
import com.gemstone.gemfire.test.dunit.SerializableRunnable;
import com.gemstone.gemfire.test.dunit.VM;
@@ -60,7 +62,7 @@ public class DistributedAckRegionDUnitTest extends MultiVMRegionTestCase {
public Properties getDistributedSystemProperties() {
Properties p = new Properties();
p.put(DistributionConfig.STATISTIC_SAMPLING_ENABLED_NAME, "true");
- p.put(DistributionConfig.LOG_LEVEL_NAME, getDUnitLogLevel());
+ p.put(DistributionConfig.LOG_LEVEL_NAME, DUnitEnv.getDUnitLogLevel());
return p;
}
@@ -90,7 +92,7 @@ public class DistributedAckRegionDUnitTest extends MultiVMRegionTestCase {
createRegion(name, "INCOMPATIBLE_ROOT", getRegionAttributes());
} catch (CacheException ex) {
- fail("While creating ACK region", ex);
+ Assert.fail("While creating ACK region", ex);
}
}
});
@@ -109,7 +111,7 @@ public class DistributedAckRegionDUnitTest extends MultiVMRegionTestCase {
}
} catch (CacheException ex) {
- fail("While creating GLOBAL Region", ex);
+ Assert.fail("While creating GLOBAL Region", ex);
}
}
});
@@ -127,7 +129,7 @@ public class DistributedAckRegionDUnitTest extends MultiVMRegionTestCase {
}
} catch (CacheException ex) {
- fail("While creating NOACK Region", ex);
+ Assert.fail("While creating NOACK Region", ex);
}
}
});
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckRegionOffHeapDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckRegionOffHeapDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckRegionOffHeapDUnitTest.java
index 5d7f8f6..69dc159 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckRegionOffHeapDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckRegionOffHeapDUnitTest.java
@@ -22,6 +22,7 @@ import com.gemstone.gemfire.cache.AttributesFactory;
import com.gemstone.gemfire.cache.RegionAttributes;
import com.gemstone.gemfire.distributed.internal.DistributionConfig;
import com.gemstone.gemfire.internal.cache.OffHeapTestUtil;
+import com.gemstone.gemfire.test.dunit.Invoke;
import com.gemstone.gemfire.test.dunit.SerializableRunnable;
/**
@@ -38,7 +39,7 @@ public class DistributedAckRegionOffHeapDUnitTest extends DistributedAckRegionDU
}
@Override
- public void tearDown2() throws Exception {
+ public void tearDownBeforeDisconnect() throws Exception {
SerializableRunnable checkOrphans = new SerializableRunnable() {
@Override
@@ -48,11 +49,11 @@ public class DistributedAckRegionOffHeapDUnitTest extends DistributedAckRegionDU
}
}
};
- invokeInEveryVM(checkOrphans);
+ Invoke.invokeInEveryVM(checkOrphans);
try {
checkOrphans.run();
} finally {
- super.tearDown2();
+ super.tearDownBeforeDisconnect();
}
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/DistributedMulticastRegionDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/DistributedMulticastRegionDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/DistributedMulticastRegionDUnitTest.java
index 3728cf6..97f6062 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/DistributedMulticastRegionDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/DistributedMulticastRegionDUnitTest.java
@@ -37,6 +37,7 @@ import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
import com.gemstone.gemfire.internal.cache.OffHeapTestUtil;
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.SerializableCallable;
import com.gemstone.gemfire.test.dunit.SerializableRunnable;
import com.gemstone.gemfire.test.dunit.VM;
@@ -60,9 +61,9 @@ public class DistributedMulticastRegionDUnitTest extends CacheTestCase {
}
@Override
- public void tearDown2() throws Exception {
+ public void tearDownBeforeDisconnect() throws Exception {
clean();
- super.tearDown2();
+ super.tearDownBeforeDisconnect();
}
private void clean(){
@@ -72,7 +73,7 @@ public class DistributedMulticastRegionDUnitTest extends CacheTestCase {
disconnectFromDS();
}
};
- invokeInEveryVM(cleanVM);
+ Invoke.invokeInEveryVM(cleanVM);
}
public void testMulticastEnabled() {
@@ -172,7 +173,7 @@ public class DistributedMulticastRegionDUnitTest extends CacheTestCase {
locator1Vm.invoke(new SerializableCallable() {
@Override
public Object call() {
- final File locatorLogFile = new File(testName + "-locator-" + locatorPort + ".log");
+ final File locatorLogFile = new File(getTestName() + "-locator-" + locatorPort + ".log");
final Properties locatorProps = new Properties();
locatorProps.setProperty(DistributionConfig.NAME_NAME, "LocatorWithMcast");
locatorProps.setProperty(DistributionConfig.MCAST_PORT_NAME, mcastport);
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/DistributedNoAckRegionCCEDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/DistributedNoAckRegionCCEDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/DistributedNoAckRegionCCEDUnitTest.java
index c65101e..a9083fe 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/DistributedNoAckRegionCCEDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/DistributedNoAckRegionCCEDUnitTest.java
@@ -33,10 +33,12 @@ import com.gemstone.gemfire.cache.util.CacheListenerAdapter;
import com.gemstone.gemfire.distributed.internal.DistributionConfig;
import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem;
import com.gemstone.gemfire.internal.cache.LocalRegion;
+import com.gemstone.gemfire.test.dunit.Assert;
import com.gemstone.gemfire.test.dunit.AsyncInvocation;
import com.gemstone.gemfire.test.dunit.Host;
import com.gemstone.gemfire.test.dunit.SerializableRunnable;
-import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
public class DistributedNoAckRegionCCEDUnitTest extends
DistributedNoAckRegionDUnitTest {
@@ -126,7 +128,7 @@ public class DistributedNoAckRegionCCEDUnitTest extends
AsyncInvocation vm1Ops = vm1.invokeAsync(DistributedNoAckRegionCCEDUnitTest.class, "doManyOps");
AsyncInvocation vm2Ops = vm2.invokeAsync(DistributedNoAckRegionCCEDUnitTest.class, "doManyOps");
// pause to let a bunch of operations build up
- pause(5000);
+ Wait.pause(5000);
AsyncInvocation a0 = vm3.invokeAsync(DistributedNoAckRegionCCEDUnitTest.class, "clearRegion");
vm0.invoke(DistributedNoAckRegionCCEDUnitTest.class, "unblockListener");
vm1.invoke(DistributedNoAckRegionCCEDUnitTest.class, "unblockListener");
@@ -139,7 +141,7 @@ public class DistributedNoAckRegionCCEDUnitTest extends
// if (a0failed && a1failed) {
// fail("neither member saw event conflation - check stats for " + name);
// }
- pause(2000);//this test has with noack, thus we should wait before validating entries
+ Wait.pause(2000);//this test has with noack, thus we should wait before validating entries
// check consistency of the regions
Map r0Contents = (Map)vm0.invoke(this.getClass(), "getCCRegionContents");
Map r1Contents = (Map)vm1.invoke(this.getClass(), "getCCRegionContents");
@@ -314,7 +316,7 @@ public class DistributedNoAckRegionCCEDUnitTest extends
}
CCRegion = (LocalRegion)f.create(name);
} catch (CacheException ex) {
- fail("While creating region", ex);
+ Assert.fail("While creating region", ex);
}
}
};
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/DistributedNoAckRegionCCEOffHeapDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/DistributedNoAckRegionCCEOffHeapDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/DistributedNoAckRegionCCEOffHeapDUnitTest.java
index 4d3bb80..da0cb24 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/DistributedNoAckRegionCCEOffHeapDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/DistributedNoAckRegionCCEOffHeapDUnitTest.java
@@ -22,6 +22,7 @@ import com.gemstone.gemfire.cache.AttributesFactory;
import com.gemstone.gemfire.cache.RegionAttributes;
import com.gemstone.gemfire.distributed.internal.DistributionConfig;
import com.gemstone.gemfire.internal.cache.OffHeapTestUtil;
+import com.gemstone.gemfire.test.dunit.Invoke;
import com.gemstone.gemfire.test.dunit.SerializableRunnable;
/**
@@ -38,7 +39,7 @@ public class DistributedNoAckRegionCCEOffHeapDUnitTest extends DistributedNoAckR
}
@Override
- public void tearDown2() throws Exception {
+ public void tearDownBeforeDisconnect() throws Exception {
SerializableRunnable checkOrphans = new SerializableRunnable() {
@Override
@@ -48,11 +49,11 @@ public class DistributedNoAckRegionCCEOffHeapDUnitTest extends DistributedNoAckR
}
}
};
- invokeInEveryVM(checkOrphans);
+ Invoke.invokeInEveryVM(checkOrphans);
try {
checkOrphans.run();
} finally {
- super.tearDown2();
+ super.tearDownBeforeDisconnect();
}
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/DistributedNoAckRegionDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/DistributedNoAckRegionDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/DistributedNoAckRegionDUnitTest.java
index aa39758..d3a0424 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/DistributedNoAckRegionDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/DistributedNoAckRegionDUnitTest.java
@@ -28,11 +28,14 @@ import com.gemstone.gemfire.cache.Scope;
import com.gemstone.gemfire.distributed.internal.membership.InternalDistributedMember;
import com.gemstone.gemfire.internal.cache.DistributedRegion;
import com.gemstone.gemfire.internal.cache.StateFlushOperation;
+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;
/**
* This class tests the functionality of a cache {@link Region region}
@@ -104,7 +107,7 @@ public class DistributedNoAckRegionDUnitTest
assertTrue(getRootRegion("INCOMPATIBLE_ROOT").getAttributes().getScope().isDistributedNoAck());
assertTrue(region.getAttributes().getScope().isDistributedNoAck());
} catch (CacheException ex) {
- fail("While creating NO ACK region", ex);
+ Assert.fail("While creating NO ACK region", ex);
}
}
});
@@ -126,7 +129,7 @@ public class DistributedNoAckRegionDUnitTest
// assertNull(getRootRegion());
} catch (CacheException ex) {
- fail("While creating GLOBAL Region", ex);
+ Assert.fail("While creating GLOBAL Region", ex);
}
}
});
@@ -147,7 +150,7 @@ public class DistributedNoAckRegionDUnitTest
// assertNull(getRootRegion());
} catch (CacheException ex) {
- fail("While creating ACK Region", ex);
+ Assert.fail("While creating ACK Region", ex);
}
}
});
@@ -248,7 +251,7 @@ public class DistributedNoAckRegionDUnitTest
stopPutting = true;
}
});
- DistributedTestCase.join(async, 30 * 1000, getLogWriter());
+ Threads.join(async, 30 * 1000);
// wait for overflow queue to quiesce before continuing
vm2.invoke(new SerializableRunnable("Wait for Overflow Queue") {
public void run() {
@@ -260,7 +263,7 @@ public class DistributedNoAckRegionDUnitTest
return "overflow queue remains nonempty";
}
};
- DistributedTestCase.waitForCriterion(ev, 30 * 1000, 200, true);
+ Wait.waitForCriterion(ev, 30 * 1000, 200, true);
// pause(100);
// try {
// getRootRegion().getSubregion(name).destroyRegion();
@@ -272,18 +275,18 @@ public class DistributedNoAckRegionDUnitTest
} // finally
getLogWriter().info("testBug30705: at end of test");
if (async.exceptionOccurred()) {
- fail("Got exception", async.getException());
+ Assert.fail("Got exception", async.getException());
}
}
@Override
protected void pauseIfNecessary(int ms) {
- pause(ms);
+ Wait.pause(ms);
}
@Override
protected void pauseIfNecessary() {
- pause();
+ Wait.pause();
}
@Override
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/DistributedNoAckRegionOffHeapDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/DistributedNoAckRegionOffHeapDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/DistributedNoAckRegionOffHeapDUnitTest.java
index 2aa1f1e..823a768 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/DistributedNoAckRegionOffHeapDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/DistributedNoAckRegionOffHeapDUnitTest.java
@@ -22,6 +22,7 @@ import com.gemstone.gemfire.cache.AttributesFactory;
import com.gemstone.gemfire.cache.RegionAttributes;
import com.gemstone.gemfire.distributed.internal.DistributionConfig;
import com.gemstone.gemfire.internal.cache.OffHeapTestUtil;
+import com.gemstone.gemfire.test.dunit.Invoke;
import com.gemstone.gemfire.test.dunit.SerializableRunnable;
/**
@@ -38,7 +39,7 @@ public class DistributedNoAckRegionOffHeapDUnitTest extends DistributedNoAckRegi
}
@Override
- public void tearDown2() throws Exception {
+ public void tearDownBeforeDisconnect() throws Exception {
SerializableRunnable checkOrphans = new SerializableRunnable() {
@Override
@@ -48,11 +49,11 @@ public class DistributedNoAckRegionOffHeapDUnitTest extends DistributedNoAckRegi
}
}
};
- invokeInEveryVM(checkOrphans);
+ Invoke.invokeInEveryVM(checkOrphans);
try {
checkOrphans.run();
} finally {
- super.tearDown2();
+ super.tearDownBeforeDisconnect();
}
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/DynamicRegionDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/DynamicRegionDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/DynamicRegionDUnitTest.java
index f8baf5a..5adf5be 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/DynamicRegionDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/DynamicRegionDUnitTest.java
@@ -71,7 +71,7 @@ public class DynamicRegionDUnitTest extends CacheTestCase {
* in a test.
* </p>
*/
- public void tearDown2() throws Exception {
+ public void tearDownBeforeDisconnect() throws Exception {
getLogWriter().info("Running tearDown in " + this);
try {
//Asif destroy dynamic regions at the end of the test
@@ -90,7 +90,7 @@ public class DynamicRegionDUnitTest extends CacheTestCase {
dr.localDestroyRegion();
}
- super.tearDown2();
+ super.tearDownBeforeDisconnect();
}
catch (VirtualMachineError e) {
SystemFailure.initiateFailure(e);
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/GlobalRegionCCEDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/GlobalRegionCCEDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/GlobalRegionCCEDUnitTest.java
index 22b303f..c328995 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/GlobalRegionCCEDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/GlobalRegionCCEDUnitTest.java
@@ -36,6 +36,7 @@ import com.gemstone.gemfire.internal.cache.RegionClearedException;
import com.gemstone.gemfire.internal.cache.RegionEntry;
import com.gemstone.gemfire.internal.cache.TombstoneService;
import com.gemstone.gemfire.internal.cache.versions.VersionTag;
+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;
@@ -167,7 +168,7 @@ public class GlobalRegionCCEDUnitTest extends GlobalRegionDUnitTest {
CCRegion.put("cckey0", "ccvalue");
CCRegion.put("cckey0", "ccvalue"); // version number will end up at 4
} catch (CacheException ex) {
- fail("While creating region", ex);
+ Assert.fail("While creating region", ex);
}
}
};
@@ -189,7 +190,7 @@ public class GlobalRegionCCEDUnitTest extends GlobalRegionDUnitTest {
try {
entry.makeTombstone(CCRegion, tag);
} catch (RegionClearedException e) {
- fail("region was mysteriously cleared during unit testing", e);
+ Assert.fail("region was mysteriously cleared during unit testing", e);
}
}
});
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/GlobalRegionCCEOffHeapDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/GlobalRegionCCEOffHeapDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/GlobalRegionCCEOffHeapDUnitTest.java
index 8579548..76ed01d 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/GlobalRegionCCEOffHeapDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/GlobalRegionCCEOffHeapDUnitTest.java
@@ -22,6 +22,7 @@ import com.gemstone.gemfire.cache.AttributesFactory;
import com.gemstone.gemfire.cache.RegionAttributes;
import com.gemstone.gemfire.distributed.internal.DistributionConfig;
import com.gemstone.gemfire.internal.cache.OffHeapTestUtil;
+import com.gemstone.gemfire.test.dunit.Invoke;
import com.gemstone.gemfire.test.dunit.SerializableRunnable;
/**
@@ -38,7 +39,7 @@ public class GlobalRegionCCEOffHeapDUnitTest extends GlobalRegionCCEDUnitTest {
}
@Override
- public void tearDown2() throws Exception {
+ public void tearDownBeforeDisconnect() throws Exception {
SerializableRunnable checkOrphans = new SerializableRunnable() {
@Override
@@ -48,11 +49,11 @@ public class GlobalRegionCCEOffHeapDUnitTest extends GlobalRegionCCEDUnitTest {
}
}
};
- invokeInEveryVM(checkOrphans);
+ Invoke.invokeInEveryVM(checkOrphans);
try {
checkOrphans.run();
} finally {
- super.tearDown2();
+ super.tearDownBeforeDisconnect();
}
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/GlobalRegionDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/GlobalRegionDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/GlobalRegionDUnitTest.java
index f08b66f..a07f672 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/GlobalRegionDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/GlobalRegionDUnitTest.java
@@ -31,10 +31,11 @@ import com.gemstone.gemfire.cache.Region;
import com.gemstone.gemfire.cache.RegionAttributes;
import com.gemstone.gemfire.cache.Scope;
import com.gemstone.gemfire.cache.TimeoutException;
+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;
/**
@@ -86,7 +87,7 @@ public class GlobalRegionDUnitTest extends MultiVMRegionTestCase {
try {
createRegion(name, "INCOMPATIBLE_ROOT", getRegionAttributes());
} catch (CacheException ex) {
- fail("While creating GLOBAL region", ex);
+ Assert.fail("While creating GLOBAL region", ex);
}
assertTrue(getRootRegion("INCOMPATIBLE_ROOT").getAttributes().getScope().isGlobal());
}
@@ -108,7 +109,7 @@ public class GlobalRegionDUnitTest extends MultiVMRegionTestCase {
}
} catch (CacheException ex) {
- fail("While creating GLOBAL Region", ex);
+ Assert.fail("While creating GLOBAL Region", ex);
}
}
});
@@ -134,7 +135,7 @@ public class GlobalRegionDUnitTest extends MultiVMRegionTestCase {
}
} catch (CacheException ex) {
- fail("While creating GLOBAL Region", ex);
+ Assert.fail("While creating GLOBAL Region", ex);
}
}
});
@@ -245,7 +246,7 @@ public class GlobalRegionDUnitTest extends MultiVMRegionTestCase {
SystemFailure.setFailure((VirtualMachineError)e); // don't throw
}
String s = "Uncaught exception in thread " + t;
- fail(s, e);
+ Assert.fail(s, e);
}
};
@@ -284,9 +285,9 @@ public class GlobalRegionDUnitTest extends MultiVMRegionTestCase {
}
} catch (InterruptedException ex) {
- fail("While incrementing", ex);
+ Assert.fail("While incrementing", ex);
} catch (Exception ex) {
- fail("While incrementing", ex);
+ Assert.fail("While incrementing", ex);
}
}
catch (VirtualMachineError e) {
@@ -304,7 +305,7 @@ public class GlobalRegionDUnitTest extends MultiVMRegionTestCase {
}
for (int i = 0; i < threads.length; i++) {
- DistributedTestCase.join(threads[i], 30 * 1000, getLogWriter());
+ Threads.join(threads[i], 30 * 1000);
}
}
};
@@ -315,9 +316,9 @@ public class GlobalRegionDUnitTest extends MultiVMRegionTestCase {
}
for (int i = 0; i < vmCount; i++) {
- DistributedTestCase.join(invokes[i], 5 * 60 * 1000, getLogWriter());
+ Threads.join(invokes[i], 5 * 60 * 1000);
if (invokes[i].exceptionOccurred()) {
- fail("invocation failed", invokes[i].getException());
+ Assert.fail("invocation failed", invokes[i].getException());
}
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/GlobalRegionOffHeapDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/GlobalRegionOffHeapDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/GlobalRegionOffHeapDUnitTest.java
index 4af6072..a264e34 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/GlobalRegionOffHeapDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/GlobalRegionOffHeapDUnitTest.java
@@ -22,6 +22,7 @@ import com.gemstone.gemfire.cache.AttributesFactory;
import com.gemstone.gemfire.cache.RegionAttributes;
import com.gemstone.gemfire.distributed.internal.DistributionConfig;
import com.gemstone.gemfire.internal.cache.OffHeapTestUtil;
+import com.gemstone.gemfire.test.dunit.Invoke;
import com.gemstone.gemfire.test.dunit.SerializableRunnable;
/**
@@ -38,7 +39,7 @@ public class GlobalRegionOffHeapDUnitTest extends GlobalRegionDUnitTest {
}
@Override
- public void tearDown2() throws Exception {
+ public void tearDownBeforeDisconnect() throws Exception {
SerializableRunnable checkOrphans = new SerializableRunnable() {
@Override
@@ -48,11 +49,11 @@ public class GlobalRegionOffHeapDUnitTest extends GlobalRegionDUnitTest {
}
}
};
- invokeInEveryVM(checkOrphans);
+ Invoke.invokeInEveryVM(checkOrphans);
try {
checkOrphans.run();
} finally {
- super.tearDown2();
+ super.tearDownBeforeDisconnect();
}
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/LocalRegionDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/LocalRegionDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/LocalRegionDUnitTest.java
index 0ea842d..2ed532b 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/LocalRegionDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/LocalRegionDUnitTest.java
@@ -26,6 +26,7 @@ import com.gemstone.gemfire.cache.Region;
import com.gemstone.gemfire.cache.RegionAttributes;
import com.gemstone.gemfire.cache.Scope;
import com.gemstone.gemfire.cache.TimeoutException;
+import com.gemstone.gemfire.test.dunit.Assert;
/**
* Tests the functionality of a {@link Scope#LOCAL locally scoped}
@@ -124,7 +125,7 @@ public class LocalRegionDUnitTest extends CacheListenerTestCase {
helper.netSearch(true);
} catch (TimeoutException ex) {
- fail("Why did I timeout?", ex);
+ Assert.fail("Why did I timeout?", ex);
}
return null;