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:15 UTC
[05/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/wan/concurrent/ConcurrentAsyncEventQueueDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/concurrent/ConcurrentAsyncEventQueueDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/concurrent/ConcurrentAsyncEventQueueDUnitTest.java
index 0e6efa0..f3b3efd 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/concurrent/ConcurrentAsyncEventQueueDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/concurrent/ConcurrentAsyncEventQueueDUnitTest.java
@@ -19,6 +19,7 @@ package com.gemstone.gemfire.internal.cache.wan.concurrent;
import com.gemstone.gemfire.cache.asyncqueue.internal.AsyncEventQueueFactoryImpl;
import com.gemstone.gemfire.cache.wan.GatewaySender.OrderPolicy;
import com.gemstone.gemfire.internal.cache.wan.AsyncEventQueueTestBase;
+import com.gemstone.gemfire.test.dunit.Assert;
import com.gemstone.gemfire.test.dunit.AsyncInvocation;
/**
@@ -105,15 +106,15 @@ public class ConcurrentAsyncEventQueueDUnitTest extends AsyncEventQueueTestBase
false, 100, 10, true, false, null, false, 3, OrderPolicy.KEY });
vm4.invoke(AsyncEventQueueTestBase.class, "createReplicatedRegionWithAsyncEventQueue",
- new Object[] { testName + "_RR", "ln", isOffHeap() });
+ new Object[] { getTestName() + "_RR", "ln", isOffHeap() });
vm5.invoke(AsyncEventQueueTestBase.class, "createReplicatedRegionWithAsyncEventQueue",
- new Object[] { testName + "_RR", "ln", isOffHeap() });
+ new Object[] { getTestName() + "_RR", "ln", isOffHeap() });
vm6.invoke(AsyncEventQueueTestBase.class, "createReplicatedRegionWithAsyncEventQueue",
- new Object[] { testName + "_RR", "ln", isOffHeap() });
+ new Object[] { getTestName() + "_RR", "ln", isOffHeap() });
vm7.invoke(AsyncEventQueueTestBase.class, "createReplicatedRegionWithAsyncEventQueue",
- new Object[] { testName + "_RR", "ln", isOffHeap() });
+ new Object[] { getTestName() + "_RR", "ln", isOffHeap() });
- vm4.invoke(AsyncEventQueueTestBase.class, "doPuts", new Object[] { testName + "_RR",
+ vm4.invoke(AsyncEventQueueTestBase.class, "doPuts", new Object[] { getTestName() + "_RR",
100 });
vm4.invoke(AsyncEventQueueTestBase.class, "waitForAsyncQueueToGetEmpty",
@@ -163,19 +164,19 @@ public class ConcurrentAsyncEventQueueDUnitTest extends AsyncEventQueueTestBase
false, 100, 10, true, false, null, false, 3, OrderPolicy.THREAD });
vm4.invoke(AsyncEventQueueTestBase.class, "createReplicatedRegionWithAsyncEventQueue",
- new Object[] { testName + "_RR", "ln", isOffHeap() });
+ new Object[] { getTestName() + "_RR", "ln", isOffHeap() });
vm5.invoke(AsyncEventQueueTestBase.class, "createReplicatedRegionWithAsyncEventQueue",
- new Object[] { testName + "_RR", "ln", isOffHeap() });
+ new Object[] { getTestName() + "_RR", "ln", isOffHeap() });
vm6.invoke(AsyncEventQueueTestBase.class, "createReplicatedRegionWithAsyncEventQueue",
- new Object[] { testName + "_RR", "ln", isOffHeap() });
+ new Object[] { getTestName() + "_RR", "ln", isOffHeap() });
vm7.invoke(AsyncEventQueueTestBase.class, "createReplicatedRegionWithAsyncEventQueue",
- new Object[] { testName + "_RR", "ln", isOffHeap() });
+ new Object[] { getTestName() + "_RR", "ln", isOffHeap() });
- AsyncInvocation inv1 = vm4.invokeAsync(AsyncEventQueueTestBase.class, "doPuts", new Object[] { testName + "_RR",
+ AsyncInvocation inv1 = vm4.invokeAsync(AsyncEventQueueTestBase.class, "doPuts", new Object[] { getTestName() + "_RR",
50 });
- AsyncInvocation inv2 = vm4.invokeAsync(AsyncEventQueueTestBase.class, "doNextPuts", new Object[] { testName + "_RR",
+ AsyncInvocation inv2 = vm4.invokeAsync(AsyncEventQueueTestBase.class, "doNextPuts", new Object[] { getTestName() + "_RR",
50, 100 });
- AsyncInvocation inv3 = vm4.invokeAsync(AsyncEventQueueTestBase.class, "doNextPuts", new Object[] { testName + "_RR",
+ AsyncInvocation inv3 = vm4.invokeAsync(AsyncEventQueueTestBase.class, "doNextPuts", new Object[] { getTestName() + "_RR",
100, 150 });
try {
@@ -183,7 +184,7 @@ public class ConcurrentAsyncEventQueueDUnitTest extends AsyncEventQueueTestBase
inv2.join();
inv3.join();
} catch (InterruptedException ie) {
- fail(
+ Assert.fail(
"Cought interrupted exception while waiting for the task tgo complete.",
ie);
}
@@ -235,15 +236,15 @@ public class ConcurrentAsyncEventQueueDUnitTest extends AsyncEventQueueTestBase
true, 100, 10, true, false, null, false, 3, OrderPolicy.KEY });
vm4.invoke(AsyncEventQueueTestBase.class, "createPartitionedRegionWithAsyncEventQueue",
- new Object[] { testName + "_PR", "ln", isOffHeap() });
+ new Object[] { getTestName() + "_PR", "ln", isOffHeap() });
vm5.invoke(AsyncEventQueueTestBase.class, "createPartitionedRegionWithAsyncEventQueue",
- new Object[] { testName + "_PR", "ln", isOffHeap() });
+ new Object[] { getTestName() + "_PR", "ln", isOffHeap() });
vm6.invoke(AsyncEventQueueTestBase.class, "createPartitionedRegionWithAsyncEventQueue",
- new Object[] { testName + "_PR", "ln", isOffHeap() });
+ new Object[] { getTestName() + "_PR", "ln", isOffHeap() });
vm7.invoke(AsyncEventQueueTestBase.class, "createPartitionedRegionWithAsyncEventQueue",
- new Object[] { testName + "_PR", "ln", isOffHeap() });
+ new Object[] { getTestName() + "_PR", "ln", isOffHeap() });
- vm4.invoke(AsyncEventQueueTestBase.class, "doPuts", new Object[] { testName + "_PR",
+ vm4.invoke(AsyncEventQueueTestBase.class, "doPuts", new Object[] { getTestName() + "_PR",
100 });
vm4.invoke(AsyncEventQueueTestBase.class, "waitForAsyncQueueToGetEmpty",
@@ -301,15 +302,15 @@ public class ConcurrentAsyncEventQueueDUnitTest extends AsyncEventQueueTestBase
OrderPolicy.PARTITION });
vm4.invoke(AsyncEventQueueTestBase.class, "createPartitionedRegionWithAsyncEventQueue",
- new Object[] { testName + "_PR", "ln", isOffHeap() });
+ new Object[] { getTestName() + "_PR", "ln", isOffHeap() });
vm5.invoke(AsyncEventQueueTestBase.class, "createPartitionedRegionWithAsyncEventQueue",
- new Object[] { testName + "_PR", "ln", isOffHeap() });
+ new Object[] { getTestName() + "_PR", "ln", isOffHeap() });
vm6.invoke(AsyncEventQueueTestBase.class, "createPartitionedRegionWithAsyncEventQueue",
- new Object[] { testName + "_PR", "ln", isOffHeap() });
+ new Object[] { getTestName() + "_PR", "ln", isOffHeap() });
vm7.invoke(AsyncEventQueueTestBase.class, "createPartitionedRegionWithAsyncEventQueue",
- new Object[] { testName + "_PR", "ln", isOffHeap() });
+ new Object[] { getTestName() + "_PR", "ln", isOffHeap() });
- vm4.invoke(AsyncEventQueueTestBase.class, "doPuts", new Object[] { testName + "_PR",
+ vm4.invoke(AsyncEventQueueTestBase.class, "doPuts", new Object[] { getTestName() + "_PR",
100 });
vm4.invoke(AsyncEventQueueTestBase.class, "waitForAsyncQueueToGetEmpty",
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/CommonParallelAsyncEventQueueDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/CommonParallelAsyncEventQueueDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/CommonParallelAsyncEventQueueDUnitTest.java
index 5b9d3bd..0d77040 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/CommonParallelAsyncEventQueueDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/CommonParallelAsyncEventQueueDUnitTest.java
@@ -17,6 +17,8 @@
package com.gemstone.gemfire.internal.cache.wan.misc;
import com.gemstone.gemfire.internal.cache.wan.AsyncEventQueueTestBase;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.IgnoredException;
/**
* @author skumar
@@ -35,24 +37,24 @@ public class CommonParallelAsyncEventQueueDUnitTest extends AsyncEventQueueTestB
}
public void testSameSenderWithNonColocatedRegions() throws Exception {
- addExpectedException("cannot have the same parallel async");
+ IgnoredException.addIgnoredException("cannot have the same parallel async");
Integer lnPort = (Integer)vm0.invoke(AsyncEventQueueTestBase.class,
"createFirstLocatorWithDSId", new Object[] { 1 });
vm4.invoke(AsyncEventQueueTestBase.class, "createCache", new Object[] { lnPort });
vm4.invoke(AsyncEventQueueTestBase.class, "createAsyncEventQueue", new Object[] { "ln",
true, 100, 100, false, false, null, false });
vm4.invoke(AsyncEventQueueTestBase.class, "createPartitionedRegionWithAsyncEventQueue",
- new Object[] { testName + "_PR1", "ln", isOffHeap() });
+ new Object[] { getTestName() + "_PR1", "ln", isOffHeap() });
try {
vm4.invoke(AsyncEventQueueTestBase.class, "createPartitionedRegionWithAsyncEventQueue",
- new Object[] { testName + "_PR2", "ln", isOffHeap() });
+ new Object[] { getTestName() + "_PR2", "ln", isOffHeap() });
fail("Expected IllegateStateException : cannot have the same parallel gateway sender");
}
catch (Exception e) {
if (!(e.getCause() instanceof IllegalStateException)
|| !(e.getCause().getMessage()
.contains("cannot have the same parallel async event queue id"))) {
- fail("Expected IllegalStateException", e);
+ Assert.fail("Expected IllegalStateException", e);
}
}
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/internal/compression/CompressionCacheConfigDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/compression/CompressionCacheConfigDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/compression/CompressionCacheConfigDUnitTest.java
index 84c9193..9da6610 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/compression/CompressionCacheConfigDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/compression/CompressionCacheConfigDUnitTest.java
@@ -26,7 +26,7 @@ import com.gemstone.gemfire.cache30.CacheTestCase;
import com.gemstone.gemfire.compression.Compressor;
import com.gemstone.gemfire.compression.SnappyCompressor;
import com.gemstone.gemfire.internal.cache.LocalRegion;
-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.SerializableCallable;
import com.gemstone.gemfire.test.dunit.SerializableRunnable;
@@ -67,8 +67,8 @@ public class CompressionCacheConfigDUnitTest extends CacheTestCase {
}
@Override
- public void tearDown2() throws Exception {
- super.tearDown2();
+ public void tearDownBeforeDisconnect() throws Exception {
+ super.tearDownBeforeDisconnect();
}
/**
@@ -96,9 +96,9 @@ public class CompressionCacheConfigDUnitTest extends CacheTestCase {
* @throws Exception
*/
public void testCreateCacheWithBadCompressor() throws Exception {
- addExpectedException("Unable to load class BAD_COMPRESSOR");
+ IgnoredException.addIgnoredException("Unable to load class BAD_COMPRESSOR");
File cacheXml = createCacheXml(BAD_COMPRESSOR);
- ExpectedException expectedException = DistributedTestCase.addExpectedException("While reading Cache XML file");
+ IgnoredException expectedException = IgnoredException.addIgnoredException("While reading Cache XML file");
try {
assertFalse(createCacheOnVM(getVM(0), cacheXml.getCanonicalPath()));
} finally {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/internal/compression/CompressionCacheListenerDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/compression/CompressionCacheListenerDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/compression/CompressionCacheListenerDUnitTest.java
index 3ff3e9b..ebc7718 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/compression/CompressionCacheListenerDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/compression/CompressionCacheListenerDUnitTest.java
@@ -179,7 +179,7 @@ public class CompressionCacheListenerDUnitTest extends CacheTestCase {
}
@Override
- public void tearDown2() throws Exception {
+ public void tearDownBeforeDisconnect() throws Exception {
try {
SnappyCompressor.getDefaultInstance();
cleanup(getVM(TEST_VM));
@@ -187,7 +187,7 @@ public class CompressionCacheListenerDUnitTest extends CacheTestCase {
// Not a supported OS
}
- 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/compression/CompressionCacheListenerOffHeapDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/compression/CompressionCacheListenerOffHeapDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/compression/CompressionCacheListenerOffHeapDUnitTest.java
index cf8583a..cdc688c 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/compression/CompressionCacheListenerOffHeapDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/compression/CompressionCacheListenerOffHeapDUnitTest.java
@@ -21,6 +21,7 @@ import java.util.Properties;
import com.gemstone.gemfire.compression.SnappyCompressor;
import com.gemstone.gemfire.distributed.internal.DistributionConfig;
import com.gemstone.gemfire.internal.cache.OffHeapTestUtil;
+import com.gemstone.gemfire.test.dunit.Invoke;
import com.gemstone.gemfire.test.dunit.SerializableRunnable;
@SuppressWarnings("serial")
@@ -39,7 +40,7 @@ public class CompressionCacheListenerOffHeapDUnitTest extends
}
@Override
- public void tearDown2() throws Exception {
+ public void tearDownBeforeDisconnect() throws Exception {
SerializableRunnable checkOrphans = new SerializableRunnable() {
@Override
@@ -49,11 +50,11 @@ public class CompressionCacheListenerOffHeapDUnitTest 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/compression/CompressionRegionConfigDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/compression/CompressionRegionConfigDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/compression/CompressionRegionConfigDUnitTest.java
index 8061b3c..b7beede 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/compression/CompressionRegionConfigDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/compression/CompressionRegionConfigDUnitTest.java
@@ -27,11 +27,13 @@ import com.gemstone.gemfire.cache.server.CacheServer;
import com.gemstone.gemfire.cache30.CacheTestCase;
import com.gemstone.gemfire.compression.Compressor;
import com.gemstone.gemfire.compression.SnappyCompressor;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
+import com.gemstone.gemfire.test.dunit.DUnitEnv;
import com.gemstone.gemfire.test.dunit.Host;
import com.gemstone.gemfire.test.dunit.SerializableCallable;
import com.gemstone.gemfire.test.dunit.SerializableRunnable;
import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
import com.gemstone.gemfire.test.dunit.standalone.DUnitLauncher;
/**
@@ -74,8 +76,8 @@ public class CompressionRegionConfigDUnitTest extends CacheTestCase {
}
@Override
- public void tearDown2() throws Exception {
- super.tearDown2();
+ public void tearDownBeforeDisconnect() throws Exception {
+ super.tearDownBeforeDisconnect();
}
/**
@@ -236,7 +238,7 @@ public class CompressionRegionConfigDUnitTest extends CacheTestCase {
* @param key the key to wait on.
*/
private void waitOnPut(final VM vm, final String key) {
- DistributedTestCase.waitForCriterion(new DistributedTestCase.WaitCriterion() {
+ Wait.waitForCriterion(new WaitCriterion() {
@Override
public boolean done() {
return (getUsingVM(vm, key) != null);
@@ -523,7 +525,7 @@ public class CompressionRegionConfigDUnitTest extends CacheTestCase {
}
// Running in hydra
else {
- return getDUnitLocatorPort();
+ return DUnitEnv.getDUnitLocatorPort();
}
}
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/internal/compression/CompressionRegionFactoryDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/compression/CompressionRegionFactoryDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/compression/CompressionRegionFactoryDUnitTest.java
index 37dbddf..102a465 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/compression/CompressionRegionFactoryDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/compression/CompressionRegionFactoryDUnitTest.java
@@ -60,8 +60,8 @@ public class CompressionRegionFactoryDUnitTest extends CacheTestCase {
}
@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/compression/CompressionRegionOperationsDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/compression/CompressionRegionOperationsDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/compression/CompressionRegionOperationsDUnitTest.java
index e8153e2..a76e8bd 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/compression/CompressionRegionOperationsDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/compression/CompressionRegionOperationsDUnitTest.java
@@ -147,7 +147,7 @@ public class CompressionRegionOperationsDUnitTest extends CacheTestCase {
}
@Override
- public void tearDown2() throws Exception {
+ public void tearDownBeforeDisconnect() throws Exception {
try {
SnappyCompressor.getDefaultInstance();
cleanup(getVM(TEST_VM));
@@ -155,7 +155,7 @@ public class CompressionRegionOperationsDUnitTest extends CacheTestCase {
// Not a supported OS
}
- 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/compression/CompressionRegionOperationsOffHeapDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/compression/CompressionRegionOperationsOffHeapDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/compression/CompressionRegionOperationsOffHeapDUnitTest.java
index 8c66f96..63115a8 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/compression/CompressionRegionOperationsOffHeapDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/compression/CompressionRegionOperationsOffHeapDUnitTest.java
@@ -22,6 +22,7 @@ import com.gemstone.gemfire.compression.Compressor;
import com.gemstone.gemfire.compression.SnappyCompressor;
import com.gemstone.gemfire.distributed.internal.DistributionConfig;
import com.gemstone.gemfire.internal.cache.OffHeapTestUtil;
+import com.gemstone.gemfire.test.dunit.Invoke;
import com.gemstone.gemfire.test.dunit.SerializableRunnable;
public class CompressionRegionOperationsOffHeapDUnitTest extends
@@ -31,7 +32,7 @@ public class CompressionRegionOperationsOffHeapDUnitTest extends
super(name);
}
@Override
- public void tearDown2() throws Exception {
+ public void tearDownBeforeDisconnect() throws Exception {
SerializableRunnable checkOrphans = new SerializableRunnable() {
@Override
@@ -41,11 +42,11 @@ public class CompressionRegionOperationsOffHeapDUnitTest 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/jta/dunit/ExceptionsDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/ExceptionsDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/ExceptionsDUnitTest.java
index 8015b6a..a15891e 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/ExceptionsDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/ExceptionsDUnitTest.java
@@ -184,7 +184,7 @@ public class ExceptionsDUnitTest extends DistributedTestCase {
vm0.invoke(ExceptionsDUnitTest.class, "init");
}
- public void tearDown2() throws NamingException, SQLException {
+ public void tearDownBeforeDisconnect() throws NamingException, SQLException {
Host host = Host.getHost(0);
VM vm0 = host.getVM(0);
vm0.invoke(ExceptionsDUnitTest.class, "closeCache");
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/IdleTimeOutDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/IdleTimeOutDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/IdleTimeOutDUnitTest.java
index c340ae3..9d527ec 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/IdleTimeOutDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/IdleTimeOutDUnitTest.java
@@ -37,9 +37,11 @@ import com.gemstone.gemfire.cache.CacheFactory;
import com.gemstone.gemfire.distributed.DistributedSystem;
import com.gemstone.gemfire.internal.OSProcess;
import com.gemstone.gemfire.internal.jta.CacheUtils;
+import com.gemstone.gemfire.test.dunit.Assert;
import com.gemstone.gemfire.test.dunit.AsyncInvocation;
import com.gemstone.gemfire.test.dunit.DistributedTestCase;
import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.Threads;
import com.gemstone.gemfire.test.dunit.VM;
import com.gemstone.gemfire.util.test.TestUtil;
@@ -250,7 +252,7 @@ public class IdleTimeOutDUnitTest extends DistributedTestCase {
vm0.invoke(IdleTimeOutDUnitTest.class, "init", o);
}
- public void tearDown2() throws NamingException, SQLException {
+ public void tearDownBeforeDisconnect() throws NamingException, SQLException {
VM vm0 = Host.getHost(0).getVM(0);
// destroyTable call disabled due to high rate of failure - see internal ticket #52274
// vm0.invoke(IdleTimeOutDUnitTest.class, "destroyTable");
@@ -264,9 +266,9 @@ public class IdleTimeOutDUnitTest extends DistributedTestCase {
vm0.invoke(IdleTimeOutDUnitTest.class, "runTest1");
AsyncInvocation asyncObj = vm0.invokeAsync(IdleTimeOutDUnitTest.class,
"runTest2");
- DistributedTestCase.join(asyncObj, 30 * 1000, getLogWriter());
+ Threads.join(asyncObj, 30 * 1000);
if(asyncObj.exceptionOccurred()){
- fail("asyncObj failed", asyncObj.getException());
+ Assert.fail("asyncObj failed", asyncObj.getException());
}
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/LoginTimeOutDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/LoginTimeOutDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/LoginTimeOutDUnitTest.java
index 6be7241..db470db 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/LoginTimeOutDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/LoginTimeOutDUnitTest.java
@@ -40,11 +40,15 @@ import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem;
import com.gemstone.gemfire.internal.OSProcess;
import com.gemstone.gemfire.internal.jta.CacheUtils;
import com.gemstone.gemfire.internal.logging.LogService;
+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.RMIException;
+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;
import com.gemstone.gemfire.util.test.TestUtil;
public class LoginTimeOutDUnitTest extends DistributedTestCase {
@@ -248,11 +252,11 @@ public class LoginTimeOutDUnitTest extends DistributedTestCase {
VM vm0 = host.getVM(0);
AsyncInvocation test1 = vm0.invokeAsync(LoginTimeOutDUnitTest.class, "runTest1");
AsyncInvocation test2 = vm0.invokeAsync(LoginTimeOutDUnitTest.class, "runTest2");
- DistributedTestCase.join(test2, 120 * 1000, getLogWriter());
+ Threads.join(test2, 120 * 1000);
if(test2.exceptionOccurred()){
- fail("asyncObj failed", test2.getException());
+ Assert.fail("asyncObj failed", test2.getException());
}
- DistributedTestCase.join(test1, 30000, getLogWriter());
+ Threads.join(test1, 30000);
}
public static void runTest1() throws Exception {
@@ -292,7 +296,7 @@ public class LoginTimeOutDUnitTest extends DistributedTestCase {
return null;
}
};
- DistributedTestCase.waitForCriterion(ev, 60 * 1000, 200, true);
+ Wait.waitForCriterion(ev, 60 * 1000, 200, true);
}
public static void runTest2() throws Exception {
@@ -306,7 +310,7 @@ public class LoginTimeOutDUnitTest extends DistributedTestCase {
return null;
}
};
- DistributedTestCase.waitForCriterion(ev, 60 * 1000, 200, true);
+ Wait.waitForCriterion(ev, 60 * 1000, 200, true);
DataSource ds = null;
try {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/MaxPoolSizeDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/MaxPoolSizeDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/MaxPoolSizeDUnitTest.java
index 5e31e12..90da7b5 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/MaxPoolSizeDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/MaxPoolSizeDUnitTest.java
@@ -37,9 +37,11 @@ import com.gemstone.gemfire.cache.CacheFactory;
import com.gemstone.gemfire.distributed.DistributedSystem;
import com.gemstone.gemfire.internal.OSProcess;
import com.gemstone.gemfire.internal.jta.CacheUtils;
+import com.gemstone.gemfire.test.dunit.Assert;
import com.gemstone.gemfire.test.dunit.AsyncInvocation;
import com.gemstone.gemfire.test.dunit.DistributedTestCase;
import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.Threads;
import com.gemstone.gemfire.test.dunit.VM;
import com.gemstone.gemfire.util.test.TestUtil;
@@ -252,7 +254,7 @@ public class MaxPoolSizeDUnitTest extends DistributedTestCase {
vm0.invoke(MaxPoolSizeDUnitTest.class, "init", o);
}
- public void tearDown2() throws NamingException, SQLException {
+ public void tearDownBeforeDisconnect() throws NamingException, SQLException {
Host host = Host.getHost(0);
VM vm0 = host.getVM(0);
try {
@@ -267,9 +269,9 @@ public class MaxPoolSizeDUnitTest extends DistributedTestCase {
VM vm0 = host.getVM(0);
AsyncInvocation asyncObj = vm0.invokeAsync(MaxPoolSizeDUnitTest.class,
"runTest1");
- DistributedTestCase.join(asyncObj, 30 * 1000, getLogWriter());
+ Threads.join(asyncObj, 30 * 1000);
if(asyncObj.exceptionOccurred()){
- fail("asyncObj failed", asyncObj.getException());
+ Assert.fail("asyncObj failed", asyncObj.getException());
}
}
@@ -300,7 +302,7 @@ public class MaxPoolSizeDUnitTest extends DistributedTestCase {
}
catch (SQLException e) {
if (count < (MAX_CONNECTIONS-1)) {
- fail("runTest1 SQL Exception", e);
+ Assert.fail("runTest1 SQL Exception", e);
}
else {
getLogWriter().fine("Success SQLException caught at connection #"
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/TransactionTimeOutDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/TransactionTimeOutDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/TransactionTimeOutDUnitTest.java
index 22b8bff..eacac9a 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/TransactionTimeOutDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/TransactionTimeOutDUnitTest.java
@@ -41,9 +41,11 @@ import com.gemstone.gemfire.internal.OSProcess;
import com.gemstone.gemfire.internal.datasource.GemFireTransactionDataSource;
import com.gemstone.gemfire.internal.jta.CacheUtils;
import com.gemstone.gemfire.internal.jta.UserTransactionImpl;
+import com.gemstone.gemfire.test.dunit.Assert;
import com.gemstone.gemfire.test.dunit.AsyncInvocation;
import com.gemstone.gemfire.test.dunit.DistributedTestCase;
import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.Threads;
import com.gemstone.gemfire.test.dunit.VM;
import com.gemstone.gemfire.util.test.TestUtil;
@@ -123,7 +125,7 @@ public class TransactionTimeOutDUnitTest extends DistributedTestCase {
vm0.invoke(TransactionTimeOutDUnitTest.class, "init");
}
- public void tearDown2() throws NamingException, SQLException {
+ public void tearDownBeforeDisconnect() throws NamingException, SQLException {
Host host = Host.getHost(0);
VM vm0 = host.getVM(0);
vm0.invoke(TransactionTimeOutDUnitTest.class, "closeCache");
@@ -135,13 +137,13 @@ public class TransactionTimeOutDUnitTest extends DistributedTestCase {
AsyncInvocation async1 = vm0.invokeAsync(TransactionTimeOutDUnitTest.class, "runTest1");
AsyncInvocation async2 =vm0.invokeAsync(TransactionTimeOutDUnitTest.class, "runTest2");
- DistributedTestCase.join(async1, 30 * 1000, getLogWriter());
- DistributedTestCase.join(async2, 30 * 1000, getLogWriter());
+ Threads.join(async1, 30 * 1000);
+ Threads.join(async2, 30 * 1000);
if(async1.exceptionOccurred()){
- fail("async1 failed", async1.getException());
+ Assert.fail("async1 failed", async1.getException());
}
if(async2.exceptionOccurred()){
- fail("async2 failed", async2.getException());
+ Assert.fail("async2 failed", async2.getException());
}
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/TxnManagerMultiThreadDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/TxnManagerMultiThreadDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/TxnManagerMultiThreadDUnitTest.java
index 83e29af..587f793 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/TxnManagerMultiThreadDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/TxnManagerMultiThreadDUnitTest.java
@@ -42,9 +42,11 @@ import com.gemstone.gemfire.distributed.DistributedSystem;
import com.gemstone.gemfire.internal.OSProcess;
import com.gemstone.gemfire.internal.jta.CacheUtils;
import com.gemstone.gemfire.internal.jta.JTAUtils;
+import com.gemstone.gemfire.test.dunit.Assert;
import com.gemstone.gemfire.test.dunit.AsyncInvocation;
import com.gemstone.gemfire.test.dunit.DistributedTestCase;
import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.Threads;
import com.gemstone.gemfire.test.dunit.VM;
import com.gemstone.gemfire.util.test.TestUtil;
@@ -352,7 +354,7 @@ public class TxnManagerMultiThreadDUnitTest extends DistributedTestCase {
}
}//end of delRows
- public void tearDown2() throws java.lang.Exception {
+ public void tearDownBeforeDisconnect() throws java.lang.Exception {
VM vm0 = Host.getHost(0).getVM(0);
//get tableName to pass to destroyTable
String tableName = CacheUtils.getTableName();
@@ -422,9 +424,9 @@ public class TxnManagerMultiThreadDUnitTest extends DistributedTestCase {
VM vm0 = Host.getHost(0).getVM(0);
AsyncInvocation asyncObj1 = vm0.invokeAsync(
TxnManagerMultiThreadDUnitTest.class, "callCommitThreads");
- DistributedTestCase.join(asyncObj1, 30 * 1000, getLogWriter());
+ Threads.join(asyncObj1, 30 * 1000);
if(asyncObj1.exceptionOccurred()){
- fail("asyncObj1 failed", asyncObj1.getException());
+ Assert.fail("asyncObj1 failed", asyncObj1.getException());
}
vm0.invoke(TxnManagerMultiThreadDUnitTest.class, "getNumberOfRows");
}//end of testAllCommit
@@ -455,9 +457,9 @@ public class TxnManagerMultiThreadDUnitTest extends DistributedTestCase {
VM vm0 = Host.getHost(0).getVM(0);
AsyncInvocation asyncObj1 = vm0.invokeAsync(
TxnManagerMultiThreadDUnitTest.class, "callCommitandRollbackThreads");
- DistributedTestCase.join(asyncObj1, 30 * 1000, getLogWriter());
+ Threads.join(asyncObj1, 30 * 1000);
if(asyncObj1.exceptionOccurred()){
- fail("asyncObj1 failed", asyncObj1.getException());
+ Assert.fail("asyncObj1 failed", asyncObj1.getException());
}
vm0.invoke(TxnManagerMultiThreadDUnitTest.class, "getNumberOfRows");
}//end of test3Commit2Rollback
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/TxnTimeOutDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/TxnTimeOutDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/TxnTimeOutDUnitTest.java
index 7e81aae..2e201d9 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/TxnTimeOutDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/TxnTimeOutDUnitTest.java
@@ -35,9 +35,12 @@ import com.gemstone.gemfire.cache.CacheFactory;
import com.gemstone.gemfire.distributed.DistributedSystem;
import com.gemstone.gemfire.internal.OSProcess;
import com.gemstone.gemfire.internal.jta.CacheUtils;
+import com.gemstone.gemfire.test.dunit.Assert;
import com.gemstone.gemfire.test.dunit.AsyncInvocation;
+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.Threads;
import com.gemstone.gemfire.test.dunit.VM;
import com.gemstone.gemfire.util.test.TestUtil;
@@ -69,7 +72,7 @@ public class TxnTimeOutDUnitTest extends DistributedTestCase {
wr.close();
props.setProperty("cache-xml-file", path);
// props.setProperty("mcast-port", "10321");
- props.setProperty("log-level", getDUnitLogLevel());
+ props.setProperty("log-level", DUnitEnv.getDUnitLogLevel());
try {
// ds = DistributedSystem.connect(props);
ds = (new TxnTimeOutDUnitTest("temp")).getSystem(props);
@@ -119,7 +122,7 @@ public class TxnTimeOutDUnitTest extends DistributedTestCase {
vm0.invoke(TxnTimeOutDUnitTest.class, "init");
}
- public void tearDown2() throws NamingException, SQLException {
+ public void tearDownBeforeDisconnect() throws NamingException, SQLException {
Host host = Host.getHost(0);
VM vm0 = host.getVM(0);
vm0.invoke(TxnTimeOutDUnitTest.class, "closeCache");
@@ -154,29 +157,29 @@ public class TxnTimeOutDUnitTest extends DistributedTestCase {
AsyncInvocation asyncObj5 = vm0.invokeAsync(TxnTimeOutDUnitTest.class,
"runTest3",o4);
- DistributedTestCase.join(asyncObj1, 5 * 60 * 1000, getLogWriter());
+ Threads.join(asyncObj1, 5 * 60 * 1000);
if(asyncObj1.exceptionOccurred()){
- fail("asyncObj1 failed", asyncObj1.getException());
+ Assert.fail("asyncObj1 failed", asyncObj1.getException());
}
- DistributedTestCase.join(asyncObj2, 5 * 60 * 1000, getLogWriter());
+ Threads.join(asyncObj2, 5 * 60 * 1000);
if(asyncObj2.exceptionOccurred()){
- fail("asyncObj2 failed", asyncObj2.getException());
+ Assert.fail("asyncObj2 failed", asyncObj2.getException());
}
- DistributedTestCase.join(asyncObj3, 5 * 60 * 1000, getLogWriter());
+ Threads.join(asyncObj3, 5 * 60 * 1000);
if(asyncObj3.exceptionOccurred()){
- fail("asyncObj3 failed", asyncObj3.getException());
+ Assert.fail("asyncObj3 failed", asyncObj3.getException());
}
- DistributedTestCase.join(asyncObj4, 5 * 60 * 1000, getLogWriter());
+ Threads.join(asyncObj4, 5 * 60 * 1000);
if(asyncObj4.exceptionOccurred()){
- fail("asyncObj4 failed", asyncObj4.getException());
+ Assert.fail("asyncObj4 failed", asyncObj4.getException());
}
- DistributedTestCase.join(asyncObj5, 5 * 60 * 1000, getLogWriter());
+ Threads.join(asyncObj5, 5 * 60 * 1000);
if(asyncObj5.exceptionOccurred()){
- fail("asyncObj5 failed", asyncObj5.getException());
+ Assert.fail("asyncObj5 failed", asyncObj5.getException());
}
@@ -193,14 +196,14 @@ public class TxnTimeOutDUnitTest extends DistributedTestCase {
"runTest2");
AsyncInvocation asyncObj2 = vm0.invokeAsync(TxnTimeOutDUnitTest.class, "runTest1");
- DistributedTestCase.join(asyncObj1, 5 * 60 * 1000, getLogWriter());
+ Threads.join(asyncObj1, 5 * 60 * 1000);
if(asyncObj1.exceptionOccurred()){
- fail("asyncObj1 failed", asyncObj1.getException());
+ Assert.fail("asyncObj1 failed", asyncObj1.getException());
}
- DistributedTestCase.join(asyncObj2, 5 * 60 * 1000, getLogWriter());
+ Threads.join(asyncObj2, 5 * 60 * 1000);
if(asyncObj2.exceptionOccurred()){
- fail("asyncObj2 failed", asyncObj2.getException());
+ Assert.fail("asyncObj2 failed", asyncObj2.getException());
}
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/internal/logging/DistributedSystemLogFileJUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/logging/DistributedSystemLogFileJUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/logging/DistributedSystemLogFileJUnitTest.java
index a8b664e..b3f4029 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/logging/DistributedSystemLogFileJUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/logging/DistributedSystemLogFileJUnitTest.java
@@ -43,8 +43,8 @@ import com.gemstone.gemfire.distributed.internal.DistributionConfig;
import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem;
import com.gemstone.gemfire.internal.logging.log4j.FastLogger;
import com.gemstone.gemfire.internal.logging.log4j.LogWriterLogger;
-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;
/**
@@ -113,7 +113,7 @@ public class DistributedSystemLogFileJUnitTest {
assertEquals("Expected " + LogWriterImpl.levelToString(InternalLogWriter.INFO_LEVEL) + " but was " + LogWriterImpl.levelToString(logWriter.getLogWriterLevel()),
InternalLogWriter.INFO_LEVEL, logWriter.getLogWriterLevel());
- DistributedTestCase.waitForCriterion(new WaitCriterion() {
+ Wait.waitForCriterion(new WaitCriterion() {
@Override
public boolean done() {
return logFile.exists();
@@ -504,7 +504,7 @@ public class DistributedSystemLogFileJUnitTest {
assertTrue(logWriter instanceof FastLogger);
assertTrue(((FastLogger)logWriter).isDelegating());
- DistributedTestCase.waitForCriterion(new WaitCriterion() {
+ Wait.waitForCriterion(new WaitCriterion() {
@Override
public boolean done() {
return logFile.exists();
@@ -720,7 +720,7 @@ public class DistributedSystemLogFileJUnitTest {
assertTrue(logWriter instanceof FastLogger);
assertTrue(((FastLogger)logWriter).isDelegating());
- DistributedTestCase.waitForCriterion(new WaitCriterion() {
+ Wait.waitForCriterion(new WaitCriterion() {
@Override
public boolean done() {
return logFile.exists();
@@ -961,7 +961,7 @@ public class DistributedSystemLogFileJUnitTest {
assertTrue(((FastLogger)logWriter).isDelegating());
- DistributedTestCase.waitForCriterion(new WaitCriterion() {
+ Wait.waitForCriterion(new WaitCriterion() {
@Override
public boolean done() {
return securityLogFile.exists() && logFile.exists();
@@ -1076,7 +1076,7 @@ public class DistributedSystemLogFileJUnitTest {
assertTrue(((FastLogger)securityLogWriter).isDelegating());
assertTrue(((FastLogger)logWriter).isDelegating());
- DistributedTestCase.waitForCriterion(new WaitCriterion() {
+ Wait.waitForCriterion(new WaitCriterion() {
@Override
public boolean done() {
return securityLogFile.exists() && logFile.exists();
@@ -1248,7 +1248,7 @@ public class DistributedSystemLogFileJUnitTest {
assertTrue(((FastLogger)securityLogWriter).isDelegating());
assertTrue(((FastLogger)logWriter).isDelegating());
- DistributedTestCase.waitForCriterion(new WaitCriterion() {
+ Wait.waitForCriterion(new WaitCriterion() {
@Override
public boolean done() {
return logFile.exists();
@@ -1397,7 +1397,7 @@ public class DistributedSystemLogFileJUnitTest {
assertTrue(((FastLogger)securityLogWriter).isDelegating());
assertTrue(((FastLogger)logWriter).isDelegating());
- DistributedTestCase.waitForCriterion(new WaitCriterion() {
+ Wait.waitForCriterion(new WaitCriterion() {
@Override
public boolean done() {
return logFile.exists();
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/internal/logging/LocatorLogFileJUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/logging/LocatorLogFileJUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/logging/LocatorLogFileJUnitTest.java
index d817f74..ffb09ce 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/logging/LocatorLogFileJUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/logging/LocatorLogFileJUnitTest.java
@@ -35,8 +35,8 @@ import com.gemstone.gemfire.distributed.internal.DistributionConfig;
import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem;
import com.gemstone.gemfire.internal.AvailablePort;
import com.gemstone.gemfire.internal.logging.log4j.LogWriterLogger;
-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;
/**
@@ -103,7 +103,7 @@ public class LocatorLogFileJUnitTest {
InternalLogWriter.INFO_LEVEL, logWriter.getLogWriterLevel());
assertNotNull(this.locator);
- DistributedTestCase.waitForCriterion(new WaitCriterion() {
+ Wait.waitForCriterion(new WaitCriterion() {
@Override
public boolean done() {
return logFile.exists();
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/internal/logging/MergeLogFilesJUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/logging/MergeLogFilesJUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/logging/MergeLogFilesJUnitTest.java
index e076d04..5e29323 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/logging/MergeLogFilesJUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/logging/MergeLogFilesJUnitTest.java
@@ -41,7 +41,7 @@ import org.junit.experimental.categories.Category;
import com.gemstone.gemfire.LogWriter;
import com.gemstone.gemfire.SystemFailure;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
+import com.gemstone.gemfire.test.dunit.Threads;
import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
/**
@@ -79,7 +79,7 @@ public class MergeLogFilesJUnitTest {
for (Iterator iter = workers.iterator(); iter.hasNext(); ) {
Worker worker = (Worker) iter.next();
- DistributedTestCase.join(worker, 120 * 1000, null);
+ Threads.join(worker, 120 * 1000);
}
if (group.exceptionOccurred()) {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/internal/offheap/OffHeapRegionBase.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/offheap/OffHeapRegionBase.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/offheap/OffHeapRegionBase.java
index 1c3a33a..b515959 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/offheap/OffHeapRegionBase.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/offheap/OffHeapRegionBase.java
@@ -44,7 +44,7 @@ import com.gemstone.gemfire.internal.offheap.annotations.Retained;
import com.gemstone.gemfire.pdx.PdxReader;
import com.gemstone.gemfire.pdx.PdxSerializable;
import com.gemstone.gemfire.pdx.PdxWriter;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
/**
* Basic test of regions that use off heap storage.
@@ -146,7 +146,7 @@ public abstract class OffHeapRegionBase {
return "Waiting for disconnect to complete";
}
};
- com.gemstone.gemfire.test.dunit.DistributedTestCase.waitForCriterion(waitForDisconnect, 10*1000, 100, true);
+ com.gemstone.gemfire.test.dunit.Wait.waitForCriterion(waitForDisconnect, 10*1000, 100, true);
assertTrue(gfc.isClosed());
} finally {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/internal/offheap/OutOfOffHeapMemoryDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/offheap/OutOfOffHeapMemoryDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/offheap/OutOfOffHeapMemoryDUnitTest.java
index 77814b0..629a741 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/offheap/OutOfOffHeapMemoryDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/offheap/OutOfOffHeapMemoryDUnitTest.java
@@ -38,7 +38,11 @@ import com.gemstone.gemfire.internal.cache.OffHeapTestUtil;
import com.gemstone.gemfire.internal.logging.LogService;
import com.gemstone.gemfire.internal.util.StopWatch;
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.SerializableRunnable;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
/**
* Test behavior of region when running out of off-heap memory.
@@ -61,7 +65,7 @@ public class OutOfOffHeapMemoryDUnitTest extends CacheTestCase {
public void setUp() throws Exception {
disconnectAllFromDS();
super.setUp();
- addExpectedException(OutOfOffHeapMemoryException.class.getSimpleName());
+ IgnoredException.addIgnoredException(OutOfOffHeapMemoryException.class.getSimpleName());
}
// public static void caseSetUp() {
@@ -80,7 +84,7 @@ public class OutOfOffHeapMemoryDUnitTest extends CacheTestCase {
// }
@Override
- public void tearDown2() throws Exception {
+ public void tearDownBeforeDisconnect() throws Exception {
final SerializableRunnable checkOrphans = new SerializableRunnable() {
@Override
public void run() {
@@ -89,12 +93,12 @@ public class OutOfOffHeapMemoryDUnitTest extends CacheTestCase {
}
}
};
- invokeInEveryVM(checkOrphans);
+ Invoke.invokeInEveryVM(checkOrphans);
try {
checkOrphans.run();
} finally {
- invokeInEveryVM(getClass(), "cleanup");
- super.tearDown2();
+ Invoke.invokeInEveryVM(getClass(), "cleanup");
+ super.tearDownBeforeDisconnect();
}
}
@@ -162,7 +166,7 @@ public class OutOfOffHeapMemoryDUnitTest extends CacheTestCase {
return "Waiting for cache, system and dm to close";
}
};
- waitForCriterion(waitForDisconnect, 10*1000, 100, true);
+ Wait.waitForCriterion(waitForDisconnect, 10*1000, 100, true);
// wait for cache instance to be nulled out
final WaitCriterion waitForNull = new WaitCriterion() {
@@ -173,7 +177,7 @@ public class OutOfOffHeapMemoryDUnitTest extends CacheTestCase {
return "Waiting for GemFireCacheImpl to null its instance";
}
};
- waitForCriterion(waitForNull, 10*1000, 100, true);
+ Wait.waitForCriterion(waitForNull, 10*1000, 100, true);
assertNull(GemFireCacheImpl.getInstance());
// verify system was closed out due to OutOfOffHeapMemoryException
@@ -330,7 +334,7 @@ public class OutOfOffHeapMemoryDUnitTest extends CacheTestCase {
return msg;
}
};
- waitForCriterion(waitForDisconnect, 30*1000, 10, true);
+ Wait.waitForCriterion(waitForDisconnect, 30*1000, 10, true);
}
});
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/internal/process/LocalProcessLauncherDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/process/LocalProcessLauncherDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/process/LocalProcessLauncherDUnitTest.java
index 1a27437..5324e25 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/process/LocalProcessLauncherDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/process/LocalProcessLauncherDUnitTest.java
@@ -50,7 +50,7 @@ public class LocalProcessLauncherDUnitTest extends DistributedTestCase {
}
@Override
- public void tearDown2() throws Exception {
+ public void tearDownBeforeDisconnect() throws Exception {
}
public void testExistingPidFileThrows() throws Exception {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/internal/statistics/StatisticsDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/statistics/StatisticsDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/statistics/StatisticsDUnitTest.java
index 40aa750..d9c4e97 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/statistics/StatisticsDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/statistics/StatisticsDUnitTest.java
@@ -60,10 +60,14 @@ import com.gemstone.gemfire.internal.StatArchiveReader.StatSpec;
import com.gemstone.gemfire.internal.StatSamplerStats;
import com.gemstone.gemfire.internal.StatisticsTypeFactoryImpl;
import com.gemstone.gemfire.internal.StatArchiveReader.StatValue;
+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.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
/**
* Integration tests for Statistics. VM0 performs puts and VM1 receives
@@ -127,8 +131,8 @@ public class StatisticsDUnitTest extends CacheTestCase {
}
@Override
- public void tearDown2() throws Exception {
- invokeInEveryVM(getClass(), "cleanup");
+ public void tearDownBeforeDisconnect() throws Exception {
+ Invoke.invokeInEveryVM(getClass(), "cleanup");
disconnectAllFromDS(); // because this test enabled stat sampling!
}
@@ -173,7 +177,7 @@ public class StatisticsDUnitTest extends CacheTestCase {
return "sampler.getSampleCollector() is still null!";
}
};
- waitForCriterion(waitForSampleCollector, 4*1000, 10, true);
+ Wait.waitForCriterion(waitForSampleCollector, 4*1000, 10, true);
final SampleCollector sampleCollector = sampler.getSampleCollector();
assertNotNull(sampleCollector);
@@ -230,7 +234,7 @@ public class StatisticsDUnitTest extends CacheTestCase {
return "sampler.getSampleCollector() is still null!";
}
};
- waitForCriterion(waitForSampleCollector, 2*1000, 10, true);
+ Wait.waitForCriterion(waitForSampleCollector, 2*1000, 10, true);
final SampleCollector sampleCollector = sampler.getSampleCollector();
assertNotNull(sampleCollector);
@@ -284,7 +288,7 @@ public class StatisticsDUnitTest extends CacheTestCase {
return rml.members + " should contain " + subMember;
}
};
- waitForCriterion(wc, 4*1000, 10, true);
+ Wait.waitForCriterion(wc, 4*1000, 10, true);
// publish lots of puts cycling through the NUM_KEYS
assertEquals(0, statistics.getPuts());
@@ -331,14 +335,14 @@ public class StatisticsDUnitTest extends CacheTestCase {
return "Waiting for " + StatSamplerStats.SAMPLE_COUNT + " >= " + initialSampleCount + 2;
}
};
- waitForCriterion(wc, 4*1000, 10, true);
+ Wait.waitForCriterion(wc, 4*1000, 10, true);
}
});
}
for (int pubThread = 0; pubThread < publishers.length; pubThread++) {
publishers[pubThread].join();
if (publishers[pubThread].exceptionOccurred()) {
- fail("Test failed", publishers[pubThread].getException());
+ Assert.fail("Test failed", publishers[pubThread].getException());
}
}
}
@@ -361,7 +365,7 @@ public class StatisticsDUnitTest extends CacheTestCase {
return "Waiting for " + StatSamplerStats.SAMPLE_COUNT + " >= " + initialSampleCount + 2;
}
};
- waitForCriterion(wc, 4*1000, 10, true);
+ Wait.waitForCriterion(wc, 4*1000, 10, true);
// now post total updateEvents to static
final PubSubStats statistics = subStatsRef.get();
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/internal/statistics/ValueMonitorJUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/statistics/ValueMonitorJUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/statistics/ValueMonitorJUnitTest.java
index cc76ce2..1d1a738 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/statistics/ValueMonitorJUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/statistics/ValueMonitorJUnitTest.java
@@ -39,8 +39,8 @@ import com.gemstone.gemfire.StatisticsType;
import com.gemstone.gemfire.internal.NanoTimer;
import com.gemstone.gemfire.internal.StatisticsManager;
import com.gemstone.gemfire.internal.statistics.StatisticsNotification.Type;
-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;
import junit.framework.TestCase;
@@ -369,6 +369,6 @@ public class ValueMonitorJUnitTest {
return "waiting for notification";
}
};
- DistributedTestCase.waitForCriterion(wc, ms, interval, throwOnTimeout);
+ Wait.waitForCriterion(wc, ms, interval, throwOnTimeout);
}
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/management/CacheManagementDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/management/CacheManagementDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/management/CacheManagementDUnitTest.java
index 2698e2a..74ba76a 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/management/CacheManagementDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/management/CacheManagementDUnitTest.java
@@ -46,9 +46,10 @@ import com.gemstone.gemfire.management.internal.ManagementConstants;
import com.gemstone.gemfire.management.internal.SystemManagementService;
import com.gemstone.gemfire.management.internal.NotificationHub.NotificationHubListener;
import com.gemstone.gemfire.test.dunit.AsyncInvocation;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
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 static com.jayway.awaitility.Awaitility.*;
import static org.hamcrest.Matchers.*;
@@ -99,8 +100,8 @@ public class CacheManagementDUnitTest extends ManagementTestBase {
}
- public void tearDown2() throws Exception {
- super.tearDown2();
+ public void tearDownBeforeDisconnect() throws Exception {
+ super.tearDownBeforeDisconnect();
}
@@ -683,7 +684,7 @@ public class CacheManagementDUnitTest extends ManagementTestBase {
}
public static void assertExpectedMembers(int expectedMemberCount) {
- DistributedTestCase.waitForCriterion(new WaitCriterion() {
+ Wait.waitForCriterion(new WaitCriterion() {
public String description() {
return "Waiting all nodes to shutDown";
}
@@ -841,7 +842,7 @@ public class CacheManagementDUnitTest extends ManagementTestBase {
SystemManagementService service = (SystemManagementService) getManagementService();
final Map<ObjectName, NotificationHubListener> hubMap = service.getNotificationHub().getListenerObjectMap();
- DistributedTestCase.waitForCriterion(new WaitCriterion() {
+ Wait.waitForCriterion(new WaitCriterion() {
public String description() {
return "Waiting for manager to register the listener";
}
@@ -919,7 +920,7 @@ public class CacheManagementDUnitTest extends ManagementTestBase {
public void run() {
- DistributedTestCase.waitForCriterion(new WaitCriterion() {
+ Wait.waitForCriterion(new WaitCriterion() {
public String description() {
return "Waiting for all the RegionCreated notification to reach the manager " + notifList.size();
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/management/ClientHealthStatsDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/management/ClientHealthStatsDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/management/ClientHealthStatsDUnitTest.java
index 7f7c4fd..24b93bc 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/management/ClientHealthStatsDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/management/ClientHealthStatsDUnitTest.java
@@ -48,10 +48,12 @@ import com.gemstone.gemfire.internal.cache.tier.sockets.CacheClientProxy;
import com.gemstone.gemfire.internal.i18n.LocalizedStrings;
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.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;
/**
* Client health stats check
@@ -101,11 +103,11 @@ public class ClientHealthStatsDUnitTest extends DistributedTestCase {
server = host.getVM(1);
client = host.getVM(2);
client2 = host.getVM(3);
- addExpectedException("Connection reset");
+ IgnoredException.addIgnoredException("Connection reset");
}
- public void tearDown2() throws Exception {
- super.tearDown2();
+ public void tearDownBeforeDisconnect() throws Exception {
+ super.tearDownBeforeDisconnect();
reset();
helper.closeCache(managingNode);
helper.closeCache(client);
@@ -233,9 +235,9 @@ public class ClientHealthStatsDUnitTest extends DistributedTestCase {
props.setProperty(DistributionConfig.DURABLE_CLIENT_ID_NAME, "durable-"+clientNum);
props.setProperty(DistributionConfig.DURABLE_CLIENT_TIMEOUT_NAME, "300000");
- props.setProperty("log-file", testName+"_client_" + clientNum + ".log");
+ props.setProperty("log-file", getTestName()+"_client_" + clientNum + ".log");
props.setProperty("log-level", "info");
- props.setProperty("statistic-archive-file", testName+"_client_" + clientNum
+ props.setProperty("statistic-archive-file", getTestName()+"_client_" + clientNum
+ ".gfs");
props.setProperty("statistic-sampling-enabled", "true");
@@ -340,7 +342,7 @@ public class ClientHealthStatsDUnitTest extends DistributedTestCase {
return "Did not receive last key.";
}
};
- DistributedTestCase.waitForCriterion(wc, 60*1000, 500, true);
+ Wait.waitForCriterion(wc, 60*1000, 500, true);
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/management/CompositeTypeTestDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/management/CompositeTypeTestDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/management/CompositeTypeTestDUnitTest.java
index 54078e8..393bf27 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/management/CompositeTypeTestDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/management/CompositeTypeTestDUnitTest.java
@@ -26,6 +26,8 @@ import com.gemstone.gemfire.management.internal.ManagementConstants;
import com.gemstone.gemfire.management.internal.SystemManagementService;
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 CompositeTypeTestDUnitTest extends ManagementTestBase {
@@ -46,8 +48,8 @@ public class CompositeTypeTestDUnitTest extends ManagementTestBase {
}
- public void tearDown2() throws Exception {
- super.tearDown2();
+ public void tearDownBeforeDisconnect() throws Exception {
+ super.tearDownBeforeDisconnect();
}
@@ -123,7 +125,7 @@ public class CompositeTypeTestDUnitTest extends ManagementTestBase {
try {
final ObjectName objectName = new ObjectName("GemFire:service=custom,type=composite,member="+memberID);
- waitForCriterion(new WaitCriterion() {
+ Wait.waitForCriterion(new WaitCriterion() {
public String description() {
return "Waiting for Composite Type MBean";
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/management/DLockManagementDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/management/DLockManagementDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/management/DLockManagementDUnitTest.java
index 793526c..b555b83 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/management/DLockManagementDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/management/DLockManagementDUnitTest.java
@@ -31,6 +31,8 @@ import com.gemstone.gemfire.management.internal.MBeanJMXAdapter;
import com.gemstone.gemfire.management.internal.SystemManagementService;
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 DLockManagementDUnitTest extends ManagementTestBase {
@@ -55,8 +57,8 @@ public class DLockManagementDUnitTest extends ManagementTestBase {
}
- public void tearDown2() throws Exception {
- super.tearDown2();
+ public void tearDownBeforeDisconnect() throws Exception {
+ super.tearDownBeforeDisconnect();
}
@@ -145,7 +147,7 @@ public class DLockManagementDUnitTest extends ManagementTestBase {
RegionMXBean bean = null;
try {
- waitForCriterion(new WaitCriterion() {
+ Wait.waitForCriterion(new WaitCriterion() {
LockServiceMXBean bean = null;
@@ -305,7 +307,7 @@ public class DLockManagementDUnitTest extends ManagementTestBase {
final String LOCK_OBJECT = "lockObject_" + vm.getPid();
- waitForCriterion(new WaitCriterion() {
+ Wait.waitForCriterion(new WaitCriterion() {
DistributedLockService service = null;
public String description() {
@@ -432,7 +434,7 @@ public class DLockManagementDUnitTest extends ManagementTestBase {
final ManagementService service = getManagementService();
if (expectedMembers == 0) {
try {
- waitForCriterion(new WaitCriterion() {
+ Wait.waitForCriterion(new WaitCriterion() {
DistributedLockServiceMXBean bean = null;
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/management/DiskManagementDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/management/DiskManagementDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/management/DiskManagementDUnitTest.java
index c9a177a..4d0a8ae 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/management/DiskManagementDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/management/DiskManagementDUnitTest.java
@@ -45,6 +45,8 @@ import com.gemstone.gemfire.test.dunit.AsyncInvocation;
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;
/**
* Test cases to cover all test cases which pertains to disk from Management
@@ -90,8 +92,8 @@ public class DiskManagementDUnitTest extends ManagementTestBase {
}
- public void tearDown2() throws Exception {
- super.tearDown2();
+ public void tearDownBeforeDisconnect() throws Exception {
+ super.tearDownBeforeDisconnect();
com.gemstone.gemfire.internal.FileUtil.delete(diskDir);
}
@@ -589,7 +591,7 @@ public class DiskManagementDUnitTest extends ManagementTestBase {
vm.invoke(new SerializableRunnable() {
public void run() {
- waitForCriterion(new WaitCriterion() {
+ Wait.waitForCriterion(new WaitCriterion() {
public String description() {
return "Waiting to blocked waiting for another persistent member to come online";
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/management/DistributedSystemDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/management/DistributedSystemDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/management/DistributedSystemDUnitTest.java
index 1a52f9b..1f429e1 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/management/DistributedSystemDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/management/DistributedSystemDUnitTest.java
@@ -49,10 +49,14 @@ import com.gemstone.gemfire.management.internal.NotificationHub.NotificationHubL
import com.gemstone.gemfire.management.internal.SystemManagementService;
import com.gemstone.gemfire.management.internal.beans.MemberMBean;
import com.gemstone.gemfire.management.internal.beans.SequenceNumber;
+import com.gemstone.gemfire.test.dunit.IgnoredException;
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;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
/**
* Distributed System tests
@@ -112,8 +116,8 @@ public class DistributedSystemDUnitTest extends ManagementTestBase {
}
- public void tearDown2() throws Exception {
- super.tearDown2();
+ public void tearDownBeforeDisconnect() throws Exception {
+ super.tearDownBeforeDisconnect();
}
@@ -205,7 +209,7 @@ public class DistributedSystemDUnitTest extends ManagementTestBase {
public Object call() throws Exception {
- waitForCriterion(new WaitCriterion() {
+ Wait.waitForCriterion(new WaitCriterion() {
public String description() {
return "Waiting for all alert Listener to register with managed node";
}
@@ -284,7 +288,7 @@ public class DistributedSystemDUnitTest extends ManagementTestBase {
ManagementService service = getManagementService();
final DistributedSystemMXBean bean = service.getDistributedSystemMXBean();
- waitForCriterion(new WaitCriterion() {
+ Wait.waitForCriterion(new WaitCriterion() {
public String description() {
return "Waiting for all members to send their initial Data";
}
@@ -359,7 +363,7 @@ public class DistributedSystemDUnitTest extends ManagementTestBase {
public void run() {
- waitForCriterion(new WaitCriterion() {
+ Wait.waitForCriterion(new WaitCriterion() {
public String description() {
return "Waiting for all Notifications to reach the Managing Node";
}
@@ -430,7 +434,7 @@ public class DistributedSystemDUnitTest extends ManagementTestBase {
ManagementService service = getManagementService();
final DistributedSystemMXBean bean = service.getDistributedSystemMXBean();
- waitForCriterion(new WaitCriterion() {
+ Wait.waitForCriterion(new WaitCriterion() {
public String description() {
return "Waiting for all members to send their initial Data";
}
@@ -562,7 +566,7 @@ public class DistributedSystemDUnitTest extends ManagementTestBase {
public Object call() throws Exception {
final AlertNotifListener nt = AlertNotifListener.getInstance();
- waitForCriterion(new WaitCriterion() {
+ Wait.waitForCriterion(new WaitCriterion() {
public String description() {
return "Waiting for all alerts to reach the Managing Node";
}
@@ -613,7 +617,7 @@ public class DistributedSystemDUnitTest extends ManagementTestBase {
vm1.invoke(new SerializableCallable("Warning level Alerts") {
public Object call() throws Exception {
- final ExpectedException warnEx = addExpectedException(WARNING_LEVEL_MESSAGE);
+ final IgnoredException warnEx = IgnoredException.addIgnoredException(WARNING_LEVEL_MESSAGE);
logger.warn(WARNING_LEVEL_MESSAGE);
warnEx.remove();
return null;
@@ -647,7 +651,7 @@ public class DistributedSystemDUnitTest extends ManagementTestBase {
public Object call() throws Exception {
// add expected exception strings
- final ExpectedException severeEx = addExpectedException(SEVERE_LEVEL_MESSAGE);
+ final IgnoredException severeEx = IgnoredException.addIgnoredException(SEVERE_LEVEL_MESSAGE);
logger.fatal(SEVERE_LEVEL_MESSAGE);
severeEx.remove();
return null;
@@ -705,7 +709,7 @@ public class DistributedSystemDUnitTest extends ManagementTestBase {
final DistributedSystemMXBean bean = service.getDistributedSystemMXBean();
assertNotNull(service.getDistributedSystemMXBean());
- waitForCriterion(new WaitCriterion() {
+ Wait.waitForCriterion(new WaitCriterion() {
public String description() {
return "Waiting All members to intitialize DistributedSystemMBean expect 5 but found " + bean.getMemberCount();
}
@@ -777,7 +781,7 @@ public class DistributedSystemDUnitTest extends ManagementTestBase {
DistributedSystemMXBean bean = service.getDistributedSystemMXBean();
assertNotNull(service.getDistributedSystemMXBean());
bean.shutDownAllMembers();
- staticPause(2000);
+ Threads.staticPause(2000);
assertEquals(
cache.getDistributedSystem().getAllOtherMembers().size(), 1);
return null;
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/management/LocatorManagementDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/management/LocatorManagementDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/management/LocatorManagementDUnitTest.java
index 631c9d0..be22781 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/management/LocatorManagementDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/management/LocatorManagementDUnitTest.java
@@ -31,9 +31,13 @@ import com.gemstone.gemfire.internal.AvailablePort;
import com.gemstone.gemfire.internal.AvailablePortHelper;
import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
import com.gemstone.gemfire.management.internal.ManagementConstants;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.DUnitEnv;
import com.gemstone.gemfire.test.dunit.Host;
import com.gemstone.gemfire.test.dunit.SerializableCallable;
import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
/**
@@ -69,9 +73,9 @@ public class LocatorManagementDUnitTest extends ManagementTestBase {
locator = managedNode1;
}
- public void tearDown2() throws Exception {
+ public void tearDownBeforeDisconnect() throws Exception {
stopLocator(locator);
- super.tearDown2();
+ super.tearDownBeforeDisconnect();
}
@@ -164,21 +168,21 @@ public class LocatorManagementDUnitTest extends ManagementTestBase {
props.setProperty(DistributionConfig.MCAST_PORT_NAME,"0");
props.setProperty(DistributionConfig.LOCATORS_NAME, "");
- props.setProperty(DistributionConfig.LOG_LEVEL_NAME, getDUnitLogLevel());
+ props.setProperty(DistributionConfig.LOG_LEVEL_NAME, DUnitEnv.getDUnitLogLevel());
InetAddress bindAddr = null;
try {
bindAddr = InetAddress.getByName(getServerHostName(vm.getHost()));
} catch (UnknownHostException uhe) {
- fail("While resolving bind address ", uhe);
+ Assert.fail("While resolving bind address ", uhe);
}
try {
- File logFile = new File(testName + "-locator" + port + ".log");
+ File logFile = new File(getTestName() + "-locator" + port + ".log");
Locator locator = Locator.startLocatorAndDS(port, logFile, bindAddr,
props, isPeer, true, null);
} catch (IOException ex) {
- fail("While starting locator on port " + port, ex);
+ Assert.fail("While starting locator on port " + port, ex);
}
assertTrue(InternalLocator.hasLocator());
@@ -283,7 +287,7 @@ public class LocatorManagementDUnitTest extends ManagementTestBase {
final LocatorMXBean bean = service.getLocalLocatorMXBean();
assertNotNull(bean);
- waitForCriterion(new WaitCriterion() {
+ Wait.waitForCriterion(new WaitCriterion() {
public String description() {
return "Waiting for the managers List";
@@ -323,7 +327,7 @@ public class LocatorManagementDUnitTest extends ManagementTestBase {
final LocatorMXBean bean = service.getLocalLocatorMXBean();
assertNotNull(bean);
- waitForCriterion(new WaitCriterion() {
+ Wait.waitForCriterion(new WaitCriterion() {
public String description() {
return "Waiting for the Willing managers List";
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e2f18f97/gemfire-core/src/test/java/com/gemstone/gemfire/management/MBeanUtil.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/management/MBeanUtil.java b/gemfire-core/src/test/java/com/gemstone/gemfire/management/MBeanUtil.java
index 171204c..92278ca 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/management/MBeanUtil.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/management/MBeanUtil.java
@@ -37,7 +37,8 @@ import com.gemstone.gemfire.management.internal.MBeanJMXAdapter;
import com.gemstone.gemfire.management.internal.ManagementConstants;
import com.gemstone.gemfire.management.internal.SystemManagementService;
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;
/**
* Utility test class to get various proxies
@@ -66,7 +67,7 @@ public class MBeanUtil {
final SystemManagementService service = (SystemManagementService) ManagementTestBase
.getManagementService();
final ObjectName memberMBeanName = service.getMemberMBeanName(member);
- DistributedTestCase.waitForCriterion(new WaitCriterion() {
+ Wait.waitForCriterion(new WaitCriterion() {
MemberMXBean bean = null;
public String description() {
@@ -110,7 +111,7 @@ public class MBeanUtil {
final ObjectName cacheServerMBeanName = service
.getCacheServerMBeanName(port,member);
- DistributedTestCase.waitForCriterion(new WaitCriterion() {
+ Wait.waitForCriterion(new WaitCriterion() {
CacheServerMXBean bean = null;
public String description() {
@@ -159,7 +160,7 @@ public class MBeanUtil {
final ObjectName lockServiceMBeanName = service.getLockServiceMBeanName(
member, lockServiceName);
- DistributedTestCase.waitForCriterion(new WaitCriterion() {
+ Wait.waitForCriterion(new WaitCriterion() {
LockServiceMXBean bean = null;
public String description() {
@@ -208,7 +209,7 @@ public class MBeanUtil {
final ObjectName regionMBeanName = service.getRegionMBeanName(
member, regionPath);
- DistributedTestCase.waitForCriterion(new WaitCriterion(){
+ Wait.waitForCriterion(new WaitCriterion(){
RegionMXBean bean = null;
public String description() {
@@ -258,7 +259,7 @@ public class MBeanUtil {
final ObjectName senderMBeanName = service.getGatewaySenderMBeanName(member, gatwaySenderId);
- DistributedTestCase.waitForCriterion(new WaitCriterion() {
+ Wait.waitForCriterion(new WaitCriterion() {
GatewaySenderMXBean bean = null;
@@ -310,7 +311,7 @@ public class MBeanUtil {
final ObjectName queueMBeanName = service.getAsyncEventQueueMBeanName(
member, queueId);
- DistributedTestCase.waitForCriterion(new WaitCriterion() {
+ Wait.waitForCriterion(new WaitCriterion() {
AsyncEventQueueMXBean bean = null;
@@ -358,7 +359,7 @@ public class MBeanUtil {
final ObjectName receiverMBeanName = service.getGatewayReceiverMBeanName(member);
- DistributedTestCase.waitForCriterion(new WaitCriterion() {
+ Wait.waitForCriterion(new WaitCriterion() {
GatewayReceiverMXBean bean = null;
@@ -406,7 +407,7 @@ public class MBeanUtil {
final ManagementService service = ManagementTestBase
.getManagementService();
- DistributedTestCase.waitForCriterion(new WaitCriterion() {
+ Wait.waitForCriterion(new WaitCriterion() {
DistributedRegionMXBean bean = null;
@@ -444,7 +445,7 @@ public class MBeanUtil {
final ManagementService service = ManagementTestBase
.getManagementService();
- DistributedTestCase.waitForCriterion(new WaitCriterion() {
+ Wait.waitForCriterion(new WaitCriterion() {
DistributedLockServiceMXBean bean = null;
@@ -483,7 +484,7 @@ public class MBeanUtil {
final ObjectName locatorMBeanName = service.getLocatorMBeanName(member);
- DistributedTestCase.waitForCriterion(new WaitCriterion() {
+ Wait.waitForCriterion(new WaitCriterion() {
LocatorMXBean bean = null;