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:24 UTC
[14/27] incubator-geode git commit: GEODE 773 rough draft
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/SizingFlagDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/SizingFlagDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/SizingFlagDUnitTest.java
index 19170f2..90360ef 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/SizingFlagDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/SizingFlagDUnitTest.java
@@ -46,6 +46,7 @@ import com.gemstone.gemfire.distributed.DistributedMember;
import com.gemstone.gemfire.distributed.DistributedSystem;
import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem;
import com.gemstone.gemfire.internal.i18n.LocalizedStrings;
+import com.gemstone.gemfire.test.dunit.Assert;
import com.gemstone.gemfire.test.dunit.Host;
import com.gemstone.gemfire.test.dunit.SerializableCallable;
import com.gemstone.gemfire.test.dunit.SerializableRunnable;
@@ -358,7 +359,7 @@ public class SizingFlagDUnitTest extends CacheTestCase {
try {
region.getAttributesMutator().addCacheListener(new TestCacheListener());
} catch (Exception e) {
- fail("couldn't create index", e);
+ Assert.fail("couldn't create index", e);
}
}
});
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/SystemFailureDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/SystemFailureDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/SystemFailureDUnitTest.java
index e3858fb..ac132ae 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/SystemFailureDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/SystemFailureDUnitTest.java
@@ -398,7 +398,7 @@ public class SystemFailureDUnitTest extends DistributedCacheTestCase {
protected static Boolean verifyConnected() {
if (SystemFailure.getFailure() != null) {
- fail("System failure present!", SystemFailure.getFailure());
+ com.gemstone.gemfire.test.dunit.Assert.fail("System failure present!", SystemFailure.getFailure());
return Boolean.FALSE;
}
GemFireCacheImpl gfc = (GemFireCacheImpl)cache;
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/TXReservationMgrJUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/TXReservationMgrJUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/TXReservationMgrJUnitTest.java
index 663ef61..cd3f7bf 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/TXReservationMgrJUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/TXReservationMgrJUnitTest.java
@@ -30,7 +30,7 @@ import com.gemstone.gemfire.cache.CacheFactory;
import com.gemstone.gemfire.cache.CommitConflictException;
import com.gemstone.gemfire.cache.Scope;
import com.gemstone.gemfire.distributed.DistributedSystem;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
+import com.gemstone.gemfire.test.dunit.Threads;
import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
@Category(IntegrationTest.class)
@@ -124,7 +124,7 @@ public class TXReservationMgrJUnitTest {
threads[i].start();
}
for (int i=0; i < THREAD_COUNT; i++) {
- DistributedTestCase.join(threads[i], 60 * 1000, null); // increased from 30 to 60 for parallel junit runs
+ Threads.join(threads[i], 60 * 1000); // increased from 30 to 60 for parallel junit runs
}
int invalidCount = 0;
for (int i=0; i < KEY_COUNT; i++) {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/TransactionsWithDeltaDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/TransactionsWithDeltaDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/TransactionsWithDeltaDUnitTest.java
index 06a8f09..7476230 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/TransactionsWithDeltaDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/TransactionsWithDeltaDUnitTest.java
@@ -43,6 +43,7 @@ import com.gemstone.gemfire.internal.cache.execute.CustomerIDPartitionResolver;
import com.gemstone.gemfire.internal.cache.execute.data.CustId;
import com.gemstone.gemfire.internal.cache.execute.data.Order;
import com.gemstone.gemfire.internal.cache.execute.data.OrderId;
+import com.gemstone.gemfire.test.dunit.DUnitEnv;
import com.gemstone.gemfire.test.dunit.Host;
import com.gemstone.gemfire.test.dunit.SerializableCallable;
import com.gemstone.gemfire.test.dunit.VM;
@@ -114,7 +115,7 @@ public class TransactionsWithDeltaDUnitTest extends CacheTestCase {
ClientCacheFactory ccf = new ClientCacheFactory();
ccf.addPoolServer("localhost"/*getServerHostName(Host.getHost(0))*/, port);
ccf.setPoolSubscriptionEnabled(false);
- ccf.set("log-level", getDUnitLogLevel());
+ ccf.set("log-level", DUnitEnv.getDUnitLogLevel());
ClientCache cCache = getClientCache(ccf);
ClientRegionFactory<Integer, String> crf = cCache
.createClientRegionFactory(isEmpty ? ClientRegionShortcut.PROXY
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/control/RebalanceOperationDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/control/RebalanceOperationDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/control/RebalanceOperationDUnitTest.java
index 1c25dcc..2d80bef 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/control/RebalanceOperationDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/control/RebalanceOperationDUnitTest.java
@@ -73,11 +73,15 @@ import com.gemstone.gemfire.internal.cache.PartitionedRegionDataStore;
import com.gemstone.gemfire.internal.cache.control.InternalResourceManager.ResourceObserverAdapter;
import com.gemstone.gemfire.internal.cache.partitioned.BucketCountLoadProbe;
import com.gemstone.gemfire.internal.cache.partitioned.LoadProbe;
+import com.gemstone.gemfire.test.dunit.Assert;
import com.gemstone.gemfire.test.dunit.AsyncInvocation;
import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.Invoke;
import com.gemstone.gemfire.test.dunit.SerializableCallable;
import com.gemstone.gemfire.test.dunit.SerializableRunnable;
import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
/**
* @author dsmith
@@ -91,9 +95,9 @@ public class RebalanceOperationDUnitTest extends CacheTestCase {
@Override
- public void tearDown2() throws Exception {
- super.tearDown2();
- invokeInEveryVM(new SerializableRunnable() {
+ public void tearDownBeforeDisconnect() throws Exception {
+ super.tearDownBeforeDisconnect();
+ Invoke.invokeInEveryVM(new SerializableRunnable() {
public void run() {
InternalResourceManager.setResourceObserver(null);
System.clearProperty("gemfire.resource.manager.threads");
@@ -328,7 +332,7 @@ public class RebalanceOperationDUnitTest extends CacheTestCase {
}
public void enforceIp(final boolean simulate) {
- invokeInEveryVM(new SerializableRunnable() {
+ Invoke.invokeInEveryVM(new SerializableRunnable() {
public void run() {
Properties props = new Properties();
props.setProperty(DistributionConfig.ENFORCE_UNIQUE_HOST_NAME, "true");
@@ -426,7 +430,7 @@ public class RebalanceOperationDUnitTest extends CacheTestCase {
} finally {
disconnectFromDS();
- invokeInEveryVM(new SerializableRunnable() {
+ Invoke.invokeInEveryVM(new SerializableRunnable() {
public void run() {
disconnectFromDS();
}
@@ -559,7 +563,7 @@ public class RebalanceOperationDUnitTest extends CacheTestCase {
} finally {
disconnectFromDS();
- invokeInEveryVM(new SerializableRunnable() {
+ Invoke.invokeInEveryVM(new SerializableRunnable() {
public void run() {
//clear the redundancy zone setting
disconnectFromDS();
@@ -610,7 +614,7 @@ public class RebalanceOperationDUnitTest extends CacheTestCase {
try {
barrier.await(MAX_WAIT, TimeUnit.SECONDS);
} catch (Exception e) {
- fail("failed waiting for barrier", e);
+ Assert.fail("failed waiting for barrier", e);
}
observerCalled = true;
} else {
@@ -764,7 +768,7 @@ public class RebalanceOperationDUnitTest extends CacheTestCase {
checkBucketCount(vm2, "region2", 6);
} finally {
disconnectFromDS();
- invokeInEveryVM(new SerializableRunnable() {
+ Invoke.invokeInEveryVM(new SerializableRunnable() {
public void run() {
//clear the redundancy zone setting
disconnectFromDS();
@@ -819,9 +823,9 @@ public class RebalanceOperationDUnitTest extends CacheTestCase {
.simulate()
.getResults(MAX_WAIT, TimeUnit.SECONDS);
} catch (InterruptedException e) {
- fail("Interrupted waiting on rebalance", e);
+ Assert.fail("Interrupted waiting on rebalance", e);
} catch (TimeoutException e) {
- fail("Timeout waiting on rebalance", e);
+ Assert.fail("Timeout waiting on rebalance", e);
}
} else {
try {
@@ -831,9 +835,9 @@ public class RebalanceOperationDUnitTest extends CacheTestCase {
.start()
.getResults(MAX_WAIT, TimeUnit.SECONDS);
} catch (InterruptedException e) {
- fail("Interrupted waiting on rebalance", e);
+ Assert.fail("Interrupted waiting on rebalance", e);
} catch (TimeoutException e) {
- fail("Timeout waiting on rebalance", e);
+ Assert.fail("Timeout waiting on rebalance", e);
}
}
assertEquals(Collections.emptySet(), manager.getRebalanceOperations());
@@ -1098,7 +1102,7 @@ public class RebalanceOperationDUnitTest extends CacheTestCase {
}
public void testRecoverRedundancyParallelAsyncEventQueueSimulation() throws NoSuchFieldException, SecurityException {
- invokeInEveryVM(new SerializableRunnable() {
+ Invoke.invokeInEveryVM(new SerializableRunnable() {
@Override
public void run () {
@@ -2744,7 +2748,7 @@ public class RebalanceOperationDUnitTest extends CacheTestCase {
// the rebalance op may think that the other member doesn't have buckets, then
// ask it to create them and get a negative reply because it actually does
// have the buckets, causing the test to fail
- pause(10000);
+ Wait.pause(10000);
//Try to rebalance again. This shouldn't do anything, because
//we already recovered redundancy earlier.
@@ -3166,7 +3170,7 @@ public class RebalanceOperationDUnitTest extends CacheTestCase {
Cache cache = getCache();
final PartitionedRegion region = (PartitionedRegion) cache.getRegion(regionName);
- waitForCriterion(new WaitCriterion() {
+ Wait.waitForCriterion(new WaitCriterion() {
@Override
public boolean done() {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/diskPerf/DiskRegionOverflowAsyncRollingOpLogJUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/diskPerf/DiskRegionOverflowAsyncRollingOpLogJUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/diskPerf/DiskRegionOverflowAsyncRollingOpLogJUnitTest.java
index 10a7df7..5f0a249 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/diskPerf/DiskRegionOverflowAsyncRollingOpLogJUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/diskPerf/DiskRegionOverflowAsyncRollingOpLogJUnitTest.java
@@ -29,8 +29,8 @@ import com.gemstone.gemfire.*;
import com.gemstone.gemfire.cache.*;
import com.gemstone.gemfire.internal.cache.lru.LRUStatistics;
import com.gemstone.gemfire.internal.cache.*;
-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;
import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
/**
@@ -168,7 +168,7 @@ public class DiskRegionOverflowAsyncRollingOpLogJUnitTest extends
return null;
}
};
- DistributedTestCase.waitForCriterion(ev, 30 * 1000, 200, true);
+ Wait.waitForCriterion(ev, 30 * 1000, 200, true);
}
//Now get 0-9999 entries
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/diskPerf/DiskRegionOverflowSyncRollingOpLogJUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/diskPerf/DiskRegionOverflowSyncRollingOpLogJUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/diskPerf/DiskRegionOverflowSyncRollingOpLogJUnitTest.java
index df09e2c..d94cf73 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/diskPerf/DiskRegionOverflowSyncRollingOpLogJUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/diskPerf/DiskRegionOverflowSyncRollingOpLogJUnitTest.java
@@ -30,8 +30,8 @@ import static org.junit.Assert.*;
import com.gemstone.gemfire.*;
import com.gemstone.gemfire.cache.*;
import com.gemstone.gemfire.internal.cache.lru.LRUStatistics;
-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;
import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
/**
@@ -163,7 +163,7 @@ public class DiskRegionOverflowSyncRollingOpLogJUnitTest extends
return null;
}
};
- DistributedTestCase.waitForCriterion(ev, 30 * 1000, 200, true);
+ Wait.waitForCriterion(ev, 30 * 1000, 200, true);
}
//Now get 0-9999 entries
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/diskPerf/MultiThreadedOplogPerJUnitPerformanceTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/diskPerf/MultiThreadedOplogPerJUnitPerformanceTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/diskPerf/MultiThreadedOplogPerJUnitPerformanceTest.java
index 719a9b2..94495a1 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/diskPerf/MultiThreadedOplogPerJUnitPerformanceTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/diskPerf/MultiThreadedOplogPerJUnitPerformanceTest.java
@@ -34,7 +34,7 @@ import com.gemstone.gemfire.cache.Region;
import com.gemstone.gemfire.cache.Scope;
import com.gemstone.gemfire.distributed.DistributedSystem;
import com.gemstone.gemfire.internal.cache.DiskStoreFactoryImpl;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
+import com.gemstone.gemfire.test.dunit.Threads;
import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
@Category(IntegrationTest.class)
@@ -142,7 +142,7 @@ public class MultiThreadedOplogPerJUnitPerformanceTest
}
for (int i = 0; i < numberOfThreads; i++) {
- DistributedTestCase.join(threads[i], 30 * 1000, null);
+ Threads.join(threads[i], 30 * 1000);
}
long totalPuts = ((long)numberOfIterations * numberOfKeysPerThread * numberOfThreads);
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/Bug51193DUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/Bug51193DUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/Bug51193DUnitTest.java
index 63fdf64..9dca212 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/Bug51193DUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/Bug51193DUnitTest.java
@@ -41,6 +41,7 @@ import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
import com.gemstone.gemfire.internal.cache.tier.ClientHandShake;
import com.gemstone.gemfire.internal.cache.tier.sockets.AcceptorImpl;
import com.gemstone.gemfire.internal.cache.tier.sockets.ServerConnection;
+import com.gemstone.gemfire.test.dunit.DUnitEnv;
import com.gemstone.gemfire.test.dunit.DistributedTestCase;
import com.gemstone.gemfire.test.dunit.Host;
import com.gemstone.gemfire.test.dunit.VM;
@@ -69,7 +70,7 @@ public class Bug51193DUnitTest extends DistributedTestCase {
}
- public void tearDown2() {
+ public void tearDownBeforeDisconnect() {
closeCache();
server0.invoke(Bug51193DUnitTest.class, "closeCache");
client0.invoke(Bug51193DUnitTest.class, "closeCache");
@@ -117,7 +118,7 @@ public class Bug51193DUnitTest extends DistributedTestCase {
public static Integer createServerCache(Boolean createPR)
throws Exception {
Properties props = new Properties();
- props.setProperty("locators", "localhost["+getDUnitLocatorPort()+"]");
+ props.setProperty("locators", "localhost["+DUnitEnv.getDUnitLocatorPort()+"]");
Bug51193DUnitTest test = new Bug51193DUnitTest("Bug51193DUnitTest");
DistributedSystem ds = test.getSystem(props);
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/ClientServerFunctionExecutionDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/ClientServerFunctionExecutionDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/ClientServerFunctionExecutionDUnitTest.java
index 1e78da2..bede648 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/ClientServerFunctionExecutionDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/ClientServerFunctionExecutionDUnitTest.java
@@ -33,8 +33,12 @@ import com.gemstone.gemfire.cache.execute.ResultCollector;
import com.gemstone.gemfire.distributed.DistributedSystem;
import com.gemstone.gemfire.internal.cache.functions.TestFunction;
import com.gemstone.gemfire.internal.cache.tier.sockets.CacheServerTestUtil;
+import com.gemstone.gemfire.test.dunit.Assert;
import com.gemstone.gemfire.test.dunit.AsyncInvocation;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
+import com.gemstone.gemfire.test.dunit.IgnoredException;
+import com.gemstone.gemfire.test.dunit.NetworkSupport;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
import java.io.Serializable;
import java.util.ArrayList;
@@ -59,7 +63,7 @@ public class ClientServerFunctionExecutionDUnitTest extends PRClientServerTestBa
public void setUp() throws Exception {
super.setUp();
- addExpectedException("java.net.ConnectException");
+ IgnoredException.addIgnoredException("java.net.ConnectException");
}
@@ -300,7 +304,7 @@ public class ClientServerFunctionExecutionDUnitTest extends PRClientServerTestBa
//The test code appears to trigger this because the first
//call to the function disconnects from the DS but does not call
//last result;
- addExpectedException("did not send last result");
+ IgnoredException.addIgnoredException("did not send last result");
createScenario();
server1.invoke(
@@ -317,7 +321,7 @@ public class ClientServerFunctionExecutionDUnitTest extends PRClientServerTestBa
client.invoke(ClientServerFunctionExecutionDUnitTest.class,
"createProxyRegion",
- new Object[] { getServerHostName(server1.getHost()) });
+ new Object[] { NetworkSupport.getServerHostName(server1.getHost()) });
function = new TestFunction(true, TestFunction.TEST_FUNCTION_HA_SERVER);
registerFunctionAtServer(function);
@@ -337,8 +341,8 @@ public class ClientServerFunctionExecutionDUnitTest extends PRClientServerTestBa
//The test code appears to trigger this because the first
//call to the function disconnects from the DS but does not call
//last result;
- addExpectedException("Socket Closed");
- addExpectedException("did not send last result");
+ IgnoredException.addIgnoredException("Socket Closed");
+ IgnoredException.addIgnoredException("did not send last result");
createScenario();
server1.invoke(
@@ -355,7 +359,7 @@ public class ClientServerFunctionExecutionDUnitTest extends PRClientServerTestBa
client.invoke(ClientServerFunctionExecutionDUnitTest.class,
"createProxyRegion",
- new Object[] { getServerHostName(server1.getHost()) });
+ new Object[] { NetworkSupport.getServerHostName(server1.getHost()) });
function = new TestFunction(true, TestFunction.TEST_FUNCTION_HA_SERVER);
registerFunctionAtServer(function);
@@ -379,7 +383,7 @@ public class ClientServerFunctionExecutionDUnitTest extends PRClientServerTestBa
//The test code appears to trigger this because the first
//call to the function disconnects from the DS but does not call
//last result;
- addExpectedException("did not send last result");
+ IgnoredException.addIgnoredException("did not send last result");
createScenario();
server1.invoke(
ClientServerFunctionExecutionDUnitTest.class,
@@ -395,7 +399,7 @@ public class ClientServerFunctionExecutionDUnitTest extends PRClientServerTestBa
client.invoke(ClientServerFunctionExecutionDUnitTest.class,
"createProxyRegion",
- new Object[] { getServerHostName(server1.getHost()) });
+ new Object[] { NetworkSupport.getServerHostName(server1.getHost()) });
function = new TestFunction(true, TestFunction.TEST_FUNCTION_NONHA_SERVER);
registerFunctionAtServer(function);
@@ -587,7 +591,7 @@ public class ClientServerFunctionExecutionDUnitTest extends PRClientServerTestBa
return excuse;
}
};
- DistributedTestCase.waitForCriterion(wc, 3 * 60 * 1000, 1000, true);
+ Wait.waitForCriterion(wc, 3 * 60 * 1000, 1000, true);
}
public static Object serverExecutionHAOneServerDown(Boolean isByName, Function function,
@@ -678,7 +682,7 @@ public class ClientServerFunctionExecutionDUnitTest extends PRClientServerTestBa
assertTrue(((Integer)list.get(1)) == 5);
} catch (Exception ex) {
ex.printStackTrace();
- fail("This is not expected Exception", ex);
+ Assert.fail("This is not expected Exception", ex);
}
}
@@ -945,7 +949,7 @@ public static void allServerExecution_SendException(Boolean isByName, Function f
}
}
- public void tearDown2() throws Exception {
- super.tearDown2();
+ public void tearDownBeforeDisconnect() throws Exception {
+ super.tearDownBeforeDisconnect();
}
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/ColocationFailoverDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/ColocationFailoverDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/ColocationFailoverDUnitTest.java
index 81b9984..b836ecf 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/ColocationFailoverDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/ColocationFailoverDUnitTest.java
@@ -39,10 +39,14 @@ import com.gemstone.gemfire.distributed.DistributedSystem;
import com.gemstone.gemfire.internal.cache.PartitionedRegion;
import com.gemstone.gemfire.internal.cache.partitioned.RegionAdvisor;
import com.gemstone.gemfire.internal.logging.InternalLogWriter;
+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.SerializableRunnable;
import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
public class ColocationFailoverDUnitTest extends DistributedTestCase {
@@ -100,7 +104,7 @@ public class ColocationFailoverDUnitTest extends DistributedTestCase {
putInPRs();
verifyColocationInAllVms();
dataStore1.invoke(ColocationFailoverDUnitTest.class, "closeCache");
- pause(5000); //wait for volunteering primary
+ Wait.pause(5000); //wait for volunteering primary
verifyColocationAfterFailover();
}
@@ -206,7 +210,7 @@ public class ColocationFailoverDUnitTest extends DistributedTestCase {
return excuse;
}
};
- DistributedTestCase.waitForCriterion(wc, 60 * 1000, 1000, true);
+ Wait.waitForCriterion(wc, 60 * 1000, 1000, true);
}
@@ -348,7 +352,7 @@ public class ColocationFailoverDUnitTest extends DistributedTestCase {
return excuse;
}
};
- DistributedTestCase.waitForCriterion(wc, 2 * 60 * 1000, 1000, true);
+ Wait.waitForCriterion(wc, 2 * 60 * 1000, 1000, true);
}
public static void createCacheInAllVms() {
@@ -374,7 +378,7 @@ public class ColocationFailoverDUnitTest extends DistributedTestCase {
assertNotNull(cache);
}
catch (Exception e) {
- fail("Failed while creating the cache", e);
+ Assert.fail("Failed while creating the cache", e);
}
}
@@ -466,14 +470,14 @@ public class ColocationFailoverDUnitTest extends DistributedTestCase {
}
}
- public void tearDown2() throws Exception {
+ public void tearDownBeforeDisconnect() throws Exception {
closeCache();
- invokeInEveryVM(new SerializableRunnable() {
+ Invoke.invokeInEveryVM(new SerializableRunnable() {
public void run() {
closeCache();
}
});
- super.tearDown2();
+ super.tearDownBeforeDisconnect();
}
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/DistributedRegionFunctionExecutionDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/DistributedRegionFunctionExecutionDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/DistributedRegionFunctionExecutionDUnitTest.java
index 286a5bd..220c85e 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/DistributedRegionFunctionExecutionDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/DistributedRegionFunctionExecutionDUnitTest.java
@@ -52,10 +52,15 @@ import com.gemstone.gemfire.internal.cache.functions.DistribuedRegionFunctionFun
import com.gemstone.gemfire.internal.cache.functions.DistributedRegionFunction;
import com.gemstone.gemfire.internal.cache.functions.TestFunction;
import com.gemstone.gemfire.internal.cache.tier.sockets.CacheServerTestUtil;
+import com.gemstone.gemfire.test.dunit.Assert;
import com.gemstone.gemfire.test.dunit.AsyncInvocation;
import com.gemstone.gemfire.test.dunit.DistributedTestCase;
+import com.gemstone.gemfire.test.dunit.IgnoredException;
import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.Threads;
import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
public class DistributedRegionFunctionExecutionDUnitTest extends
DistributedTestCase {
@@ -93,7 +98,7 @@ public class DistributedRegionFunctionExecutionDUnitTest extends
}
@Override
- public void tearDown2() throws Exception {
+ public void tearDownBeforeDisconnect() throws Exception {
// this test creates a cache that is incompatible with CacheTestCase,
// so we need to close it and null out the cache variable
disconnectAllFromDS();
@@ -314,7 +319,7 @@ public class DistributedRegionFunctionExecutionDUnitTest extends
"registerFunction", new Object[] { new Boolean(true), new Integer(5) });
// add expected exception to avoid suspect strings
- final ExpectedException ex = addExpectedException("I have been thrown");
+ final IgnoredException ex = IgnoredException.addIgnoredException("I have been thrown");
replicate1.invoke(DistributedRegionFunctionExecutionDUnitTest.class,
"executeFunctionFunctionInvocationTargetException");
ex.remove();
@@ -361,7 +366,7 @@ public class DistributedRegionFunctionExecutionDUnitTest extends
new Integer(0) });
// add expected exception to avoid suspect strings
- final ExpectedException ex = addExpectedException("I have been thrown");
+ final IgnoredException ex = IgnoredException.addIgnoredException("I have been thrown");
replicate1.invoke(DistributedRegionFunctionExecutionDUnitTest.class,
"executeFunctionFunctionInvocationTargetExceptionWithoutHA");
ex.remove();
@@ -401,7 +406,7 @@ public class DistributedRegionFunctionExecutionDUnitTest extends
"registerFunction", new Object[] { new Boolean(true), new Integer(5) });
// add expected exception to avoid suspect strings
- final ExpectedException ex = addExpectedException("I have been thrown");
+ final IgnoredException ex = IgnoredException.addIgnoredException("I have been thrown");
executeFunctionFunctionInvocationTargetException();
ex.remove();
}
@@ -443,7 +448,7 @@ public class DistributedRegionFunctionExecutionDUnitTest extends
new Integer(0) });
// add expected exception to avoid suspect strings
- final ExpectedException ex = addExpectedException("I have been thrown");
+ final IgnoredException ex = IgnoredException.addIgnoredException("I have been thrown");
executeFunctionFunctionInvocationTargetExceptionWithoutHA();
ex.remove();
}
@@ -531,9 +536,9 @@ public class DistributedRegionFunctionExecutionDUnitTest extends
replicate1.invoke(DistributedRegionFunctionExecutionDUnitTest.class,
"disconnect");
- DistributedTestCase.join(async[0], 50 * 1000, getLogWriter());
+ Threads.join(async[0], 50 * 1000);
if (async[0].getException() != null) {
- fail("UnExpected Exception Occured : ", async[0].getException());
+ Assert.fail("UnExpected Exception Occured : ", async[0].getException());
}
List l = (List)async[0].getReturnValue();
assertEquals(5001, l.size());
@@ -634,9 +639,9 @@ public class DistributedRegionFunctionExecutionDUnitTest extends
createClientAndPopulateClientRegion(DataPolicy.EMPTY, port1, port2);
// add ExpectedException's to servers since client can connect to any
// one of those
- final ExpectedException expectedEx = addExpectedException(
+ final IgnoredException expectedEx = IgnoredException.addIgnoredException(
"did not send last result", empty1);
- final ExpectedException expectedEx2 = addExpectedException(
+ final IgnoredException expectedEx2 = IgnoredException.addIgnoredException(
"did not send last result", empty2);
try {
executeFunction_NoLastResult();
@@ -687,9 +692,9 @@ public class DistributedRegionFunctionExecutionDUnitTest extends
"startServerHA");
emptyServer1.invoke(DistributedRegionFunctionExecutionDUnitTest.class,
"closeCacheHA");
- DistributedTestCase.join(async[0], 4 * 60 * 1000, getLogWriter());
+ Threads.join(async[0], 4 * 60 * 1000);
if (async[0].getException() != null) {
- fail("UnExpected Exception Occured : ", async[0].getException());
+ Assert.fail("UnExpected Exception Occured : ", async[0].getException());
}
List l = (List)async[0].getReturnValue();
assertEquals(5001, l.size());
@@ -730,7 +735,7 @@ public class DistributedRegionFunctionExecutionDUnitTest extends
createClientAndPopulateClientRegion(DataPolicy.EMPTY, port1, port2);
// add expected exception
- final ExpectedException ex = addExpectedException(
+ final IgnoredException ex = IgnoredException.addIgnoredException(
"DataPolicy.NORMAL is not supported");
try {
executeFunction();
@@ -846,7 +851,7 @@ public class DistributedRegionFunctionExecutionDUnitTest extends
createClientAndPopulateClientRegion(DataPolicy.EMPTY, port1, port2);
// add expected exception to avoid suspect strings
- final ExpectedException ex = addExpectedException("I have been thrown");
+ final IgnoredException ex = IgnoredException.addIgnoredException("I have been thrown");
executeFunctionFunctionInvocationTargetException_ClientServer();
ex.remove();
}
@@ -897,7 +902,7 @@ public class DistributedRegionFunctionExecutionDUnitTest extends
createClientAndPopulateClientRegion(DataPolicy.EMPTY, port1, port2);
// add expected exception to avoid suspect strings
- final ExpectedException ex = addExpectedException("I have been thrown");
+ final IgnoredException ex = IgnoredException.addIgnoredException("I have been thrown");
executeFunctionFunctionInvocationTargetException_ClientServer_WithoutHA();
ex.remove();
}
@@ -939,7 +944,7 @@ public class DistributedRegionFunctionExecutionDUnitTest extends
"registerFunction", new Object[] { new Boolean(true), new Integer(5) });
// add expected exception to avoid suspect strings
- final ExpectedException ex = addExpectedException("I have been thrown");
+ final IgnoredException ex = IgnoredException.addIgnoredException("I have been thrown");
executeFunctionFunctionInvocationTargetException_ClientServer();
ex.remove();
}
@@ -989,7 +994,7 @@ public class DistributedRegionFunctionExecutionDUnitTest extends
new Integer(0) });
// add expected exception to avoid suspect strings
- final ExpectedException ex = addExpectedException("I have been thrown");
+ final IgnoredException ex = IgnoredException.addIgnoredException("I have been thrown");
executeFunctionFunctionInvocationTargetException_ClientServer_WithoutHA();
ex.remove();
}
@@ -1079,7 +1084,7 @@ public class DistributedRegionFunctionExecutionDUnitTest extends
}
public void testFunctionWithNoResultThrowsException(){
- addExpectedException("RuntimeException");
+ IgnoredException.addIgnoredException("RuntimeException");
replicate1.invoke(DistributedRegionFunctionExecutionDUnitTest.class,
"createCacheInVm");
replicate2.invoke(DistributedRegionFunctionExecutionDUnitTest.class,
@@ -1097,7 +1102,7 @@ public class DistributedRegionFunctionExecutionDUnitTest extends
createClientAndPopulateClientRegion(DataPolicy.EMPTY, port1, port2);
executeFunctionWithNoResultThrowException();
- pause(10000);
+ Wait.pause(10000);
}
public static void executeFunction_NoResult() {
@@ -1134,7 +1139,7 @@ public class DistributedRegionFunctionExecutionDUnitTest extends
catch (Exception e) {
getLogWriter().info("Exception Occured : " + e.getMessage());
e.printStackTrace();
- fail("Test failed", e);
+ Assert.fail("Test failed", e);
}
}
@@ -1314,7 +1319,7 @@ public class DistributedRegionFunctionExecutionDUnitTest extends
}
catch (Exception e) {
e.printStackTrace();
- fail("This is not expected Exception", e);
+ Assert.fail("This is not expected Exception", e);
}
}
@@ -1344,7 +1349,7 @@ public class DistributedRegionFunctionExecutionDUnitTest extends
}
catch (Exception e) {
e.printStackTrace();
- fail("This is not expected Exception", e);
+ Assert.fail("This is not expected Exception", e);
}
}
@@ -1459,7 +1464,7 @@ public class DistributedRegionFunctionExecutionDUnitTest extends
server.start();
}
catch (IOException e) {
- fail("Failed to start the Server", e);
+ Assert.fail("Failed to start the Server", e);
}
assertTrue(server.isRunning());
return new Integer(server.getPort());
@@ -1496,7 +1501,7 @@ public class DistributedRegionFunctionExecutionDUnitTest extends
FunctionService.registerFunction(function);
}
catch (Exception e) {
- fail(
+ Assert.fail(
"DistributedRegionFunctionExecutionDUnitTest#createCache() Failed while creating the cache",
e);
}
@@ -1515,7 +1520,7 @@ public class DistributedRegionFunctionExecutionDUnitTest extends
return excuse;
}
};
- DistributedTestCase.waitForCriterion(wc, 3000, 200, false);
+ Wait.waitForCriterion(wc, 3000, 200, false);
long endTime = System.currentTimeMillis();
region.getCache().getLogger().fine(
"Time wait for Cache Close = " + (endTime - startTime));
@@ -1534,7 +1539,7 @@ public class DistributedRegionFunctionExecutionDUnitTest extends
return excuse;
}
};
- DistributedTestCase.waitForCriterion(wc, 2000, 500, false);
+ Wait.waitForCriterion(wc, 2000, 500, false);
Collection bridgeServers = cache.getCacheServers();
getLogWriter().info(
"Start Server Bridge Servers list : " + bridgeServers.size());
@@ -1561,7 +1566,7 @@ public class DistributedRegionFunctionExecutionDUnitTest extends
return excuse;
}
};
- DistributedTestCase.waitForCriterion(wc, 1000, 200, false);
+ Wait.waitForCriterion(wc, 1000, 200, false);
try {
Iterator iter = cache.getCacheServers().iterator();
if (iter.hasNext()) {
@@ -1586,7 +1591,7 @@ public class DistributedRegionFunctionExecutionDUnitTest extends
return excuse;
}
};
- DistributedTestCase.waitForCriterion(wc, 1000, 200, false);
+ Wait.waitForCriterion(wc, 1000, 200, false);
if (cache != null && !cache.isClosed()) {
try {
Iterator iter = cache.getCacheServers().iterator();
@@ -1616,7 +1621,7 @@ public class DistributedRegionFunctionExecutionDUnitTest extends
return excuse;
}
};
- DistributedTestCase.waitForCriterion(wc, 2000, 200, false);
+ Wait.waitForCriterion(wc, 2000, 200, false);
long endTime = System.currentTimeMillis();
region.getCache().getLogger().fine(
"Time wait for Disconnecting = " + (endTime - startTime));
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/FunctionServiceStatsDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/FunctionServiceStatsDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/FunctionServiceStatsDUnitTest.java
index 3c36a60..5b8f585 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/FunctionServiceStatsDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/FunctionServiceStatsDUnitTest.java
@@ -52,11 +52,12 @@ import com.gemstone.gemfire.internal.cache.PartitionedRegion;
import com.gemstone.gemfire.internal.cache.PartitionedRegionTestHelper;
import com.gemstone.gemfire.internal.cache.functions.TestFunction;
import com.gemstone.gemfire.internal.cache.tier.sockets.CacheServerTestUtil;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
+import com.gemstone.gemfire.test.dunit.Assert;
import com.gemstone.gemfire.test.dunit.Host;
import com.gemstone.gemfire.test.dunit.SerializableCallable;
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;
/*
* This is DUnite Test to test the Function Execution stats under various
@@ -398,13 +399,13 @@ public class FunctionServiceStatsDUnitTest extends PRClientServerTestBase{
server.start();
}
catch (IOException e) {
- fail("Failed to start the Server", e);
+ Assert.fail("Failed to start the Server", e);
}
assertTrue(server.isRunning());
return new Integer(server.getPort());
}
catch (Exception e) {
- fail(
+ Assert.fail(
"FunctionServiceStatsDUnitTest#createCache() Failed while creating the cache",
e);
throw e;
@@ -460,7 +461,7 @@ public class FunctionServiceStatsDUnitTest extends PRClientServerTestBase{
return Boolean.TRUE;
}
catch (Exception e) {
- fail(
+ Assert.fail(
"FunctionServiceStatsDUnitTest#createCache() Failed while creating the cache",
e);
throw e;
@@ -517,12 +518,12 @@ public class FunctionServiceStatsDUnitTest extends PRClientServerTestBase{
}
catch (FunctionException e) {
e.printStackTrace();
- fail("test failed due to", e);
+ Assert.fail("test failed due to", e);
throw e;
}
catch (Exception e) {
e.printStackTrace();
- fail("test failed due to", e);
+ Assert.fail("test failed due to", e);
throw e;
}
@@ -1028,12 +1029,12 @@ public class FunctionServiceStatsDUnitTest extends PRClientServerTestBase{
}
catch (FunctionException e) {
e.printStackTrace();
- fail("test failed due to", e);
+ Assert.fail("test failed due to", e);
return Boolean.FALSE;
}
catch (Exception e) {
e.printStackTrace();
- fail("test failed due to", e);
+ Assert.fail("test failed due to", e);
return Boolean.FALSE;
}
@@ -1090,7 +1091,7 @@ public class FunctionServiceStatsDUnitTest extends PRClientServerTestBase{
assertNotNull(ds);
}
catch (Exception e) {
- fail("Failed while creating the Distribued System", e);
+ Assert.fail("Failed while creating the Distribued System", e);
}
return Boolean.TRUE;
}
@@ -1149,7 +1150,7 @@ public class FunctionServiceStatsDUnitTest extends PRClientServerTestBase{
catch (Exception e) {
getLogWriter().info("Exception Occured : " + e.getMessage());
e.printStackTrace();
- fail("Test failed", e);
+ Assert.fail("Test failed", e);
}
return Boolean.TRUE;
}
@@ -1296,7 +1297,7 @@ public class FunctionServiceStatsDUnitTest extends PRClientServerTestBase{
return excuse;
}
};
- DistributedTestCase.waitForCriterion(wc, 20000, 1000, false);
+ Wait.waitForCriterion(wc, 20000, 1000, false);
rc.getResult();
}
catch (Exception expected) {
@@ -1365,7 +1366,7 @@ public class FunctionServiceStatsDUnitTest extends PRClientServerTestBase{
// this tear down is geeting used in client server mode. this is making use of
// cache object for client server
//For P2P, i have added separate closeDistributedSystem method
- public void tearDown2() throws Exception {
- super.tearDown2();
+ public void tearDownBeforeDisconnect() throws Exception {
+ super.tearDownBeforeDisconnect();
}
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/LocalDataSetDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/LocalDataSetDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/LocalDataSetDUnitTest.java
index 5dfb429..cb63a35 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/LocalDataSetDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/LocalDataSetDUnitTest.java
@@ -44,6 +44,7 @@ import com.gemstone.gemfire.cache30.CacheTestCase;
import com.gemstone.gemfire.distributed.DistributedSystem;
import com.gemstone.gemfire.internal.cache.PartitionedRegion;
import com.gemstone.gemfire.internal.cache.functions.LocalDataSetFunction;
+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.SerializableCallable;
@@ -204,7 +205,7 @@ public class LocalDataSetDUnitTest extends CacheTestCase {
}
catch (Exception e) {
e.printStackTrace();
- fail("Test failed due to ", e);
+ Assert.fail("Test failed due to ", e);
}
}
private void registerFunctions() {
@@ -249,7 +250,7 @@ public class LocalDataSetDUnitTest extends CacheTestCase {
assertNotNull(cache);
}
catch (Exception e) {
- fail("Failed while creating the cache", e);
+ Assert.fail("Failed while creating the cache", e);
}
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/LocalDataSetIndexingDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/LocalDataSetIndexingDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/LocalDataSetIndexingDUnitTest.java
index 8b0d4ba..1d933e3 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/LocalDataSetIndexingDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/LocalDataSetIndexingDUnitTest.java
@@ -124,7 +124,7 @@ public class LocalDataSetIndexingDUnitTest extends CacheTestCase {
"/pr2 e2");
}
catch (Exception e) {
- fail("Test failed due to Exception in index creation ", e);
+ com.gemstone.gemfire.test.dunit.Assert.fail("Test failed due to Exception in index creation ", e);
}
}
};
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/LocalFunctionExecutionDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/LocalFunctionExecutionDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/LocalFunctionExecutionDUnitTest.java
index f58d349..d77be54 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/LocalFunctionExecutionDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/LocalFunctionExecutionDUnitTest.java
@@ -34,8 +34,10 @@ import com.gemstone.gemfire.cache.execute.ResultCollector;
import com.gemstone.gemfire.distributed.DistributedMember;
import com.gemstone.gemfire.distributed.DistributedSystem;
import com.gemstone.gemfire.internal.cache.functions.TestFunction;
+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.SerializableRunnable;
import com.gemstone.gemfire.test.dunit.VM;
@@ -96,7 +98,7 @@ public class LocalFunctionExecutionDUnitTest extends DistributedTestCase{
assertNotNull(cache);
}
catch (Exception e) {
- fail("Failed while creating the cache", e);
+ Assert.fail("Failed while creating the cache", e);
}
}
@@ -144,7 +146,7 @@ public class LocalFunctionExecutionDUnitTest extends DistributedTestCase{
FunctionService.registerFunction(function1);
ResultCollector rc = FunctionService.onRegion(region).withArgs(Boolean.TRUE).execute(function1.getId());
rc.getResult();
- fail("Exception should occur",new Exception("Test Failed"));
+ Assert.fail("Exception should occur",new Exception("Test Failed"));
}
catch (Exception e) {
assertTrue(e.getMessage().contains("I have been thrown from TestFunction"));
@@ -158,7 +160,7 @@ public class LocalFunctionExecutionDUnitTest extends DistributedTestCase{
DistributedMember localmember = system.getDistributedMember();
ResultCollector rc = FunctionService.onMember(system, localmember).withArgs(Boolean.TRUE).execute(function1.getId());
rc.getResult();
- fail("Exception should occur",new Exception("Test Failed"));
+ Assert.fail("Exception should occur",new Exception("Test Failed"));
}
catch (Exception e) {
assertTrue(e.getMessage().contains("I have been thrown from TestFunction"));
@@ -166,13 +168,13 @@ public class LocalFunctionExecutionDUnitTest extends DistributedTestCase{
}
}
- public void tearDown2() throws Exception {
- super.tearDown2();
+ public void tearDownBeforeDisconnect() throws Exception {
+ super.tearDownBeforeDisconnect();
if(cache != null) {
cache.close();
}
cache = null;
- invokeInEveryVM(new SerializableRunnable() { public void run() {
+ Invoke.invokeInEveryVM(new SerializableRunnable() { public void run() {
if(cache != null) {
cache.close();
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/MemberFunctionExecutionDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/MemberFunctionExecutionDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/MemberFunctionExecutionDUnitTest.java
index 9508726..7e8725c 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/MemberFunctionExecutionDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/MemberFunctionExecutionDUnitTest.java
@@ -48,6 +48,7 @@ import com.gemstone.gemfire.i18n.LogWriterI18n;
import com.gemstone.gemfire.internal.ClassBuilder;
import com.gemstone.gemfire.internal.cache.functions.TestFunction;
import com.gemstone.gemfire.internal.i18n.LocalizedStrings;
+import com.gemstone.gemfire.test.dunit.Assert;
import com.gemstone.gemfire.test.dunit.Host;
import com.gemstone.gemfire.test.dunit.SerializableCallable;
import com.gemstone.gemfire.test.dunit.SerializableRunnable;
@@ -340,7 +341,7 @@ public class MemberFunctionExecutionDUnitTest extends CacheTestCase {
fail("Should have seen an exception");
} catch (Exception e) {
if(!(e.getCause() instanceof FunctionInvocationTargetException)) {
- fail("failed", e);
+ Assert.fail("failed", e);
}
}
@@ -396,7 +397,7 @@ public class MemberFunctionExecutionDUnitTest extends CacheTestCase {
catch (Exception e) {
getLogWriter().info("Exception Occured : "+ e.getMessage());
e.printStackTrace();
- fail("Test failed",e);
+ Assert.fail("Test failed",e);
}
}
/*
@@ -452,7 +453,7 @@ public class MemberFunctionExecutionDUnitTest extends CacheTestCase {
catch (Exception e) {
getLogWriter().info("Exception Occured : "+ e.getMessage());
e.printStackTrace();
- fail("Test failed",e);
+ Assert.fail("Test failed",e);
}
}
@@ -492,7 +493,7 @@ public class MemberFunctionExecutionDUnitTest extends CacheTestCase {
catch (Exception e) {
getLogWriter().info("Exception Occured : "+ e.getMessage());
e.printStackTrace();
- fail("Test failed",e);
+ Assert.fail("Test failed",e);
}
}
@@ -594,7 +595,7 @@ public class MemberFunctionExecutionDUnitTest extends CacheTestCase {
catch (Exception e) {
getLogWriter().info("Exception Occured : "+ e.getMessage());
e.printStackTrace();
- fail("Test failed",e);
+ Assert.fail("Test failed",e);
}
}
@@ -658,20 +659,20 @@ public class MemberFunctionExecutionDUnitTest extends CacheTestCase {
FunctionService.registerFunction(new TestFunction(true,TestFunction.TEST_FUNCTION_NO_LASTRESULT));
}
catch (Exception e) {
- fail("Failed while creating the Distribued System", e);
+ Assert.fail("Failed while creating the Distribued System", e);
}
return ds;
}
@Override
- public void tearDown2() throws Exception {
+ public void tearDownBeforeDisconnect() throws Exception {
List<VM> members = new ArrayList<VM>(4);
members.add(member1); members.add(member2); members.add(member3); members.add(member4);
for (VM member: members) {
member.invoke(MemberFunctionExecutionDUnitTest.class, "registerExpectedExceptions",
new Object[] { Boolean.FALSE });
}
- super.tearDown2();
+ super.tearDownBeforeDisconnect();
disconnectAllFromDS();
}
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/MultiRegionFunctionExecutionDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/MultiRegionFunctionExecutionDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/MultiRegionFunctionExecutionDUnitTest.java
index b9f0dc2..c6c7d49 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/MultiRegionFunctionExecutionDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/MultiRegionFunctionExecutionDUnitTest.java
@@ -35,6 +35,7 @@ import com.gemstone.gemfire.cache30.CacheTestCase;
import com.gemstone.gemfire.distributed.DistributedSystem;
import com.gemstone.gemfire.internal.Assert;
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;
@@ -70,10 +71,10 @@ public class MultiRegionFunctionExecutionDUnitTest extends CacheTestCase {
vm3 = host.getVM(3);
}
- public void tearDown2() throws Exception {
- super.tearDown2();
+ public void tearDownBeforeDisconnect() throws Exception {
+ super.tearDownBeforeDisconnect();
cache = null;
- invokeInEveryVM(new SerializableRunnable() { public void run() { cache = null; } });
+ Invoke.invokeInEveryVM(new SerializableRunnable() { public void run() { cache = null; } });
}
public void testMultiRegionFunctionExecution(){
@@ -153,7 +154,7 @@ public class MultiRegionFunctionExecutionDUnitTest extends CacheTestCase {
assertNotNull(cache);
}
catch (Exception e) {
- fail("Failed while creating the cache", e);
+ com.gemstone.gemfire.test.dunit.Assert.fail("Failed while creating the cache", e);
}
}
@SuppressWarnings("unchecked")
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/OnGroupsFunctionExecutionDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/OnGroupsFunctionExecutionDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/OnGroupsFunctionExecutionDUnitTest.java
index fd5b1a4..1b8a652 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/OnGroupsFunctionExecutionDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/OnGroupsFunctionExecutionDUnitTest.java
@@ -43,10 +43,15 @@ import com.gemstone.gemfire.distributed.Locator;
import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem;
import com.gemstone.gemfire.internal.AvailablePortHelper;
import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
+import com.gemstone.gemfire.test.dunit.DUnitEnv;
import com.gemstone.gemfire.test.dunit.DistributedTestCase;
+import com.gemstone.gemfire.test.dunit.IgnoredException;
import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.Invoke;
import com.gemstone.gemfire.test.dunit.SerializableCallable;
import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
/**
*
@@ -59,8 +64,8 @@ public class OnGroupsFunctionExecutionDUnitTest extends DistributedTestCase {
}
@Override
- public void tearDown2() throws Exception {
- invokeInEveryVM(new SerializableCallable() {
+ public void tearDownBeforeDisconnect() throws Exception {
+ Invoke.invokeInEveryVM(new SerializableCallable() {
@Override
public Object call() throws Exception {
Cache c = null;
@@ -492,7 +497,7 @@ public class OnGroupsFunctionExecutionDUnitTest extends DistributedTestCase {
//The test function deliberately throws a null pointer exception.
//which is logged.
- addExpectedException(NullPointerException.class.getSimpleName());
+ IgnoredException.addIgnoredException(NullPointerException.class.getSimpleName());
initVM(vm0, "g0,mg", regionName, false);
initVM(vm1, "g1", regionName, false);
@@ -684,7 +689,7 @@ public class OnGroupsFunctionExecutionDUnitTest extends DistributedTestCase {
ClientCacheFactory ccf = new ClientCacheFactory();
ccf.addPoolLocator(hostName, locatorPort);
ccf.setPoolServerGroup("mg");
- ccf.set("log-level", getDUnitLogLevel());
+ ccf.set("log-level", DUnitEnv.getDUnitLogLevel());
ClientCache c = ccf.create();
c.getLogger().info("SWAP:invoking function from client on g0");
@@ -782,7 +787,7 @@ public class OnGroupsFunctionExecutionDUnitTest extends DistributedTestCase {
ClientCacheFactory ccf = new ClientCacheFactory();
ccf.addPoolLocator(hostName, locatorPort);
ccf.setPoolServerGroup("mg");
- ccf.set("log-level", getDUnitLogLevel());
+ ccf.set("log-level", DUnitEnv.getDUnitLogLevel());
ClientCache c = ccf.create();
c.getLogger().info("SWAP:invoking function from client on g0");
@@ -859,10 +864,10 @@ public class OnGroupsFunctionExecutionDUnitTest extends DistributedTestCase {
ClientCacheFactory ccf = new ClientCacheFactory();
ccf.addPoolLocator(hostName, locatorPort);
ccf.setPoolServerGroup("mg");
- ccf.set("log-level", getDUnitLogLevel());
+ ccf.set("log-level", DUnitEnv.getDUnitLogLevel());
ClientCache c = ccf.create();
- ExpectedException ex = addExpectedException("No member found");
+ IgnoredException ex = IgnoredException.addIgnoredException("No member found");
try {
InternalFunctionService.onServer(c, "no such group").execute(new OnGroupsFunction()).getResult();
fail("expected exception not thrown");
@@ -939,10 +944,10 @@ public class OnGroupsFunctionExecutionDUnitTest extends DistributedTestCase {
ClientCacheFactory ccf = new ClientCacheFactory();
ccf.addPoolLocator(hostName, locatorPort);
ccf.setPoolServerGroup("mg");
- ccf.set("log-level", getDUnitLogLevel());
+ ccf.set("log-level", DUnitEnv.getDUnitLogLevel());
ClientCache c = ccf.create();
- ExpectedException expected = addExpectedException("No member found");
+ IgnoredException expected = IgnoredException.addIgnoredException("No member found");
try {
InternalFunctionService.onServers(c, "no such group").execute(new OnGroupsFunction()).getResult();
fail("expected exception not thrown");
@@ -951,7 +956,7 @@ public class OnGroupsFunctionExecutionDUnitTest extends DistributedTestCase {
expected.remove();
}
- addExpectedException("NullPointerException");
+ IgnoredException.addIgnoredException("NullPointerException");
Execution e = InternalFunctionService.onServers(c, "mg");
ArrayList<String> args = new ArrayList<String>();
args.add("runtime");
@@ -1016,7 +1021,7 @@ public class OnGroupsFunctionExecutionDUnitTest extends DistributedTestCase {
ClientCacheFactory ccf = new ClientCacheFactory();
ccf.addPoolLocator(hostName, locatorPort);
ccf.setPoolServerGroup("mg");
- ccf.set("log-level", getDUnitLogLevel());
+ ccf.set("log-level", DUnitEnv.getDUnitLogLevel());
ClientCache c = ccf.create();
Execution e = InternalFunctionService.onServers(c, "g1");
@@ -1024,7 +1029,7 @@ public class OnGroupsFunctionExecutionDUnitTest extends DistributedTestCase {
args.add("disconnect");
e = e.withArgs(args);
- addExpectedException("FunctionInvocationTargetException");
+ IgnoredException.addIgnoredException("FunctionInvocationTargetException");
try {
e.execute(new OnGroupsExceptionFunction()).getResult();
fail("expected exception not thrown");
@@ -1065,7 +1070,7 @@ public class OnGroupsFunctionExecutionDUnitTest extends DistributedTestCase {
ClientCacheFactory ccf = new ClientCacheFactory();
ccf.addPoolLocator(hostName, locatorPort);
ccf.setPoolServerGroup("mg");
- ccf.set("log-level", getDUnitLogLevel());
+ ccf.set("log-level", DUnitEnv.getDUnitLogLevel());
ClientCache c = ccf.create();
Execution e = InternalFunctionService.onServers(c, "g1");
@@ -1073,7 +1078,7 @@ public class OnGroupsFunctionExecutionDUnitTest extends DistributedTestCase {
args.add("disconnect");
args.add("g2");
e = e.withArgs(args);
- addExpectedException("FunctionInvocationTargetException");
+ IgnoredException.addIgnoredException("FunctionInvocationTargetException");
try {
e.execute(new OnGroupsExceptionFunction()).getResult();
fail("expected exception not thrown");
@@ -1114,7 +1119,7 @@ public class OnGroupsFunctionExecutionDUnitTest extends DistributedTestCase {
ClientCacheFactory ccf = new ClientCacheFactory();
ccf.addPoolLocator(hostName, locatorPort);
ccf.setPoolServerGroup("mg");
- ccf.set("log-level", getDUnitLogLevel());
+ ccf.set("log-level", DUnitEnv.getDUnitLogLevel());
ClientCache c = ccf.create();
Execution e = InternalFunctionService.onServers(c, "g1");
@@ -1152,7 +1157,7 @@ public class OnGroupsFunctionExecutionDUnitTest extends DistributedTestCase {
public void testNoAckGroupsFunction() {
//Workaround for #52005. This is a product bug
//that should be fixed
- addExpectedException("Cannot return any result");
+ IgnoredException.addIgnoredException("Cannot return any result");
Host host = Host.getHost(0);
final VM server0 = host.getVM(0);
final VM server1 = host.getVM(1);
@@ -1181,7 +1186,7 @@ public class OnGroupsFunctionExecutionDUnitTest extends DistributedTestCase {
ClientCacheFactory ccf = new ClientCacheFactory();
ccf.addPoolLocator(hostName, locatorPort);
ccf.setPoolServerGroup("mg");
- ccf.set("log-level", getDUnitLogLevel());
+ ccf.set("log-level", DUnitEnv.getDUnitLogLevel());
ClientCache c = ccf.create();
c.getLogger().info("SWAP:invoking function from client on g0");
@@ -1203,7 +1208,7 @@ public class OnGroupsFunctionExecutionDUnitTest extends DistributedTestCase {
return "OnGroupsNoAck invocation count mismatch";
}
};
- DistributedTestCase.waitForCriterion(wc, 30000, 1000, true);
+ Wait.waitForCriterion(wc, 30000, 1000, true);
resetInvocationCount(server0);
resetInvocationCount(server1);
@@ -1219,7 +1224,7 @@ public class OnGroupsFunctionExecutionDUnitTest extends DistributedTestCase {
}
});
// pause here to verify that we do not get more than 1 invocation
- DistributedTestCase.pause(5000);
+ Wait.pause(5000);
WaitCriterion wc2 = new WaitCriterion() {
@Override
public boolean done() {
@@ -1233,7 +1238,7 @@ public class OnGroupsFunctionExecutionDUnitTest extends DistributedTestCase {
return "OnGroupsNoAck invocation count mismatch";
}
};
- DistributedTestCase.waitForCriterion(wc2, 30000, 1000, true);
+ Wait.waitForCriterion(wc2, 30000, 1000, true);
resetInvocationCount(server0);
resetInvocationCount(server1);
resetInvocationCount(server2);
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRClientServerFunctionExecutionNoAckDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRClientServerFunctionExecutionNoAckDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRClientServerFunctionExecutionNoAckDUnitTest.java
index d923eda..2b03e30 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRClientServerFunctionExecutionNoAckDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRClientServerFunctionExecutionNoAckDUnitTest.java
@@ -251,8 +251,8 @@ public class PRClientServerFunctionExecutionNoAckDUnitTest extends PRClientServe
}
}
- public void tearDown2() throws Exception {
- super.tearDown2();
+ public void tearDownBeforeDisconnect() throws Exception {
+ super.tearDownBeforeDisconnect();
}
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRClientServerRegionFunctionExecutionDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRClientServerRegionFunctionExecutionDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRClientServerRegionFunctionExecutionDUnitTest.java
index 72780f1..32710af 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRClientServerRegionFunctionExecutionDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRClientServerRegionFunctionExecutionDUnitTest.java
@@ -56,9 +56,12 @@ import com.gemstone.gemfire.internal.cache.PartitionedRegion;
import com.gemstone.gemfire.internal.cache.functions.TestFunction;
import com.gemstone.gemfire.internal.cache.tier.sockets.CacheServerTestUtil;
import com.gemstone.gemfire.internal.i18n.LocalizedStrings;
+import com.gemstone.gemfire.test.dunit.Assert;
import com.gemstone.gemfire.test.dunit.AsyncInvocation;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
+import com.gemstone.gemfire.test.dunit.IgnoredException;
import com.gemstone.gemfire.test.dunit.SerializableRunnable;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
public class PRClientServerRegionFunctionExecutionDUnitTest extends PRClientServerTestBase {
private static final String TEST_FUNCTION7 = TestFunction.TEST_FUNCTION7;
@@ -211,7 +214,7 @@ public class PRClientServerRegionFunctionExecutionDUnitTest extends PRClientServ
isByName = new Boolean(true);
toRegister = new Boolean(true);
- final ExpectedException ex = addExpectedException("did not send last result");
+ final IgnoredException ex = IgnoredException.addIgnoredException("did not send last result");
client.invoke(PRClientServerRegionFunctionExecutionDUnitTest.class,
"serverSingleKeyExecution_NoLastResult", new Object[] { isByName,
toRegister });
@@ -522,7 +525,7 @@ public class PRClientServerRegionFunctionExecutionDUnitTest extends PRClientServ
} catch (Exception ex) {
ex.printStackTrace();
getLogWriter().info("Exception : ", ex);
- fail("Test failed after the execute operation", ex);
+ Assert.fail("Test failed after the execute operation", ex);
}
}
@@ -681,7 +684,7 @@ public class PRClientServerRegionFunctionExecutionDUnitTest extends PRClientServ
return excuse;
}
};
- DistributedTestCase.waitForCriterion(wc, 3 * 60 * 1000, 1000, true);
+ Wait.waitForCriterion(wc, 3 * 60 * 1000, 1000, true);
}
public static void executeFunction() throws ServerException,
@@ -872,7 +875,7 @@ public class PRClientServerRegionFunctionExecutionDUnitTest extends PRClientServ
assertEquals(origVals, foundVals);
}catch(Exception e){
- fail("Test failed after the put operation", e);
+ Assert.fail("Test failed after the put operation", e);
}
}
@@ -994,7 +997,7 @@ public class PRClientServerRegionFunctionExecutionDUnitTest extends PRClientServ
}
}catch(Exception e){
- fail("Test failed after the put operation", e);
+ Assert.fail("Test failed after the put operation", e);
}
}
@@ -1024,7 +1027,7 @@ public class PRClientServerRegionFunctionExecutionDUnitTest extends PRClientServ
}catch (Exception ex) {
ex.printStackTrace();
getLogWriter().info("Exception : " , ex);
- fail("Test failed after the put operation",ex);
+ Assert.fail("Test failed after the put operation",ex);
}
}
@@ -1127,7 +1130,7 @@ public class PRClientServerRegionFunctionExecutionDUnitTest extends PRClientServ
}
catch (Throwable e) {
e.printStackTrace();
- fail("This is not expected Exception", e);
+ Assert.fail("This is not expected Exception", e);
}
}
@@ -1163,7 +1166,7 @@ public class PRClientServerRegionFunctionExecutionDUnitTest extends PRClientServ
.toLocalizedString("return any"))));
}
catch (Exception notexpected) {
- fail("Test failed during execute or sleeping", notexpected);
+ Assert.fail("Test failed during execute or sleeping", notexpected);
} finally {
cache.getLogger().info("<ExpectedException action=remove>" +
"FunctionException" +
@@ -1246,7 +1249,7 @@ public class PRClientServerRegionFunctionExecutionDUnitTest extends PRClientServ
}catch (Exception ex) {
ex.printStackTrace();
getLogWriter().info("Exception : " , ex);
- fail("Test failed after the put operation",ex);
+ Assert.fail("Test failed after the put operation",ex);
}
}
@@ -1301,7 +1304,7 @@ public class PRClientServerRegionFunctionExecutionDUnitTest extends PRClientServ
catch (Exception ex) {
ex.printStackTrace();
getLogWriter().info("Exception : ", ex);
- fail("Test failed after the put operation", ex);
+ Assert.fail("Test failed after the put operation", ex);
}
try {
@@ -1321,7 +1324,7 @@ public class PRClientServerRegionFunctionExecutionDUnitTest extends PRClientServ
catch (Exception ex) {
ex.printStackTrace();
getLogWriter().info("Exception : ", ex);
- fail("Test failed after the put operation", ex);
+ Assert.fail("Test failed after the put operation", ex);
}
}
@@ -1383,7 +1386,7 @@ public class PRClientServerRegionFunctionExecutionDUnitTest extends PRClientServ
}catch (Exception ex) {
ex.printStackTrace();
getLogWriter().info("Exception : " , ex);
- fail("Test failed after the put operation",ex);
+ Assert.fail("Test failed after the put operation",ex);
}
Region region2 = cache.getRegion(PartitionedRegionName+"2");
@@ -1454,7 +1457,7 @@ public class PRClientServerRegionFunctionExecutionDUnitTest extends PRClientServ
}
catch (Exception ex) {
ex.printStackTrace();
- fail("This is not expected Exception", ex);
+ Assert.fail("This is not expected Exception", ex);
}
}
@@ -1557,7 +1560,7 @@ public class PRClientServerRegionFunctionExecutionDUnitTest extends PRClientServ
}catch (Exception ex) {
ex.printStackTrace();
getLogWriter().info("Exception : " , ex);
- fail("Test failed after the put operation",ex);
+ Assert.fail("Test failed after the put operation",ex);
}
}
@@ -1634,8 +1637,8 @@ public class PRClientServerRegionFunctionExecutionDUnitTest extends PRClientServ
}
@Override
- public void tearDown2() throws Exception {
- super.tearDown2();
+ public void tearDownBeforeDisconnect() throws Exception {
+ super.tearDownBeforeDisconnect();
}
/**
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRClientServerRegionFunctionExecutionFailoverDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRClientServerRegionFunctionExecutionFailoverDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRClientServerRegionFunctionExecutionFailoverDUnitTest.java
index 5ee1472..f9b7d63 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRClientServerRegionFunctionExecutionFailoverDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRClientServerRegionFunctionExecutionFailoverDUnitTest.java
@@ -44,10 +44,14 @@ import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
import com.gemstone.gemfire.internal.cache.LocalRegion;
import com.gemstone.gemfire.internal.cache.functions.TestFunction;
import com.gemstone.gemfire.internal.cache.tier.sockets.CacheServerTestUtil;
+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.DUnitEnv;
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.Threads;
import com.gemstone.gemfire.test.dunit.VM;
public class PRClientServerRegionFunctionExecutionFailoverDUnitTest extends
@@ -64,15 +68,15 @@ public class PRClientServerRegionFunctionExecutionFailoverDUnitTest extends
@Override
public void setUp() throws Exception {
super.setUp();
- addExpectedException("Connection reset");
- addExpectedException("SocketTimeoutException");
- addExpectedException("ServerConnectivityException");
- addExpectedException("Socket Closed");
+ IgnoredException.addIgnoredException("Connection reset");
+ IgnoredException.addIgnoredException("SocketTimeoutException");
+ IgnoredException.addIgnoredException("ServerConnectivityException");
+ IgnoredException.addIgnoredException("Socket Closed");
}
@Override
- public void tearDown2() throws Exception {
- super.tearDown2();
+ public void tearDownBeforeDisconnect() throws Exception {
+ super.tearDownBeforeDisconnect();
}
public void testserverMultiKeyExecution_SocektTimeOut() {
@@ -90,7 +94,7 @@ public class PRClientServerRegionFunctionExecutionFailoverDUnitTest extends
*/
public void testServerFailoverWithTwoServerAliveHA()
throws InterruptedException {
- addExpectedException("FunctionInvocationTargetException");
+ IgnoredException.addIgnoredException("FunctionInvocationTargetException");
ArrayList commonAttributes = createCommonServerAttributes(
"TestPartitionedRegion", null, 1, 13, null);
createClientServerScenarion(commonAttributes, 20, 20, 20);
@@ -116,9 +120,9 @@ public class PRClientServerRegionFunctionExecutionFailoverDUnitTest extends
client.invoke(PRClientServerRegionFunctionExecutionDUnitTest.class,
"verifyDeadAndLiveServers", new Object[] { new Integer(1),
new Integer(2) });
- DistributedTestCase.join(async[0], 6 * 60 * 1000, getLogWriter());
+ Threads.join(async[0], 6 * 60 * 1000);
if (async[0].getException() != null) {
- fail("UnExpected Exception Occured : ", async[0].getException());
+ Assert.fail("UnExpected Exception Occured : ", async[0].getException());
}
List l = (List)async[0].getReturnValue();
assertEquals(2, l.size());
@@ -130,7 +134,7 @@ public class PRClientServerRegionFunctionExecutionFailoverDUnitTest extends
*/
public void testServerCacheClosedFailoverWithTwoServerAliveHA()
throws InterruptedException {
- addExpectedException("FunctionInvocationTargetException");
+ IgnoredException.addIgnoredException("FunctionInvocationTargetException");
ArrayList commonAttributes = createCommonServerAttributes(
"TestPartitionedRegion", null, 1, 13, null);
createClientServerScenarion(commonAttributes, 20, 20, 20);
@@ -156,9 +160,9 @@ public class PRClientServerRegionFunctionExecutionFailoverDUnitTest extends
client.invoke(PRClientServerRegionFunctionExecutionDUnitTest.class,
"verifyDeadAndLiveServers", new Object[] { new Integer(1),
new Integer(2) });
- DistributedTestCase.join(async[0], 5 * 60 * 1000, getLogWriter());
+ Threads.join(async[0], 5 * 60 * 1000);
if (async[0].getException() != null) {
- fail("UnExpected Exception Occured : ", async[0].getException());
+ Assert.fail("UnExpected Exception Occured : ", async[0].getException());
}
List l = (List)async[0].getReturnValue();
assertEquals(2, l.size());
@@ -180,7 +184,7 @@ public class PRClientServerRegionFunctionExecutionFailoverDUnitTest extends
public void testOnRegionFailoverWithTwoServerDownHA()
throws InterruptedException {
- addExpectedException("FunctionInvocationTargetException");
+ IgnoredException.addIgnoredException("FunctionInvocationTargetException");
createScenario();
server1.invoke(PRClientServerRegionFunctionExecutionDUnitTest.class,
@@ -194,7 +198,7 @@ public class PRClientServerRegionFunctionExecutionFailoverDUnitTest extends
client.invoke(PRClientServerRegionFunctionExecutionDUnitTest.class,
"createProxyRegion",
- new Object[] { getServerHostName(server1.getHost()) });
+ new Object[] { NetworkSupport.getServerHostName(server1.getHost()) });
Function function = new TestFunction(true,
TestFunction.TEST_FUNCTION_HA_REGION);
@@ -211,7 +215,7 @@ public class PRClientServerRegionFunctionExecutionFailoverDUnitTest extends
// retry attempts is 2
public void testOnRegionFailoverWithOneServerDownHA()
throws InterruptedException {
- addExpectedException("FunctionInvocationTargetException");
+ IgnoredException.addIgnoredException("FunctionInvocationTargetException");
createScenario();
server1.invokeAsync(PRClientServerRegionFunctionExecutionDUnitTest.class,
@@ -225,7 +229,7 @@ public class PRClientServerRegionFunctionExecutionFailoverDUnitTest extends
client.invoke(PRClientServerRegionFunctionExecutionDUnitTest.class,
"createProxyRegion",
- new Object[] { getServerHostName(server1.getHost()) });
+ new Object[] { NetworkSupport.getServerHostName(server1.getHost()) });
Function function = new TestFunction(true,
TestFunction.TEST_FUNCTION_HA_REGION);
@@ -245,7 +249,7 @@ public class PRClientServerRegionFunctionExecutionFailoverDUnitTest extends
*/
public void testOnRegionFailoverNonHA() throws InterruptedException { // See #47489 before enabling it
createScenario();
- addExpectedException("FunctionInvocationTargetException");
+ IgnoredException.addIgnoredException("FunctionInvocationTargetException");
server1.invoke(PRClientServerRegionFunctionExecutionDUnitTest.class,
"createReplicatedRegion");
@@ -257,7 +261,7 @@ public class PRClientServerRegionFunctionExecutionFailoverDUnitTest extends
client.invoke(PRClientServerRegionFunctionExecutionDUnitTest.class,
"createProxyRegion",
- new Object[] { getServerHostName(server1.getHost()) });
+ new Object[] { NetworkSupport.getServerHostName(server1.getHost()) });
Function function = new TestFunction(true,
TestFunction.TEST_FUNCTION_NONHA_REGION);
@@ -290,7 +294,7 @@ public class PRClientServerRegionFunctionExecutionFailoverDUnitTest extends
client.invoke(PRClientServerRegionFunctionExecutionDUnitTest.class,
"createProxyRegion",
- new Object[] { getServerHostName(server1.getHost()) });
+ new Object[] { NetworkSupport.getServerHostName(server1.getHost()) });
//Make sure the buckets are created.
client.invoke(new SerializableRunnable() {
@@ -341,7 +345,7 @@ public class PRClientServerRegionFunctionExecutionFailoverDUnitTest extends
public void testServerBucketMovedException() throws InterruptedException {
- addExpectedException("BucketMovedException");
+ IgnoredException.addIgnoredException("BucketMovedException");
final Host host = Host.getHost(0);
VM server1 = host.getVM(0);
VM server2 = host.getVM(1);
@@ -355,7 +359,7 @@ public class PRClientServerRegionFunctionExecutionFailoverDUnitTest extends
final int portLocator = AvailablePort
.getRandomAvailablePort(AvailablePort.SOCKET);
- final String hostLocator = getServerHostName(server1.getHost());
+ final String hostLocator = NetworkSupport.getServerHostName(server1.getHost());
final String locator = hostLocator + "[" + portLocator + "]";
startLocatorInVM(portLocator);
@@ -400,7 +404,7 @@ public class PRClientServerRegionFunctionExecutionFailoverDUnitTest extends
public void testServerBucketMovedException_LocalServer()
throws InterruptedException {
- addExpectedException("BucketMovedException");
+ IgnoredException.addIgnoredException("BucketMovedException");
final Host host = Host.getHost(0);
VM server1 = host.getVM(0);
@@ -413,7 +417,7 @@ public class PRClientServerRegionFunctionExecutionFailoverDUnitTest extends
final int portLocator = AvailablePort
.getRandomAvailablePort(AvailablePort.SOCKET);
- final String hostLocator = getServerHostName(server1.getHost());
+ final String hostLocator = NetworkSupport.getServerHostName(server1.getHost());
final String locator = hostLocator + "[" + portLocator + "]";
startLocatorInVM(portLocator);
@@ -460,14 +464,14 @@ public class PRClientServerRegionFunctionExecutionFailoverDUnitTest extends
File logFile = new File("locator-" + locatorPort + ".log");
Properties props = new Properties();
- props = getAllDistributedSystemProperties(props);
+ props = DUnitEnv.getAllDistributedSystemProperties(props);
props.setProperty(DistributionConfig.ENABLE_CLUSTER_CONFIGURATION_NAME, "false");
try {
locator = Locator.startLocatorAndDS(locatorPort, logFile, null, props);
}
catch (IOException e) {
- fail("Unable to start locator ", e);
+ Assert.fail("Unable to start locator ", e);
}
}
@@ -492,7 +496,7 @@ public class PRClientServerRegionFunctionExecutionFailoverDUnitTest extends
server.start();
}
catch (IOException e) {
- fail("Failed to start server ", e);
+ Assert.fail("Failed to start server ", e);
}
PartitionAttributesFactory paf = new PartitionAttributesFactory();
if (isAccessor) {