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:25 UTC
[15/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/PartitionedRegionEvictionDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionEvictionDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionEvictionDUnitTest.java
index 5fe0b45..0319171 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionEvictionDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionEvictionDUnitTest.java
@@ -46,11 +46,13 @@ import com.gemstone.gemfire.internal.cache.control.HeapMemoryMonitor;
import com.gemstone.gemfire.internal.cache.control.InternalResourceManager.ResourceType;
import com.gemstone.gemfire.internal.cache.lru.HeapEvictor;
import com.gemstone.gemfire.internal.cache.lru.HeapLRUCapacityController;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
+import com.gemstone.gemfire.test.dunit.Assert;
import com.gemstone.gemfire.test.dunit.Host;
import com.gemstone.gemfire.test.dunit.SerializableCallable;
import com.gemstone.gemfire.test.dunit.SerializableRunnable;
import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
public class PartitionedRegionEvictionDUnitTest extends CacheTestCase {
public PartitionedRegionEvictionDUnitTest(final String name) {
@@ -160,7 +162,7 @@ public class PartitionedRegionEvictionDUnitTest extends CacheTestCase {
return excuse;
}
};
- DistributedTestCase.waitForCriterion(wc, 60000, 1000, true);
+ Wait.waitForCriterion(wc, 60000, 1000, true);
int entriesEvicted = 0;
@@ -298,7 +300,7 @@ public class PartitionedRegionEvictionDUnitTest extends CacheTestCase {
return excuse;
}
};
- DistributedTestCase.waitForCriterion(wc, 60000, 1000, true);
+ Wait.waitForCriterion(wc, 60000, 1000, true);
entriesEvicted = ((AbstractLRURegionMap)pr.entries)._getLruList().stats()
.getEvictions();
@@ -362,7 +364,7 @@ public class PartitionedRegionEvictionDUnitTest extends CacheTestCase {
assertNotNull(pr);
}
catch (final CacheException ex) {
- fail("While creating Partitioned region", ex);
+ Assert.fail("While creating Partitioned region", ex);
}
}
};
@@ -543,7 +545,7 @@ public class PartitionedRegionEvictionDUnitTest extends CacheTestCase {
assertNotNull(pr);
}
catch (final CacheException ex) {
- fail("While creating Partitioned region", ex);
+ Assert.fail("While creating Partitioned region", ex);
}
}
};
@@ -661,7 +663,7 @@ public class PartitionedRegionEvictionDUnitTest extends CacheTestCase {
assertNotNull(pr);
}
catch (final CacheException ex) {
- fail("While creating Partitioned region", ex);
+ Assert.fail("While creating Partitioned region", ex);
}
}
};
@@ -1723,7 +1725,7 @@ public class PartitionedRegionEvictionDUnitTest extends CacheTestCase {
assertNotNull(pr);
}
catch (final CacheException ex) {
- fail("While creating Partitioned region", ex);
+ Assert.fail("While creating Partitioned region", ex);
}
}
};
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionHADUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionHADUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionHADUnitTest.java
index 9ce79e1..b2028d3 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionHADUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionHADUnitTest.java
@@ -36,11 +36,12 @@ import com.gemstone.gemfire.cache30.CacheSerializableRunnable;
import com.gemstone.gemfire.internal.cache.control.InternalResourceManager;
import com.gemstone.gemfire.internal.cache.control.InternalResourceManager.ResourceObserver;
import com.gemstone.gemfire.internal.cache.control.InternalResourceManager.ResourceObserverAdapter;
+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.SerializableCallable;
import com.gemstone.gemfire.test.dunit.SerializableRunnable;
+import com.gemstone.gemfire.test.dunit.Threads;
import com.gemstone.gemfire.test.dunit.VM;
/**
@@ -102,7 +103,7 @@ public class PartitionedRegionHADUnitTest extends PartitionedRegionDUnitTestCase
}
assertNotNull(partitionedregion);
} catch (InterruptedException e) {
- fail("interrupted",e);
+ Assert.fail("interrupted",e);
} finally {
InternalResourceManager.setResourceObserver(null);
}
@@ -219,7 +220,7 @@ public class PartitionedRegionHADUnitTest extends PartitionedRegionDUnitTestCase
fail("recovery didn't happen in 60 seconds");
}
} catch (InterruptedException e) {
- fail("recovery wait interrupted", e);
+ Assert.fail("recovery wait interrupted", e);
} finally {
InternalResourceManager.setResourceObserver(null);
}
@@ -297,7 +298,7 @@ public class PartitionedRegionHADUnitTest extends PartitionedRegionDUnitTestCase
// dataStore1.invoke(addExpectedExceptions);
AsyncInvocation async0 = dataStore0.invokeAsync(dataStore0Puts);
// AsyncInvocation async1 = dataStore1.invokeAsync(dataStore1Puts);
- DistributedTestCase.join(async0, 30 * 1000, getLogWriter());
+ Threads.join(async0, 30 * 1000);
// async1.join();
dataStore0.invoke(removeExpectedExceptions);
// dataStore1.invoke(removeExpectedExceptions);
@@ -317,11 +318,11 @@ public class PartitionedRegionHADUnitTest extends PartitionedRegionDUnitTestCase
async0 = dataStore0.invokeAsync(dataStore0Puts);
// async1 = dataStore1.invokeAsync(dataStore1Puts);
- DistributedTestCase.join(async0, 30 * 1000, getLogWriter());
+ Threads.join(async0, 30 * 1000);
// async1.join();
if (async0.exceptionOccurred()) {
- fail("async0 failed", async0.getException());
+ Assert.fail("async0 failed", async0.getException());
}
// assertFalse(async1.exceptionOccurred());
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionHAFailureAndRecoveryDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionHAFailureAndRecoveryDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionHAFailureAndRecoveryDUnitTest.java
index 726423d..8c49b22 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionHAFailureAndRecoveryDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionHAFailureAndRecoveryDUnitTest.java
@@ -32,11 +32,13 @@ import com.gemstone.gemfire.cache30.CertifiableTestCacheListener;
import com.gemstone.gemfire.distributed.DistributedMember;
import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem;
import com.gemstone.gemfire.internal.NanoTimer;
+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.SerializableCallable;
import com.gemstone.gemfire.test.dunit.SerializableRunnable;
+import com.gemstone.gemfire.test.dunit.Threads;
import com.gemstone.gemfire.test.dunit.VM;
/**
@@ -396,12 +398,12 @@ public class PartitionedRegionHAFailureAndRecoveryDUnitTest extends
redundancy, localMaxMemory, recoveryDelay));
}
for (int count2 = 0; count2 < async.length; count2++) {
- DistributedTestCase.join(async[count2], 30 * 1000, getLogWriter());
+ Threads.join(async[count2], 30 * 1000);
}
for (int count2 = 0; count2 < async.length; count2++) {
if (async[count2].exceptionOccurred()) {
- fail("exception during " + count2, async[count2].getException());
+ Assert.fail("exception during " + count2, async[count2].getException());
}
}
}
@@ -453,7 +455,7 @@ public class PartitionedRegionHAFailureAndRecoveryDUnitTest extends
assertNotNull(bucketHost);
// Disconnect the selected host
- Map stillHasDS = invokeInEveryVM(new SerializableCallable("Disconnect provided bucketHost") {
+ Map stillHasDS = Invoke.invokeInEveryVM(new SerializableCallable("Disconnect provided bucketHost") {
public Object call() throws Exception {
if (getSystem().getDistributedMember().equals(bucketHost)) {
getLogWriter().info("Disconnecting distributed member " + getSystem().getDistributedMember());
@@ -491,7 +493,7 @@ public class PartitionedRegionHAFailureAndRecoveryDUnitTest extends
TimeUnit.MILLISECONDS.sleep(250);
}
catch (InterruptedException e) {
- fail("Interrupted, ah!", e);
+ Assert.fail("Interrupted, ah!", e);
}
}
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionLocalMaxMemoryOffHeapDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionLocalMaxMemoryOffHeapDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionLocalMaxMemoryOffHeapDUnitTest.java
index a9b7619..2f16547 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionLocalMaxMemoryOffHeapDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionLocalMaxMemoryOffHeapDUnitTest.java
@@ -22,6 +22,7 @@ import com.gemstone.gemfire.cache.AttributesFactory;
import com.gemstone.gemfire.cache.EvictionAttributes;
import com.gemstone.gemfire.cache.RegionAttributes;
import com.gemstone.gemfire.distributed.internal.DistributionConfig;
+import com.gemstone.gemfire.test.dunit.Invoke;
import com.gemstone.gemfire.test.dunit.SerializableRunnable;
/**
@@ -38,7 +39,7 @@ public class PartitionedRegionLocalMaxMemoryOffHeapDUnitTest extends Partitioned
}
@Override
- public void tearDown2() throws Exception {
+ public void tearDownBeforeDisconnect() throws Exception {
SerializableRunnable checkOrphans = new SerializableRunnable() {
@Override
@@ -48,11 +49,11 @@ public class PartitionedRegionLocalMaxMemoryOffHeapDUnitTest extends Partitioned
}
}
};
- 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/internal/cache/PartitionedRegionMultipleDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionMultipleDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionMultipleDUnitTest.java
index 6ace0a5..5aa483b 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionMultipleDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionMultipleDUnitTest.java
@@ -20,9 +20,10 @@ import com.gemstone.gemfire.cache.Cache;
import com.gemstone.gemfire.cache.CacheException;
import com.gemstone.gemfire.cache.Region;
import com.gemstone.gemfire.cache30.CacheSerializableRunnable;
+import com.gemstone.gemfire.test.dunit.Assert;
import com.gemstone.gemfire.test.dunit.AsyncInvocation;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.Threads;
import com.gemstone.gemfire.test.dunit.VM;
/**
@@ -238,12 +239,12 @@ public class PartitionedRegionMultipleDUnitTest extends
startIndexForRegion, endIndexForRegion));
for (int count = 0; count < AsyncInvocationArrSize; count++) {
- DistributedTestCase.join(async[count], 120 * 1000, getLogWriter());
+ Threads.join(async[count], 120 * 1000);
}
for (int count = 0; count < AsyncInvocationArrSize; count++) {
if (async[count].exceptionOccurred()) {
- fail("exception during " + count, async[count].getException());
+ Assert.fail("exception during " + count, async[count].getException());
}
}
@@ -298,12 +299,12 @@ public class PartitionedRegionMultipleDUnitTest extends
startIndexForRegion, endIndexForRegion));
for (int count = 0; count < AsyncInvocationArrSize; count++) {
- DistributedTestCase.join(async[count], 30 * 1000, getLogWriter());
+ Threads.join(async[count], 30 * 1000);
}
for (int count = 0; count < AsyncInvocationArrSize; count++) {
if (async[count].exceptionOccurred()) {
- fail("exception during " + count, async[count].getException());
+ Assert.fail("exception during " + count, async[count].getException());
}
}
}
@@ -334,12 +335,12 @@ public class PartitionedRegionMultipleDUnitTest extends
/** main thread is waiting for the other threads to complete */
for (int count = 0; count < AsyncInvocationArrSize; count++) {
- DistributedTestCase.join(async[count], 30 * 1000, getLogWriter());
+ Threads.join(async[count], 30 * 1000);
}
for (int count = 0; count < AsyncInvocationArrSize; count++) {
if (async[count].exceptionOccurred()) {
- fail("exception during " + count, async[count].getException());
+ Assert.fail("exception during " + count, async[count].getException());
}
}
}
@@ -367,12 +368,12 @@ public class PartitionedRegionMultipleDUnitTest extends
endIndexForRegion));
/** main thread is waiting for the other threads to complete */
for (int count = 0; count < AsyncInvocationArrSize; count++) {
- DistributedTestCase.join(async[count], 30 * 1000, getLogWriter());
+ Threads.join(async[count], 30 * 1000);
}
for (int count = 0; count < AsyncInvocationArrSize; count++) {
if (async[count].exceptionOccurred()) {
- fail("Failed due to exception: "+ async[count].getException(),
+ Assert.fail("Failed due to exception: "+ async[count].getException(),
async[count].getException());
}
}
@@ -406,12 +407,12 @@ public class PartitionedRegionMultipleDUnitTest extends
/** main thread is waiting for the other threads to complete */
for (int count = 0; count < AsyncInvocationArrSize; count++) {
- DistributedTestCase.join(async[count], 30 * 1000, getLogWriter());
+ Threads.join(async[count], 30 * 1000);
}
for (int count = 0; count < AsyncInvocationArrSize; count++) {
if (async[count].exceptionOccurred()) {
- fail("exception during " + count, async[count].getException());
+ Assert.fail("exception during " + count, async[count].getException());
}
}
}
@@ -543,9 +544,9 @@ public class PartitionedRegionMultipleDUnitTest extends
startIndexForRegion, endIndexForRegion, afterPutFlag));
/** main thread is waiting for the other threads to complete */
for (int count = 0; count < AsyncInvocationArrSize; count++) {
- DistributedTestCase.join(async[count], 30 * 1000, getLogWriter());
+ Threads.join(async[count], 30 * 1000);
if (async[count].exceptionOccurred()) {
- fail("exception during " + count, async[count].getException());
+ Assert.fail("exception during " + count, async[count].getException());
}
}
@@ -586,12 +587,12 @@ public class PartitionedRegionMultipleDUnitTest extends
/** main thread is waiting for the other threads to complete */
for (int count = 0; count < AsyncInvocationArrSize; count++) {
- DistributedTestCase.join(async[count], 30 * 1000, getLogWriter());
+ Threads.join(async[count], 30 * 1000);
}
for (int count = 0; count < AsyncInvocationArrSize; count++) {
if (async[count].exceptionOccurred()) {
- fail("exception during " + count, async[count].getException());
+ Assert.fail("exception during " + count, async[count].getException());
}
}
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionOffHeapEvictionDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionOffHeapEvictionDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionOffHeapEvictionDUnitTest.java
index 042e1f7..f799763 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionOffHeapEvictionDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionOffHeapEvictionDUnitTest.java
@@ -23,6 +23,7 @@ import com.gemstone.gemfire.distributed.internal.DistributionConfig;
import com.gemstone.gemfire.internal.cache.control.InternalResourceManager.ResourceType;
import com.gemstone.gemfire.internal.cache.control.OffHeapMemoryMonitor;
import com.gemstone.gemfire.internal.cache.lru.HeapEvictor;
+import com.gemstone.gemfire.test.dunit.Invoke;
import com.gemstone.gemfire.test.dunit.SerializableRunnable;
public class PartitionedRegionOffHeapEvictionDUnitTest extends
@@ -33,7 +34,7 @@ public class PartitionedRegionOffHeapEvictionDUnitTest extends
}
@Override
- public void tearDown2() throws Exception {
+ public void tearDownBeforeDisconnect() throws Exception {
SerializableRunnable checkOrphans = new SerializableRunnable() {
@Override
@@ -43,11 +44,11 @@ public class PartitionedRegionOffHeapEvictionDUnitTest extends
}
}
};
- 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/internal/cache/PartitionedRegionPRIDDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionPRIDDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionPRIDDUnitTest.java
index 496026d..a3b9662 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionPRIDDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionPRIDDUnitTest.java
@@ -23,9 +23,10 @@ import java.util.*;
import com.gemstone.gemfire.cache.Cache;
import com.gemstone.gemfire.cache.Region;
import com.gemstone.gemfire.cache30.*;
+import com.gemstone.gemfire.test.dunit.Assert;
import com.gemstone.gemfire.test.dunit.AsyncInvocation;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.Threads;
import com.gemstone.gemfire.test.dunit.VM;
/**
@@ -116,12 +117,12 @@ public class PartitionedRegionPRIDDUnitTest extends
/** main thread is waiting for the other threads to complete */
for (int count = 0; count < AsyncInvocationArrSize; count++) {
- DistributedTestCase.join(async[count], 30 * 1000, getLogWriter());
+ Threads.join(async[count], 30 * 1000);
}
for (int count = 0; count < AsyncInvocationArrSize; count++) {
if (async[count].exceptionOccurred()) {
- fail("VM " + count
+ Assert.fail("VM " + count
+ " encountered this exception during async invocation",
async[count].getException());
}
@@ -233,12 +234,12 @@ public class PartitionedRegionPRIDDUnitTest extends
numNodes++;
}
for (int i = 0; i < numNodes; i++) {
- DistributedTestCase.join(async[i], 30 * 1000, getLogWriter());
+ Threads.join(async[i], 30 * 1000);
}
for (int i = 0; i < numNodes; i++) {
if (async[i].exceptionOccurred()) {
- fail("VM " + i
+ Assert.fail("VM " + i
+ " encountered this exception during async invocation",
async[i].getException());
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionQueryDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionQueryDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionQueryDUnitTest.java
index b4af7d1..d9b4c0a 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionQueryDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionQueryDUnitTest.java
@@ -58,7 +58,9 @@ import com.gemstone.gemfire.cache30.CacheSerializableRunnable;
import com.gemstone.gemfire.internal.AvailablePortHelper;
import com.gemstone.gemfire.internal.cache.partitioned.QueryMessage;
import com.gemstone.gemfire.pdx.JSONFormatter;
+import com.gemstone.gemfire.test.dunit.Assert;
import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.NetworkSupport;
import com.gemstone.gemfire.test.dunit.SerializableCallable;
import com.gemstone.gemfire.test.dunit.SerializableRunnable;
import com.gemstone.gemfire.test.dunit.VM;
@@ -295,7 +297,7 @@ public class PartitionedRegionQueryDUnitTest extends CacheTestCase {
9 })), results.asSet());
} catch (Exception e) {
- fail("Bad query", e);
+ Assert.fail("Bad query", e);
}
}
});
@@ -367,7 +369,7 @@ public class PartitionedRegionQueryDUnitTest extends CacheTestCase {
9 })), results.asSet());
} catch (Exception e) {
- fail("Bad query", e);
+ Assert.fail("Bad query", e);
}
}
});
@@ -438,7 +440,7 @@ public class PartitionedRegionQueryDUnitTest extends CacheTestCase {
9 })), results.asSet());
} catch (Exception e) {
- fail("Bad query", e);
+ Assert.fail("Bad query", e);
}
}
});
@@ -510,7 +512,7 @@ public class PartitionedRegionQueryDUnitTest extends CacheTestCase {
9 })), results.asSet());
} catch (Exception e) {
- fail("Bad query", e);
+ Assert.fail("Bad query", e);
}
}
});
@@ -582,7 +584,7 @@ public class PartitionedRegionQueryDUnitTest extends CacheTestCase {
9 })), results.asSet());
} catch (Exception e) {
- fail("Bad query", e);
+ Assert.fail("Bad query", e);
}
}
});
@@ -655,7 +657,7 @@ public class PartitionedRegionQueryDUnitTest extends CacheTestCase {
9 })), results.asSet());
} catch (Exception e) {
- fail("Bad query", e);
+ Assert.fail("Bad query", e);
}
}
});
@@ -727,7 +729,7 @@ public class PartitionedRegionQueryDUnitTest extends CacheTestCase {
9 })), results.asSet());
} catch (Exception e) {
- fail("Bad query", e);
+ Assert.fail("Bad query", e);
}
}
});
@@ -798,7 +800,7 @@ public class PartitionedRegionQueryDUnitTest extends CacheTestCase {
9 })), results.asSet());
} catch (Exception e) {
- fail("Bad query", e);
+ Assert.fail("Bad query", e);
}
}
});
@@ -941,8 +943,8 @@ public class PartitionedRegionQueryDUnitTest extends CacheTestCase {
@Override
public Object call() throws Exception {
ClientCacheFactory cf = new ClientCacheFactory();
- cf.addPoolServer(getServerHostName(server1.getHost()), port1);
- cf.addPoolServer(getServerHostName(server2.getHost()), port2);
+ cf.addPoolServer(NetworkSupport.getServerHostName(server1.getHost()), port1);
+ cf.addPoolServer(NetworkSupport.getServerHostName(server2.getHost()), port2);
ClientCache cache = getClientCache(cf);
Region region = cache.createClientRegionFactory(
@@ -953,7 +955,7 @@ public class PartitionedRegionQueryDUnitTest extends CacheTestCase {
try {
qs = getCache().getQueryService();
} catch (Exception e) {
- fail("Failed to get QueryService.", e);
+ Assert.fail("Failed to get QueryService.", e);
}
for (int i = 0; i < queries.length; i++) {
@@ -962,7 +964,7 @@ public class PartitionedRegionQueryDUnitTest extends CacheTestCase {
assertTrue("Size of resultset should be greater than 0 for query: "
+ queries[i], sr.size() > 0);
} catch (Exception e) {
- fail("Failed executing query ", e);
+ Assert.fail("Failed executing query ", e);
}
}
return null;
@@ -1004,7 +1006,7 @@ public class PartitionedRegionQueryDUnitTest extends CacheTestCase {
SelectResults results = (SelectResults) query.execute();
assertEquals(new HashSet(Arrays.asList(new Integer[] { 1, 2, 3 ,4, 5, 6, 7, 8, 9 })), results.asSet());
} catch (Exception e) {
- fail("Bad query", e);
+ Assert.fail("Bad query", e);
}
}
});
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionRedundancyZoneDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionRedundancyZoneDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionRedundancyZoneDUnitTest.java
index 39fcc76..93b8184 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionRedundancyZoneDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionRedundancyZoneDUnitTest.java
@@ -36,8 +36,8 @@ import com.gemstone.gemfire.test.dunit.VM;
public class PartitionedRegionRedundancyZoneDUnitTest extends CacheTestCase {
@Override
- public void tearDown2() throws Exception {
- super.tearDown2();
+ public void tearDownBeforeDisconnect() throws Exception {
+ super.tearDownBeforeDisconnect();
// this makes sure we don't leave anything for the next tests
// Tests that set redundancy zones causes other jvms connected
// to the ds to have "enforce-unique-hosts" set to true.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionSerializableObjectJUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionSerializableObjectJUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionSerializableObjectJUnitTest.java
index 6244cea..95cd035 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionSerializableObjectJUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionSerializableObjectJUnitTest.java
@@ -35,7 +35,7 @@ import static org.junit.Assert.*;
import com.gemstone.gemfire.cache.Region;
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;
import junit.framework.TestCase;
@@ -82,7 +82,7 @@ public class PartitionedRegionSerializableObjectJUnitTest
for (int i = 0; i < MAX_THREADS; i++) {
threadArr[i].start();
- DistributedTestCase.join(threadArr[i], 30 * 1000, null);
+ Threads.join(threadArr[i], 30 * 1000);
}
for (int i = 0; i < MAX_THREADS; i++) {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionSingleHopDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionSingleHopDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionSingleHopDUnitTest.java
index e5e238e..ed6561e 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionSingleHopDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionSingleHopDUnitTest.java
@@ -65,10 +65,14 @@ import com.gemstone.gemfire.internal.cache.execute.data.CustId;
import com.gemstone.gemfire.internal.cache.execute.data.OrderId;
import com.gemstone.gemfire.internal.cache.execute.data.ShipmentId;
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.Host;
+import com.gemstone.gemfire.test.dunit.IgnoredException;
+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;
public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
@@ -104,7 +108,7 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
public void setUp() throws Exception {
super.setUp();
- addExpectedException("Connection refused");
+ IgnoredException.addIgnoredException("Connection refused");
Host host = Host.getHost(0);
member0 = host.getVM(0);
member1 = host.getVM(1);
@@ -112,7 +116,7 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
member3 = host.getVM(3);
}
- public void tearDown2() throws Exception {
+ public void tearDownBeforeDisconnect() throws Exception {
try {
/* fixes GEODE-444, really close client cache first by using super.tearDown2();
// close the clients first
@@ -122,7 +126,7 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
member3.invoke(PartitionedRegionSingleHopDUnitTest.class, "closeCache");
closeCache();
*/
- super.tearDown2();
+ super.tearDownBeforeDisconnect();
member0 = null;
member1 = null;
@@ -186,7 +190,7 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
server.start();
}
catch (IOException e) {
- fail("Failed to start server ", e);
+ Assert.fail("Failed to start server ", e);
}
PartitionAttributesFactory paf = new PartitionAttributesFactory();
@@ -438,7 +442,7 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
return "expected metadataservice to be called atleast once, but it was not called";
}
};
- DistributedTestCase.waitForCriterion(wc, 60000, 1000, true);
+ Wait.waitForCriterion(wc, 60000, 1000, true);
cms.satisfyRefreshMetadata_TEST_ONLY(false);
region.put(new Integer(0), "create0");
@@ -455,7 +459,7 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
return "expected no metadata to be refreshed";
}
};
- DistributedTestCase.waitForCriterion(wc, 60000, 1000, true);
+ Wait.waitForCriterion(wc, 60000, 1000, true);
}
@@ -497,7 +501,7 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
return "expected metadataservice to be called atleast once, but it was not called";
}
};
- DistributedTestCase.waitForCriterion(wc, 60000, 1000, true);
+ Wait.waitForCriterion(wc, 60000, 1000, true);
}
public void test_MetadataServiceCallAccuracy_FromGetOp() {
@@ -539,15 +543,15 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
return "expected metadataservice to be called atleast once, but it was not called";
}
};
- DistributedTestCase.waitForCriterion(wc, 60000, 1000, true);
+ Wait.waitForCriterion(wc, 60000, 1000, true);
printMetadata();
- pause(5000);
+ Wait.pause(5000);
cms.satisfyRefreshMetadata_TEST_ONLY(false);
region.get(new Integer(0));
region.get(new Integer(1));
region.get(new Integer(2));
region.get(new Integer(3));
- pause(5000);
+ Wait.pause(5000);
assertFalse(cms.isRefreshMetadataTestOnly());
}
@@ -591,7 +595,7 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
return "expected metadataservice to be called atleast once, but it was not called";
}
};
- DistributedTestCase.waitForCriterion(wc, 60000, 1000, true);
+ Wait.waitForCriterion(wc, 60000, 1000, true);
// kill server
member0.invoke(PartitionedRegionSingleHopDUnitTest.class, "stopServer");
@@ -604,7 +608,7 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
public void test_SingleHopWithHAWithLocator() {
int port3 = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
- final String host0 = getServerHostName(member3.getHost());
+ final String host0 = NetworkSupport.getServerHostName(member3.getHost());
final String locator = host0 + "[" + port3 + "]";
member3.invoke(PartitionedRegionSingleHopDUnitTest.class,
"startLocatorInVM", new Object[] { port3 });
@@ -669,7 +673,7 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
region.get(new Integer(1));
region.get(new Integer(2));
region.get(new Integer(3));
- pause(5000);
+ Wait.pause(5000);
assertFalse(cms.isRefreshMetadataTestOnly());
printMetadata();
@@ -678,7 +682,7 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
region.get(new Integer(1));
region.get(new Integer(2));
region.get(new Integer(3));
- pause(5000);
+ Wait.pause(5000);
assertFalse(cms.isRefreshMetadataTestOnly());
}
@@ -722,7 +726,7 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
region.put(new Integer(3), "create3");
final boolean metadataRefreshed_get4 = cms
.isRefreshMetadataTestOnly();
- pause(5000);
+ Wait.pause(5000);
assertFalse(metadataRefreshed_get1 || metadataRefreshed_get2
|| metadataRefreshed_get3 || metadataRefreshed_get4);
@@ -732,7 +736,7 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
region.put(new Integer(1), "create1");
region.put(new Integer(2), "create2");
region.put(new Integer(3), "create3");
- pause(5000);
+ Wait.pause(5000);
assertFalse(cms.isRefreshMetadataTestOnly());
}
@@ -760,7 +764,7 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
region.destroy(new Integer(1));
region.destroy(new Integer(2));
region.destroy(new Integer(3));
- pause(5000);
+ Wait.pause(5000);
assertFalse(cms.isRefreshMetadataTestOnly());
}
@@ -780,7 +784,7 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
createClient(port0, port1, port2, port3);
putIntoPartitionedRegions();
getFromPartitionedRegions();
- pause(5000);
+ Wait.pause(5000);
ClientMetadataService cms = ((GemFireCacheImpl)cache).getClientMetadataService();
Map<String, ClientPartitionAdvisor> regionMetaData = cms.getClientPRMetadata_TEST_ONLY();
assertEquals(4, regionMetaData.size());
@@ -797,7 +801,7 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
}
member0.invoke(PartitionedRegionSingleHopDUnitTest.class, "stopServer");
member1.invoke(PartitionedRegionSingleHopDUnitTest.class, "stopServer");
- pause(5000);//make sure that ping detects the dead servers
+ Wait.pause(5000);//make sure that ping detects the dead servers
getFromPartitionedRegions();
verifyDeadServer(regionMetaData, customerRegion, port0, port1);
verifyDeadServer(regionMetaData, region, port0, port1);
@@ -805,7 +809,7 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
public void testMetadataFetchOnlyThroughFunctions() {
//Workaround for 52004
- addExpectedException("InternalFunctionInvocationTargetException");
+ IgnoredException.addIgnoredException("InternalFunctionInvocationTargetException");
Integer port0 = (Integer)member0.invoke(
PartitionedRegionSingleHopDUnitTest.class, "createServer",
new Object[] { 3, 4 });
@@ -832,7 +836,7 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
return "expected no metadata to be refreshed";
}
};
- DistributedTestCase.waitForCriterion(wc, 60000, 1000, true);
+ Wait.waitForCriterion(wc, 60000, 1000, true);
assertEquals(1, regionMetaData.size());
assertTrue(regionMetaData.containsKey(region.getFullPath()));
@@ -866,7 +870,7 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
return "expected no metadata to be refreshed";
}
};
- DistributedTestCase.waitForCriterion(wc, 60000, 1000, true);
+ Wait.waitForCriterion(wc, 60000, 1000, true);
// assertEquals(4/*numBuckets*/, prMetaData.getBucketServerLocationsMap_TEST_ONLY().size());
}
@@ -896,7 +900,7 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
return "expected no metadata to be refreshed";
}
};
- DistributedTestCase.waitForCriterion(wc, 60000, 1000, true);
+ Wait.waitForCriterion(wc, 60000, 1000, true);
assertTrue(regionMetaData.containsKey(region.getFullPath()));
@@ -910,7 +914,7 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
return "expected no metadata to be refreshed";
}
};
- DistributedTestCase.waitForCriterion(wc, 60000, 1000, true);
+ Wait.waitForCriterion(wc, 60000, 1000, true);
}
@@ -955,7 +959,7 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
return "expected no metadata to be refreshed";
}
};
- DistributedTestCase.waitForCriterion(wc, 60000, 1000, true);
+ Wait.waitForCriterion(wc, 60000, 1000, true);
for (Entry entry : clientMap.entrySet()) {
assertEquals(4, ((List)entry.getValue()).size());
}
@@ -1001,7 +1005,7 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
return "bucket copies are not created";
}
};
- DistributedTestCase.waitForCriterion(wc, 60000, 400, true);
+ Wait.waitForCriterion(wc, 60000, 400, true);
cms = ((GemFireCacheImpl)cache).getClientMetadataService();
cms.getClientPRMetadata((LocalRegion)region);
@@ -1020,7 +1024,7 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
return "expected no metadata to be refreshed";
}
};
- DistributedTestCase.waitForCriterion(wc, 60000, 1000, true);
+ Wait.waitForCriterion(wc, 60000, 1000, true);
for (Entry entry : clientMap.entrySet()) {
assertEquals(4, ((List)entry.getValue()).size());
}
@@ -1077,12 +1081,12 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
return "expected no metadata to be refreshed";
}
};
- DistributedTestCase.waitForCriterion(wc, 60000, 1000, true);
+ Wait.waitForCriterion(wc, 60000, 1000, true);
for (Entry entry : clientMap.entrySet()) {
assertEquals(2, ((List)entry.getValue()).size());
}
final Map<Integer, List<BucketServerLocation66>> fclientMap = clientMap;
- waitForCriterion(new WaitCriterion() {
+ Wait.waitForCriterion(new WaitCriterion() {
public boolean done() {
try {
@@ -1129,7 +1133,7 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
return "expected metadata is ready";
}
};
- DistributedTestCase.waitForCriterion(wc, 60000, 1000, true);
+ Wait.waitForCriterion(wc, 60000, 1000, true);
assertEquals(1, regionMetaData.size());
assertTrue(regionMetaData.containsKey(region.getFullPath()));
@@ -1163,7 +1167,7 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
return "expected no metadata to be refreshed";
}
};
- DistributedTestCase.waitForCriterion(wc, 60000, 1000, true);
+ Wait.waitForCriterion(wc, 60000, 1000, true);
for (Entry entry : clientMap.entrySet()) {
assertEquals(2, ((List)entry.getValue()).size());
}
@@ -1213,7 +1217,7 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
+ bucketId + " size : " + size + " the list is " + globalList;
}
};
- DistributedTestCase.waitForCriterion(wc, 60000, 400, true);
+ Wait.waitForCriterion(wc, 60000, 400, true);
}
//TODO This is failing in WAN_Dev_Dec11 branch after downmerge from trunk revision 34709
@@ -1247,7 +1251,7 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
member1.invoke(PartitionedRegionSingleHopDUnitTest.class, "closeCache");
member2.invoke(PartitionedRegionSingleHopDUnitTest.class, "closeCache");
member3.invoke(PartitionedRegionSingleHopDUnitTest.class, "closeCache");
- pause(1000); //let client detect that servers are dead through ping
+ Wait.pause(1000); //let client detect that servers are dead through ping
AsyncInvocation m3 = member3.invokeAsync(PartitionedRegionSingleHopDUnitTest.class, "createPersistentPrsAndServerOnPort",new Object[] { 3, 4,port3 });
AsyncInvocation m2 = member2.invokeAsync(PartitionedRegionSingleHopDUnitTest.class, "createPersistentPrsAndServerOnPort",new Object[] { 3, 4,port2 });
AsyncInvocation m1 = member1.invokeAsync(PartitionedRegionSingleHopDUnitTest.class, "createPersistentPrsAndServerOnPort",new Object[] { 3, 4,port1 });
@@ -1333,7 +1337,7 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
+ pr.getDataStore().getAllLocalBuckets().size();
}
};
- DistributedTestCase.waitForCriterion(wc, 60000, 400, true);
+ Wait.waitForCriterion(wc, 60000, 400, true);
}
public static void waitForBucketsCreation(){
@@ -1349,7 +1353,7 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
return "bucket copies are not created";
}
};
- DistributedTestCase.waitForCriterion(wc, 60000, 400, true);
+ Wait.waitForCriterion(wc, 60000, 400, true);
}
private void verifyDeadServer(Map<String, ClientPartitionAdvisor> regionMetaData, Region region, int port0, int port1) {
@@ -1404,7 +1408,7 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
server.start();
}
catch (IOException e) {
- fail("Failed to start server ", e);
+ Assert.fail("Failed to start server ", e);
}
PartitionAttributesFactory paf = new PartitionAttributesFactory();
@@ -1474,7 +1478,7 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
server.start();
}
catch (IOException e) {
- fail("Failed to start server ", e);
+ Assert.fail("Failed to start server ", e);
}
PartitionAttributesFactory paf = new PartitionAttributesFactory();
@@ -1616,7 +1620,7 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
server.start();
}
catch (IOException e) {
- fail("Failed to start server ", e);
+ Assert.fail("Failed to start server ", e);
}
return port;
}
@@ -1699,7 +1703,7 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
server.start();
}
catch (IOException e) {
- fail("Failed to start server ", e);
+ Assert.fail("Failed to start server ", e);
}
return port;
}
@@ -1714,7 +1718,7 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
server.start();
}
catch (IOException e) {
- fail("Failed to start server ", e);
+ Assert.fail("Failed to start server ", e);
}
PartitionAttributesFactory paf = new PartitionAttributesFactory();
@@ -1786,7 +1790,7 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
server.start();
}
catch (IOException e) {
- fail("Failed to start server ", e);
+ Assert.fail("Failed to start server ", e);
}
}
@@ -2252,7 +2256,7 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
return "expected PRAdvisor to be ready";
}
};
- DistributedTestCase.waitForCriterion(wc, 60000, 1000, true);
+ Wait.waitForCriterion(wc, 60000, 1000, true);
assertEquals(4, regionMetaData.size());
assertTrue(regionMetaData.containsKey(region.getFullPath()));
@@ -2266,7 +2270,7 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
return "expected no metadata to be refreshed";
}
};
- DistributedTestCase.waitForCriterion(wc, 60000, 1000, true);
+ Wait.waitForCriterion(wc, 60000, 1000, true);
}
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionSingleHopWithServerGroupDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionSingleHopWithServerGroupDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionSingleHopWithServerGroupDUnitTest.java
index ee256a9..ee31cde 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionSingleHopWithServerGroupDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionSingleHopWithServerGroupDUnitTest.java
@@ -41,10 +41,15 @@ import com.gemstone.gemfire.internal.cache.execute.data.CustId;
import com.gemstone.gemfire.internal.cache.execute.data.OrderId;
import com.gemstone.gemfire.internal.cache.execute.data.ShipmentId;
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.IgnoredException;
+import com.gemstone.gemfire.test.dunit.Invoke;
+import com.gemstone.gemfire.test.dunit.NetworkSupport;
import com.gemstone.gemfire.test.dunit.SerializableRunnable;
import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
import java.io.File;
import java.io.IOException;
@@ -115,10 +120,10 @@ public class PartitionedRegionSingleHopWithServerGroupDUnitTest extends CacheTes
member1 = host.getVM(1);
member2 = host.getVM(2);
member3 = host.getVM(3);
- addExpectedException("java.net.SocketException");
+ IgnoredException.addIgnoredException("java.net.SocketException");
}
- public void tearDown2() throws Exception {
+ public void tearDownBeforeDisconnect() throws Exception {
try {
// close the clients first
@@ -128,13 +133,13 @@ public class PartitionedRegionSingleHopWithServerGroupDUnitTest extends CacheTes
member3.invoke(PartitionedRegionSingleHopWithServerGroupDUnitTest.class, "closeCache");
closeCache();
- super.tearDown2();
+ super.tearDownBeforeDisconnect();
member0 = null;
member1 = null;
member2 = null;
member3 = null;
- invokeInEveryVM(new SerializableRunnable() { public void run() {
+ Invoke.invokeInEveryVM(new SerializableRunnable() { public void run() {
cache = null;
orderRegion = null;
orderRegion2 = null;
@@ -169,7 +174,7 @@ public class PartitionedRegionSingleHopWithServerGroupDUnitTest extends CacheTes
public void test_SingleHopWith2ServerGroup() {
int port3 = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
- final String host0 = getServerHostName(member3.getHost());
+ final String host0 = NetworkSupport.getServerHostName(member3.getHost());
final String locator = host0 + "[" + port3 + "]";
member3.invoke(PartitionedRegionSingleHopWithServerGroupDUnitTest.class,
"startLocatorInVM", new Object[] { port3 });
@@ -203,7 +208,7 @@ public class PartitionedRegionSingleHopWithServerGroupDUnitTest extends CacheTes
public void test_SingleHopWith2ServerGroup2() {
int port3 = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
- final String host0 = getServerHostName(member3.getHost());
+ final String host0 = NetworkSupport.getServerHostName(member3.getHost());
final String locator = host0 + "[" + port3 + "]";
member3.invoke(PartitionedRegionSingleHopWithServerGroupDUnitTest.class,
"startLocatorInVM", new Object[] { port3 });
@@ -237,7 +242,7 @@ public class PartitionedRegionSingleHopWithServerGroupDUnitTest extends CacheTes
public void test_SingleHopWith2ServerGroup2WithoutSystemProperty() {
int port3 = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
- final String host0 = getServerHostName(member3.getHost());
+ final String host0 = NetworkSupport.getServerHostName(member3.getHost());
final String locator = host0 + "[" + port3 + "]";
member3.invoke(PartitionedRegionSingleHopWithServerGroupDUnitTest.class,
"startLocatorInVM", new Object[] { port3 });
@@ -266,7 +271,7 @@ public class PartitionedRegionSingleHopWithServerGroupDUnitTest extends CacheTes
public void test_SingleHopWithServerGroupAccessor() {
int port3 = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
- final String host0 = getServerHostName(member3.getHost());
+ final String host0 = NetworkSupport.getServerHostName(member3.getHost());
final String locator = host0 + "[" + port3 + "]";
member3.invoke(PartitionedRegionSingleHopWithServerGroupDUnitTest.class,
"startLocatorInVM", new Object[] { port3 });
@@ -299,7 +304,7 @@ public class PartitionedRegionSingleHopWithServerGroupDUnitTest extends CacheTes
public void test_SingleHopWithServerGroupOneServerInTwoGroups() {
int port3 = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
- final String host0 = getServerHostName(member3.getHost());
+ final String host0 = NetworkSupport.getServerHostName(member3.getHost());
final String locator = host0 + "[" + port3 + "]";
member3.invoke(PartitionedRegionSingleHopWithServerGroupDUnitTest.class,
"startLocatorInVM", new Object[] { port3 });
@@ -338,7 +343,7 @@ public class PartitionedRegionSingleHopWithServerGroupDUnitTest extends CacheTes
public void test_SingleHopWithServerGroupWithOneDefaultServer() {
int port3 = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
- final String host0 = getServerHostName(member3.getHost());
+ final String host0 = NetworkSupport.getServerHostName(member3.getHost());
final String locator = host0 + "[" + port3 + "]";
member3.invoke(PartitionedRegionSingleHopWithServerGroupDUnitTest.class,
"startLocatorInVM", new Object[] { port3 });
@@ -371,7 +376,7 @@ public class PartitionedRegionSingleHopWithServerGroupDUnitTest extends CacheTes
public void test_SingleHopWithServerGroupClientServerGroupNull() {
int port3 = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
- final String host0 = getServerHostName(member3.getHost());
+ final String host0 = NetworkSupport.getServerHostName(member3.getHost());
final String locator = host0 + "[" + port3 + "]";
member3.invoke(PartitionedRegionSingleHopWithServerGroupDUnitTest.class,
"startLocatorInVM", new Object[] { port3 });
@@ -404,7 +409,7 @@ public class PartitionedRegionSingleHopWithServerGroupDUnitTest extends CacheTes
public void test_SingleHopWithServerGroupTwoClientServerGroup() {
int port3 = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
- final String host0 = getServerHostName(member3.getHost());
+ final String host0 = NetworkSupport.getServerHostName(member3.getHost());
final String locator = host0 + "[" + port3 + "]";
member3.invoke(PartitionedRegionSingleHopWithServerGroupDUnitTest.class,
"startLocatorInVM", new Object[] { port3 });
@@ -451,7 +456,7 @@ public class PartitionedRegionSingleHopWithServerGroupDUnitTest extends CacheTes
public void test_SingleHopWithServerGroupTwoClientServerGroup2() {
int port3 = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
- final String host0 = getServerHostName(member3.getHost());
+ final String host0 = NetworkSupport.getServerHostName(member3.getHost());
final String locator = host0 + "[" + port3 + "]";
member3.invoke(PartitionedRegionSingleHopWithServerGroupDUnitTest.class,
"startLocatorInVM", new Object[] { port3 });
@@ -495,7 +500,7 @@ public class PartitionedRegionSingleHopWithServerGroupDUnitTest extends CacheTes
public void test_SingleHopWithServerGroupTwoClientOneWithOneWithoutServerGroup() {
int port3 = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
- final String host0 = getServerHostName(member3.getHost());
+ final String host0 = NetworkSupport.getServerHostName(member3.getHost());
final String locator = host0 + "[" + port3 + "]";
member3.invoke(PartitionedRegionSingleHopWithServerGroupDUnitTest.class,
"startLocatorInVM", new Object[] { port3 });
@@ -534,7 +539,7 @@ public class PartitionedRegionSingleHopWithServerGroupDUnitTest extends CacheTes
public void test_SingleHopWithServerGroup2ClientInOneVMServerGroup() {
int port3 = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
- final String host0 = getServerHostName(member3.getHost());
+ final String host0 = NetworkSupport.getServerHostName(member3.getHost());
final String locator = host0 + "[" + port3 + "]";
member3.invoke(PartitionedRegionSingleHopWithServerGroupDUnitTest.class,
"startLocatorInVM", new Object[] { port3 });
@@ -578,7 +583,7 @@ public class PartitionedRegionSingleHopWithServerGroupDUnitTest extends CacheTes
public void test_SingleHopWithServerGroupColocatedRegionsInDifferentGroup() {
int port3 = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
- final String host0 = getServerHostName(member3.getHost());
+ final String host0 = NetworkSupport.getServerHostName(member3.getHost());
final String locator = host0 + "[" + port3 + "]";
member3.invoke(PartitionedRegionSingleHopWithServerGroupDUnitTest.class,
"startLocatorInVM", new Object[] { port3 });
@@ -626,7 +631,7 @@ public class PartitionedRegionSingleHopWithServerGroupDUnitTest extends CacheTes
}
};
- DistributedTestCase.waitForCriterion(wc, 60000, 1000, true);
+ Wait.waitForCriterion(wc, 60000, 1000, true);
if (numRegions != 0) {
assertTrue(regionMetaData.containsKey(region.getFullPath()));
@@ -667,7 +672,7 @@ public class PartitionedRegionSingleHopWithServerGroupDUnitTest extends CacheTes
}
};
- DistributedTestCase.waitForCriterion(wc, 120000, 1000, true);
+ Wait.waitForCriterion(wc, 120000, 1000, true);
assertTrue(regionMetaData.containsKey(region.getFullPath()));
ClientPartitionAdvisor prMetaData = regionMetaData.get(region
@@ -747,7 +752,7 @@ public class PartitionedRegionSingleHopWithServerGroupDUnitTest extends CacheTes
}
};
- DistributedTestCase.waitForCriterion(wc, 120000, 1000, true);
+ Wait.waitForCriterion(wc, 120000, 1000, true);
if (numRegions != 0) {
assertTrue(regionMetaData.containsKey(region.getFullPath()));
@@ -809,7 +814,7 @@ public class PartitionedRegionSingleHopWithServerGroupDUnitTest extends CacheTes
server.start();
}
catch (IOException e) {
- fail("Failed to start server ", e);
+ Assert.fail("Failed to start server ", e);
}
PartitionAttributesFactory paf = new PartitionAttributesFactory();
@@ -895,7 +900,7 @@ public class PartitionedRegionSingleHopWithServerGroupDUnitTest extends CacheTes
server.start();
}
catch (IOException e) {
- fail("Failed to start server ", e);
+ Assert.fail("Failed to start server ", e);
}
PartitionAttributesFactory paf = new PartitionAttributesFactory();
@@ -981,7 +986,7 @@ public class PartitionedRegionSingleHopWithServerGroupDUnitTest extends CacheTes
server.start();
}
catch (IOException e) {
- fail("Failed to start server ", e);
+ Assert.fail("Failed to start server ", e);
}
PartitionAttributesFactory paf = new PartitionAttributesFactory();
@@ -1350,7 +1355,7 @@ public class PartitionedRegionSingleHopWithServerGroupDUnitTest extends CacheTes
server.start();
}
catch (IOException e) {
- fail("Failed to start server ", e);
+ Assert.fail("Failed to start server ", e);
}
PartitionAttributesFactory paf = new PartitionAttributesFactory();
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionSizeDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionSizeDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionSizeDUnitTest.java
index c4c9796..b3aaf38 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionSizeDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionSizeDUnitTest.java
@@ -31,11 +31,12 @@ import com.gemstone.gemfire.cache30.CacheSerializableRunnable;
import com.gemstone.gemfire.distributed.DistributedSystem;
import com.gemstone.gemfire.internal.OSProcess;
import com.gemstone.gemfire.internal.logging.InternalLogWriter;
+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.SerializableCallable;
import com.gemstone.gemfire.test.dunit.SerializableRunnable;
+import com.gemstone.gemfire.test.dunit.Threads;
import com.gemstone.gemfire.test.dunit.VM;
/**
@@ -234,10 +235,10 @@ public class PartitionedRegionSizeDUnitTest extends
}
});
- DistributedTestCase.join(async0, 30 * 1000, getLogWriter());
+ Threads.join(async0, 30 * 1000);
if (async0.exceptionOccurred()) {
- fail("Exception during async0", async0.getException());
+ Assert.fail("Exception during async0", async0.getException());
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionStatsDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionStatsDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionStatsDUnitTest.java
index fe2a104..2a9a040 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionStatsDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionStatsDUnitTest.java
@@ -30,9 +30,12 @@ import com.gemstone.gemfire.cache.control.RebalanceOperation;
import com.gemstone.gemfire.cache.control.RebalanceResults;
import com.gemstone.gemfire.cache30.CacheSerializableRunnable;
import com.gemstone.gemfire.distributed.DistributedSystem;
+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;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
/**
* @author tapshank, Created on Jan 19, 2006
@@ -358,7 +361,7 @@ public class PartitionedRegionStatsDUnitTest extends
try {
RebalanceResults results = op.getResults();
} catch (Exception e) {
- fail("ex", e);
+ Assert.fail("ex", e);
}
}
};
@@ -406,7 +409,7 @@ public class PartitionedRegionStatsDUnitTest extends
RebalanceResults results = op.getResults();
}
catch (Exception e) {
- fail("ex", e);
+ Assert.fail("ex", e);
}
}
};
@@ -517,7 +520,7 @@ public class PartitionedRegionStatsDUnitTest extends
Cache cache = getCache();
PartitionedRegion region = (PartitionedRegion) cache.getRegion("region1");
final PartitionedRegionStats stats = region.getPrStats();
- waitForCriterion(new WaitCriterion() {
+ Wait.waitForCriterion(new WaitCriterion() {
@Override
public boolean done() {
@@ -541,7 +544,7 @@ public class PartitionedRegionStatsDUnitTest extends
try {
tombstoneService.forceBatchExpirationForTests(1);
} catch (InterruptedException e) {
- fail("interrupted", e);
+ Assert.fail("interrupted", e);
}
}
});
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionTestUtilsDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionTestUtilsDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionTestUtilsDUnitTest.java
index 7840a2b..0b73af0 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionTestUtilsDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionTestUtilsDUnitTest.java
@@ -36,6 +36,7 @@ import com.gemstone.gemfire.cache.PartitionAttributesFactory;
import com.gemstone.gemfire.cache.Region;
import com.gemstone.gemfire.cache30.CacheSerializableRunnable;
import com.gemstone.gemfire.distributed.DistributedMember;
+import com.gemstone.gemfire.test.dunit.Assert;
import com.gemstone.gemfire.test.dunit.Host;
import com.gemstone.gemfire.test.dunit.VM;
@@ -97,9 +98,9 @@ public class PartitionedRegionTestUtilsDUnitTest extends
assertNotNull(s);
assertTrue(s.isEmpty());
} catch (ClassNotFoundException cnfe) {
- fail("GetSomeKeys failed with ClassNotFoundException", cnfe);
+ Assert.fail("GetSomeKeys failed with ClassNotFoundException", cnfe);
} catch (IOException ioe) {
- fail("GetSomeKeys failed with IOException", ioe);
+ Assert.fail("GetSomeKeys failed with IOException", ioe);
}
}
@@ -127,9 +128,9 @@ public class PartitionedRegionTestUtilsDUnitTest extends
assertTrue(val.intValue() < MAXKEYS);
}
} catch (ClassNotFoundException cnfe) {
- fail("GetSomeKeys failed with ClassNotFoundException", cnfe);
+ Assert.fail("GetSomeKeys failed with ClassNotFoundException", cnfe);
} catch (IOException ioe) {
- fail("GetSomeKeys failed with IOException", ioe);
+ Assert.fail("GetSomeKeys failed with IOException", ioe);
}
}
}
@@ -513,7 +514,7 @@ public class PartitionedRegionTestUtilsDUnitTest extends
assertEquals(0, p.getBucketOwnersForValidation(i).size());
}
} catch (ForceReattemptException noGood) {
- fail("Unexpected force retry", noGood);
+ Assert.fail("Unexpected force retry", noGood);
}
}
}
@@ -562,7 +563,7 @@ public class PartitionedRegionTestUtilsDUnitTest extends
assertEquals(1, primCount);
}
} catch (ForceReattemptException noGood) {
- fail("Unexpected force retry", noGood);
+ Assert.fail("Unexpected force retry", noGood);
}
}
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionWithSameNameDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionWithSameNameDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionWithSameNameDUnitTest.java
index 55d9a82..b6ad72d 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionWithSameNameDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionWithSameNameDUnitTest.java
@@ -37,6 +37,7 @@ import com.gemstone.gemfire.cache.RegionAttributes;
import com.gemstone.gemfire.cache.RegionExistsException;
import com.gemstone.gemfire.cache.Scope;
import com.gemstone.gemfire.cache30.CacheSerializableRunnable;
+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;
@@ -754,7 +755,7 @@ public class PartitionedRegionWithSameNameDUnitTest extends
cache.createRegion(innerPrPrefix + i, ra);
}
catch (RegionExistsException ex) {
- fail(
+ Assert.fail(
"Got incorrect exception because the partition region being created prior to local region",
ex);
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PutAllDAckDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PutAllDAckDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PutAllDAckDUnitTest.java
index b192a43..317243f 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PutAllDAckDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PutAllDAckDUnitTest.java
@@ -38,6 +38,7 @@ import com.gemstone.gemfire.cache.Scope;
import com.gemstone.gemfire.cache.util.CacheWriterAdapter;
import com.gemstone.gemfire.cache30.CacheSerializableRunnable;
import com.gemstone.gemfire.distributed.DistributedSystem;
+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.VM;
@@ -74,7 +75,7 @@ public class PutAllDAckDUnitTest extends DistributedTestCase {
getLogWriter().fine("Cache created successfully");
}
- public void tearDown2(){
+ public void tearDownBeforeDisconnect(){
Host host = Host.getHost(0);
VM vm0 = host.getVM(0);
VM vm1 = host.getVM(1);
@@ -144,7 +145,7 @@ public class PutAllDAckDUnitTest extends DistributedTestCase {
obj = region.put(ob, str);
}
}catch(Exception ex){
- fail("Failed while region.put", ex);
+ Assert.fail("Failed while region.put", ex);
}
return obj;
}//end of putMethod
@@ -162,7 +163,7 @@ public class PutAllDAckDUnitTest extends DistributedTestCase {
region.putAll(m);
}catch(Exception ex){
- fail("Failed while region.putAll", ex);
+ Assert.fail("Failed while region.putAll", ex);
}
}//end of putAllMethod
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PutAllGlobalDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PutAllGlobalDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PutAllGlobalDUnitTest.java
index 0aa77f0..d90cb85 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PutAllGlobalDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PutAllGlobalDUnitTest.java
@@ -44,10 +44,13 @@ import com.gemstone.gemfire.cache.util.CacheWriterAdapter;
import com.gemstone.gemfire.cache30.CacheSerializableRunnable;
import com.gemstone.gemfire.distributed.DistributedSystem;
import com.gemstone.gemfire.distributed.internal.locks.DLockGrantor;
+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;
/**
@@ -88,14 +91,14 @@ public class PutAllGlobalDUnitTest extends DistributedTestCase {
getLogWriter().fine("Cache created successfully");
}
- public void tearDown2(){
+ public void tearDownBeforeDisconnect(){
Host host = Host.getHost(0);
VM vm0 = host.getVM(0);
VM vm1 = host.getVM(1);
vm0.invoke(PutAllGlobalDUnitTest.class, "closeCache");
vm1.invoke(PutAllGlobalDUnitTest.class, "closeCache");
cache = null;
- invokeInEveryVM(new SerializableRunnable() { public void run() { cache = null; } });
+ Invoke.invokeInEveryVM(new SerializableRunnable() { public void run() { cache = null; } });
}
public static void createCacheForVM0(){
@@ -196,21 +199,21 @@ public class PutAllGlobalDUnitTest extends DistributedTestCase {
}
}
catch(Exception ex){
- fail("async2 threw unexpected exception", ex);
+ Assert.fail("async2 threw unexpected exception", ex);
//ex.printStackTrace();
}
}
});
- DistributedTestCase.join(async2, 30 * 1000, getLogWriter());
+ Threads.join(async2, 30 * 1000);
if (async2.exceptionOccurred()) {
- DistributedTestCase.join(async1, 30 * 1000, getLogWriter());
- fail("async2 failed", async2.getException());
+ Threads.join(async1, 30 * 1000);
+ Assert.fail("async2 failed", async2.getException());
}
- 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());
}
}//end of test case1
@@ -231,7 +234,7 @@ public class PutAllGlobalDUnitTest extends DistributedTestCase {
}catch(Exception ex){
// ex.printStackTrace();
- fail("Failed while region.putAll", ex);
+ Assert.fail("Failed while region.putAll", ex);
}
}//end of putAllMethod
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/RemoteTransactionDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/RemoteTransactionDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/RemoteTransactionDUnitTest.java
index 8a58653..0c241fb 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/RemoteTransactionDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/RemoteTransactionDUnitTest.java
@@ -96,12 +96,15 @@ import com.gemstone.gemfire.internal.cache.execute.data.Customer;
import com.gemstone.gemfire.internal.cache.execute.data.Order;
import com.gemstone.gemfire.internal.cache.execute.data.OrderId;
import com.gemstone.gemfire.internal.cache.versions.VersionTag;
-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.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.DistributedTestCase.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
/**
* @author sbawaska
@@ -123,7 +126,7 @@ public class RemoteTransactionDUnitTest extends CacheTestCase {
//TXManagerImpl mgr = getGemfireCache().getTxManager();
//assertEquals(0, mgr.hostedTransactionsInProgressForTest());
final TXManagerImpl mgr = getGemfireCache().getTxManager();
- waitForCriterion(new WaitCriterion() {
+ Wait.waitForCriterion(new WaitCriterion() {
@Override
public boolean done() {
return mgr.hostedTransactionsInProgressForTest() == 0;
@@ -149,12 +152,12 @@ public class RemoteTransactionDUnitTest extends CacheTestCase {
}
@Override
- public void tearDown2() throws Exception {
+ public void tearDownBeforeDisconnect() throws Exception {
try {
- invokeInEveryVM(verifyNoTxState);
+ Invoke.invokeInEveryVM(verifyNoTxState);
} finally {
closeAllCache();
- super.tearDown2();
+ super.tearDownBeforeDisconnect();
}
}
@@ -3468,7 +3471,7 @@ public class RemoteTransactionDUnitTest extends CacheTestCase {
ClientCacheFactory ccf = new ClientCacheFactory();
ccf.addPoolServer("localhost"/*getServerHostName(Host.getHost(0))*/, port);
ccf.setPoolSubscriptionEnabled(true);
- ccf.set("log-level", getDUnitLogLevel());
+ ccf.set("log-level", DUnitEnv.getDUnitLogLevel());
ClientCache cCache = getClientCache(ccf);
ClientRegionFactory<Integer, String> crf = cCache
.createClientRegionFactory(isEmpty ? ClientRegionShortcut.PROXY
@@ -3648,7 +3651,7 @@ protected static class ClientListener extends CacheListenerAdapter {
return "listener was never invoked";
}
};
- DistributedTestCase.waitForCriterion(waitForListenerInvocation, 10 * 1000, 10, true);
+ Wait.waitForCriterion(waitForListenerInvocation, 10 * 1000, 10, true);
return null;
}
});
@@ -3680,7 +3683,7 @@ protected static class ClientListener extends CacheListenerAdapter {
ClientCacheFactory ccf = new ClientCacheFactory();
ccf.addPoolServer("localhost"/*getServerHostName(Host.getHost(0))*/, port);
ccf.setPoolSubscriptionEnabled(true);
- ccf.set("log-level", getDUnitLogLevel());
+ ccf.set("log-level", DUnitEnv.getDUnitLogLevel());
ClientCache cCache = getClientCache(ccf);
ClientRegionFactory<Integer, String> crf = cCache
.createClientRegionFactory(ClientRegionShortcut.CACHING_PROXY);
@@ -3723,7 +3726,7 @@ protected static class ClientListener extends CacheListenerAdapter {
return "listener invoked:"+l.invoked;
}
};
- DistributedTestCase.waitForCriterion(wc, 10*1000, 200, true);
+ Wait.waitForCriterion(wc, 10*1000, 200, true);
return null;
}
});
@@ -3769,7 +3772,7 @@ protected static class ClientListener extends CacheListenerAdapter {
return "listener was never invoked";
}
};
- DistributedTestCase.waitForCriterion(waitForListenerInvocation, 10 * 1000, 10, true);
+ Wait.waitForCriterion(waitForListenerInvocation, 10 * 1000, 10, true);
return null;
}
});
@@ -3919,7 +3922,7 @@ protected static class ClientListener extends CacheListenerAdapter {
//Putting a string key causes this, the partition resolver
//doesn't handle it.
- addExpectedException("IllegalStateException");
+ IgnoredException.addIgnoredException("IllegalStateException");
assertEquals(Status.STATUS_ACTIVE, tx.getStatus());
final CountDownLatch latch = new CountDownLatch(1);
Thread t = new Thread(new Runnable() {
@@ -4107,11 +4110,11 @@ protected static class ClientListener extends CacheListenerAdapter {
// is not hosting the tx. But it will not allow an expiration
// initiated on the hosting jvm.
// tx is hosted in vm2 so expiration can happen in vm1.
- DistributedTestCase.waitForCriterion(wc2, 30000, 5, true);
+ Wait.waitForCriterion(wc2, 30000, 5, true);
getCache().getCacheTransactionManager().resume(tx);
assertTrue(r.containsKey("key"));
getCache().getCacheTransactionManager().commit();
- DistributedTestCase.waitForCriterion(wc2, 30000, 5, true);
+ Wait.waitForCriterion(wc2, 30000, 5, true);
return null;
}
});
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/RemoveAllDAckDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/RemoveAllDAckDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/RemoveAllDAckDUnitTest.java
index 7ccdd6a..f3f8ea5 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/RemoveAllDAckDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/RemoveAllDAckDUnitTest.java
@@ -36,6 +36,7 @@ import com.gemstone.gemfire.cache.Scope;
import com.gemstone.gemfire.cache.util.CacheWriterAdapter;
import com.gemstone.gemfire.cache30.CacheSerializableRunnable;
import com.gemstone.gemfire.distributed.DistributedSystem;
+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.VM;
@@ -71,7 +72,7 @@ public class RemoveAllDAckDUnitTest extends DistributedTestCase {
getLogWriter().fine("Cache created successfully");
}
- public void tearDown2(){
+ public void tearDownBeforeDisconnect(){
Host host = Host.getHost(0);
VM vm0 = host.getVM(0);
VM vm1 = host.getVM(1);
@@ -139,7 +140,7 @@ public class RemoveAllDAckDUnitTest extends DistributedTestCase {
obj = region.put(ob, str);
}
}catch(Exception ex){
- fail("Failed while region.put", ex);
+ Assert.fail("Failed while region.put", ex);
}
return obj;
}//end of putMethod
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/RemoveDAckDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/RemoveDAckDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/RemoveDAckDUnitTest.java
index b32f4f5..06bbfe6 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/RemoveDAckDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/RemoveDAckDUnitTest.java
@@ -68,7 +68,7 @@ public class RemoveDAckDUnitTest 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/internal/cache/RemoveGlobalDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/RemoveGlobalDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/RemoveGlobalDUnitTest.java
index 008d09b..0119066 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/RemoveGlobalDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/RemoveGlobalDUnitTest.java
@@ -40,6 +40,7 @@ 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;
/**
@@ -71,7 +72,7 @@ public class RemoveGlobalDUnitTest extends DistributedTestCase {
vm1.invoke(RemoveGlobalDUnitTest.class, "createCache");
}
- public void tearDown2(){
+ public void tearDownBeforeDisconnect(){
vm0.invoke(RemoveGlobalDUnitTest.class, "resetFlag");
vm1.invoke(RemoveGlobalDUnitTest.class, "resetFlag");
vm0.invoke(RemoveGlobalDUnitTest.class, "closeCache");
@@ -150,7 +151,7 @@ public class RemoveGlobalDUnitTest extends DistributedTestCase {
}
});
- DistributedTestCase.join(async, 30 * 1000, getLogWriter());
+ Threads.join(async, 30 * 1000);
if(async.exceptionOccurred())
throw async.getException();
@@ -223,7 +224,7 @@ public class RemoveGlobalDUnitTest extends DistributedTestCase {
}
});
- DistributedTestCase.join(async, 30 * 1000, getLogWriter());
+ Threads.join(async, 30 * 1000);
if(async.exceptionOccurred())
throw async.getException();
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/SimpleDiskRegionJUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/SimpleDiskRegionJUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/SimpleDiskRegionJUnitTest.java
index 10bdab3..3d615c0 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/SimpleDiskRegionJUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/SimpleDiskRegionJUnitTest.java
@@ -34,7 +34,7 @@ import org.junit.experimental.categories.Category;
import static org.junit.Assert.*;
import com.gemstone.gemfire.StatisticsFactory;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
+import com.gemstone.gemfire.test.dunit.Threads;
import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
/**
@@ -363,11 +363,11 @@ public class SimpleDiskRegionJUnitTest extends DiskRegionTestingBase
thread4.start();
thread5.start();
- DistributedTestCase.join(thread1, 30 * 1000, null);
- DistributedTestCase.join(thread2, 30 * 1000, null);
- DistributedTestCase.join(thread3, 30 * 1000, null);
- DistributedTestCase.join(thread4, 30 * 1000, null);
- DistributedTestCase.join(thread5, 30 * 1000, null);
+ Threads.join(thread1, 30 * 1000);
+ Threads.join(thread2, 30 * 1000);
+ Threads.join(thread3, 30 * 1000);
+ Threads.join(thread4, 30 * 1000);
+ Threads.join(thread5, 30 * 1000);
if (keyIds.size() != 50000) {
fail("Size not equal to 5000 as expected but is " + keyIds.size());
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/SingleHopStatsDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/SingleHopStatsDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/SingleHopStatsDUnitTest.java
index a6023c7..c4862fb 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/SingleHopStatsDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/SingleHopStatsDUnitTest.java
@@ -41,9 +41,13 @@ import com.gemstone.gemfire.internal.cache.execute.data.CustId;
import com.gemstone.gemfire.internal.cache.execute.data.OrderId;
import com.gemstone.gemfire.internal.cache.execute.data.ShipmentId;
import com.gemstone.gemfire.internal.cache.tier.sockets.CacheServerTestUtil;
+import com.gemstone.gemfire.test.dunit.Assert;
import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.Invoke;
import com.gemstone.gemfire.test.dunit.SerializableRunnable;
import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
public class SingleHopStatsDUnitTest extends CacheTestCase{
@@ -105,7 +109,7 @@ public class SingleHopStatsDUnitTest extends CacheTestCase{
member3 = host.getVM(3);
}
- public void tearDown2() throws Exception {
+ public void tearDownBeforeDisconnect() throws Exception {
try {
// close the clients first
@@ -115,14 +119,14 @@ public class SingleHopStatsDUnitTest extends CacheTestCase{
member3.invoke(SingleHopStatsDUnitTest.class, "closeCache");
closeCache();
- super.tearDown2();
+ super.tearDownBeforeDisconnect();
member0 = null;
member1 = null;
member2 = null;
member3 = null;
cache = null;
- invokeInEveryVM(new SerializableRunnable() { public void run() { cache = null; } });
+ Invoke.invokeInEveryVM(new SerializableRunnable() { public void run() { cache = null; } });
}
finally {
@@ -239,7 +243,7 @@ public class SingleHopStatsDUnitTest extends CacheTestCase{
server.start();
}
catch (IOException e) {
- fail("Failed to start server ", e);
+ Assert.fail("Failed to start server ", e);
}
if (colocation.equals("No_Colocation")) {
@@ -368,7 +372,7 @@ public class SingleHopStatsDUnitTest extends CacheTestCase{
cms = ((GemFireCacheImpl)cache).getClientMetadataService();
// since PR metadata is fetched in a background executor thread
// we need to wait for it to arrive for a bit
- waitForCriterion(new WaitCriterion(){
+ Wait.waitForCriterion(new WaitCriterion(){
public boolean done() {
return regionMetaData.size() == 1;
}