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/05/24 00:31:44 UTC
[19/29] incubator-geode git commit: Converting dunits to junit 4
using dunits_to_junit4.sh
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/f83cc548/geode-core/src/test/java/com/gemstone/gemfire/cache30/TXDistributedDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/TXDistributedDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/TXDistributedDUnitTest.java
index 3af5447..b7a3ad7 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/TXDistributedDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/TXDistributedDUnitTest.java
@@ -29,6 +29,15 @@
package com.gemstone.gemfire.cache30;
+import org.junit.experimental.categories.Category;
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
+
import java.io.IOException;
import java.io.Serializable;
import java.util.HashSet;
@@ -90,9 +99,10 @@ import com.gemstone.gemfire.test.dunit.Wait;
import com.gemstone.gemfire.test.dunit.WaitCriterion;
import com.gemstone.gemfire.test.junit.categories.FlakyTest;
-public class TXDistributedDUnitTest extends CacheTestCase {
- public TXDistributedDUnitTest(String name) {
- super(name);
+@Category(DistributedTest.class)
+public class TXDistributedDUnitTest extends JUnit4CacheTestCase {
+ public TXDistributedDUnitTest() {
+ super();
}
protected RegionAttributes getRegionAttributes() {
@@ -111,6 +121,7 @@ public class TXDistributedDUnitTest extends CacheTestCase {
/**
* Test a remote grantor
*/
+ @Test
public void testRemoteGrantor() throws Exception {
IgnoredException.addIgnoredException("killing members ds");
final CacheTransactionManager txMgr = this.getCache().getCacheTransactionManager();
@@ -210,6 +221,7 @@ public class TXDistributedDUnitTest extends CacheTestCase {
/**
* Test the internal callbacks used for what else... testing
*/
+ @Test
public void testInternalCallbacks() throws Exception {
final CacheTransactionManager txMgr = this.getCache().getCacheTransactionManager();
final String rgnName1 = getUniqueName() + "_1";
@@ -452,6 +464,7 @@ public class TXDistributedDUnitTest extends CacheTestCase {
* Test distributed ack transactions that consist only of
* data from loaded values
*/
+ @Test
public void testDACKLoadedMessage() throws Exception {
final CacheTransactionManager txMgr = this.getCache().getCacheTransactionManager();
final String rgnName = getUniqueName();
@@ -531,6 +544,7 @@ public class TXDistributedDUnitTest extends CacheTestCase {
}
@Category(FlakyTest.class) // GEODE-635: eats and logs exceptions, retry loops
+ @Test
public void testHighAvailabilityFeatures() throws Exception {
IgnoredException.addIgnoredException("DistributedSystemDisconnectedException");
// final CacheTransactionManager txMgr = this.getCache().getCacheTransactionManager();
@@ -1099,6 +1113,7 @@ public class TXDistributedDUnitTest extends CacheTestCase {
* discovered between a commit's locking phase and the applicatoin of the
* Region's data. See bug 32999
*/
+ @Test
public void testLockBatchParticipantsUpdate() throws Exception {
// final CacheTransactionManager txMgr = this.getCache().getCacheTransactionManager();
final String rgnName = getUniqueName();
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/f83cc548/geode-core/src/test/java/com/gemstone/gemfire/cache30/TXOrderDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/TXOrderDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/TXOrderDUnitTest.java
index faf2873..c76f813 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/TXOrderDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/TXOrderDUnitTest.java
@@ -16,6 +16,15 @@
*/
package com.gemstone.gemfire.cache30;
+import org.junit.experimental.categories.Category;
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
+
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
@@ -61,14 +70,15 @@ import com.gemstone.gemfire.test.dunit.VM;
*
* @since 5.0
*/
-public class TXOrderDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class TXOrderDUnitTest extends JUnit4CacheTestCase {
private transient Region r;
private transient DistributedMember otherId;
protected transient int invokeCount;
- public TXOrderDUnitTest(String name) {
- super(name);
+ public TXOrderDUnitTest() {
+ super();
}
private VM getOtherVm() {
@@ -124,6 +134,7 @@ public class TXOrderDUnitTest extends CacheTestCase {
/**
* make sure listeners get invoked in correct order on far side of tx
*/
+ @Test
public void testFarSideOrder() throws CacheException {
initOtherId();
AttributesFactory af = new AttributesFactory();
@@ -226,6 +237,7 @@ public class TXOrderDUnitTest extends CacheTestCase {
});
}
+ @Test
public void testInternalRegionNotExposed() {
Host host = Host.getHost(0);
VM vm1 = host.getVM(0);
@@ -316,14 +328,17 @@ public class TXOrderDUnitTest extends CacheTestCase {
* verify that queries on indexes work with transaction
* @throws Exception
*/
+ @Test
public void testFarSideIndexOnPut() throws Exception {
doTest(TEST_PUT);
}
+ @Test
public void testFarSideIndexOnInvalidate() throws Exception {
doTest(TEST_INVALIDATE);
}
+ @Test
public void testFarSideIndexOnDestroy() throws Exception {
doTest(TEST_DESTROY);
}
@@ -392,6 +407,7 @@ public class TXOrderDUnitTest extends CacheTestCase {
});
}
+ @Test
public void testBug43353() {
Host host = Host.getHost(0);
VM vm1 = host.getVM(0);
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/f83cc548/geode-core/src/test/java/com/gemstone/gemfire/cache30/TXRestrictionsDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/TXRestrictionsDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/TXRestrictionsDUnitTest.java
index 7d969c8..7d330cb 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/TXRestrictionsDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/TXRestrictionsDUnitTest.java
@@ -26,6 +26,15 @@
*/
package com.gemstone.gemfire.cache30;
+import org.junit.experimental.categories.Category;
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
+
import java.io.File;
import com.gemstone.gemfire.cache.AttributesFactory;
@@ -40,9 +49,10 @@ import com.gemstone.gemfire.test.dunit.Assert;
import com.gemstone.gemfire.test.dunit.Invoke;
import com.gemstone.gemfire.test.dunit.SerializableRunnable;
-public class TXRestrictionsDUnitTest extends CacheTestCase {
- public TXRestrictionsDUnitTest(String name) {
- super(name);
+@Category(DistributedTest.class)
+public class TXRestrictionsDUnitTest extends JUnit4CacheTestCase {
+ public TXRestrictionsDUnitTest() {
+ super();
}
protected RegionAttributes getRegionAttributes() {
@@ -69,6 +79,7 @@ public class TXRestrictionsDUnitTest extends CacheTestCase {
/**
* Check that remote persistent regions cause conflicts
*/
+ @Test
public void testPersistentRestriction() throws Exception {
final CacheTransactionManager txMgr = this.getCache().getCacheTransactionManager();
final String misConfigRegionName = getUniqueName();
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/f83cc548/geode-core/src/test/java/com/gemstone/gemfire/distributed/DistributedLockServiceDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/distributed/DistributedLockServiceDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/distributed/DistributedLockServiceDUnitTest.java
index 5729bf6..eb2348c 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/distributed/DistributedLockServiceDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/distributed/DistributedLockServiceDUnitTest.java
@@ -16,6 +16,15 @@
*/
package com.gemstone.gemfire.distributed;
+import org.junit.experimental.categories.Category;
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
+
import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
@@ -62,7 +71,8 @@ import org.junit.experimental.categories.Category;
* This class tests distributed ownership via the DistributedLockService api.
*/
@Category(DistributedTest.class)
-public class DistributedLockServiceDUnitTest extends DistributedTestCase {
+@Category(DistributedTest.class)
+public class DistributedLockServiceDUnitTest extends JUnit4DistributedTestCase {
protected static DistributedSystem dlstSystem;
private static DistributedLockBlackboard blackboard;
@@ -74,8 +84,8 @@ public class DistributedLockServiceDUnitTest extends DistributedTestCase {
private boolean got;
- public DistributedLockServiceDUnitTest(String name) {
- super(name);
+ public DistributedLockServiceDUnitTest() {
+ super();
}
/////////// Test lifecycle //////////
@@ -138,11 +148,12 @@ public class DistributedLockServiceDUnitTest extends DistributedTestCase {
* Connects a DistributedSystem, saves it in static variable "system"
*/
protected static void connectDistributedSystem() {
- dlstSystem = (new DistributedLockServiceDUnitTest("dummy")).getSystem();
+ dlstSystem = (new DistributedLockServiceDUnitTest()).getSystem();
}
///////// Public test methods
+ @Test
public void testBasic() {
String serviceName = getUniqueName();
String objectName = "object";
@@ -169,6 +180,7 @@ public class DistributedLockServiceDUnitTest extends DistributedTestCase {
DistributedLockService.destroy(serviceName);
}
+ @Test
public void testCreateDestroy() throws Exception {
final String serviceName = getUniqueName();
final String abc = "abc";
@@ -275,6 +287,7 @@ public class DistributedLockServiceDUnitTest extends DistributedTestCase {
protected static volatile boolean stop_testFairness;
protected static volatile boolean[] done_testFairness = new boolean[16];
static { Arrays.fill(done_testFairness, true); }
+ @Test
public void testFairness() throws Exception {
final String serviceName = "testFairness_" + getUniqueName();
final Object lock = "lock";
@@ -418,6 +431,7 @@ public class DistributedLockServiceDUnitTest extends DistributedTestCase {
return new Integer(count_testFairness[i.intValue()]);
}
+ @Test
public void testOneGetsAndOthersTimeOut() throws Exception {
doOneGetsAndOthersTimeOut(1, 1);
// doOneGetsAndOthersTimeOut(2, 2);
@@ -475,6 +489,7 @@ public class DistributedLockServiceDUnitTest extends DistributedTestCase {
service.becomeLockGrantor();
}
+ @Test
public void testGrantorSelection() {
// TODO change distributedCreateService usage to be concurrent threads
@@ -501,6 +516,7 @@ public class DistributedLockServiceDUnitTest extends DistributedTestCase {
}
}
+ @Test
public void testBasicGrantorRecovery() {
//DLockGrantor.setUncleanDestroyEnabled(true);
// try {
@@ -583,6 +599,7 @@ public class DistributedLockServiceDUnitTest extends DistributedTestCase {
// }
}
+ @Test
public void testLockFailover() {
final int originalGrantorVM = 0;
final int oneVM = 1;
@@ -672,6 +689,7 @@ public class DistributedLockServiceDUnitTest extends DistributedTestCase {
oneID, twoID);
}
+ @Test
public void testLockThenBecomeLockGrantor() {
final int originalGrantorVM = 0;
final int becomeGrantorVM = 1;
@@ -752,6 +770,7 @@ public class DistributedLockServiceDUnitTest extends DistributedTestCase {
Boolean.FALSE, unlocked);
}
+ @Test
public void testBecomeLockGrantor() {
// create lock services...
int numVMs = 4;
@@ -828,6 +847,7 @@ public class DistributedLockServiceDUnitTest extends DistributedTestCase {
// verify that pending requests are granted by unlocking them also
}
+ @Test
public void testTryLock() {
final Long waitMillis = new Long(100);
@@ -860,6 +880,7 @@ public class DistributedLockServiceDUnitTest extends DistributedTestCase {
1, unlockCount);
}
+ @Test
public void testOneGetsThenOtherGets() throws Exception { // (numVMs, numThreadsPerVM)
doOneGetsThenOtherGets(1, 1);
// doOneGetsThenOtherGets(2, 2);
@@ -867,6 +888,7 @@ public class DistributedLockServiceDUnitTest extends DistributedTestCase {
doOneGetsThenOtherGets(4, 3);
}
+ @Test
public void testLockDifferentNames() throws Exception {
String serviceName = getUniqueName();
@@ -890,6 +912,7 @@ public class DistributedLockServiceDUnitTest extends DistributedTestCase {
service.unlock("masterVMobj");
}
+ @Test
public void testLocalGetLockAndIncrement() throws Exception {
String serviceName = getUniqueName();
remoteCreateService(serviceName);
@@ -897,6 +920,7 @@ public class DistributedLockServiceDUnitTest extends DistributedTestCase {
assertEquals(Boolean.TRUE,
getLockAndIncrement(serviceName, "localVMobj", -1, 0));
}
+ @Test
public void testRemoteGetLockAndIncrement() {
String serviceName = getUniqueName();
VM vm = Host.getHost(0).getVM(0);
@@ -906,6 +930,7 @@ public class DistributedLockServiceDUnitTest extends DistributedTestCase {
)));
}
+ @Test
public void testLockSameNameDifferentService()
{
String serviceName1 = getUniqueName() + "_1";
@@ -933,6 +958,7 @@ public class DistributedLockServiceDUnitTest extends DistributedTestCase {
service1.unlock(objName);
}
+ @Test
public void testLeaseDoesntExpire()
throws InterruptedException
{
@@ -970,6 +996,7 @@ public class DistributedLockServiceDUnitTest extends DistributedTestCase {
service.unlock(objName);
}
+ @Test
public void testLockUnlock() {
String serviceName = getUniqueName();
Object objName = new Integer(42);
@@ -987,6 +1014,7 @@ public class DistributedLockServiceDUnitTest extends DistributedTestCase {
Assert.assertTrue(!service.isHeldByCurrentThread(objName));
}
+ @Test
public void testLockExpireUnlock() {
long leaseMs = 200;
long waitBeforeLockingMs = 210;
@@ -1013,6 +1041,7 @@ public class DistributedLockServiceDUnitTest extends DistributedTestCase {
}
}
+ @Test
public void testLockRecursion() {
String serviceName = getUniqueName();
Object objName = new Integer(42);
@@ -1039,6 +1068,7 @@ public class DistributedLockServiceDUnitTest extends DistributedTestCase {
Assert.assertTrue(!service.isHeldByCurrentThread(objName));
}
+ @Test
public void testLockRecursionWithExpiration() {
long leaseMs = 500;
long waitBeforeLockingMs = 750;
@@ -1099,12 +1129,14 @@ public class DistributedLockServiceDUnitTest extends DistributedTestCase {
Assert.assertTrue(!service.isHeldByCurrentThread(objName));
}
+ @Test
public void testLeaseExpiresBeforeOtherLocks()
throws InterruptedException
{
leaseExpiresTest(false);
}
+ @Test
public void testLeaseExpiresWhileOtherLocks()
throws InterruptedException
{
@@ -1181,6 +1213,7 @@ public class DistributedLockServiceDUnitTest extends DistributedTestCase {
}
}
+ @Test
public void testSuspendLockingAfterExpiration() throws Exception {
LogWriterUtils.getLogWriter().fine("[leaseExpiresThenSuspendTest]");
@@ -1228,6 +1261,7 @@ public class DistributedLockServiceDUnitTest extends DistributedTestCase {
volatile Throwable exception = null;
volatile Throwable throwable = null;
+ @Test
public void testLockInterruptiblyIsInterruptible() {
started = false;
gotLock = false;
@@ -1291,6 +1325,7 @@ public class DistributedLockServiceDUnitTest extends DistributedTestCase {
volatile boolean wasFlagSet = false;
+ @Test
public void testLockIsNotInterruptible() {
// Lock entire service in first thread
LogWriterUtils.getLogWriter().fine("[testLockIsNotInterruptible] lock in first thread");
@@ -1355,6 +1390,7 @@ public class DistributedLockServiceDUnitTest extends DistributedTestCase {
/**
* Test DistributedLockService.acquireExclusiveLocking(), releaseExclusiveLocking()
*/
+ @Test
public void testSuspendLockingBasic()
throws InterruptedException {
final DistributedLockService service =
@@ -1396,6 +1432,7 @@ public class DistributedLockServiceDUnitTest extends DistributedTestCase {
/**
* Test that exlusive locking prohibits locking activity
*/
+ @Test
public void testSuspendLockingProhibitsLocking()
{
final String name = getUniqueName();
@@ -1646,6 +1683,7 @@ public class DistributedLockServiceDUnitTest extends DistributedTestCase {
/**
* Test that exlusive locking prohibits locking activity
*/
+ @Test
public void testSuspendLockingBlocksUntilNoLocks()
throws InterruptedException
{
@@ -1717,6 +1755,7 @@ public class DistributedLockServiceDUnitTest extends DistributedTestCase {
}
+ @Test
public void testSuspendLockingInterruptiblyIsInterruptible() {
started = false;
@@ -1761,6 +1800,7 @@ public class DistributedLockServiceDUnitTest extends DistributedTestCase {
DistributedLockService.destroy(name);
}
+ @Test
public void testSuspendLockingIsNotInterruptible() {
started = false;
@@ -1822,6 +1862,7 @@ public class DistributedLockServiceDUnitTest extends DistributedTestCase {
*
* @author David Whitlock
*/
+ @Test
public void testLockDestroyedService() {
String serviceName = this.getUniqueName();
DistributedLockService service =
@@ -1836,6 +1877,7 @@ public class DistributedLockServiceDUnitTest extends DistributedTestCase {
}
}
+ @Test
public void testDepartedLastOwnerWithLease() {
final String serviceName = this.getUniqueName();
@@ -1868,6 +1910,7 @@ public class DistributedLockServiceDUnitTest extends DistributedTestCase {
}
+ @Test
public void testDepartedLastOwnerNoLease() {
final String serviceName = this.getUniqueName();
@@ -1907,6 +1950,7 @@ public class DistributedLockServiceDUnitTest extends DistributedTestCase {
* attempts to lock "lock" and old dlock throws StuckLockException. VM-C
* should now succeed in acquiring the lock.
*/
+ @Test
public void testBug32461() throws Exception {
LogWriterUtils.getLogWriter().fine("[testBug32461] prepping");
@@ -1956,6 +2000,7 @@ public class DistributedLockServiceDUnitTest extends DistributedTestCase {
});
}
+ @Test
public void testNoStuckLock() {
final String serviceName = this.getUniqueName();
final Object keyWithLease = "key-with-lease";
@@ -1999,6 +2044,7 @@ public class DistributedLockServiceDUnitTest extends DistributedTestCase {
* the grant reply. This causes the Client to send a release msg to the
* grantor.
*/
+ @Test
public void testReleaseOrphanedGrant_Local() {
DLockRequestProcessor.setDebugReleaseOrphanedGrant(true);
DLockRequestProcessor.setWaitToProcessDLockResponse(false);
@@ -2089,9 +2135,11 @@ public class DistributedLockServiceDUnitTest extends DistributedTestCase {
static volatile boolean unlockedThreadVM1_testReleaseOrphanedGrant_Remote;
static volatile boolean startedThreadVM2_testReleaseOrphanedGrant_Remote;
static volatile boolean gotLockThreadVM2_testReleaseOrphanedGrant_Remote;
+ @Test
public void testReleaseOrphanedGrant_Remote() {
doTestReleaseOrphanedGrant_Remote(false);
}
+ @Test
public void testReleaseOrphanedGrant_RemoteWithDestroy() {
doTestReleaseOrphanedGrant_Remote(true);
}
@@ -2217,6 +2265,7 @@ public class DistributedLockServiceDUnitTest extends DistributedTestCase {
}
}
+ @Test
public void testDestroyLockServiceAfterGrantResponse() throws Throwable {
Host host = Host.getHost(0);
VM vm0 = host.getVM(0);
@@ -2270,6 +2319,7 @@ public class DistributedLockServiceDUnitTest extends DistributedTestCase {
});
}
+ @Test
public void testDestroyLockServiceBeforeGrantRequest() throws Throwable {
Host host = Host.getHost(0);
VM vm0 = host.getVM(0);
@@ -2537,6 +2587,7 @@ public class DistributedLockServiceDUnitTest extends DistributedTestCase {
}
+ @Test
public void testTokenCleanup() throws Exception {
final String dlsName = getUniqueName();
@@ -2666,6 +2717,7 @@ public class DistributedLockServiceDUnitTest extends DistributedTestCase {
//static volatile boolean finishedThreadVM2_testTokenCleanup;
//static volatile DLockToken grantorDLockToken_testTokenCleanup;
+ @Test
public void testGrantTokenCleanup() throws Exception {
final String dlsName = getUniqueName();
@@ -2761,6 +2813,7 @@ public class DistributedLockServiceDUnitTest extends DistributedTestCase {
}
static final AtomicBoolean testLockQuery_whileVM1Locks = new AtomicBoolean();
+ @Test
public void testLockQuery() throws Exception {
final String dlsName = getUniqueName();
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/f83cc548/geode-core/src/test/java/com/gemstone/gemfire/distributed/LocatorDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/distributed/LocatorDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/distributed/LocatorDUnitTest.java
index 3a06c1c..7c5a862 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/distributed/LocatorDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/distributed/LocatorDUnitTest.java
@@ -16,6 +16,15 @@
*/
package com.gemstone.gemfire.distributed;
+import org.junit.experimental.categories.Category;
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
+
import com.gemstone.gemfire.ForcedDisconnectException;
import com.gemstone.gemfire.GemFireConfigException;
import com.gemstone.gemfire.LogWriter;
@@ -55,7 +64,8 @@ import java.util.Set;
*
* @since 4.0
*/
-public class LocatorDUnitTest extends DistributedTestCase {
+@Category(DistributedTest.class)
+public class LocatorDUnitTest extends JUnit4DistributedTestCase {
private static volatile InternalDistributedSystem system = null;
@@ -64,8 +74,8 @@ public class LocatorDUnitTest extends DistributedTestCase {
/**
* Creates a new <code>LocatorDUnitTest</code>
*/
- public LocatorDUnitTest(String name) {
- super(name);
+ public LocatorDUnitTest() {
+ super();
}
private static final String WAIT2_MS_NAME = "LocatorDUnitTest.WAIT2_MS";
@@ -120,6 +130,7 @@ public class LocatorDUnitTest extends DistributedTestCase {
* it hung with the restarted locator trying to become elder again because
* it put its address at the beginning of the new view it sent out.
*/
+ @Test
public void testCollocatedLocatorWithSecurity() throws Exception {
disconnectAllFromDS();
Host host = Host.getHost(0);
@@ -249,6 +260,7 @@ public class LocatorDUnitTest extends DistributedTestCase {
*
* @throws Exception
*/
+ @Test
public void testStartTwoLocators() throws Exception {
disconnectAllFromDS();
Host host = Host.getHost(0);
@@ -362,6 +374,7 @@ public class LocatorDUnitTest extends DistributedTestCase {
/**
* test lead member selection
*/
+ @Test
public void testLeadMemberSelection() throws Exception {
disconnectAllFromDS();
Host host = Host.getHost(0);
@@ -471,6 +484,7 @@ public class LocatorDUnitTest extends DistributedTestCase {
* We then kill the lead member and demonstrate that the original locator
* (which is now the sole remaining member) shuts itself down.
*/
+ @Test
public void testLeadAndCoordFailure() throws Exception {
IgnoredException.addIgnoredException("Possible loss of quorum due");
disconnectAllFromDS();
@@ -604,6 +618,7 @@ public class LocatorDUnitTest extends DistributedTestCase {
* We then shut down the group coordinator and observe the second locator
* pick up the job and the remaining member continues to operate normally.
*/
+ @Test
public void testLeadFailureAndCoordShutdown() throws Exception {
disconnectAllFromDS();
Host host = Host.getHost(0);
@@ -750,6 +765,7 @@ public class LocatorDUnitTest extends DistributedTestCase {
*/
// disabled on trunk - should be reenabled on cedar_dev_Oct12
// this test leaves a CloserThread around forever that logs "pausing" messages every 500 ms
+ @Test
public void testForceDisconnectAndPeerShutdownCause() throws Exception {
disconnectAllFromDS();
Host host = Host.getHost(0);
@@ -887,6 +903,7 @@ public class LocatorDUnitTest extends DistributedTestCase {
* We kill the coordinator and shut down the lead member and observe the second locator
* pick up the job and the remaining member continue to operate normally.
*/
+ @Test
public void testLeadShutdownAndCoordFailure() throws Exception {
disconnectAllFromDS();
Host host = Host.getHost(0);
@@ -1012,6 +1029,7 @@ public class LocatorDUnitTest extends DistributedTestCase {
* Tests that attempting to connect to a distributed system in which
* no locator is defined throws an exception.
*/
+ @Test
public void testNoLocator() {
disconnectAllFromDS();
Host host = Host.getHost(0);
@@ -1072,6 +1090,7 @@ public class LocatorDUnitTest extends DistributedTestCase {
* <p>The locator is then restarted and is shown to take over the
* role of membership coordinator.
*/
+ @Test
public void testOneLocator() throws Exception {
disconnectAllFromDS();
Host host = Host.getHost(0);
@@ -1164,6 +1183,7 @@ public class LocatorDUnitTest extends DistributedTestCase {
* is correct. It then restarts the locator to demonstrate that
* it can connect to and function as the group coordinator
*/
+ @Test
public void testLocatorBecomesCoordinator() throws Exception {
disconnectAllFromDS();
final String expected = "java.net.ConnectException";
@@ -1301,6 +1321,7 @@ public class LocatorDUnitTest extends DistributedTestCase {
/**
* Tests starting multiple locators in multiple VMs.
*/
+ @Test
public void testMultipleLocators() throws Exception {
disconnectAllFromDS();
Host host = Host.getHost(0);
@@ -1418,6 +1439,7 @@ public class LocatorDUnitTest extends DistributedTestCase {
* GEODE-870
*/
@Category(FlakyTest.class) // GEODE-1150: random ports, disk pollution, waitForCriterion, time sensitive, eats exceptions (fixed several)
+ @Test
public void testMultipleLocatorsRestartingAtSameTime() throws Exception {
disconnectAllFromDS();
Host host = Host.getHost(0);
@@ -1620,6 +1642,7 @@ public class LocatorDUnitTest extends DistributedTestCase {
/**
* Tests starting multiple locators in multiple VMs.
*/
+ @Test
public void testMultipleMcastLocators() throws Exception {
disconnectAllFromDS();
IgnoredException.addIgnoredException("Could not stop Distribution Locator"); // shutdown timing issue in InternalLocator
@@ -1735,6 +1758,7 @@ public class LocatorDUnitTest extends DistributedTestCase {
* Tests that a VM can connect to a locator that is hosted in its
* own VM.
*/
+ @Test
public void testConnectToOwnLocator() throws Exception {
disconnectAllFromDS();
Host host = Host.getHost(0);
@@ -1762,6 +1786,7 @@ public class LocatorDUnitTest extends DistributedTestCase {
/**
* Tests that a single VM can NOT host multiple locators
*/
+ @Test
public void testHostingMultipleLocators() throws Exception {
disconnectAllFromDS();
Host host = Host.getHost(0);
@@ -1819,6 +1844,7 @@ public class LocatorDUnitTest extends DistributedTestCase {
*
* @since 4.1
*/
+ @Test
public void testRestartLocator() throws Exception {
disconnectAllFromDS();
port1 =
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/f83cc548/geode-core/src/test/java/com/gemstone/gemfire/distributed/RoleDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/distributed/RoleDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/distributed/RoleDUnitTest.java
index 25428b2..a24d85f 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/distributed/RoleDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/distributed/RoleDUnitTest.java
@@ -16,6 +16,15 @@
*/
package com.gemstone.gemfire.distributed;
+import org.junit.experimental.categories.Category;
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
+
import java.util.Iterator;
import java.util.Properties;
import java.util.Set;
@@ -33,12 +42,13 @@ import com.gemstone.gemfire.test.dunit.SerializableRunnable;
* Tests the setting of Roles in a DistributedSystem
*
*/
-public class RoleDUnitTest extends DistributedTestCase {
+@Category(DistributedTest.class)
+public class RoleDUnitTest extends JUnit4DistributedTestCase {
static Properties distributionProperties = new Properties();
- public RoleDUnitTest(String name) {
- super(name);
+ public RoleDUnitTest() {
+ super();
}
@@ -51,6 +61,7 @@ public class RoleDUnitTest extends DistributedTestCase {
/**
* Tests usage of Roles in a Loner vm.
*/
+ @Test
public void testRolesInLonerVM() {
final String rolesProp = "A,B,C,D,E,F,G";
final String[] rolesArray = new String[] {"A","B","C","D","E","F","G"};
@@ -89,6 +100,7 @@ public class RoleDUnitTest extends DistributedTestCase {
/**
* Tests usage of Roles in four distributed vms.
*/
+ @Test
public void testRolesInDistributedVMs() {
// connect all four vms...
final String[] vmRoles = new String[]
@@ -149,6 +161,7 @@ public class RoleDUnitTest extends DistributedTestCase {
/**
* Tests that specifying duplicate role names results in just one Role.
*/
+ @Test
public void testDuplicateRoleNames() {
final String rolesProp = "A,A";
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/f83cc548/geode-core/src/test/java/com/gemstone/gemfire/distributed/SystemAdminDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/distributed/SystemAdminDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/distributed/SystemAdminDUnitTest.java
index 73c9c8c..e72d825 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/distributed/SystemAdminDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/distributed/SystemAdminDUnitTest.java
@@ -15,6 +15,15 @@
* limitations under the License.
*/
package com.gemstone.gemfire.distributed;
+
+import org.junit.experimental.categories.Category;
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
import java.io.BufferedReader;
import java.io.File;
@@ -33,10 +42,11 @@ import com.gemstone.gemfire.test.dunit.DistributedTestCase;
import com.gemstone.gemfire.test.dunit.DistributedTestUtils;
import com.gemstone.gemfire.test.dunit.LogWriterUtils;
-public class SystemAdminDUnitTest extends DistributedTestCase {
+@Category(DistributedTest.class)
+public class SystemAdminDUnitTest extends JUnit4DistributedTestCase {
- public SystemAdminDUnitTest(String name) {
- super(name);
+ public SystemAdminDUnitTest() {
+ super();
}
@Override
@@ -59,6 +69,7 @@ public class SystemAdminDUnitTest extends DistributedTestCase {
}
}
+ @Test
public void testPrintStacks() throws Exception {
// create a gemfire.properties that lets SystemAdmin find the dunit locator
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/f83cc548/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/Bug40751DUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/Bug40751DUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/Bug40751DUnitTest.java
index d906c09..06bfc5f 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/Bug40751DUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/Bug40751DUnitTest.java
@@ -15,6 +15,15 @@
* limitations under the License.
*/
package com.gemstone.gemfire.distributed.internal;
+
+import org.junit.experimental.categories.Category;
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
import java.io.DataInput;
import java.io.DataOutput;
@@ -41,10 +50,11 @@ import com.gemstone.gemfire.test.dunit.SerializableCallable;
import com.gemstone.gemfire.test.dunit.SerializableRunnable;
import com.gemstone.gemfire.test.dunit.VM;
-public class Bug40751DUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class Bug40751DUnitTest extends JUnit4CacheTestCase {
- public Bug40751DUnitTest(String name) {
- super(name);
+ public Bug40751DUnitTest() {
+ super();
}
@Override
@@ -52,6 +62,7 @@ public class Bug40751DUnitTest extends CacheTestCase {
disconnectAllFromDS();
}
+ @Test
public void testRR() {
System.setProperty("p2p.nodirectBuffers", "true");
try {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/f83cc548/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/ConsoleDistributionManagerDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/ConsoleDistributionManagerDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/ConsoleDistributionManagerDUnitTest.java
index 2aa9d27..11d5779 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/ConsoleDistributionManagerDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/ConsoleDistributionManagerDUnitTest.java
@@ -16,6 +16,15 @@
*/
package com.gemstone.gemfire.distributed.internal;
+import org.junit.experimental.categories.Category;
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
+
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.Properties;
@@ -54,14 +63,15 @@ import com.gemstone.gemfire.test.dunit.WaitCriterion;
* This class tests the functionality of the {@linkplain com.gemstone.gemfire.internal.admin internal
* admin} API.
*/
+@Category(DistributedTest.class)
public class ConsoleDistributionManagerDUnitTest
- extends CacheTestCase implements AlertListener {
+ extends JUnit4CacheTestCase implements AlertListener {
protected GfManagerAgent agent = null;
private static boolean firstTime = true;
- public ConsoleDistributionManagerDUnitTest(String name) {
- super(name);
+ public ConsoleDistributionManagerDUnitTest() {
+ super();
}
// private volatile Alert lastAlert = null;
@@ -158,12 +168,14 @@ public class ConsoleDistributionManagerDUnitTest
}
}
+ @Test
public void testGetDistributionVMType() {
DM dm = this.agent.getDM();
InternalDistributedMember ipaddr = dm.getId();
assertEquals(DistributionManager.ADMIN_ONLY_DM_TYPE, ipaddr.getVmKind());
}
+ @Test
public void testAgent() {
assertEquals("expected empty peer array", 0, agent.listPeers().length);
int systemCount = 0;
@@ -177,6 +189,7 @@ public class ConsoleDistributionManagerDUnitTest
assertTrue("agent should have been disconnected", !agent.isConnected());
}
+ @Test
public void testApplications() throws Exception {
{
WaitCriterion ev = new WaitCriterion() {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/f83cc548/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/DistributionAdvisorDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/DistributionAdvisorDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/DistributionAdvisorDUnitTest.java
index 375c2c6..804c7a3 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/DistributionAdvisorDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/DistributionAdvisorDUnitTest.java
@@ -16,6 +16,15 @@
*/
package com.gemstone.gemfire.distributed.internal;
+import org.junit.experimental.categories.Category;
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
+
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
@@ -33,12 +42,13 @@ import com.gemstone.gemfire.test.dunit.VM;
*
*
*/
-public class DistributionAdvisorDUnitTest extends DistributedTestCase {
+@Category(DistributedTest.class)
+public class DistributionAdvisorDUnitTest extends JUnit4DistributedTestCase {
private transient DistributionAdvisor.Profile profiles[];
protected transient DistributionAdvisor advisor;
- public DistributionAdvisorDUnitTest(String name) {
- super(name);
+ public DistributionAdvisorDUnitTest() {
+ super();
}
@Override
@@ -88,6 +98,7 @@ public class DistributionAdvisorDUnitTest extends DistributedTestCase {
}
+ @Test
public void testGenericAdvice() {
Set expected = new HashSet();
for (int i = 0; i < profiles.length; i++) {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/f83cc548/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/DistributionManagerDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/DistributionManagerDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/DistributionManagerDUnitTest.java
index d1487ee..7b6c839 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/DistributionManagerDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/DistributionManagerDUnitTest.java
@@ -16,6 +16,15 @@
*/
package com.gemstone.gemfire.distributed.internal;
+import org.junit.experimental.categories.Category;
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
+
import java.net.InetAddress;
import java.util.Properties;
@@ -60,7 +69,8 @@ import com.gemstone.gemfire.test.dunit.WaitCriterion;
* This class tests the functionality of the {@link
* DistributionManager} class.
*/
-public class DistributionManagerDUnitTest extends DistributedTestCase {
+@Category(DistributedTest.class)
+public class DistributionManagerDUnitTest extends JUnit4DistributedTestCase {
private static final Logger logger = LogService.getLogger();
/**
@@ -71,8 +81,8 @@ public class DistributionManagerDUnitTest extends DistributedTestCase {
dm.clearExceptionInThreads();
}
- public DistributionManagerDUnitTest(String name) {
- super(name);
+ public DistributionManagerDUnitTest() {
+ super();
}
@Override
@@ -97,6 +107,7 @@ public class DistributionManagerDUnitTest extends DistributedTestCase {
public static DistributedSystem ds;
+ @Test
public void testGetDistributionVMType() {
DM dm = getSystem().getDistributionManager();
InternalDistributedMember ipaddr = dm.getId();
@@ -106,6 +117,7 @@ public class DistributionManagerDUnitTest extends DistributedTestCase {
/**
* Send the distribution manager a message it can't deserialize
*/
+ @Test
public void testExceptionInThreads() throws InterruptedException {
DM dm = getSystem().getDistributionManager();
String p1 = "ItsOkayForMyClassNotToBeFound";
@@ -139,6 +151,7 @@ public class DistributionManagerDUnitTest extends DistributedTestCase {
* Demonstrate that a new UDP port is used when an attempt is made to
* reconnect using a shunned port
*/
+ @Test
public void testConnectAfterBeingShunned() {
InternalDistributedSystem sys = getSystem();
MembershipManager mgr = MembershipManagerHelper.getMembershipManager(sys);
@@ -168,6 +181,7 @@ public class DistributionManagerDUnitTest extends DistributedTestCase {
* until the member should be gone and force more view processing to have
* it scrubbed from the set.
**/
+ @Test
public void testSurpriseMemberHandling() {
VM vm0 = Host.getHost(0).getVM(0);
@@ -256,6 +270,7 @@ public class DistributionManagerDUnitTest extends DistributedTestCase {
* region that sleeps when notified, forcing the operation to take longer
* than ack-wait-threshold + ack-severe-alert-threshold
*/
+ @Test
public void testAckSevereAlertThreshold() throws Exception {
disconnectAllFromDS();
Host host = Host.getHost(0);
@@ -397,6 +412,7 @@ public class DistributionManagerDUnitTest extends DistributedTestCase {
/**
* Tests that a sick member is kicked out
*/
+ @Test
public void testKickOutSickMember() throws Exception {
disconnectAllFromDS();
IgnoredException.addIgnoredException("10 seconds have elapsed while waiting");
@@ -511,6 +527,7 @@ public class DistributionManagerDUnitTest extends DistributedTestCase {
* test use of a bad bind-address for bug #32565
* @throws Exception
*/
+ @Test
public void testBadBindAddress() throws Exception {
disconnectAllFromDS();
@@ -540,6 +557,7 @@ public class DistributionManagerDUnitTest extends DistributedTestCase {
/**
* install a new view and show that waitForViewInstallation works as expected
*/
+ @Test
public void testWaitForViewInstallation() {
getSystem(new Properties());
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/f83cc548/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/ProductUseLogDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/ProductUseLogDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/ProductUseLogDUnitTest.java
index 2cc8ce2..33d45e4 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/ProductUseLogDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/ProductUseLogDUnitTest.java
@@ -15,6 +15,15 @@
* limitations under the License.
*/
package com.gemstone.gemfire.distributed.internal;
+
+import org.junit.experimental.categories.Category;
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
import java.io.BufferedReader;
import java.io.File;
@@ -41,10 +50,11 @@ import com.gemstone.gemfire.test.dunit.SerializableCallable;
import com.gemstone.gemfire.test.dunit.SerializableRunnable;
import com.gemstone.gemfire.test.dunit.VM;
-public class ProductUseLogDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class ProductUseLogDUnitTest extends JUnit4CacheTestCase {
- public ProductUseLogDUnitTest(String name) {
- super(name);
+ public ProductUseLogDUnitTest() {
+ super();
}
@Override
@@ -59,6 +69,7 @@ public class ProductUseLogDUnitTest extends CacheTestCase {
return p;
}
+ @Test
public void testMembershipMonitoring() throws Exception {
Host host = Host.getHost(0);
VM vm0 = host.getVM(0);
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/f83cc548/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/deadlock/GemFireDeadlockDetectorDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/deadlock/GemFireDeadlockDetectorDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/deadlock/GemFireDeadlockDetectorDUnitTest.java
index 8977172..7767432 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/deadlock/GemFireDeadlockDetectorDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/deadlock/GemFireDeadlockDetectorDUnitTest.java
@@ -16,6 +16,15 @@
*/
package com.gemstone.gemfire.distributed.internal.deadlock;
+import org.junit.experimental.categories.Category;
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
+
import java.util.Collections;
import java.util.HashSet;
import java.util.LinkedList;
@@ -46,7 +55,8 @@ import com.gemstone.gemfire.test.dunit.SerializableRunnable;
import com.gemstone.gemfire.test.dunit.VM;
import com.gemstone.gemfire.test.junit.categories.FlakyTest;
-public class GemFireDeadlockDetectorDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class GemFireDeadlockDetectorDUnitTest extends JUnit4CacheTestCase {
private static final Set<Thread> stuckThreads = Collections.synchronizedSet(new HashSet<Thread>());
@@ -73,10 +83,11 @@ public class GemFireDeadlockDetectorDUnitTest extends CacheTestCase {
});
}
- public GemFireDeadlockDetectorDUnitTest(String name) {
- super(name);
+ public GemFireDeadlockDetectorDUnitTest() {
+ super();
}
+ @Test
public void testNoDeadlock() {
Host host = Host.getHost(0);
VM vm0 = host.getVM(0);
@@ -96,6 +107,7 @@ public class GemFireDeadlockDetectorDUnitTest extends CacheTestCase {
private static final Lock lock = new ReentrantLock();
@Category(FlakyTest.class) // GEODE-516 & GEODE-576: async actions, thread sleeps, time sensitive
+ @Test
public void testDistributedDeadlockWithFunction() throws Throwable {
Host host = Host.getHost(0);
VM vm0 = host.getVM(0);
@@ -142,6 +154,7 @@ public class GemFireDeadlockDetectorDUnitTest extends CacheTestCase {
});
}
+ @Test
public void testDistributedDeadlockWithDLock() throws Throwable {
Host host = Host.getHost(0);
VM vm0 = host.getVM(0);
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/f83cc548/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/streaming/StreamingOperationManyDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/streaming/StreamingOperationManyDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/streaming/StreamingOperationManyDUnitTest.java
index a5bba7c..1daeeb2 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/streaming/StreamingOperationManyDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/streaming/StreamingOperationManyDUnitTest.java
@@ -20,6 +20,15 @@
//
package com.gemstone.gemfire.distributed.internal.streaming;
+import org.junit.experimental.categories.Category;
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
+
import static com.gemstone.gemfire.test.dunit.Wait.pause;
import java.util.ArrayList;
@@ -46,12 +55,14 @@ import com.gemstone.gemfire.test.dunit.SerializableRunnable;
import com.gemstone.gemfire.test.dunit.VM;
import com.jayway.awaitility.Awaitility;
-public class StreamingOperationManyDUnitTest extends DistributedTestCase {
+@Category(DistributedTest.class)
+public class StreamingOperationManyDUnitTest extends JUnit4DistributedTestCase {
- public StreamingOperationManyDUnitTest(String name) {
- super(name);
+ public StreamingOperationManyDUnitTest() {
+ super();
}
+ @Test
public void testStreamingManyProvidersNoExceptions() throws Exception {
// final String name = this.getUniqueName();
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/f83cc548/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/streaming/StreamingOperationOneDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/streaming/StreamingOperationOneDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/streaming/StreamingOperationOneDUnitTest.java
index a09c167..1a39c91 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/streaming/StreamingOperationOneDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/streaming/StreamingOperationOneDUnitTest.java
@@ -20,6 +20,15 @@
//
package com.gemstone.gemfire.distributed.internal.streaming;
+import org.junit.experimental.categories.Category;
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
+
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collections;
@@ -41,12 +50,14 @@ import com.gemstone.gemfire.test.dunit.DistributedTestCase;
import com.gemstone.gemfire.test.dunit.Host;
import com.gemstone.gemfire.test.dunit.VM;
-public class StreamingOperationOneDUnitTest extends DistributedTestCase {
+@Category(DistributedTest.class)
+public class StreamingOperationOneDUnitTest extends JUnit4DistributedTestCase {
- public StreamingOperationOneDUnitTest(String name) {
- super(name);
+ public StreamingOperationOneDUnitTest() {
+ super();
}
+ @Test
public void testStreamingOneProviderNoExceptions() throws Exception {
// final String name = this.getUniqueName();
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/f83cc548/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/tcpserver/TcpServerBackwardCompatDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/tcpserver/TcpServerBackwardCompatDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/tcpserver/TcpServerBackwardCompatDUnitTest.java
index 5fd0f27..67555c8 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/tcpserver/TcpServerBackwardCompatDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/tcpserver/TcpServerBackwardCompatDUnitTest.java
@@ -16,6 +16,15 @@
*/
package com.gemstone.gemfire.distributed.internal.tcpserver;
+import org.junit.experimental.categories.Category;
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
+
import java.io.File;
import java.io.IOException;
import java.net.InetAddress;
@@ -56,13 +65,14 @@ import com.gemstone.gemfire.test.junit.categories.DistributedTest;
*/
@Category(DistributedTest.class)
//@Ignore("Test was disabled by renaming to DisabledTest")
-public class TcpServerBackwardCompatDUnitTest extends DistributedTestCase {
+@Category(DistributedTest.class)
+public class TcpServerBackwardCompatDUnitTest extends JUnit4DistributedTestCase {
/**
* @param name
*/
- public TcpServerBackwardCompatDUnitTest(String name) {
- super(name);
+ public TcpServerBackwardCompatDUnitTest() {
+ super();
}
@Override
@@ -94,6 +104,7 @@ public class TcpServerBackwardCompatDUnitTest extends DistributedTestCase {
* GOSSIPVERSION and verifies that it has recoverd the system
* View. Then we upgrade next locator.
*/
+ @Test
public void testGossipVersionBackwardCompatibility() {
Host host = Host.getHost(0);
final VM locator0 = host.getVM(0);
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/f83cc548/geode-core/src/test/java/com/gemstone/gemfire/disttx/CacheMapDistTXDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/disttx/CacheMapDistTXDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/disttx/CacheMapDistTXDUnitTest.java
index f0ea16d..5f3442f 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/disttx/CacheMapDistTXDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/disttx/CacheMapDistTXDUnitTest.java
@@ -16,6 +16,15 @@
*/
package com.gemstone.gemfire.disttx;
+import org.junit.experimental.categories.Category;
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
+
import com.gemstone.gemfire.cache30.CacheMapTxnDUnitTest;
import com.gemstone.gemfire.distributed.internal.DistributionConfig;
import com.gemstone.gemfire.test.dunit.Host;
@@ -26,10 +35,11 @@ import com.gemstone.gemfire.test.dunit.VM;
* Same tests as that of {@link CacheMapTxnDUnitTest} after setting
* "distributed-transactions" property to true
*/
+@Category(DistributedTest.class)
public class CacheMapDistTXDUnitTest extends CacheMapTxnDUnitTest {
- public CacheMapDistTXDUnitTest(String name) {
- super(name);
+ public CacheMapDistTXDUnitTest() {
+ super();
}
@Override
@@ -68,6 +78,7 @@ public class CacheMapDistTXDUnitTest extends CacheMapTxnDUnitTest {
}
@Override
+ @Test
public void testCommitTxn() {
// [DISTTX] TODO test overridden intentionally and left blank as it fails
// fix this
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/f83cc548/geode-core/src/test/java/com/gemstone/gemfire/disttx/DistTXOrderDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/disttx/DistTXOrderDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/disttx/DistTXOrderDUnitTest.java
index e2f08a9..0c05fdd 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/disttx/DistTXOrderDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/disttx/DistTXOrderDUnitTest.java
@@ -16,6 +16,15 @@
*/
package com.gemstone.gemfire.disttx;
+import org.junit.experimental.categories.Category;
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
+
import java.util.Properties;
import com.gemstone.gemfire.cache.CacheException;
@@ -27,10 +36,11 @@ import com.gemstone.gemfire.distributed.internal.DistributionConfig;
* Same tests as that of {@link TXOrderDUnitTest} after setting
* "distributed-transactions" property to true
*/
+@Category(DistributedTest.class)
public class DistTXOrderDUnitTest extends TXOrderDUnitTest {
- public DistTXOrderDUnitTest(String name) {
- super(name);
+ public DistTXOrderDUnitTest() {
+ super();
}
@Override
@@ -42,12 +52,14 @@ public class DistTXOrderDUnitTest extends TXOrderDUnitTest {
}
@Override
+ @Test
public void testFarSideOrder() throws CacheException {
// [DISTTX] TODO test overridden intentionally and left blank as it fails
// fix this
}
@Override
+ @Test
public void testInternalRegionNotExposed() {
// [DISTTX] TODO test overridden intentionally and left blank as it fails
// fix this
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/f83cc548/geode-core/src/test/java/com/gemstone/gemfire/disttx/DistTXRestrictionsDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/disttx/DistTXRestrictionsDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/disttx/DistTXRestrictionsDUnitTest.java
index 28ae360..99a27cb 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/disttx/DistTXRestrictionsDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/disttx/DistTXRestrictionsDUnitTest.java
@@ -16,6 +16,15 @@
*/
package com.gemstone.gemfire.disttx;
+import org.junit.experimental.categories.Category;
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
+
import java.util.Properties;
import org.junit.experimental.categories.Category;
@@ -29,10 +38,11 @@ import com.gemstone.gemfire.test.junit.categories.DistributedTransactionsTest;
* Same tests as that of {@link TXRestrictionsDUnitTest} after setting
* "distributed-transactions" property to true
*/
+@Category(DistributedTest.class)
public class DistTXRestrictionsDUnitTest extends TXRestrictionsDUnitTest {
- public DistTXRestrictionsDUnitTest(String name) {
- super(name);
+ public DistTXRestrictionsDUnitTest() {
+ super();
}
@Override
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/f83cc548/geode-core/src/test/java/com/gemstone/gemfire/disttx/DistTXWithDeltaDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/disttx/DistTXWithDeltaDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/disttx/DistTXWithDeltaDUnitTest.java
index f6a3530..dc09e86 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/disttx/DistTXWithDeltaDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/disttx/DistTXWithDeltaDUnitTest.java
@@ -16,15 +16,25 @@
*/
package com.gemstone.gemfire.disttx;
+import org.junit.experimental.categories.Category;
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
+
import java.util.Properties;
import com.gemstone.gemfire.distributed.internal.DistributionConfig;
import com.gemstone.gemfire.internal.cache.TransactionsWithDeltaDUnitTest;
+@Category(DistributedTest.class)
public class DistTXWithDeltaDUnitTest extends TransactionsWithDeltaDUnitTest {
- public DistTXWithDeltaDUnitTest(String name) {
- super(name);
+ public DistTXWithDeltaDUnitTest() {
+ super();
}
@Override
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/f83cc548/geode-core/src/test/java/com/gemstone/gemfire/disttx/DistributedTransactionDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/disttx/DistributedTransactionDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/disttx/DistributedTransactionDUnitTest.java
index 33306d8..4bd647c 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/disttx/DistributedTransactionDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/disttx/DistributedTransactionDUnitTest.java
@@ -16,6 +16,15 @@
*/
package com.gemstone.gemfire.disttx;
+import org.junit.experimental.categories.Category;
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
+
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;
@@ -70,7 +79,8 @@ import com.gemstone.gemfire.test.dunit.VM;
*
*/
@SuppressWarnings("deprecation")
-public class DistributedTransactionDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class DistributedTransactionDUnitTest extends JUnit4CacheTestCase {
final protected String CUSTOMER_PR = "customerPRRegion";
final protected String ORDER_PR = "orderPRRegion";
final protected String D_REFERENCE = "distrReference";
@@ -117,8 +127,8 @@ public class DistributedTransactionDUnitTest extends CacheTestCase {
});
}
- public DistributedTransactionDUnitTest(String name) {
- super(name);
+ public DistributedTransactionDUnitTest() {
+ super();
}
public Object execute(VM vm, SerializableCallable c) {
@@ -380,6 +390,7 @@ public class DistributedTransactionDUnitTest extends CacheTestCase {
*
* @throws Exception
*/
+ @Test
public void testTransactionalPutOnReplicatedRegion() throws Exception {
Host host = Host.getHost(0);
VM server1 = host.getVM(0);
@@ -449,6 +460,7 @@ public class DistributedTransactionDUnitTest extends CacheTestCase {
});
}
+ @Test
public void testTransactionalPutOnPartitionedRegion() throws Exception {
Host host = Host.getHost(0);
VM server1 = host.getVM(0);
@@ -530,6 +542,7 @@ public class DistributedTransactionDUnitTest extends CacheTestCase {
}
@SuppressWarnings("serial")
+ @Test
public void testCommitOnPartitionedAndReplicatedRegions() throws Exception {
Host host = Host.getHost(0);
VM server1 = host.getVM(0);
@@ -574,6 +587,7 @@ public class DistributedTransactionDUnitTest extends CacheTestCase {
});
}
+ @Test
public void testGetIsolated() throws Exception {
Host host = Host.getHost(0);
VM server1 = host.getVM(0);
@@ -618,6 +632,7 @@ public class DistributedTransactionDUnitTest extends CacheTestCase {
});
}
+ @Test
public void testCommitAndRollback() throws Exception {
Host host = Host.getHost(0);
VM server1 = host.getVM(0);
@@ -658,6 +673,7 @@ public class DistributedTransactionDUnitTest extends CacheTestCase {
* We create 2 partitioned regions one on each server and have a third node
* as accessor and fire transactional operations on it.
*/
+ @Test
public void testNonColocatedPutByPartitioning() {
Host host = Host.getHost(0);
VM server1 = host.getVM(0); // datastore
@@ -765,6 +781,7 @@ public class DistributedTransactionDUnitTest extends CacheTestCase {
});
}
+ @Test
public void testTransactionalKeyBasedUpdates() throws Exception {
Host host = Host.getHost(0);
VM server1 = host.getVM(0);
@@ -816,6 +833,7 @@ public class DistributedTransactionDUnitTest extends CacheTestCase {
});
}
+ @Test
public void testTransactionalKeyBasedDestroys_PR() throws Exception {
Host host = Host.getHost(0);
VM server1 = host.getVM(0);
@@ -861,6 +879,7 @@ public class DistributedTransactionDUnitTest extends CacheTestCase {
});
}
+ @Test
public void testTransactionalKeyBasedDestroys_RR() throws Exception {
Host host = Host.getHost(0);
VM server1 = host.getVM(0);
@@ -904,6 +923,7 @@ public class DistributedTransactionDUnitTest extends CacheTestCase {
});
}
+ @Test
public void testTransactionalUpdates() throws Exception {
Host host = Host.getHost(0);
VM server1 = host.getVM(0);
@@ -960,6 +980,7 @@ public class DistributedTransactionDUnitTest extends CacheTestCase {
});
}
+ @Test
public void testPutAllWithTransactions() throws Exception {
Host host = Host.getHost(0);
VM server1 = host.getVM(0);
@@ -1077,6 +1098,7 @@ public class DistributedTransactionDUnitTest extends CacheTestCase {
});
}
+ @Test
public void testRemoveAllWithTransactions() throws Exception {
Host host = Host.getHost(0);
VM server1 = host.getVM(0);
@@ -1146,6 +1168,7 @@ public class DistributedTransactionDUnitTest extends CacheTestCase {
});
}
+ @Test
public void testTxWithSingleDataStore() throws Exception {
Host host = Host.getHost(0);
VM server1 = host.getVM(0); // datastore
@@ -1221,6 +1244,7 @@ public class DistributedTransactionDUnitTest extends CacheTestCase {
});
}
+ @Test
public void testMultipleOpsOnSameKeyInTx() throws Exception {
Host host = Host.getHost(0);
VM server1 = host.getVM(0);
@@ -1520,6 +1544,7 @@ public class DistributedTransactionDUnitTest extends CacheTestCase {
execute(secondary, verifySecondary);
}
+ @Test
public void testBasicDistributedTX() throws Exception {
Host host = Host.getHost(0);
VM server1 = host.getVM(0);
@@ -1555,6 +1580,7 @@ public class DistributedTransactionDUnitTest extends CacheTestCase {
}
+ @Test
public void testRegionAndEntryVersionsPR() throws Exception {
Host host = Host.getHost(0);
VM server1 = host.getVM(0);
@@ -1648,6 +1674,7 @@ public class DistributedTransactionDUnitTest extends CacheTestCase {
}
+ @Test
public void testRegionAndEntryVersionsRR() throws Exception {
Host host = Host.getHost(0);
VM server1 = host.getVM(0);
@@ -1741,6 +1768,7 @@ public class DistributedTransactionDUnitTest extends CacheTestCase {
}
+ @Test
public void testTxWorksWithNewNodeJoining() throws Exception {
Host host = Host.getHost(0);
VM server1 = host.getVM(0);
@@ -1889,6 +1917,7 @@ public class DistributedTransactionDUnitTest extends CacheTestCase {
* Start two concurrent transactions that put same entries. Make sure that
* conflict is detected at the commit time.
*/
+ @Test
public void testCommitConflicts_PR() throws Exception {
Host host = Host.getHost(0);
VM server1 = host.getVM(0);
@@ -1909,6 +1938,7 @@ public class DistributedTransactionDUnitTest extends CacheTestCase {
* Start two concurrent transactions that put same entries. Make sure that
* conflict is detected at the commit time.
*/
+ @Test
public void testCommitConflicts_RR() throws Exception {
Host host = Host.getHost(0);
VM server1 = host.getVM(0);
@@ -2036,6 +2066,7 @@ public class DistributedTransactionDUnitTest extends CacheTestCase {
* transaction in a new thread that modifies same entries as in the earlier
* transaction. Make sure that conflict is detected
*/
+ @Test
public void testCommitConflicts_PR_after_locks_acquired() throws Exception {
Host host = Host.getHost(0);
VM server1 = host.getVM(0);
@@ -2053,6 +2084,7 @@ public class DistributedTransactionDUnitTest extends CacheTestCase {
* transaction in a new thread that modifies same entries as in the earlier
* transaction. Make sure that conflict is detected
*/
+ @Test
public void testCommitConflicts_RR_after_locks_acquired() throws Exception {
Host host = Host.getHost(0);
VM server1 = host.getVM(0);
@@ -2163,7 +2195,8 @@ private class TxOps_no_conflicts extends SerializableCallable {
* transaction in a new thread that modifies different entries Make sure that
* there is no conflict or exception.
*/
-public void testCommitNoConflicts_PR() throws Exception {
+ @Test
+ public void testCommitNoConflicts_PR() throws Exception {
Host host = Host.getHost(0);
VM server1 = host.getVM(0);
VM server2 = host.getVM(1);
@@ -2178,7 +2211,8 @@ public void testCommitNoConflicts_PR() throws Exception {
* transaction in a new thread that modifies different entries Make sure that
* there is no conflict or exception.
*/
-public void testCommitNoConflicts_RR() throws Exception {
+ @Test
+ public void testCommitNoConflicts_RR() throws Exception {
Host host = Host.getHost(0);
VM server1 = host.getVM(0);
VM server2 = host.getVM(1);
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/f83cc548/geode-core/src/test/java/com/gemstone/gemfire/disttx/PersistentPartitionedRegionWithDistTXDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/disttx/PersistentPartitionedRegionWithDistTXDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/disttx/PersistentPartitionedRegionWithDistTXDUnitTest.java
index 745ad60..2d3ec7c 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/disttx/PersistentPartitionedRegionWithDistTXDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/disttx/PersistentPartitionedRegionWithDistTXDUnitTest.java
@@ -16,6 +16,15 @@
*/
package com.gemstone.gemfire.disttx;
+import org.junit.experimental.categories.Category;
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
+
import java.util.Properties;
import org.junit.Ignore;
@@ -29,6 +38,7 @@ import com.gemstone.gemfire.internal.cache.partitioned.PersistentPartitionedRegi
* {@link PersistentPartitionedRegionWithTransactionDUnitTest} after setting
* "distributed-transactions" property to true
*/
+@Category(DistributedTest.class)
public class PersistentPartitionedRegionWithDistTXDUnitTest extends
PersistentPartitionedRegionWithTransactionDUnitTest {
@@ -40,7 +50,7 @@ public class PersistentPartitionedRegionWithDistTXDUnitTest extends
return props;
}
- public PersistentPartitionedRegionWithDistTXDUnitTest(String name) {
- super(name);
+ public PersistentPartitionedRegionWithDistTXDUnitTest() {
+ super();
}
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/f83cc548/geode-core/src/test/java/com/gemstone/gemfire/internal/BackwardCompatibilitySerializationDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/BackwardCompatibilitySerializationDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/BackwardCompatibilitySerializationDUnitTest.java
index 07f87a3..bf469d9 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/BackwardCompatibilitySerializationDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/BackwardCompatibilitySerializationDUnitTest.java
@@ -16,6 +16,15 @@
*/
package com.gemstone.gemfire.internal;
+import org.junit.experimental.categories.Category;
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
+
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.DataInput;
@@ -42,7 +51,8 @@ import com.gemstone.gemfire.internal.cache.DistributedPutAllOperation.EntryVersi
*
*
*/
-public class BackwardCompatibilitySerializationDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class BackwardCompatibilitySerializationDUnitTest extends JUnit4CacheTestCase {
private transient ByteArrayOutputStream baos;
private transient ByteArrayInputStream bais;
@@ -56,8 +66,8 @@ public class BackwardCompatibilitySerializationDUnitTest extends CacheTestCase {
public TestMessage msg = new TestMessage();
- public BackwardCompatibilitySerializationDUnitTest(String name) {
- super(name);
+ public BackwardCompatibilitySerializationDUnitTest() {
+ super();
}
@Override
@@ -85,6 +95,7 @@ public class BackwardCompatibilitySerializationDUnitTest extends CacheTestCase {
* @throws Exception
*/
@Test
+ @Test
public void testToDataFromHigherVersionToLower() throws Exception {
DataOutputStream dos = new VersionedDataOutputStream(new DataOutputStream(
baos), Version.GFE_56);
@@ -100,6 +111,7 @@ public class BackwardCompatibilitySerializationDUnitTest extends CacheTestCase {
* @throws Exception
*/
@Test
+ @Test
public void testToDataFromLowerVersionToHigher() throws Exception {
DataOutputStream dos = new VersionedDataOutputStream(new DataOutputStream(
baos), Version.GFE_701);
@@ -114,6 +126,7 @@ public class BackwardCompatibilitySerializationDUnitTest extends CacheTestCase {
* @throws Exception
*/
@Test
+ @Test
public void testFromDataFromHigherVersionToLower() throws Exception {
InternalDataSerializer.writeDSFID(msg, new DataOutputStream(baos));
this.bais = new ByteArrayInputStream(baos.toByteArray());
@@ -132,6 +145,7 @@ public class BackwardCompatibilitySerializationDUnitTest extends CacheTestCase {
* @throws Exception
*/
@Test
+ @Test
public void testFromDataFromLowerVersionToHigher() throws Exception {
InternalDataSerializer.writeDSFID(msg, new DataOutputStream(baos));
this.bais = new ByteArrayInputStream(baos.toByteArray());
@@ -150,6 +164,7 @@ public class BackwardCompatibilitySerializationDUnitTest extends CacheTestCase {
* @throws Exception
*/
@Test
+ @Test
public void testAllMessages() throws Exception {
// list of msgs not created using reflection
// taken from DSFIDFactory.create()
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/f83cc548/geode-core/src/test/java/com/gemstone/gemfire/internal/ClassNotFoundExceptionDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/ClassNotFoundExceptionDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/ClassNotFoundExceptionDUnitTest.java
index b61be01..edc8f3c 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/ClassNotFoundExceptionDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/ClassNotFoundExceptionDUnitTest.java
@@ -16,6 +16,15 @@
*/
package com.gemstone.gemfire.internal;
+import org.junit.experimental.categories.Category;
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
+
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
@@ -48,19 +57,22 @@ import com.gemstone.gemfire.test.dunit.VM;
/**
*
*/
-public class ClassNotFoundExceptionDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class ClassNotFoundExceptionDUnitTest extends JUnit4CacheTestCase {
/**
* @param name
*/
- public ClassNotFoundExceptionDUnitTest(String name) {
- super(name);
+ public ClassNotFoundExceptionDUnitTest() {
+ super();
}
+ @Test
public void testDataSerializable() throws InterruptedException {
doTest(new ObjectFactory() { public Object get() { return new ClassNotFoundDataSerializable();} });
}
+ @Test
public void testPdx() throws InterruptedException {
doTest(new ObjectFactory() { public Object get() { return new ClassNotFoundPdx(false);} });
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/f83cc548/geode-core/src/test/java/com/gemstone/gemfire/internal/JarDeployerDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/JarDeployerDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/JarDeployerDUnitTest.java
index b70564b..53562c4 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/JarDeployerDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/JarDeployerDUnitTest.java
@@ -16,6 +16,15 @@
*/
package com.gemstone.gemfire.internal;
+import org.junit.experimental.categories.Category;
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
+
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
@@ -55,13 +64,14 @@ import com.gemstone.gemfire.test.dunit.VM;
*
* @since 7.0
*/
-public class JarDeployerDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class JarDeployerDUnitTest extends JUnit4CacheTestCase {
private static final long serialVersionUID = 1L;
static FileLock savedFileLock = null;
private final ClassBuilder classBuilder = new ClassBuilder();
- public JarDeployerDUnitTest(String name) {
- super(name);
+ public JarDeployerDUnitTest() {
+ super();
}
@Override
@@ -82,6 +92,7 @@ public class JarDeployerDUnitTest extends CacheTestCase {
}
@Test
+ @Test
public void testDeployFileAndChange() throws IOException, ClassNotFoundException {
final JarDeployer jarDeployer = new JarDeployer();
final File currentDir = new File(".").getAbsoluteFile();
@@ -133,6 +144,7 @@ public class JarDeployerDUnitTest extends CacheTestCase {
}
@Test
+ @Test
public void testDeployNoUpdateWhenNoChange() throws IOException, ClassNotFoundException {
final JarDeployer jarDeployer = new JarDeployer();
final File currentDir = new File(".").getAbsoluteFile();
@@ -161,6 +173,7 @@ public class JarDeployerDUnitTest extends CacheTestCase {
@Test
@SuppressWarnings("serial")
+ @Test
public void testDeployExclusiveLock() throws IOException, ClassNotFoundException {
final JarDeployer jarDeployer = new JarDeployer();
final File currentDir = new File(".").getAbsoluteFile();
@@ -218,6 +231,7 @@ public class JarDeployerDUnitTest extends CacheTestCase {
@Test
@SuppressWarnings("serial")
+ @Test
public void testDeploySharedLock() throws IOException, ClassNotFoundException {
final JarDeployer jarDeployer = new JarDeployer();
final File currentDir = new File(".").getAbsoluteFile();
@@ -283,6 +297,7 @@ public class JarDeployerDUnitTest extends CacheTestCase {
@Test
@SuppressWarnings("serial")
+ @Test
public void testUndeploySharedLock() throws IOException, ClassNotFoundException {
final JarDeployer jarDeployer = new JarDeployer();
final File currentDir = new File(".").getAbsoluteFile();
@@ -335,6 +350,7 @@ public class JarDeployerDUnitTest extends CacheTestCase {
@Test
@SuppressWarnings("serial")
+ @Test
public void testDeployUpdateByAnotherVM() throws IOException, ClassNotFoundException {
final JarDeployer jarDeployer = new JarDeployer();
final File currentDir = new File(".").getAbsoluteFile();
@@ -395,6 +411,7 @@ public class JarDeployerDUnitTest extends CacheTestCase {
}
@Test
+ @Test
public void testLoadPreviouslyDeployedJars() throws IOException {
final File parentJarFile = new File(JarDeployer.JAR_PREFIX + "JarDeployerDUnitAParent.jar#1");
final File usesJarFile = new File(JarDeployer.JAR_PREFIX + "JarDeployerDUnitUses.jar#1");
@@ -458,6 +475,7 @@ public class JarDeployerDUnitTest extends CacheTestCase {
}
@Test
+ @Test
public void testDeployToAlternateDirectory() throws IOException, ClassNotFoundException {
final File alternateDir = new File("JarDeployerDUnit");
alternateDir.mkdir();
@@ -489,6 +507,7 @@ public class JarDeployerDUnitTest extends CacheTestCase {
}
@Test
+ @Test
public void testDeployToInvalidDirectory() throws IOException, ClassNotFoundException {
final File alternateDir = new File("JarDeployerDUnit");
FileUtil.delete(new File("JarDeployerDUnit"));
@@ -544,6 +563,7 @@ public class JarDeployerDUnitTest extends CacheTestCase {
boolean okayToResume;
@Test
+ @Test
public void testSuspendAndResume() throws IOException, ClassNotFoundException {
final JarDeployer jarDeployer = new JarDeployer();
byte[] jarBytes = this.classBuilder.createJarFromName("JarDeployerDUnitSAR");
@@ -579,6 +599,7 @@ public class JarDeployerDUnitTest extends CacheTestCase {
@Test
+ @Test
public void testZeroLengthFile() throws IOException, ClassNotFoundException {
final JarDeployer jarDeployer = new JarDeployer();
@@ -599,6 +620,7 @@ public class JarDeployerDUnitTest extends CacheTestCase {
}
@Test
+ @Test
public void testInvalidJarFile() throws IOException, ClassNotFoundException {
final JarDeployer jarDeployer = new JarDeployer();
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/f83cc548/geode-core/src/test/java/com/gemstone/gemfire/internal/PdxDeleteFieldDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/PdxDeleteFieldDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/PdxDeleteFieldDUnitTest.java
index f7b6529..35d1f25 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/PdxDeleteFieldDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/PdxDeleteFieldDUnitTest.java
@@ -16,6 +16,15 @@
*/
package com.gemstone.gemfire.internal;
+import org.junit.experimental.categories.Category;
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
+
import java.io.File;
import java.io.IOException;
import java.util.Collection;
@@ -43,13 +52,15 @@ import com.gemstone.gemfire.test.dunit.LogWriterUtils;
import com.gemstone.gemfire.test.dunit.SerializableCallable;
import com.gemstone.gemfire.test.dunit.VM;
-public class PdxDeleteFieldDUnitTest extends CacheTestCase{
+@Category(DistributedTest.class)
+public class PdxDeleteFieldDUnitTest extends JUnit4CacheTestCase{
final List<String> filesToBeDeleted = new CopyOnWriteArrayList<String>();
- public PdxDeleteFieldDUnitTest(String name) {
- super(name);
+ public PdxDeleteFieldDUnitTest() {
+ super();
}
+ @Test
public void testPdxDeleteFieldVersioning() throws Exception {
final String DS_NAME = "PdxDeleteFieldDUnitTestDiskStore";
final String DS_NAME2 = "PdxDeleteFieldDUnitTestDiskStore2";
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/f83cc548/geode-core/src/test/java/com/gemstone/gemfire/internal/PdxRenameDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/PdxRenameDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/PdxRenameDUnitTest.java
index f10d953..94173aa 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/PdxRenameDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/PdxRenameDUnitTest.java
@@ -16,6 +16,15 @@
*/
package com.gemstone.gemfire.internal;
+import org.junit.experimental.categories.Category;
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
+
import java.io.File;
import java.io.IOException;
import java.util.Collection;
@@ -44,13 +53,15 @@ import com.gemstone.gemfire.test.dunit.LogWriterUtils;
import com.gemstone.gemfire.test.dunit.SerializableCallable;
import com.gemstone.gemfire.test.dunit.VM;
-public class PdxRenameDUnitTest extends CacheTestCase{
+@Category(DistributedTest.class)
+public class PdxRenameDUnitTest extends JUnit4CacheTestCase{
final List<String> filesToBeDeleted = new CopyOnWriteArrayList<String>();
- public PdxRenameDUnitTest(String name) {
- super(name);
+ public PdxRenameDUnitTest() {
+ super();
}
+ @Test
public void testPdxRenameVersioning() throws Exception {
final String DS_NAME = "PdxRenameDUnitTestDiskStore";
final String DS_NAME2 = "PdxRenameDUnitTestDiskStore2";