You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by kl...@apache.org on 2016/02/02 21:21:39 UTC
[32/44] incubator-geode git commit: Refactor dunit
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/76e324b5/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/DistributionManagerDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/DistributionManagerDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/DistributionManagerDUnitTest.java
index 8b4bf9f..cdd81f3 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/DistributionManagerDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/DistributionManagerDUnitTest.java
@@ -49,8 +49,11 @@ import com.gemstone.gemfire.internal.logging.LogService;
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.SerializableRunnable;
import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
/**
* This class tests the functionality of the {@link
@@ -148,7 +151,7 @@ public class DistributionManagerDUnitTest extends DistributedTestCase {
mgr = MembershipManagerHelper.getMembershipManager(sys);
sys.disconnect();
InternalDistributedMember idm2 = mgr.getLocalMember();
- getLogWriter().info("original ID=" + idm +
+ com.gemstone.gemfire.test.dunit.LogWriterSupport.getLogWriter().info("original ID=" + idm +
" and after connecting=" + idm2);
assertTrue("should not have used a different udp port",
idm.getPort() == idm2.getPort());
@@ -173,7 +176,7 @@ public class DistributionManagerDUnitTest extends DistributedTestCase {
try {
InternalDistributedMember mbr = new InternalDistributedMember(
- DistributedTestCase.getIPLiteral(), 12345);
+ NetworkSupport.getIPLiteral(), 12345);
// first make sure we can't add this as a surprise member (bug #44566)
@@ -183,8 +186,8 @@ public class DistributionManagerDUnitTest extends DistributedTestCase {
int oldViewId = mbr.getVmViewId();
mbr.setVmViewId((int)mgr.getView().getViewId()-1);
- getLogWriter().info("current membership view is " + mgr.getView());
- getLogWriter().info("created ID " + mbr + " with view ID " + mbr.getVmViewId());
+ com.gemstone.gemfire.test.dunit.LogWriterSupport.getLogWriter().info("current membership view is " + mgr.getView());
+ com.gemstone.gemfire.test.dunit.LogWriterSupport.getLogWriter().info("created ID " + mbr + " with view ID " + mbr.getVmViewId());
sys.getLogWriter().info("<ExpectedException action=add>attempt to add old member</ExpectedException>");
sys.getLogWriter().info("<ExpectedException action=add>Removing shunned GemFire node</ExpectedException>");
try {
@@ -284,7 +287,7 @@ public class DistributionManagerDUnitTest extends DistributedTestCase {
public void run() {
props.setProperty(DistributionConfig.NAME_NAME, "sleeper");
getSystem(props);
- IgnoredException.addExpectedException("elapsed while waiting for replies");
+ IgnoredException.addIgnoredException("elapsed while waiting for replies");
RegionFactory rf = new RegionFactory();
Region r = rf.setScope(Scope.DISTRIBUTED_ACK)
.setDataPolicy(DataPolicy.REPLICATE)
@@ -398,7 +401,7 @@ public class DistributionManagerDUnitTest extends DistributedTestCase {
*/
public void testKickOutSickMember() throws Exception {
disconnectAllFromDS();
- IgnoredException.addExpectedException("10 seconds have elapsed while waiting");
+ IgnoredException.addIgnoredException("10 seconds have elapsed while waiting");
Host host = Host.getHost(0);
// VM vm0 = host.getVM(0);
VM vm1 = host.getVM(1);
@@ -461,7 +464,7 @@ public class DistributionManagerDUnitTest extends DistributedTestCase {
}
};
// if this fails it means the sick member wasn't kicked out and something is wrong
- DistributedTestCase.waitForCriterion(ev, 60 * 1000, 200, true);
+ Wait.waitForCriterion(ev, 60 * 1000, 200, true);
ev = new WaitCriterion() {
public boolean done() {
@@ -471,7 +474,7 @@ public class DistributionManagerDUnitTest extends DistributedTestCase {
return null;
}
};
- DistributedTestCase.waitForCriterion(ev, 20 * 1000, 200, false);
+ Wait.waitForCriterion(ev, 20 * 1000, 200, false);
if (!myCache.isClosed()) {
if (system.isConnected()) {
@@ -493,7 +496,7 @@ public class DistributionManagerDUnitTest extends DistributedTestCase {
return "vm1's listener should have received afterRegionDestroyed notification";
}
};
- DistributedTestCase.waitForCriterion(wc, 30 * 1000, 1000, true);
+ Wait.waitForCriterion(wc, 30 * 1000, 1000, true);
}
});
@@ -522,14 +525,14 @@ public class DistributionManagerDUnitTest extends DistributedTestCase {
try {
getSystem(props);
} catch (IllegalArgumentException e) {
- getLogWriter().info("caught expected exception (1)", e);
+ com.gemstone.gemfire.test.dunit.LogWriterSupport.getLogWriter().info("caught expected exception (1)", e);
}
// use an invalid address
props.setProperty(DistributionConfig.BIND_ADDRESS_NAME, "bruce.schuchardt");
try {
getSystem(props);
} catch (IllegalArgumentException e) {
- getLogWriter().info("caught expected exception (2_", e);
+ com.gemstone.gemfire.test.dunit.LogWriterSupport.getLogWriter().info("caught expected exception (2_", e);
}
// use a valid bind address
props.setProperty(DistributionConfig.BIND_ADDRESS_NAME, InetAddress.getLocalHost().getCanonicalHostName());
@@ -562,12 +565,12 @@ public class DistributionManagerDUnitTest extends DistributedTestCase {
t.setDaemon(true);
t.start();
- pause(2000);
+ Wait.pause(2000);
NetView newView = new NetView(v, v.getViewId()+1);
((Manager)mgr).installView(newView);
- pause(2000);
+ Wait.pause(2000);
synchronized(passed) {
Assert.assertTrue(passed[0]);
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/76e324b5/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/deadlock/GemFireDeadlockDetectorDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/deadlock/GemFireDeadlockDetectorDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/deadlock/GemFireDeadlockDetectorDUnitTest.java
index f611705..ce43c51 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/deadlock/GemFireDeadlockDetectorDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/deadlock/GemFireDeadlockDetectorDUnitTest.java
@@ -36,6 +36,8 @@ import com.gemstone.gemfire.distributed.internal.membership.InternalDistributedM
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.LogWriterSupport;
import com.gemstone.gemfire.test.dunit.SerializableCallable;
import com.gemstone.gemfire.test.dunit.SerializableRunnable;
import com.gemstone.gemfire.test.dunit.VM;
@@ -56,7 +58,7 @@ public class GemFireDeadlockDetectorDUnitTest extends CacheTestCase {
}
private void stopStuckThreads() {
- invokeInEveryVM(new SerializableRunnable() {
+ Invoke.invokeInEveryVM(new SerializableRunnable() {
public void run() {
for(Thread thread: stuckThreads) {
@@ -115,7 +117,7 @@ public class GemFireDeadlockDetectorDUnitTest extends CacheTestCase {
Thread.sleep(5000);
GemFireDeadlockDetector detect = new GemFireDeadlockDetector();
LinkedList<Dependency> deadlock = detect.find().findCycle();
- getLogWriter().info("Deadlock=" + DeadlockDetector.prettyFormat(deadlock));
+ LogWriterSupport.getLogWriter().info("Deadlock=" + DeadlockDetector.prettyFormat(deadlock));
assertEquals(8, deadlock.size());
stopStuckThreads();
async1.getResult(30000);
@@ -162,7 +164,7 @@ public class GemFireDeadlockDetectorDUnitTest extends CacheTestCase {
}
assertTrue(deadlock != null);
- getLogWriter().info("Deadlock=" + DeadlockDetector.prettyFormat(deadlock));
+ LogWriterSupport.getLogWriter().info("Deadlock=" + DeadlockDetector.prettyFormat(deadlock));
assertEquals(4, deadlock.size());
stopStuckThreads();
disconnectAllFromDS();
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/76e324b5/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/locks/CollaborationJUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/locks/CollaborationJUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/locks/CollaborationJUnitTest.java
index 991030e..c570482 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/locks/CollaborationJUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/locks/CollaborationJUnitTest.java
@@ -30,8 +30,9 @@ import com.gemstone.gemfire.CancelCriterion;
import com.gemstone.gemfire.LogWriter;
import com.gemstone.gemfire.SystemFailure;
import com.gemstone.gemfire.internal.logging.LocalLogWriter;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.Threads;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
import com.gemstone.gemfire.internal.logging.InternalLogWriter;
@@ -104,7 +105,7 @@ public class CollaborationJUnitTest {
return "waiting for thread";
}
};
- DistributedTestCase.waitForCriterion(ev, 5 * 1000, 200, true);
+ Wait.waitForCriterion(ev, 5 * 1000, 200, true);
assertTrue(this.collaboration.hasCurrentTopic(threadA));
// thread two blocks until one releeases
@@ -125,7 +126,7 @@ public class CollaborationJUnitTest {
return "waiting for release";
}
};
- DistributedTestCase.waitForCriterion(ev2, 20 * 1000, 200, true);
+ Wait.waitForCriterion(ev2, 20 * 1000, 200, true);
}
finally {
collaboration.release();
@@ -145,7 +146,7 @@ public class CollaborationJUnitTest {
return "waiting for thread b";
}
};
- DistributedTestCase.waitForCriterion(ev, 5 * 1000, 200, true);
+ Wait.waitForCriterion(ev, 5 * 1000, 200, true);
// threadA holds topic and threadB is waiting...
assertTrue(this.collaboration.hasCurrentTopic(threadA));
@@ -153,7 +154,7 @@ public class CollaborationJUnitTest {
// let threadA release so that threadB gets lock
this.flagTestBlocksUntilRelease = false;
- DistributedTestCase.join(threadA, 30 * 1000, null);
+ Threads.join(threadA, 30 * 1000, null);
// make sure threadB is doing what it's supposed to do...
ev = new WaitCriterion() {
@@ -166,11 +167,11 @@ public class CollaborationJUnitTest {
return "threadB";
}
};
- DistributedTestCase.waitForCriterion(ev, 5 * 1000, 200, true);
+ Wait.waitForCriterion(ev, 5 * 1000, 200, true);
// threadB must have lock now... let threadB release
assertTrue(this.collaboration.hasCurrentTopic(threadB));
this.flagTestBlocksUntilRelease = false;
- DistributedTestCase.join(threadB, 30 * 1000, null);
+ Threads.join(threadB, 30 * 1000, null);
// collaboration should be free now
assertFalse(this.collaboration.hasCurrentTopic(threadA));
@@ -207,7 +208,7 @@ public class CollaborationJUnitTest {
return null;
}
};
- DistributedTestCase.waitForCriterion(ev, 60 * 1000, 200, true);
+ Wait.waitForCriterion(ev, 60 * 1000, 200, true);
}
finally {
collaboration.release();
@@ -225,7 +226,7 @@ public class CollaborationJUnitTest {
return "wait for ThreadA";
}
};
- DistributedTestCase.waitForCriterion(ev, 30 * 1000, 200, true);
+ Wait.waitForCriterion(ev, 30 * 1000, 200, true);
assertTrue(this.collaboration.hasCurrentTopic(threadA));
assertTrue(this.collaboration.isCurrentTopic(topicA));
@@ -245,7 +246,7 @@ public class CollaborationJUnitTest {
return null;
}
};
- DistributedTestCase.waitForCriterion(ev2, 60 * 1000, 200, true);
+ Wait.waitForCriterion(ev2, 60 * 1000, 200, true);
}
finally {
collaboration.release();
@@ -263,7 +264,7 @@ public class CollaborationJUnitTest {
return "";
}
};
- DistributedTestCase.waitForCriterion(ev, 60 * 1000, 200, true);
+ Wait.waitForCriterion(ev, 60 * 1000, 200, true);
assertTrue(this.collaboration.hasCurrentTopic(threadB));
// thread three blocks for new topic
@@ -284,7 +285,7 @@ public class CollaborationJUnitTest {
return null;
}
};
- DistributedTestCase.waitForCriterion(ev2, 60 * 1000, 200, true);
+ Wait.waitForCriterion(ev2, 60 * 1000, 200, true);
}
finally {
collaboration.release();
@@ -302,7 +303,7 @@ public class CollaborationJUnitTest {
return null;
}
};
- DistributedTestCase.waitForCriterion(ev, 60 * 1000, 200, true);
+ Wait.waitForCriterion(ev, 60 * 1000, 200, true);
assertFalse(this.collaboration.hasCurrentTopic(threadC));
assertFalse(this.collaboration.isCurrentTopic(topicB));
@@ -336,12 +337,12 @@ public class CollaborationJUnitTest {
return null;
}
};
- DistributedTestCase.waitForCriterion(ev, 60 * 1000, 200, true);
+ Wait.waitForCriterion(ev, 60 * 1000, 200, true);
assertTrue(this.collaboration.hasCurrentTopic(threadD));
// release threadA
this.threadAFlag_TestLateComerJoinsIn = false;
- DistributedTestCase.join(threadA, 30 * 1000, null);
+ Threads.join(threadA, 30 * 1000, null);
assertFalse(this.collaboration.hasCurrentTopic(threadA));
assertTrue(this.collaboration.hasCurrentTopic(threadB));
assertFalse(this.collaboration.hasCurrentTopic(threadC));
@@ -351,7 +352,7 @@ public class CollaborationJUnitTest {
// release threadB
this.threadBFlag_TestLateComerJoinsIn = false;
- DistributedTestCase.join(threadB, 30 * 1000, null);
+ Threads.join(threadB, 30 * 1000, null);
assertFalse(this.collaboration.hasCurrentTopic(threadB));
assertFalse(this.collaboration.hasCurrentTopic(threadC));
assertTrue(this.collaboration.hasCurrentTopic(threadD));
@@ -360,7 +361,7 @@ public class CollaborationJUnitTest {
// release threadD
this.threadDFlag_TestLateComerJoinsIn = false;
- DistributedTestCase.join(threadD, 30 * 1000, null);
+ Threads.join(threadD, 30 * 1000, null);
ev = new WaitCriterion() {
@Override
public boolean done() {
@@ -371,7 +372,7 @@ public class CollaborationJUnitTest {
return null;
}
};
- DistributedTestCase.waitForCriterion(ev, 60 * 1000, 200, true);
+ Wait.waitForCriterion(ev, 60 * 1000, 200, true);
assertTrue(this.collaboration.hasCurrentTopic(threadC));
assertFalse(this.collaboration.hasCurrentTopic(threadD));
assertFalse(this.collaboration.isCurrentTopic(topicA));
@@ -379,7 +380,7 @@ public class CollaborationJUnitTest {
// release threadC
this.threadCFlag_TestLateComerJoinsIn = false;
- DistributedTestCase.join(threadC, 30 * 1000, null);
+ Threads.join(threadC, 30 * 1000, null);
assertFalse(this.collaboration.hasCurrentTopic(threadC));
assertFalse(this.collaboration.isCurrentTopic(topicA));
assertFalse(this.collaboration.isCurrentTopic(topicB));
@@ -420,7 +421,7 @@ public class CollaborationJUnitTest {
return "other threads lining up";
}
};
- DistributedTestCase.waitForCriterion(ev, 60 * 1000, 200, true);
+ Wait.waitForCriterion(ev, 60 * 1000, 200, true);
collaboration.release();
released = true;
}
@@ -454,7 +455,7 @@ public class CollaborationJUnitTest {
return "waiting for numThreads * 10";
}
};
- DistributedTestCase.waitForCriterion(ev, 5 * 60 * 1000, 200, true);
+ Wait.waitForCriterion(ev, 5 * 60 * 1000, 200, true);
}
finally {
if (this.runTestFairnessStressfully) {
@@ -463,7 +464,7 @@ public class CollaborationJUnitTest {
}
for (int t = 0; t < threads.length; t++) {
- DistributedTestCase.join(threads[t], 30 * 1000, null);
+ Threads.join(threads[t], 30 * 1000, null);
}
// assert that all topics are acquired in order
@@ -552,7 +553,7 @@ public class CollaborationJUnitTest {
return null;
}
};
- DistributedTestCase.waitForCriterion(ev, 60 * 1000, 200, true);
+ Wait.waitForCriterion(ev, 60 * 1000, 200, true);
}
finally {
collaboration.release();
@@ -573,12 +574,12 @@ public class CollaborationJUnitTest {
return null;
}
};
- DistributedTestCase.waitForCriterion(ev, 60 * 1000, 200, true);
+ Wait.waitForCriterion(ev, 60 * 1000, 200, true);
// after starting thread, hasCurrentTopic(thread) returns true
assertTrue(this.collaboration.hasCurrentTopic(thread));
this.flagTestThreadHasCurrentTopic = false;
- DistributedTestCase.join(thread, 30 * 1000, null);
+ Threads.join(thread, 30 * 1000, null);
// after thread finishes, hasCurrentTopic(thread) returns false
assertTrue(!this.collaboration.hasCurrentTopic(thread));
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/76e324b5/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/membership/gms/MembershipManagerHelper.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/membership/gms/MembershipManagerHelper.java b/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/membership/gms/MembershipManagerHelper.java
index 2c2d4a9..e392f3f 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/membership/gms/MembershipManagerHelper.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/membership/gms/MembershipManagerHelper.java
@@ -26,8 +26,8 @@ import com.gemstone.gemfire.distributed.internal.membership.InternalDistributedM
import com.gemstone.gemfire.distributed.internal.membership.MembershipManager;
import com.gemstone.gemfire.distributed.internal.membership.gms.interfaces.Manager;
import com.gemstone.gemfire.distributed.internal.membership.gms.mgr.GMSMembershipManager;
-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;
/**
* This helper class provides access to membership manager information that
@@ -149,7 +149,7 @@ public class MembershipManagerHelper
return assMsg;
}
};
- DistributedTestCase.waitForCriterion(ev, timeout, 200, true);
+ Wait.waitForCriterion(ev, timeout, 200, true);
}
public static void crashDistributedSystem(final DistributedSystem msys) {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/76e324b5/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/tcpserver/TcpServerBackwardCompatDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/tcpserver/TcpServerBackwardCompatDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/tcpserver/TcpServerBackwardCompatDUnitTest.java
index 7deedcd..0985392 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/tcpserver/TcpServerBackwardCompatDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/tcpserver/TcpServerBackwardCompatDUnitTest.java
@@ -37,7 +37,10 @@ import com.gemstone.gemfire.internal.AvailablePort;
import com.gemstone.gemfire.internal.Version;
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.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
import com.gemstone.gemfire.test.junit.categories.DistributedTest;
/**
@@ -62,7 +65,7 @@ public class TcpServerBackwardCompatDUnitTest extends DistributedTestCase {
public void setUp() throws Exception {
super.setUp();
disconnectAllFromDS();
- invokeInEveryVM(new CacheSerializableRunnable("Set TcpServer.isTesting true") {
+ Invoke.invokeInEveryVM(new CacheSerializableRunnable("Set TcpServer.isTesting true") {
@Override
public void run2() throws CacheException {
@@ -73,7 +76,7 @@ public class TcpServerBackwardCompatDUnitTest extends DistributedTestCase {
@Override
public void tearDown2() throws Exception {
- invokeInEveryVM(new CacheSerializableRunnable("Set TcpServer.isTesting true") {
+ Invoke.invokeInEveryVM(new CacheSerializableRunnable("Set TcpServer.isTesting true") {
@Override
public void run2() throws CacheException {
@@ -185,7 +188,7 @@ public class TcpServerBackwardCompatDUnitTest extends DistributedTestCase {
}
};
- DistributedTestCase.waitForCriterion(ev, 1000, 200, true);
+ Wait.waitForCriterion(ev, 1000, 200, true);
fail("this test must be fixed to work with the jgroups replacement");
// TODO
// Vector members = client.getMembers("mygroup1", new IpAddress(InetAddress.getLocalHost(), port0), true, 5000);
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/76e324b5/gemfire-core/src/test/java/com/gemstone/gemfire/disttx/DistTXDebugDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/disttx/DistTXDebugDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/disttx/DistTXDebugDUnitTest.java
index 58e76a6..f144ef1 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/disttx/DistTXDebugDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/disttx/DistTXDebugDUnitTest.java
@@ -43,6 +43,8 @@ import com.gemstone.gemfire.internal.cache.PartitionedRegion;
import com.gemstone.gemfire.internal.cache.control.InternalResourceManager;
import com.gemstone.gemfire.internal.cache.execute.CustomerIDPartitionResolver;
import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.Invoke;
+import com.gemstone.gemfire.test.dunit.LogWriterSupport;
import com.gemstone.gemfire.test.dunit.SerializableCallable;
import com.gemstone.gemfire.test.dunit.SerializableRunnable;
import com.gemstone.gemfire.test.dunit.VM;
@@ -70,7 +72,7 @@ public class DistTXDebugDUnitTest extends CacheTestCase {
@Override
public void tearDown2() throws Exception {
super.tearDown2();
- invokeInEveryVM(new SerializableRunnable() {
+ Invoke.invokeInEveryVM(new SerializableRunnable() {
public void run() {
InternalResourceManager.setResourceObserver(null);
}
@@ -126,7 +128,7 @@ public class DistTXDebugDUnitTest extends CacheTestCase {
assertNotNull(cache);
Region pr = cache.createRegion(partitionedRegionName, attr.create());
assertNotNull(pr);
- getLogWriter().info(
+ LogWriterSupport.getLogWriter().info(
"Partitioned Region " + partitionedRegionName
+ " created Successfully :" + pr.toString());
}
@@ -147,7 +149,7 @@ public class DistTXDebugDUnitTest extends CacheTestCase {
assertNotNull(cache);
Region pr = cache.getRegion(partitionedRegionName);
assertNotNull(pr);
- getLogWriter().info(
+ LogWriterSupport.getLogWriter().info(
"Destroying Partitioned Region " + partitionedRegionName);
pr.destroyRegion();
}
@@ -164,7 +166,7 @@ public class DistTXDebugDUnitTest extends CacheTestCase {
// af.create());
Region rr = cache.createRegion(replicatedRegionName, af.create());
assertNotNull(rr);
- getLogWriter().info(
+ LogWriterSupport.getLogWriter().info(
"Replicated Region " + replicatedRegionName + " created Successfully :"
+ rr.toString());
}
@@ -195,7 +197,7 @@ public class DistTXDebugDUnitTest extends CacheTestCase {
for (int i = 1; i <= 3; i++) {
DummyKeyBasedRoutingResolver dummy = new DummyKeyBasedRoutingResolver(
i);
- getLogWriter().info(" calling pr.put");
+ LogWriterSupport.getLogWriter().info(" calling pr.put");
pr1.put(dummy, "1_entry__" + i);
}
@@ -208,7 +210,7 @@ public class DistTXDebugDUnitTest extends CacheTestCase {
for (int i = 1; i <= 3; i++) {
DummyKeyBasedRoutingResolver dummy = new DummyKeyBasedRoutingResolver(
i);
- getLogWriter().info(" calling pr.put in tx 1");
+ LogWriterSupport.getLogWriter().info(" calling pr.put in tx 1");
pr1.put(dummy, "2_entry__" + i);
}
ctx.commit();
@@ -217,7 +219,7 @@ public class DistTXDebugDUnitTest extends CacheTestCase {
for (int i = 1; i <= 3; i++) {
DummyKeyBasedRoutingResolver dummy = new DummyKeyBasedRoutingResolver(
i);
- getLogWriter().info(" calling pr.get");
+ LogWriterSupport.getLogWriter().info(" calling pr.get");
assertEquals("2_entry__" + i, pr1.get(dummy));
}
@@ -226,7 +228,7 @@ public class DistTXDebugDUnitTest extends CacheTestCase {
for (int i = 1; i <= 3; i++) {
DummyKeyBasedRoutingResolver dummy = new DummyKeyBasedRoutingResolver(
i);
- getLogWriter().info(" calling pr.put in tx 2");
+ LogWriterSupport.getLogWriter().info(" calling pr.put in tx 2");
pr1.put(dummy, "3_entry__" + i);
}
ctx.rollback();
@@ -235,7 +237,7 @@ public class DistTXDebugDUnitTest extends CacheTestCase {
for (int i = 1; i <= 3; i++) {
DummyKeyBasedRoutingResolver dummy = new DummyKeyBasedRoutingResolver(
i);
- getLogWriter().info(" calling pr.get");
+ LogWriterSupport.getLogWriter().info(" calling pr.get");
assertEquals("2_entry__" + i, pr1.get(dummy));
}
@@ -244,7 +246,7 @@ public class DistTXDebugDUnitTest extends CacheTestCase {
for (int i = 1; i <= 3; i++) {
DummyKeyBasedRoutingResolver dummy = new DummyKeyBasedRoutingResolver(
i);
- getLogWriter().info(" calling pr.destroy in tx 3");
+ LogWriterSupport.getLogWriter().info(" calling pr.destroy in tx 3");
pr1.destroy(dummy);
}
ctx.commit();
@@ -253,7 +255,7 @@ public class DistTXDebugDUnitTest extends CacheTestCase {
for (int i = 1; i <= 3; i++) {
DummyKeyBasedRoutingResolver dummy = new DummyKeyBasedRoutingResolver(
i);
- getLogWriter().info(" calling pr.get");
+ LogWriterSupport.getLogWriter().info(" calling pr.get");
assertEquals(null, pr1.get(dummy));
}
@@ -263,7 +265,7 @@ public class DistTXDebugDUnitTest extends CacheTestCase {
public Object call() throws CacheException {
PartitionedRegion pr1 = (PartitionedRegion) cache
.getRegion("pregion1");
- getLogWriter().info(
+ LogWriterSupport.getLogWriter().info(
" calling pr.getLocalSize " + pr1.getLocalSize());
assertEquals(0, pr1.getLocalSize());
return null;
@@ -302,7 +304,7 @@ public class DistTXDebugDUnitTest extends CacheTestCase {
for (int i = 1; i <= 6; i++) {
DummyKeyBasedRoutingResolver dummy = new DummyKeyBasedRoutingResolver(
i);
- getLogWriter().info(" calling non-tx put");
+ LogWriterSupport.getLogWriter().info(" calling non-tx put");
pr1.put(dummy, "1_entry__" + i);
rr1.put(dummy, "1_entry__" + i);
}
@@ -314,19 +316,19 @@ public class DistTXDebugDUnitTest extends CacheTestCase {
for (int i = 1; i <= 3; i++) {
DummyKeyBasedRoutingResolver dummy = new DummyKeyBasedRoutingResolver(
i);
- getLogWriter().info(
+ LogWriterSupport.getLogWriter().info(
" calling pr1.destroy in tx key=" + dummy);
pr1.destroy(dummy);
- getLogWriter().info(" calling rr1.destroy in tx key=" + i);
+ LogWriterSupport.getLogWriter().info(" calling rr1.destroy in tx key=" + i);
rr1.destroy(dummy);
}
for (int i = 4; i <= 6; i++) {
DummyKeyBasedRoutingResolver dummy = new DummyKeyBasedRoutingResolver(
i);
- getLogWriter().info(
+ LogWriterSupport.getLogWriter().info(
" calling pr1.invalidate in tx key=" + dummy);
pr1.invalidate(dummy);
- getLogWriter().info(" calling rr1.invalidate in tx key=" + i);
+ LogWriterSupport.getLogWriter().info(" calling rr1.invalidate in tx key=" + i);
rr1.invalidate(dummy);
}
ctx.commit();
@@ -335,9 +337,9 @@ public class DistTXDebugDUnitTest extends CacheTestCase {
for (int i = 1; i <= 6; i++) {
DummyKeyBasedRoutingResolver dummy = new DummyKeyBasedRoutingResolver(
i);
- getLogWriter().info(" calling pr1.get");
+ LogWriterSupport.getLogWriter().info(" calling pr1.get");
assertEquals(null, pr1.get(dummy));
- getLogWriter().info(" calling rr1.get");
+ LogWriterSupport.getLogWriter().info(" calling rr1.get");
assertEquals(null, rr1.get(i));
}
return null;
@@ -352,10 +354,10 @@ public class DistTXDebugDUnitTest extends CacheTestCase {
public Object call() throws CacheException {
PartitionedRegion pr1 = (PartitionedRegion) cache.getRegion("pregion1");
Region rr1 = cache.getRegion("rregion1");
- getLogWriter().info(
+ LogWriterSupport.getLogWriter().info(
" calling pr1.getLocalSize " + pr1.getLocalSize());
assertEquals(2, pr1.getLocalSize());
- getLogWriter().info(" calling rr1.size " + rr1.size());
+ LogWriterSupport.getLogWriter().info(" calling rr1.size " + rr1.size());
assertEquals(3, rr1.size());
return null;
}
@@ -390,9 +392,9 @@ public class DistTXDebugDUnitTest extends CacheTestCase {
for (int i = 1; i <= 3; i++) {
DummyKeyBasedRoutingResolver dummy = new DummyKeyBasedRoutingResolver(
i);
- getLogWriter().info(" calling pr.put non-tx PR1_entry__" + i);
+ LogWriterSupport.getLogWriter().info(" calling pr.put non-tx PR1_entry__" + i);
pr1.put(dummy, "PR1_entry__" + i);
- getLogWriter().info(" calling rr.put non-tx RR1_entry__" + i);
+ LogWriterSupport.getLogWriter().info(" calling rr.put non-tx RR1_entry__" + i);
rr1.put(new Integer(i), "RR1_entry__" + i);
}
@@ -405,9 +407,9 @@ public class DistTXDebugDUnitTest extends CacheTestCase {
for (int i = 1; i <= 3; i++) {
DummyKeyBasedRoutingResolver dummy = new DummyKeyBasedRoutingResolver(
i);
- getLogWriter().info(" calling pr.put in tx PR2_entry__" + i);
+ LogWriterSupport.getLogWriter().info(" calling pr.put in tx PR2_entry__" + i);
pr1.put(dummy, "PR2_entry__" + i);
- getLogWriter().info(" calling rr.put in tx RR2_entry__" + i);
+ LogWriterSupport.getLogWriter().info(" calling rr.put in tx RR2_entry__" + i);
rr1.put(new Integer(i), "RR2_entry__" + i);
}
ctx.commit();
@@ -416,9 +418,9 @@ public class DistTXDebugDUnitTest extends CacheTestCase {
for (int i = 1; i <= 3; i++) {
DummyKeyBasedRoutingResolver dummy = new DummyKeyBasedRoutingResolver(
i);
- getLogWriter().info(" calling pr.get PR2_entry__" + i);
+ LogWriterSupport.getLogWriter().info(" calling pr.get PR2_entry__" + i);
assertEquals("PR2_entry__" + i, pr1.get(dummy));
- getLogWriter().info(" calling rr.get RR2_entry__" + i);
+ LogWriterSupport.getLogWriter().info(" calling rr.get RR2_entry__" + i);
assertEquals("RR2_entry__" + i, rr1.get(new Integer(i)));
}
return null;
@@ -432,12 +434,12 @@ public class DistTXDebugDUnitTest extends CacheTestCase {
@Override
public Object call() throws CacheException {
PartitionedRegion pr1 = (PartitionedRegion) cache.getRegion("pregion1");
- getLogWriter().info(
+ LogWriterSupport.getLogWriter().info(
" calling pr.getLocalSize " + pr1.getLocalSize());
assertEquals(2, pr1.getLocalSize());
Region rr1 = cache.getRegion("rregion1");
- getLogWriter()
+ LogWriterSupport.getLogWriter()
.info(" calling rr.getLocalSize " + rr1.size());
assertEquals(3, rr1.size());
return null;
@@ -474,7 +476,7 @@ public class DistTXDebugDUnitTest extends CacheTestCase {
for (int i = 1; i <= 3; i++) {
DummyKeyBasedRoutingResolver dummy = new DummyKeyBasedRoutingResolver(
i);
- getLogWriter().info(" calling pr.put in tx 1");
+ LogWriterSupport.getLogWriter().info(" calling pr.put in tx 1");
pr1.put(dummy, "2_entry__" + i);
}
ctx.commit();
@@ -483,7 +485,7 @@ public class DistTXDebugDUnitTest extends CacheTestCase {
for (int i = 1; i <= 3; i++) {
DummyKeyBasedRoutingResolver dummy = new DummyKeyBasedRoutingResolver(
i);
- getLogWriter().info(" calling pr.get " + pr1.get(dummy));
+ LogWriterSupport.getLogWriter().info(" calling pr.get " + pr1.get(dummy));
assertEquals("2_entry__" + i, pr1.get(dummy));
}
return null;
@@ -497,7 +499,7 @@ public class DistTXDebugDUnitTest extends CacheTestCase {
public Object call() throws CacheException {
PartitionedRegion pr1 = (PartitionedRegion) cache.getRegion("pregion1");
CacheTransactionManager ctx = cache.getCacheTransactionManager();
- getLogWriter().info(
+ LogWriterSupport.getLogWriter().info(
" calling pr.getLocalSize " + pr1.getLocalSize());
assertEquals(2, pr1.getLocalSize());
return null;
@@ -525,7 +527,7 @@ public class DistTXDebugDUnitTest extends CacheTestCase {
for (int i = 1; i <= 3; i++) {
DummyKeyBasedRoutingResolver dummy = new DummyKeyBasedRoutingResolver(
i);
- getLogWriter().info(
+ LogWriterSupport.getLogWriter().info(
" calling pr.put in tx for rollback no_entry__" + i);
pr1.put(dummy, "no_entry__" + i);
}
@@ -535,7 +537,7 @@ public class DistTXDebugDUnitTest extends CacheTestCase {
for (int i = 1; i <= 3; i++) {
DummyKeyBasedRoutingResolver dummy = new DummyKeyBasedRoutingResolver(
i);
- getLogWriter().info(
+ LogWriterSupport.getLogWriter().info(
" calling pr.get after rollback " + pr1.get(dummy));
assertEquals("2_entry__" + i, pr1.get(dummy));
}
@@ -569,10 +571,10 @@ public class DistTXDebugDUnitTest extends CacheTestCase {
for (int i = 1; i <= 3; i++) {
DummyKeyBasedRoutingResolver dummy = new DummyKeyBasedRoutingResolver(
i);
- getLogWriter().info(" calling pr.create in tx 1");
+ LogWriterSupport.getLogWriter().info(" calling pr.create in tx 1");
pr1.create(dummy, "2_entry__" + i);
- getLogWriter().info(" calling rr.create " + "2_entry__" + i);
+ LogWriterSupport.getLogWriter().info(" calling rr.create " + "2_entry__" + i);
rr1.create(new Integer(i), "2_entry__" + i);
}
ctx.commit();
@@ -581,10 +583,10 @@ public class DistTXDebugDUnitTest extends CacheTestCase {
for (int i = 1; i <= 3; i++) {
DummyKeyBasedRoutingResolver dummy = new DummyKeyBasedRoutingResolver(
i);
- getLogWriter().info(" calling pr.get " + pr1.get(dummy));
+ LogWriterSupport.getLogWriter().info(" calling pr.get " + pr1.get(dummy));
assertEquals("2_entry__" + i, pr1.get(dummy));
- getLogWriter().info(
+ LogWriterSupport.getLogWriter().info(
" calling rr.get " + rr1.get(new Integer(i)));
assertEquals("2_entry__" + i, rr1.get(new Integer(i)));
}
@@ -599,12 +601,12 @@ public class DistTXDebugDUnitTest extends CacheTestCase {
@Override
public Object call() throws CacheException {
Region rr1 = cache.getRegion("rregion1");
- getLogWriter()
+ LogWriterSupport.getLogWriter()
.info(" calling rr.getLocalSize " + rr1.size());
assertEquals(3, rr1.size());
PartitionedRegion pr1 = (PartitionedRegion) cache.getRegion("pregion1");
- getLogWriter().info(
+ LogWriterSupport.getLogWriter().info(
" calling pr.getLocalSize " + pr1.getLocalSize());
assertEquals(2, pr1.getLocalSize());
return null;
@@ -649,10 +651,10 @@ public class DistTXDebugDUnitTest extends CacheTestCase {
for (int i = 1; i <= 3; i++) {
DummyKeyBasedRoutingResolver dummy = new DummyKeyBasedRoutingResolver(
i);
- getLogWriter().info(" calling pr.get " + pr1.get(dummy));
+ LogWriterSupport.getLogWriter().info(" calling pr.get " + pr1.get(dummy));
assertEquals("2_entry__" + i, pr1.get(dummy));
- getLogWriter().info(
+ LogWriterSupport.getLogWriter().info(
" calling rr.get " + rr1.get(new Integer(i)));
assertEquals("2_entry__" + i, rr1.get(new Integer(i)));
}
@@ -667,12 +669,12 @@ public class DistTXDebugDUnitTest extends CacheTestCase {
@Override
public Object call() throws CacheException {
Region rr1 = cache.getRegion("rregion1");
- getLogWriter()
+ LogWriterSupport.getLogWriter()
.info(" calling rr.getLocalSize " + rr1.size());
assertEquals(3, rr1.size());
PartitionedRegion pr1 = (PartitionedRegion) cache.getRegion("pregion1");
- getLogWriter().info(
+ LogWriterSupport.getLogWriter().info(
" calling pr.getLocalSize " + pr1.getLocalSize());
assertEquals(2, pr1.getLocalSize());
return null;
@@ -713,7 +715,7 @@ public class DistTXDebugDUnitTest extends CacheTestCase {
for (int i = 1; i <= 3; i++) {
DummyKeyBasedRoutingResolver dummy = new DummyKeyBasedRoutingResolver(
i);
- getLogWriter().info(" calling pr.get " + pr1.get(dummy));
+ LogWriterSupport.getLogWriter().info(" calling pr.get " + pr1.get(dummy));
assertEquals("2_entry__" + i, pr1.get(dummy));
}
@@ -729,7 +731,7 @@ public class DistTXDebugDUnitTest extends CacheTestCase {
@Override
public Object call() throws CacheException {
PartitionedRegion pr1 = (PartitionedRegion) cache.getRegion("pregion1");
- getLogWriter().info(
+ LogWriterSupport.getLogWriter().info(
" calling pr.getLocalSize " + pr1.getLocalSize());
assertEquals(2, pr1.getLocalSize());
return null;
@@ -780,7 +782,7 @@ public class DistTXDebugDUnitTest extends CacheTestCase {
// verify the data
for (int i = 1; i <= 3; i++) {
- getLogWriter().info(
+ LogWriterSupport.getLogWriter().info(
" calling rr.get " + rr1.get(new Integer(i)));
assertEquals(null, rr1.get(new Integer(i)));
}
@@ -799,7 +801,7 @@ public class DistTXDebugDUnitTest extends CacheTestCase {
@Override
public Object call() throws CacheException {
Region rr1 = cache.getRegion("rregion1");
- getLogWriter()
+ LogWriterSupport.getLogWriter()
.info(" calling rr.getLocalSize " + rr1.size());
assertEquals(0, rr1.size());
return null;
@@ -840,7 +842,7 @@ public class DistTXDebugDUnitTest extends CacheTestCase {
for (int i = 1; i <= 3; i++) {
DummyKeyBasedRoutingResolver dummy = new DummyKeyBasedRoutingResolver(
i);
- getLogWriter().info(" calling pr.get " + pr1.get(dummy));
+ LogWriterSupport.getLogWriter().info(" calling pr.get " + pr1.get(dummy));
assertEquals(null, pr1.get(dummy));
}
return null;
@@ -854,7 +856,7 @@ public class DistTXDebugDUnitTest extends CacheTestCase {
@Override
public Object call() throws CacheException {
PartitionedRegion pr1 = (PartitionedRegion) cache.getRegion("pregion1");
- getLogWriter().info(
+ LogWriterSupport.getLogWriter().info(
" calling pr.getLocalSize " + pr1.getLocalSize());
assertEquals(0, pr1.getLocalSize());
return null;
@@ -885,14 +887,14 @@ public class DistTXDebugDUnitTest extends CacheTestCase {
ctx.setDistributed(true);
ctx.begin();
for (int i = 1; i <= 3; i++) {
- getLogWriter().info(" calling rr.put " + "2_entry__" + i);
+ LogWriterSupport.getLogWriter().info(" calling rr.put " + "2_entry__" + i);
rr1.put(new Integer(i), "2_entry__" + i);
}
ctx.commit();
// verify the data
for (int i = 1; i <= 3; i++) {
- getLogWriter().info(
+ LogWriterSupport.getLogWriter().info(
" calling rr.get " + rr1.get(new Integer(i)));
assertEquals("2_entry__" + i, rr1.get(new Integer(i)));
}
@@ -911,7 +913,7 @@ public class DistTXDebugDUnitTest extends CacheTestCase {
@Override
public Object call() throws CacheException {
Region rr1 = cache.getRegion("rregion1");
- getLogWriter()
+ LogWriterSupport.getLogWriter()
.info(" calling rr.getLocalSize " + rr1.size());
assertEquals(3, rr1.size());
return null;
@@ -929,7 +931,7 @@ public class DistTXDebugDUnitTest extends CacheTestCase {
ctx.setDistributed(true);
ctx.begin();
for (int i = 1; i <= 3; i++) {
- getLogWriter().info(
+ LogWriterSupport.getLogWriter().info(
" calling rr.put for rollback no_entry__" + i);
rr1.put(new Integer(i), "no_entry__" + i);
}
@@ -938,7 +940,7 @@ public class DistTXDebugDUnitTest extends CacheTestCase {
// verify the data
for (int i = 1; i <= 3; i++) {
- getLogWriter().info(
+ LogWriterSupport.getLogWriter().info(
" calling rr.get after rollback "
+ rr1.get(new Integer(i)));
assertEquals("2_entry__" + i, rr1.get(new Integer(i)));
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/76e324b5/gemfire-core/src/test/java/com/gemstone/gemfire/disttx/DistTXPersistentDebugDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/disttx/DistTXPersistentDebugDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/disttx/DistTXPersistentDebugDUnitTest.java
index 5a7375a..52971b8 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/disttx/DistTXPersistentDebugDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/disttx/DistTXPersistentDebugDUnitTest.java
@@ -27,6 +27,8 @@ import com.gemstone.gemfire.cache.RegionAttributes;
import com.gemstone.gemfire.internal.cache.TXManagerImpl;
import com.gemstone.gemfire.internal.cache.execute.data.CustId;
import com.gemstone.gemfire.internal.cache.execute.data.Customer;
+import com.gemstone.gemfire.test.dunit.Invoke;
+import com.gemstone.gemfire.test.dunit.LogWriterSupport;
import com.gemstone.gemfire.test.dunit.SerializableCallable;
public class DistTXPersistentDebugDUnitTest extends DistTXDebugDUnitTest {
@@ -38,7 +40,7 @@ public class DistTXPersistentDebugDUnitTest extends DistTXDebugDUnitTest {
@Override
public void setUp() throws Exception {
super.setUp();
- this.invokeInEveryVM(new SerializableCallable() {
+ Invoke.invokeInEveryVM(new SerializableCallable() {
@Override
public Object call() throws Exception {
//System.setProperty("gemfire.ALLOW_PERSISTENT_TRANSACTIONS", "true");
@@ -50,7 +52,7 @@ public class DistTXPersistentDebugDUnitTest extends DistTXDebugDUnitTest {
@Override
public void tearDown2() throws Exception {
- this.invokeInEveryVM(new SerializableCallable() {
+ Invoke.invokeInEveryVM(new SerializableCallable() {
@Override
public Object call() throws Exception {
//System.setProperty("gemfire.ALLOW_PERSISTENT_TRANSACTIONS", "false");
@@ -106,21 +108,21 @@ public class DistTXPersistentDebugDUnitTest extends DistTXDebugDUnitTest {
public Object call() throws Exception {
CacheTransactionManager mgr = cache.getCacheTransactionManager();
mgr.setDistributed(true);
- getLogWriter().fine("SJ:TX BEGIN");
+ LogWriterSupport.getLogWriter().fine("SJ:TX BEGIN");
mgr.begin();
Region<CustId, Customer> prRegion = cache.getRegion(regionName);
CustId custIdOne = new CustId(1);
Customer customerOne = new Customer("name1", "addr1");
- getLogWriter().fine("SJ:TX PUT 1");
+ LogWriterSupport.getLogWriter().fine("SJ:TX PUT 1");
prRegion.put(custIdOne, customerOne);
CustId custIdTwo = new CustId(2);
Customer customerTwo = new Customer("name2", "addr2");
- getLogWriter().fine("SJ:TX PUT 2");
+ LogWriterSupport.getLogWriter().fine("SJ:TX PUT 2");
prRegion.put(custIdTwo, customerTwo);
- getLogWriter().fine("SJ:TX COMMIT");
+ LogWriterSupport.getLogWriter().fine("SJ:TX COMMIT");
mgr.commit();
return null;
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/76e324b5/gemfire-core/src/test/java/com/gemstone/gemfire/disttx/DistributedTransactionDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/disttx/DistributedTransactionDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/disttx/DistributedTransactionDUnitTest.java
index 58fabb0..1556873 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/disttx/DistributedTransactionDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/disttx/DistributedTransactionDUnitTest.java
@@ -59,6 +59,8 @@ import com.gemstone.gemfire.internal.cache.execute.data.Order;
import com.gemstone.gemfire.internal.cache.execute.data.OrderId;
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.LogWriterSupport;
import com.gemstone.gemfire.test.dunit.SerializableCallable;
import com.gemstone.gemfire.test.dunit.VM;
@@ -80,7 +82,7 @@ public class DistributedTransactionDUnitTest extends CacheTestCase {
@Override
public void setUp() throws Exception{
super.setUp();
- this.invokeInEveryVM(new SerializableCallable() {
+ Invoke.invokeInEveryVM(new SerializableCallable() {
@Override
public Object call() throws Exception {
System.setProperty("gemfire.sync-commits", "true");
@@ -96,7 +98,7 @@ public class DistributedTransactionDUnitTest extends CacheTestCase {
// }
// });
- this.invokeInEveryVM(new SerializableCallable() {
+ Invoke.invokeInEveryVM(new SerializableCallable() {
@Override
public Object call() throws Exception {
//System.setProperty("gemfire.ALLOW_PERSISTENT_TRANSACTIONS", "true");
@@ -107,14 +109,14 @@ public class DistributedTransactionDUnitTest extends CacheTestCase {
}
public void tearDown2() throws Exception {
- this.invokeInEveryVM(new SerializableCallable() {
+ Invoke.invokeInEveryVM(new SerializableCallable() {
@Override
public Object call() throws Exception {
System.setProperty("gemfire.sync-commits", "false");
return null;
}
});
- this.invokeInEveryVM(new SerializableCallable() {
+ Invoke.invokeInEveryVM(new SerializableCallable() {
@Override
public Object call() throws Exception {
//System.setProperty("gemfire.ALLOW_PERSISTENT_TRANSACTIONS", "false");
@@ -1951,7 +1953,7 @@ public class DistributedTransactionDUnitTest extends CacheTestCase {
public Exception ex = new Exception();
public void run() {
- getLogWriter().info("Inside TxConflictRunnable.TxThread after aquiring locks");
+ LogWriterSupport.getLogWriter().info("Inside TxConflictRunnable.TxThread after aquiring locks");
CacheTransactionManager mgr = getGemfireCache().getTxManager();
mgr.setDistributed(true);
mgr.begin();
@@ -1964,10 +1966,10 @@ public class DistributedTransactionDUnitTest extends CacheTestCase {
mgr.commit();
} catch (CommitConflictException ce) {
gotConflict = true;
- getLogWriter().info("Received exception ", ce);
+ LogWriterSupport.getLogWriter().info("Received exception ", ce);
} catch (Exception e) {
gotOtherException = true;
- getLogWriter().info("Received exception ", e);
+ LogWriterSupport.getLogWriter().info("Received exception ", e);
ex.initCause(e);
}
}
@@ -2086,7 +2088,7 @@ public class DistributedTransactionDUnitTest extends CacheTestCase {
public Exception ex = new Exception();
public void run() {
- getLogWriter()
+ LogWriterSupport.getLogWriter()
.info("Inside TxRunnable.TxThread after aquiring locks");
CacheTransactionManager mgr = getGemfireCache().getTxManager();
mgr.setDistributed(true);
@@ -2100,7 +2102,7 @@ public class DistributedTransactionDUnitTest extends CacheTestCase {
mgr.commit();
} catch (Exception e) {
gotException = true;
- getLogWriter().info("Received exception ", e);
+ LogWriterSupport.getLogWriter().info("Received exception ", e);
ex.initCause(e);
}
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/76e324b5/gemfire-core/src/test/java/com/gemstone/gemfire/internal/ClassNotFoundExceptionDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/ClassNotFoundExceptionDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/ClassNotFoundExceptionDUnitTest.java
index 836dc13..82c45f6 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/ClassNotFoundExceptionDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/ClassNotFoundExceptionDUnitTest.java
@@ -40,6 +40,7 @@ import com.gemstone.gemfire.pdx.PdxSerializable;
import com.gemstone.gemfire.pdx.PdxWriter;
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.SerializableCallable;
import com.gemstone.gemfire.test.dunit.SerializableRunnable;
import com.gemstone.gemfire.test.dunit.VM;
@@ -66,7 +67,7 @@ public class ClassNotFoundExceptionDUnitTest extends CacheTestCase {
}
public void doTest(final ObjectFactory objectFactory) throws InterruptedException {
- IgnoredException.addExpectedException("SerializationException");
+ IgnoredException.addIgnoredException("SerializationException");
Host host = Host.getHost(0);
VM vm0 = host.getVM(0);
VM vm1 = host.getVM(1);
@@ -190,7 +191,7 @@ public class ClassNotFoundExceptionDUnitTest extends CacheTestCase {
public Object call() throws Exception {
disconnectFromDS();
ClientCacheFactory cf = new ClientCacheFactory();
- cf.addPoolServer(getServerHostName(vm.getHost()), port);
+ cf.addPoolServer(NetworkSupport.getServerHostName(vm.getHost()), port);
cf.setPoolSubscriptionEnabled(true);
ClientCache cache = getClientCache(cf);
cache.createClientRegionFactory(ClientRegionShortcut.CACHING_PROXY)
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/76e324b5/gemfire-core/src/test/java/com/gemstone/gemfire/internal/JSSESocketJUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/JSSESocketJUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/JSSESocketJUnitTest.java
index 54275dc..6d9e357 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/JSSESocketJUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/JSSESocketJUnitTest.java
@@ -48,7 +48,7 @@ import org.junit.rules.TestName;
import com.gemstone.gemfire.internal.logging.LogService;
import com.gemstone.gemfire.util.test.TestUtil;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
+import com.gemstone.gemfire.test.dunit.Threads;
import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
/**
@@ -122,7 +122,7 @@ public class JSSESocketJUnitTest {
oos.writeObject( expected );
oos.flush();
- DistributedTestCase.join(serverThread, 30 * 1000, null);
+ Threads.join(serverThread, 30 * 1000, null);
client.close();
if ( expected.equals( receiver[0] ) ) {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/76e324b5/gemfire-core/src/test/java/com/gemstone/gemfire/internal/PdxDeleteFieldDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/PdxDeleteFieldDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/PdxDeleteFieldDUnitTest.java
index d805a38..df877d8 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/PdxDeleteFieldDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/PdxDeleteFieldDUnitTest.java
@@ -39,6 +39,7 @@ import com.gemstone.gemfire.pdx.PdxWriter;
import com.gemstone.gemfire.pdx.internal.PdxType;
import com.gemstone.gemfire.pdx.internal.PdxUnreadData;
import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.LogWriterSupport;
import com.gemstone.gemfire.test.dunit.SerializableCallable;
import com.gemstone.gemfire.test.dunit.VM;
@@ -176,7 +177,7 @@ public class PdxDeleteFieldDUnitTest extends CacheTestCase{
try {
FileUtil.delete(new File(path));
} catch (IOException e) {
- getLogWriter().error("Unable to delete file", e);
+ LogWriterSupport.getLogWriter().error("Unable to delete file", e);
}
}
this.filesToBeDeleted.clear();
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/76e324b5/gemfire-core/src/test/java/com/gemstone/gemfire/internal/PdxRenameDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/PdxRenameDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/PdxRenameDUnitTest.java
index 6303719..c4f61ea 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/PdxRenameDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/PdxRenameDUnitTest.java
@@ -40,6 +40,7 @@ import com.gemstone.gemfire.pdx.internal.EnumInfo;
import com.gemstone.gemfire.pdx.internal.PdxInstanceImpl;
import com.gemstone.gemfire.pdx.internal.PdxType;
import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.LogWriterSupport;
import com.gemstone.gemfire.test.dunit.SerializableCallable;
import com.gemstone.gemfire.test.dunit.VM;
@@ -183,7 +184,7 @@ public class PdxRenameDUnitTest extends CacheTestCase{
try {
FileUtil.delete(new File(path));
} catch (IOException e) {
- getLogWriter().error("Unable to delete file", e);
+ LogWriterSupport.getLogWriter().error("Unable to delete file", e);
}
}
this.filesToBeDeleted.clear();
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/76e324b5/gemfire-core/src/test/java/com/gemstone/gemfire/internal/SocketCloserJUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/SocketCloserJUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/SocketCloserJUnitTest.java
index 7335528..83f4a08 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/SocketCloserJUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/SocketCloserJUnitTest.java
@@ -30,8 +30,8 @@ import org.junit.Before;
import org.junit.Test;
import org.junit.experimental.categories.Category;
-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.UnitTest;
/**
@@ -121,7 +121,7 @@ public class SocketCloserJUnitTest {
return "expected " + 2*maxThreads + " waiters but found only " + waitingToClose.get();
}
};
- DistributedTestCase.waitForCriterion(wc, 5000, 10, true);
+ Wait.waitForCriterion(wc, 5000, 10, true);
}
// now count down the latch that allows the sockets to close
cdl.countDown();
@@ -141,7 +141,7 @@ public class SocketCloserJUnitTest {
return "one or more sockets did not close";
}
};
- DistributedTestCase.waitForCriterion(wc, 5000, 10, true);
+ Wait.waitForCriterion(wc, 5000, 10, true);
}
}
@@ -162,7 +162,7 @@ public class SocketCloserJUnitTest {
Socket s = createClosableSocket();
s.close();
this.socketCloser.asyncClose(s, "A", r);
- DistributedTestCase.pause(10);
+ Wait.pause(10);
assertEquals(false, runnableCalled.get());
}
@@ -190,6 +190,6 @@ public class SocketCloserJUnitTest {
return "runnable was not called or socket was not closed";
}
};
- DistributedTestCase.waitForCriterion(wc, 5000, 10, true);
+ Wait.waitForCriterion(wc, 5000, 10, true);
}
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/76e324b5/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/BackupDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/BackupDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/BackupDUnitTest.java
index 0f8c1e9..c27029a 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/BackupDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/BackupDUnitTest.java
@@ -54,6 +54,8 @@ 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.Host;
+import com.gemstone.gemfire.test.dunit.Invoke;
+import com.gemstone.gemfire.test.dunit.LogWriterSupport;
import com.gemstone.gemfire.test.dunit.SerializableCallable;
import com.gemstone.gemfire.test.dunit.SerializableRunnable;
import com.gemstone.gemfire.test.dunit.VM;
@@ -77,7 +79,7 @@ public class BackupDUnitTest extends PersistentPartitionedRegionTestBase {
StringBuilder failures = new StringBuilder();
FileUtil.delete(getBackupDir(), failures);
if (failures.length() > 0) {
- getLogWriter().error(failures.toString());
+ LogWriterSupport.getLogWriter().error(failures.toString());
}
super.tearDown2();
}
@@ -88,9 +90,9 @@ public class BackupDUnitTest extends PersistentPartitionedRegionTestBase {
VM vm1 = host.getVM(1);
VM vm2 = host.getVM(2);
- getLogWriter().info("Creating region in VM0");
+ LogWriterSupport.getLogWriter().info("Creating region in VM0");
createPersistentRegion(vm0);
- getLogWriter().info("Creating region in VM1");
+ LogWriterSupport.getLogWriter().info("Creating region in VM1");
createPersistentRegion(vm1);
long lm0 = setBackupFiles(vm0);
@@ -120,7 +122,7 @@ public class BackupDUnitTest extends PersistentPartitionedRegionTestBase {
closeCache(vm1);
//Destroy the current data
- invokeInEveryVM(new SerializableRunnable("Clean disk dirs") {
+ Invoke.invokeInEveryVM(new SerializableRunnable("Clean disk dirs") {
public void run() {
try {
cleanDiskDirs();
@@ -132,9 +134,9 @@ public class BackupDUnitTest extends PersistentPartitionedRegionTestBase {
restoreBackup(2);
- getLogWriter().info("Creating region in VM0");
+ LogWriterSupport.getLogWriter().info("Creating region in VM0");
AsyncInvocation async0 = createPersistentRegionAsync(vm0);
- getLogWriter().info("Creating region in VM1");
+ LogWriterSupport.getLogWriter().info("Creating region in VM1");
AsyncInvocation async1 = createPersistentRegionAsync(vm1);
async0.getResult(MAX_WAIT);
@@ -155,9 +157,9 @@ public class BackupDUnitTest extends PersistentPartitionedRegionTestBase {
VM vm0 = host.getVM(0);
VM vm1 = host.getVM(1);
- getLogWriter().info("Creating region in VM0");
+ LogWriterSupport.getLogWriter().info("Creating region in VM0");
createPersistentRegion(vm0);
- getLogWriter().info("Creating region in VM1");
+ LogWriterSupport.getLogWriter().info("Creating region in VM1");
createPersistentRegion(vm1);
createData(vm0, 0, 5, "A", "region1");
@@ -177,7 +179,7 @@ public class BackupDUnitTest extends PersistentPartitionedRegionTestBase {
closeCache(vm1);
//Destroy the current data
- invokeInEveryVM(new SerializableRunnable("Clean disk dirs") {
+ Invoke.invokeInEveryVM(new SerializableRunnable("Clean disk dirs") {
public void run() {
try {
cleanDiskDirs();
@@ -189,9 +191,9 @@ public class BackupDUnitTest extends PersistentPartitionedRegionTestBase {
restoreBackup(2);
- getLogWriter().info("Creating region in VM0");
+ LogWriterSupport.getLogWriter().info("Creating region in VM0");
AsyncInvocation async0 = createPersistentRegionAsync(vm0);
- getLogWriter().info("Creating region in VM1");
+ LogWriterSupport.getLogWriter().info("Creating region in VM1");
AsyncInvocation async1 = createPersistentRegionAsync(vm1);
async0.getResult(MAX_WAIT);
@@ -220,14 +222,14 @@ public class BackupDUnitTest extends PersistentPartitionedRegionTestBase {
final VM vm2 = host.getVM(2);
- getLogWriter().info("Creating region in VM0");
+ LogWriterSupport.getLogWriter().info("Creating region in VM0");
createPersistentRegion(vm0);
//create a bucket on vm0
createData(vm0, 0, 1, "A", "region1");
//create the pr on vm1, which won't have any buckets
- getLogWriter().info("Creating region in VM1");
+ LogWriterSupport.getLogWriter().info("Creating region in VM1");
createPersistentRegion(vm1);
@@ -267,7 +269,7 @@ public class BackupDUnitTest extends PersistentPartitionedRegionTestBase {
closeCache(vm1);
//Destroy the current data
- invokeInEveryVM(new SerializableRunnable("Clean disk dirs") {
+ Invoke.invokeInEveryVM(new SerializableRunnable("Clean disk dirs") {
public void run() {
try {
cleanDiskDirs();
@@ -279,9 +281,9 @@ public class BackupDUnitTest extends PersistentPartitionedRegionTestBase {
restoreBackup(2);
- getLogWriter().info("Creating region in VM0");
+ LogWriterSupport.getLogWriter().info("Creating region in VM0");
AsyncInvocation async0 = createPersistentRegionAsync(vm0);
- getLogWriter().info("Creating region in VM1");
+ LogWriterSupport.getLogWriter().info("Creating region in VM1");
AsyncInvocation async1 = createPersistentRegionAsync(vm1);
async0.getResult(MAX_WAIT);
@@ -380,14 +382,14 @@ public class BackupDUnitTest extends PersistentPartitionedRegionTestBase {
});
try {
- getLogWriter().info("Creating region in VM0");
+ LogWriterSupport.getLogWriter().info("Creating region in VM0");
createPersistentRegion(vm0);
//create twos bucket on vm0
createData(vm0, 0, 2, "A", "region1");
//create the pr on vm1, which won't have any buckets
- getLogWriter().info("Creating region in VM1");
+ LogWriterSupport.getLogWriter().info("Creating region in VM1");
createPersistentRegion(vm1);
@@ -417,7 +419,7 @@ public class BackupDUnitTest extends PersistentPartitionedRegionTestBase {
closeCache(vm1);
//Destroy the current data
- invokeInEveryVM(new SerializableRunnable("Clean disk dirs") {
+ Invoke.invokeInEveryVM(new SerializableRunnable("Clean disk dirs") {
public void run() {
try {
cleanDiskDirs();
@@ -429,9 +431,9 @@ public class BackupDUnitTest extends PersistentPartitionedRegionTestBase {
restoreBackup(2);
- getLogWriter().info("Creating region in VM0");
+ LogWriterSupport.getLogWriter().info("Creating region in VM0");
AsyncInvocation async0 = createPersistentRegionAsync(vm0);
- getLogWriter().info("Creating region in VM1");
+ LogWriterSupport.getLogWriter().info("Creating region in VM1");
AsyncInvocation async1 = createPersistentRegionAsync(vm1);
async0.getResult(MAX_WAIT);
@@ -460,9 +462,9 @@ public class BackupDUnitTest extends PersistentPartitionedRegionTestBase {
VM vm1 = host.getVM(1);
VM vm2 = host.getVM(2);
- getLogWriter().info("Creating region in VM0");
+ LogWriterSupport.getLogWriter().info("Creating region in VM0");
createPersistentRegion(vm0);
- getLogWriter().info("Creating region in VM1");
+ LogWriterSupport.getLogWriter().info("Creating region in VM1");
createOverflowRegion(vm1);
createData(vm0, 0, 5, "A", "region1");
@@ -485,11 +487,11 @@ public class BackupDUnitTest extends PersistentPartitionedRegionTestBase {
VM vm2 = host.getVM(2);
VM vm3 = host.getVM(3);
- getLogWriter().info("Creating region in VM0");
+ LogWriterSupport.getLogWriter().info("Creating region in VM0");
createPersistentRegion(vm0);
- getLogWriter().info("Creating region in VM1");
+ LogWriterSupport.getLogWriter().info("Creating region in VM1");
createPersistentRegion(vm1);
- getLogWriter().info("Creating region in VM2");
+ LogWriterSupport.getLogWriter().info("Creating region in VM2");
createPersistentRegion(vm2);
createData(vm0, 0, 5, "A", "region1");
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/76e324b5/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug33359DUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug33359DUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug33359DUnitTest.java
index aa2a9b2..678bcfb 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug33359DUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug33359DUnitTest.java
@@ -36,6 +36,7 @@ import com.gemstone.gemfire.cache30.CacheSerializableRunnable;
import com.gemstone.gemfire.distributed.DistributedSystem;
import com.gemstone.gemfire.test.dunit.DistributedTestCase;
import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.LogWriterSupport;
import com.gemstone.gemfire.test.dunit.VM;
/**
@@ -67,7 +68,7 @@ public class Bug33359DUnitTest extends DistributedTestCase {
VM vm1 = host.getVM(1);
vm0.invoke(Bug33359DUnitTest.class, "createCacheVM0");
vm1.invoke(Bug33359DUnitTest.class, "createCacheVM1");
- getLogWriter().fine("Cache created in successfully");
+ LogWriterSupport.getLogWriter().fine("Cache created in successfully");
}
public void tearDown2(){
@@ -140,7 +141,7 @@ public class Bug33359DUnitTest extends DistributedTestCase {
for(int i=0; i<10; i++){
region.put(new Integer(i), Integer.toString(i));
}
- getLogWriter().fine("Did all puts successfully");
+ LogWriterSupport.getLogWriter().fine("Did all puts successfully");
}
}
);
@@ -148,7 +149,7 @@ public class Bug33359DUnitTest extends DistributedTestCase {
vm0.invoke(new CacheSerializableRunnable("perform clear on region"){
public void run2() throws CacheException {
region.clear();
- getLogWriter().fine("region is cleared");
+ LogWriterSupport.getLogWriter().fine("region is cleared");
}
}
);
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/76e324b5/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug37241DUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug37241DUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug37241DUnitTest.java
index 4ad5133..ef4e034 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug37241DUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug37241DUnitTest.java
@@ -31,6 +31,7 @@ import com.gemstone.gemfire.distributed.DistributedSystem;
import com.gemstone.gemfire.distributed.internal.ReplyException;
import com.gemstone.gemfire.test.dunit.DistributedTestCase;
import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.LogWriterSupport;
import com.gemstone.gemfire.test.dunit.VM;
/*
@@ -155,10 +156,10 @@ public class Bug37241DUnitTest extends DistributedTestCase
.getName());
//added for not to log exepected IllegalStateExcepion.
- getLogWriter().info(
+ LogWriterSupport.getLogWriter().info(
"<ExpectedException action=add>" + expectedReplyException
+ "</ExpectedException>");
- getLogWriter().info(
+ LogWriterSupport.getLogWriter().info(
"<ExpectedException action=add>" + expectedException
+ "</ExpectedException>");
cache.getLogger().info(
@@ -199,10 +200,10 @@ public class Bug37241DUnitTest extends DistributedTestCase
cache.getLogger().info(
"<ExpectedException action=remove>" + expectedReplyException
+ "</ExpectedException>");
- getLogWriter().info(
+ LogWriterSupport.getLogWriter().info(
"<ExpectedException action=remove>" + expectedException
+ "</ExpectedException>");
- getLogWriter().info(
+ LogWriterSupport.getLogWriter().info(
"<ExpectedException action=remove>" + expectedReplyException
+ "</ExpectedException>");
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/76e324b5/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug37377DUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug37377DUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug37377DUnitTest.java
index f7a2911..10a7eec 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug37377DUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug37377DUnitTest.java
@@ -34,10 +34,12 @@ import com.gemstone.gemfire.distributed.DistributedSystem;
import com.gemstone.gemfire.internal.cache.lru.EnableLRU;
import com.gemstone.gemfire.internal.util.concurrent.CustomEntryConcurrentHashMap.HashEntry;
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.LogWriterSupport;
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;
/**
* Bug37377 DUNIT Test: The Clear operation during a GII in progress can leave a
@@ -313,8 +315,8 @@ public class Bug37377DUnitTest extends CacheTestCase
vm0.invoke(createCacheForVM0());
vm0.invoke(putSomeEntries());
AsyncInvocation as1 = vm1.invokeAsync(createCacheForVM1());
- pause(10000);
- DistributedTestCase.join(as1, 30 * 1000, getLogWriter());
+ Wait.pause(10000);
+ Threads.join(as1, 30 * 1000, LogWriterSupport.getLogWriter());
vm0.invoke(closeCacheForVM(0));
vm1.invoke(closeCacheForVM(1));
vm1.invoke(createCacheForVM1());
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/76e324b5/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug39079DUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug39079DUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug39079DUnitTest.java
index 27386cf..e1e3f6a 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug39079DUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug39079DUnitTest.java
@@ -45,6 +45,7 @@ import com.gemstone.gemfire.internal.AvailablePort;
import com.gemstone.gemfire.internal.cache.persistence.UninterruptibleFileChannel;
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.SerializableRunnable;
import com.gemstone.gemfire.test.dunit.VM;
@@ -308,7 +309,7 @@ public class Bug39079DUnitTest extends CacheTestCase {
Integer port = (Integer)vm0.invoke(Bug39079DUnitTest.class, "createServerCache");
//create cache client
vm1.invoke(Bug39079DUnitTest.class, "createClientCache",
- new Object[] { getServerHostName(vm0.getHost()), port});
+ new Object[] { NetworkSupport.getServerHostName(vm0.getHost()), port});
// validate
vm0.invoke(Bug39079DUnitTest.class, "validateRuningBridgeServerList");
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/76e324b5/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug40299DUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug40299DUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug40299DUnitTest.java
index eb0a83c..5736d36 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug40299DUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug40299DUnitTest.java
@@ -291,7 +291,7 @@ public class Bug40299DUnitTest extends CacheTestCase
public void testQueryGetWithClear()
{
- IgnoredException.addExpectedException("Entry has been cleared and is not present on disk");
+ IgnoredException.addIgnoredException("Entry has been cleared and is not present on disk");
// create region in VM0
vm0.invoke(createCacheForVM0());
// Do puts to region.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/76e324b5/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug41091DUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug41091DUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug41091DUnitTest.java
index 3d109e3..753908b 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug41091DUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug41091DUnitTest.java
@@ -36,6 +36,8 @@ import com.gemstone.gemfire.internal.AvailablePort;
import com.gemstone.gemfire.internal.cache.InitialImageOperation.RequestImageMessage;
import com.gemstone.gemfire.test.dunit.Assert;
import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.LogWriterSupport;
+import com.gemstone.gemfire.test.dunit.NetworkSupport;
import com.gemstone.gemfire.test.dunit.SerializableRunnable;
import com.gemstone.gemfire.test.dunit.VM;
@@ -97,7 +99,7 @@ public class Bug41091DUnitTest extends CacheTestCase {
Properties props = new Properties();
props.setProperty(DistributionConfig.ENABLE_NETWORK_PARTITION_DETECTION_NAME, "true");
- props.setProperty(DistributionConfig.LOCATORS_NAME, getServerHostName(host) + "[" + locatorPort + "]");
+ props.setProperty(DistributionConfig.LOCATORS_NAME, NetworkSupport.getServerHostName(host) + "[" + locatorPort + "]");
getSystem(props);
@@ -117,7 +119,7 @@ public class Bug41091DUnitTest extends CacheTestCase {
public void run() {
Properties props = new Properties();
props.setProperty(DistributionConfig.ENABLE_NETWORK_PARTITION_DETECTION_NAME, "true");
- props.setProperty(DistributionConfig.LOCATORS_NAME, getServerHostName(host) + "[" + locatorPort + "]");
+ props.setProperty(DistributionConfig.LOCATORS_NAME, NetworkSupport.getServerHostName(host) + "[" + locatorPort + "]");
getSystem(props);
Cache cache = getCache();
AttributesFactory af = new AttributesFactory();
@@ -151,7 +153,7 @@ public class Bug41091DUnitTest extends CacheTestCase {
disconnectFromDS();
Properties props = new Properties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME, String.valueOf(0));
- props.setProperty(DistributionConfig.LOG_LEVEL_NAME, getDUnitLogLevel());
+ props.setProperty(DistributionConfig.LOG_LEVEL_NAME, LogWriterSupport.getDUnitLogLevel());
props.setProperty(DistributionConfig.ENABLE_NETWORK_PARTITION_DETECTION_NAME, "true");
props.setProperty(DistributionConfig.ENABLE_CLUSTER_CONFIGURATION_NAME, "false");
try {
@@ -159,7 +161,7 @@ public class Bug41091DUnitTest extends CacheTestCase {
+ ".log");
InetAddress bindAddr = null;
try {
- bindAddr = InetAddress.getByName(getServerHostName(vm.getHost()));
+ bindAddr = InetAddress.getByName(NetworkSupport.getServerHostName(vm.getHost()));
} catch (UnknownHostException uhe) {
Assert.fail("While resolving bind address ", uhe);
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/76e324b5/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug41957DUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug41957DUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug41957DUnitTest.java
index 90fc2e1..ada0b36 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug41957DUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug41957DUnitTest.java
@@ -35,7 +35,9 @@ import com.gemstone.gemfire.cache30.ClientServerTestCase;
import com.gemstone.gemfire.distributed.internal.DistributionConfig;
import com.gemstone.gemfire.internal.AvailablePort;
import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.DistributedTestSupport;
import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.NetworkSupport;
import com.gemstone.gemfire.test.dunit.VM;
/**
@@ -64,7 +66,7 @@ import com.gemstone.gemfire.test.dunit.VM;
final VM client = host.getVM(1);
final String regionName = getUniqueName();
final int serverPort = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
- final String serverHost = getServerHostName(server.getHost());
+ final String serverHost = NetworkSupport.getServerHostName(server.getHost());
createBridgeServer(server, regionName, serverPort, false);
@@ -89,7 +91,7 @@ import com.gemstone.gemfire.test.dunit.VM;
public void run2() throws CacheException {
// Create DS
Properties config = new Properties();
- config.setProperty("locators", "localhost["+getDUnitLocatorPort()+"]");
+ config.setProperty("locators", "localhost["+DistributedTestSupport.getDUnitLocatorPort()+"]");
getSystem(config);
// Create Region
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/76e324b5/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug45164DUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug45164DUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug45164DUnitTest.java
index a2e9c5d..c8d1ffc 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug45164DUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug45164DUnitTest.java
@@ -25,6 +25,7 @@ import com.gemstone.gemfire.cache.RegionShortcut;
import com.gemstone.gemfire.cache30.CacheTestCase;
import com.gemstone.gemfire.test.dunit.AsyncInvocation;
import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.LogWriterSupport;
import com.gemstone.gemfire.test.dunit.SerializableRunnable;
public class Bug45164DUnitTest extends CacheTestCase {
@@ -78,7 +79,7 @@ public class Bug45164DUnitTest extends CacheTestCase {
Cache cache = getCache(new CacheFactory());
Region<Integer, Object> region = cache.<Integer, Object>createRegionFactory(RegionShortcut.PARTITION).create("test");
if (region == null) {
- getLogWriter().error("oops!");
+ LogWriterSupport.getLogWriter().error("oops!");
}
}
};
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/76e324b5/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug47667DUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug47667DUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug47667DUnitTest.java
index 40ba9ea..bd2b165 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug47667DUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug47667DUnitTest.java
@@ -25,6 +25,7 @@ import com.gemstone.gemfire.cache.client.PoolManager;
import com.gemstone.gemfire.cache.client.internal.LocatorTestBase;
import com.gemstone.gemfire.internal.AvailablePort;
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.VM;
@@ -56,7 +57,7 @@ public class Bug47667DUnitTest extends LocatorTestBase {
VM client = host.getVM(3);
final int locatorPort = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
- final String locatorHost = getServerHostName(host);
+ final String locatorHost = NetworkSupport.getServerHostName(host);
startLocatorInVM(locator, locatorPort, "");
String locString = getLocatorString(host, locatorPort);
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/76e324b5/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/CacheAdvisorDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/CacheAdvisorDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/CacheAdvisorDUnitTest.java
index 66a7880..eb64e93 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/CacheAdvisorDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/CacheAdvisorDUnitTest.java
@@ -40,6 +40,7 @@ import com.gemstone.gemfire.distributed.DistributedSystem;
import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem;
import com.gemstone.gemfire.distributed.internal.membership.InternalDistributedMember;
import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.Invoke;
import com.gemstone.gemfire.test.dunit.VM;
/**
@@ -174,7 +175,7 @@ public class CacheAdvisorDUnitTest extends CacheTestCase {
RegionAttributes attrs = fac.create();
DistributedRegion rgn = (DistributedRegion)createRegion(rgnName, attrs);
- invokeInEveryVM(new CacheSerializableRunnable("CachAdvisorTest.testNetLoadAdviceWithAttributesMutator;createRegion") {
+ Invoke.invokeInEveryVM(new CacheSerializableRunnable("CachAdvisorTest.testNetLoadAdviceWithAttributesMutator;createRegion") {
public void run2() throws CacheException {
AttributesFactory f = new AttributesFactory();
f.setScope(Scope.DISTRIBUTED_ACK);
@@ -231,7 +232,7 @@ public class CacheAdvisorDUnitTest extends CacheTestCase {
final InternalDistributedMember myMemberId = getSystem().getDistributionManager().getId();
// assert that other VMs advisors have test member id
- invokeInEveryVM(new CacheSerializableRunnable("CacheAdvisorDUnitTest.basicTestClose;verify1") {
+ Invoke.invokeInEveryVM(new CacheSerializableRunnable("CacheAdvisorDUnitTest.basicTestClose;verify1") {
public void run2() throws CacheException {
DistributedRegion rgn1 = (DistributedRegion)getRootRegion();
assertTrue(rgn1.getDistributionAdvisor().adviseGeneric().contains(myMemberId));
@@ -249,7 +250,7 @@ public class CacheAdvisorDUnitTest extends CacheTestCase {
fail("expected op(" + op + ") to be CACHE_CLOSE, REGION_CLOSE, or REGION_LOCAL_DESTROY");
}
final InternalDistributedMember closedMemberId = getSystem().getDistributionManager().getId();
- invokeInEveryVM(new CacheSerializableRunnable("CacheAdvisorDUnitTest.basicTestClose;verify") {
+ Invoke.invokeInEveryVM(new CacheSerializableRunnable("CacheAdvisorDUnitTest.basicTestClose;verify") {
public void run2() throws CacheException {
DistributedRegion rgn1 = (DistributedRegion)getRootRegion();
assertTrue(!rgn1.getDistributionAdvisor().adviseGeneric().contains(closedMemberId));