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/06/07 20:55:11 UTC
[56/62] [abbrv] incubator-geode git commit: Merge remote-tracking
branch 'origin/develop' into feature/GEODE-837
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/cache30/PartitionedRegionDUnitTest.java
----------------------------------------------------------------------
diff --cc geode-core/src/test/java/com/gemstone/gemfire/cache30/PartitionedRegionDUnitTest.java
index 959beb9,09084be..9896110
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/PartitionedRegionDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/PartitionedRegionDUnitTest.java
@@@ -16,21 -16,12 +16,16 @@@
*/
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.Serializable;
import java.util.Collection;
import java.util.Iterator;
import java.util.Random;
import java.util.Set;
++import org.junit.Ignore;
++import org.junit.Test;
import org.junit.experimental.categories.Category;
import com.gemstone.gemfire.LogWriter;
@@@ -57,6 -48,6 +52,7 @@@ import com.gemstone.gemfire.test.dunit.
import com.gemstone.gemfire.test.dunit.SerializableCallable;
import com.gemstone.gemfire.test.dunit.SerializableRunnable;
import com.gemstone.gemfire.test.dunit.VM;
++import com.gemstone.gemfire.test.junit.categories.DistributedTest;
import com.gemstone.gemfire.test.junit.categories.FlakyTest;
/**
@@@ -64,69 -55,65 +60,67 @@@
* that has a scope of {@link Scope#DISTRIBUTED_ACK distributed ACK}
* and {@link PartitionAttributes partition-attributes}.
*
- * @since 5.1
+ * @since GemFire 5.1
*/
+@Category(DistributedTest.class)
public class PartitionedRegionDUnitTest extends MultiVMRegionTestCase {
--
++
++ public static boolean InvalidateInvoked = false;
++
static int oldLogLevel;
- public PartitionedRegionDUnitTest() {
- super();
- public PartitionedRegionDUnitTest(String name) {
- super(name);
++ @Override
++ protected boolean supportsSubregions() {
++ return false;
}
-- /*
-- * (non-Javadoc)
-- * @see com.gemstone.gemfire.cache30.RegionTestCase#supportsSubregions()
-- */
-- protected boolean supportsSubregions() { return false; }
--
-- /*
-- * (non-Javadoc)
-- * @see com.gemstone.gemfire.cache30.MultiVMRegionTestCase#supportsNetLoad()
-- */
-- protected boolean supportsNetLoad() { return false; }
++ @Override
++ protected boolean supportsNetLoad() {
++ return false;
++ }
-- /*
-- * (non-Javadoc)
-- * @see com.gemstone.gemfire.cache30.MultiVMRegionTestCase#supportsReplication()
-- */
-- protected boolean supportsReplication() { return false; }
++ @Override
++ protected boolean supportsReplication() {
++ return false;
++ }
-- /*
-- * (non-Javadoc)
-- * @see com.gemstone.gemfire.cache30.MultiVMRegionTestCase#supportsTransactions()
-- */
-- protected boolean supportsTransactions() { return false; }
++ @Override
++ protected boolean supportsTransactions() {
++ return false;
++ }
-- /*
-- * (non-Javadoc)
-- * @see com.gemstone.gemfire.cache30.RegionTestCase#supportsLocalDestroyAndLocalInvalidate()
-- */
-- protected boolean supportsLocalDestroyAndLocalInvalidate() { return false; }
++ protected boolean supportsLocalDestroyAndLocalInvalidate() {
++ return false;
++ }
++ @Ignore("TODO: test is not implemented for partioned regions")
++ @Override
+ @Test
public void testCacheLoaderModifyingArgument() throws InterruptedException {
// TODO, implement a specific PR related test that properly reflects primary allocation
// and event deliver based on that allocation
}
++ @Ignore("TODO: test is not implemented for partioned regions")
++ @Override
+ @Test
public void testLocalAndRemoteCacheWriters() throws InterruptedException {
// TODO, implement a specific PR related test that properly reflects primary allocation
// and event deliver based on that allocation
}
++ @Ignore("TODO: test is not implemented for partioned regions")
++ @Override
+ @Test
public void testLocalCacheLoader() {
// TODO, implement a specific PR related test that properly reflects primary allocation
// and event deliver based on that allocation
}
--
/**
* Returns region attributes for a partitioned region with distributed-ack scope
*/
++ @Override
protected RegionAttributes getRegionAttributes() {
AttributesFactory factory = new AttributesFactory();
factory.setEarlyAck(false);
@@@ -176,18 -163,17 +170,12 @@@
}
}
-- ////////////////////// Test Methods //////////////////////
--
-- public static boolean InvalidateInvoked = false;
--
/**
* Bug #47235 concerns assertion failures being thrown when there is a
* member that receives adjunct messages (as in a WAN gateway, a peer
* with clients, etc).
-- *
-- * @throws Exception
*/
+ @Test
public void testRegionInvalidationWithAdjunctMessages() throws Exception {
final String name = getUniqueName();
VM vm1 = Host.getHost(0).getVM(1);
@@@ -227,13 -213,12 +215,9 @@@
/**
* Tests the compatibility of creating certain kinds of subregions
* of a local region.
-- *
-- * @see Region#createSubregion
*/
- public void testIncompatibleSubregions()
- throws CacheException, InterruptedException {
-
+ @Test
- public void testIncompatibleSubregions()
- throws CacheException, InterruptedException {
-
++ public void testIncompatibleSubregions() throws CacheException, InterruptedException {
Host host = Host.getHost(0);
VM vm0 = host.getVM(0);
VM vm1 = host.getVM(1);
@@@ -268,7 -253,7 +252,6 @@@
}
});
}
--
private void setupExtendedTest(final String regionName, final int numVals) {
Host host = Host.getHost(0);
@@@ -391,84 -375,76 +374,59 @@@
}
// these tests make no sense for partitioned regions
++
++ @Ignore("Not implemented for partitioned regions")
++ @Override
+ @Test
public void testDefinedEntryUpdated() {
-- unimplemented();
}
++
++ @Ignore("Not implemented for partitioned regions")
++ @Override
+ @Test
public void testRemoteCacheListener() {
-- unimplemented();
}
--
-- // these tests require getEntry support - need an alternative way of checking
-- // the results that can be overridden here
--// public void testDistributedUpdate() {
--// unimplemented();
--// }
--// public void testDistributedPutNoUpdate() {
--// unimplemented();
--// }
--// public void testDistributedInvalidate() {
--// unimplemented();
--// }
--// public void testDistributedInvalidate4() {
--// unimplemented();
--// }
--// public void testContainsKey() {
--// unimplemented();
--// }
--// public void testBadRegionAccess() {
--// unimplemented();
--// }
--// public void testPutNonExistentEntry() {
--// unimplemented();
--// }
--// public void testDestroyEntry() {
--// unimplemented();
--// }
--// public void testInvalidateEntry() {
--// unimplemented();
--// }
--// public void testDistributedDestroy() {
--// unimplemented();
--// }
--
--
// user attributes aren't supported in partitioned regions at this time (5.1)
++
++ @Ignore("Not implemented for partitioned regions")
++ @Override
+ @Test
public void testEntryUserAttribute() {
-- unimplemented();
}
--
// these tests require misc Region operations not currently supported by PRs
++
++ @Ignore("Not implemented for partitioned regions")
++ @Override
+ @Test
public void testInvalidateRegion() {
-- unimplemented();
}
++
++ @Ignore("Not implemented for partitioned regions")
++ @Override
+ @Test
public void testLocalDestroyRegion() {
-- unimplemented();
}
++
++ @Ignore("Not implemented for partitioned regions")
++ @Override
+ @Test
public void testLocalInvalidateRegion() {
-- unimplemented();
}
++
++ @Ignore("Not implemented for partitioned regions")
++ @Override
+ @Test
public void testSnapshot() {
-- unimplemented();
}
++
++ @Ignore("Not implemented for partitioned regions")
++ @Override
+ @Test
public void testRootSnapshot() {
-- unimplemented();
}
-- private void unimplemented() {
--// StackTraceElement stack[] = new Exception("dummy").getStackTrace();
--// getLogWriter().info(stack[1].getClassName() + "." + stack[1].getMethodName()
--// + ": this test is not implemented for PartitionedRegions at this time");
-- }
static class PoisonedKey implements Serializable {
static volatile boolean poisoned = false;
static volatile boolean poisonDetected = false;
@@@ -482,7 -458,7 +440,8 @@@
poisonDetected = false; // restore default static value
return result;
}
--
++
++ @Override
public int hashCode() {
int result = k.hashCode();
synchronized (PoisonedKey.class) {
@@@ -498,7 -474,7 +457,8 @@@
PoisonedKey(String s) {
this.k = s;
}
--
++
++ @Override
public boolean equals(Object o) {
if (o == null) {
return false;
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/cache30/PartitionedRegionMembershipListenerDUnitTest.java
----------------------------------------------------------------------
diff --cc geode-core/src/test/java/com/gemstone/gemfire/cache30/PartitionedRegionMembershipListenerDUnitTest.java
index 311d3fb,f4b5f12..573d62e
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/PartitionedRegionMembershipListenerDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/PartitionedRegionMembershipListenerDUnitTest.java
@@@ -43,9 -34,8 +43,9 @@@ import com.gemstone.gemfire.distributed
import com.gemstone.gemfire.test.dunit.VM;
/**
- * @since 6.0
+ * @since GemFire 6.0
*/
+@Category(DistributedTest.class)
public class PartitionedRegionMembershipListenerDUnitTest extends
RegionMembershipListenerDUnitTest {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/cache30/PartitionedRegionOffHeapDUnitTest.java
----------------------------------------------------------------------
diff --cc geode-core/src/test/java/com/gemstone/gemfire/cache30/PartitionedRegionOffHeapDUnitTest.java
index b227c58,b487ac7..97856d2
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/PartitionedRegionOffHeapDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/PartitionedRegionOffHeapDUnitTest.java
@@@ -16,36 -16,27 +16,27 @@@
*/
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 static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+
+import java.util.Properties;
+
++import org.junit.experimental.categories.Category;
++
import com.gemstone.gemfire.cache.AttributesFactory;
import com.gemstone.gemfire.cache.RegionAttributes;
- import com.gemstone.gemfire.distributed.internal.DistributionConfig;
import com.gemstone.gemfire.internal.cache.OffHeapTestUtil;
import com.gemstone.gemfire.test.dunit.Invoke;
import com.gemstone.gemfire.test.dunit.SerializableRunnable;
-
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
++import com.gemstone.gemfire.test.junit.categories.DistributedTest;
/**
* Tests Partitioned Region with OffHeap memory.
*
- * @since 9.0
+ * @since Geode 1.0
*/
+@Category(DistributedTest.class)
public class PartitionedRegionOffHeapDUnitTest extends PartitionedRegionDUnitTest {
- public PartitionedRegionOffHeapDUnitTest() {
- super();
- public PartitionedRegionOffHeapDUnitTest(String name) {
- super(name);
-- }
--
@Override
public final void preTearDownAssertions() throws Exception {
SerializableRunnable checkOrphans = new SerializableRunnable() {
@@@ -68,8 -59,8 +59,8 @@@
return props;
}
-- @SuppressWarnings({ "rawtypes", "unchecked" })
@Override
++ @SuppressWarnings({ "rawtypes", "unchecked" })
protected RegionAttributes getRegionAttributes() {
RegionAttributes attrs = super.getRegionAttributes();
AttributesFactory factory = new AttributesFactory(attrs);
@@@ -77,8 -68,8 +68,8 @@@
return factory.create();
}
-- @SuppressWarnings({ "rawtypes", "unchecked" })
@Override
++ @SuppressWarnings({ "rawtypes", "unchecked" })
protected RegionAttributes getRegionAttributes(String type) {
RegionAttributes ra = super.getRegionAttributes(type);
AttributesFactory factory = new AttributesFactory(ra);
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/cache30/PreloadedRegionTestCase.java
----------------------------------------------------------------------
diff --cc geode-core/src/test/java/com/gemstone/gemfire/cache30/PreloadedRegionTestCase.java
index b9cf639,3508e7c..b897603
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/PreloadedRegionTestCase.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/PreloadedRegionTestCase.java
@@@ -40,13 -31,12 +40,13 @@@ import com.gemstone.gemfire.test.dunit.
* This class tests the functionality of a cache {@link Region region}
* that has a scope of {@link Scope#DISTRIBUTED_ACK distributed ACK}.
*
- * @since 3.0
+ * @since GemFire 3.0
*/
+@Category(DistributedTest.class)
public class PreloadedRegionTestCase extends MultiVMRegionTestCase {
- public PreloadedRegionTestCase(String name) {
- super(name);
+ public PreloadedRegionTestCase() {
+ super();
}
/**
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/cache30/ProxyDUnitTest.java
----------------------------------------------------------------------
diff --cc geode-core/src/test/java/com/gemstone/gemfire/cache30/ProxyDUnitTest.java
index a93c50b,3f66b32..9d63376
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/ProxyDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/ProxyDUnitTest.java
@@@ -57,10 -48,9 +57,10 @@@ import com.gemstone.gemfire.test.dunit.
* Make sure that operations are distributed and done in
* regions remote from a PROXY
*
- * @since 5.0
+ * @since GemFire 5.0
*/
-public class ProxyDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class ProxyDUnitTest extends JUnit4CacheTestCase {
private transient Region r;
private transient DistributedMember otherId;
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/cache30/QueueMsgDUnitTest.java
----------------------------------------------------------------------
diff --cc geode-core/src/test/java/com/gemstone/gemfire/cache30/QueueMsgDUnitTest.java
index 9cdca4f,7a98188..590166b
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/QueueMsgDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/QueueMsgDUnitTest.java
@@@ -16,62 -16,39 +16,54 @@@
*/
package com.gemstone.gemfire.cache30;
- import org.junit.experimental.categories.Category;
- import org.junit.Test;
-
-import com.gemstone.gemfire.cache.*;
-import com.gemstone.gemfire.internal.cache.CachePerfStats;
-import com.gemstone.gemfire.internal.cache.DistributedRegion;
-import com.gemstone.gemfire.test.dunit.*;
++import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+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.List;
import java.util.Map;
import java.util.Properties;
import java.util.TreeMap;
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
++import org.junit.Ignore;
++import org.junit.Test;
++import org.junit.experimental.categories.Category;
++
+import com.gemstone.gemfire.cache.AttributesFactory;
+import com.gemstone.gemfire.cache.CacheEvent;
+import com.gemstone.gemfire.cache.CacheException;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.EntryEvent;
+import com.gemstone.gemfire.cache.InterestPolicy;
+import com.gemstone.gemfire.cache.Operation;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionEvent;
+import com.gemstone.gemfire.cache.Scope;
+import com.gemstone.gemfire.cache.SubscriptionAttributes;
- import com.gemstone.gemfire.distributed.internal.DistributionConfig;
+import com.gemstone.gemfire.internal.cache.CachePerfStats;
+import com.gemstone.gemfire.internal.cache.DistributedRegion;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.SerializableRunnable;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
++import com.gemstone.gemfire.test.junit.categories.DistributedTest;
/**
* Test to make sure message queuing works.
*
- * @since 5.0
+ * @since GemFire 5.0
*/
+@Category(DistributedTest.class)
public class QueueMsgDUnitTest extends ReliabilityTestCase {
- public QueueMsgDUnitTest() {
- super();
- public QueueMsgDUnitTest(String name) {
- super(name);
-- }
--
/**
* Make sure that cache operations are queued when a required role is missing
*/
-- public void disabled_testQueueWhenRoleMissing() throws Exception {
++ @Ignore("TODO: test is disabled")
++ @Test
++ public void testQueueWhenRoleMissing() throws Exception {
AttributesFactory factory = new AttributesFactory();
factory.setScope(Scope.DISTRIBUTED_ACK);
--// factory.setMembershipAttributes(
--// new MembershipAttributes(new String[]{"missing"},
--// LossAction.FULL_ACCESS_WITH_QUEUING,
--// ResumptionAction.NONE));
DistributedRegion r = (DistributedRegion)createRootRegion(factory.create());
final CachePerfStats stats = r.getCachePerfStats();
int queuedOps = stats.getReliableQueuedOps();
@@@ -230,13 -207,13 +222,11 @@@
/**
* Make sure a queued region does not allow non-queued subscribers
*/
-- public void disabled_testIllegalConfigQueueExists() throws Exception {
++ @Ignore("TODO: test is disabled")
++ @Test
++ public void testIllegalConfigQueueExists() throws Exception {
AttributesFactory factory = new AttributesFactory();
factory.setScope(Scope.DISTRIBUTED_ACK);
--// factory.setMembershipAttributes(
--// new MembershipAttributes(new String[]{"pubFirst"},
--// LossAction.FULL_ACCESS_WITH_QUEUING,
--// ResumptionAction.NONE));
createRootRegion(factory.create());
VM vm = Host.getHost(0).getVM(0);
@@@ -270,11 -247,11 +260,14 @@@
}
});
}
++
/**
* Make sure a subscriber that does not allow queued messages causes a
* queued publisher to fail creation
*/
-- public void disable_testIllegalConfigSubscriberExists() throws Exception {
++ @Ignore("TODO: test is disabled")
++ @Test
++ public void testIllegalConfigSubscriberExists() throws Exception {
final String expectedExceptions = "does not allow queued messages";
VM vm = Host.getHost(0).getVM(0);
@@@ -300,11 -277,11 +293,7 @@@
AttributesFactory factory = new AttributesFactory();
factory.setScope(Scope.DISTRIBUTED_ACK);
--// factory.setMembershipAttributes(
--// new MembershipAttributes(new String[]{"subFirst"},
--// LossAction.FULL_ACCESS_WITH_QUEUING,
--// ResumptionAction.NONE));
-- getCache().getLogger().info("<ExpectedException action=add>" +
++ getCache().getLogger().info("<ExpectedException action=add>" +
expectedExceptions + "</ExpectedException>");
try {
createRootRegion(factory.create());
@@@ -315,8 -292,7 +304,4 @@@
expectedExceptions + "</ExpectedException>");
}
}
- @Test
-- public void testEmpty() {
-- // just to dunit happy
-- }
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/cache30/RRSynchronizationDUnitTest.java
----------------------------------------------------------------------
diff --cc geode-core/src/test/java/com/gemstone/gemfire/cache30/RRSynchronizationDUnitTest.java
index 37e0bda,fc69bda..a46bbab
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/RRSynchronizationDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/RRSynchronizationDUnitTest.java
@@@ -15,41 -15,10 +15,19 @@@
* limitations under the License.
*/
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.Properties;
- import java.util.concurrent.TimeoutException;
-
- import com.gemstone.gemfire.cache.AttributesFactory;
- import com.gemstone.gemfire.cache.DataPolicy;
- import com.gemstone.gemfire.cache.EvictionAction;
- import com.gemstone.gemfire.cache.EvictionAttributes;
- import com.gemstone.gemfire.cache.Operation;
- import com.gemstone.gemfire.cache.Scope;
- import com.gemstone.gemfire.distributed.DistributedSystem;
- import com.gemstone.gemfire.distributed.internal.DistributionConfig;
- import com.gemstone.gemfire.distributed.internal.DistributionManager;
- import com.gemstone.gemfire.distributed.internal.DistributionMessage;
- import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem;
- import com.gemstone.gemfire.distributed.internal.SerialDistributionMessage;
- import com.gemstone.gemfire.distributed.internal.SizeableRunnable;
+ import com.gemstone.gemfire.cache.*;
import com.gemstone.gemfire.distributed.internal.membership.InternalDistributedMember;
- import com.gemstone.gemfire.internal.AvailablePort;
- import com.gemstone.gemfire.internal.cache.DistributedRegion;
- import com.gemstone.gemfire.internal.cache.EntryEventImpl;
- import com.gemstone.gemfire.internal.cache.LocalRegion;
- import com.gemstone.gemfire.internal.cache.RegionEntry;
- import com.gemstone.gemfire.internal.cache.Token;
- import com.gemstone.gemfire.internal.cache.VMCachedDeserializable;
+ import com.gemstone.gemfire.internal.cache.*;
import com.gemstone.gemfire.internal.cache.versions.VMVersionTag;
import com.gemstone.gemfire.internal.cache.versions.VersionSource;
import com.gemstone.gemfire.internal.cache.versions.VersionTag;
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/cache30/ReconnectDUnitTest.java
----------------------------------------------------------------------
diff --cc geode-core/src/test/java/com/gemstone/gemfire/cache30/ReconnectDUnitTest.java
index ad3f8d1,a3ad8f5..f7a9830
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/ReconnectDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/ReconnectDUnitTest.java
@@@ -57,9 -47,10 +56,11 @@@ import java.util.Properties
import java.util.Set;
import java.util.concurrent.TimeUnit;
+ import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+
@SuppressWarnings("serial")
-public class ReconnectDUnitTest extends CacheTestCase
+@Category(DistributedTest.class)
+public class ReconnectDUnitTest extends JUnit4CacheTestCase
{
static int locatorPort;
static Locator locator;
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/cache30/ReconnectedCacheServerDUnitTest.java
----------------------------------------------------------------------
diff --cc geode-core/src/test/java/com/gemstone/gemfire/cache30/ReconnectedCacheServerDUnitTest.java
index 6f2c7fa,df2699e..3735e13
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/ReconnectedCacheServerDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/ReconnectedCacheServerDUnitTest.java
@@@ -66,10 -56,9 +66,10 @@@ public class ReconnectedCacheServerDUni
}
}
+ @Test
public void testCacheServerConfigRetained() {
// make sure the environment isn't polluted
- assertFalse(Boolean.getBoolean("gemfire.autoReconnect-useCacheXMLFile"));
+ assertFalse(Boolean.getBoolean(DistributionConfig.GEMFIRE_PREFIX + "autoReconnect-useCacheXMLFile"));
GemFireCacheImpl gc = (GemFireCacheImpl)this.cache;
@@@ -83,10 -72,9 +83,10 @@@
assertNotNull(gc.getCacheConfig().getCacheServerCreation());
}
+ @Test
public void testDefaultCacheServerNotCreatedOnReconnect() {
-
- assertFalse(Boolean.getBoolean("gemfire.autoReconnect-useCacheXMLFile"));
+
+ assertFalse(Boolean.getBoolean(DistributionConfig.GEMFIRE_PREFIX + "autoReconnect-useCacheXMLFile"));
GemFireCacheImpl gc = (GemFireCacheImpl)this.cache;
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionAttributesTestCase.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionExpirationDUnitTest.java
----------------------------------------------------------------------
diff --cc geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionExpirationDUnitTest.java
index 3031314,c471ddf..1acc802
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionExpirationDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionExpirationDUnitTest.java
@@@ -45,13 -36,12 +45,13 @@@ import com.gemstone.gemfire.test.dunit.
* tests.
*
*
- * @since 3.0
+ * @since GemFire 3.0
*/
-public class RegionExpirationDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class RegionExpirationDUnitTest extends JUnit4CacheTestCase {
- public RegionExpirationDUnitTest(String name) {
- super(name);
+ public RegionExpirationDUnitTest() {
+ super();
}
// /**
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionMembershipListenerDUnitTest.java
----------------------------------------------------------------------
diff --cc geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionMembershipListenerDUnitTest.java
index 2b25cd9,8485d52..156577a
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionMembershipListenerDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionMembershipListenerDUnitTest.java
@@@ -55,10 -46,9 +55,10 @@@ import com.gemstone.gemfire.test.dunit.
/**
* Test {@link RegionMembershipListener}
*
- * @since 5.0
+ * @since GemFire 5.0
*/
-public class RegionMembershipListenerDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class RegionMembershipListenerDUnitTest extends JUnit4CacheTestCase {
private transient MyRML myListener;
private transient MyRML mySRListener;
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionReliabilityDistAckDUnitTest.java
----------------------------------------------------------------------
diff --cc geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionReliabilityDistAckDUnitTest.java
index 983b3ac,e639ce0..ec8b1af
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionReliabilityDistAckDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionReliabilityDistAckDUnitTest.java
@@@ -31,13 -22,12 +31,13 @@@ import com.gemstone.gemfire.cache.*
* Tests region reliability defined by MembershipAttributes using
* DISTRIBUTED_ACK scope.
*
- * @since 5.0
+ * @since GemFire 5.0
*/
+@Category(DistributedTest.class)
public class RegionReliabilityDistAckDUnitTest extends RegionReliabilityTestCase {
- public RegionReliabilityDistAckDUnitTest(String name) {
- super(name);
+ public RegionReliabilityDistAckDUnitTest() {
+ super();
}
protected Scope getRegionScope() {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionReliabilityDistNoAckDUnitTest.java
----------------------------------------------------------------------
diff --cc geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionReliabilityDistNoAckDUnitTest.java
index e124d51,46b3f2e..b2b6e09
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionReliabilityDistNoAckDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionReliabilityDistNoAckDUnitTest.java
@@@ -31,13 -22,12 +31,13 @@@ import com.gemstone.gemfire.cache.*
* Tests region reliability defined by MembershipAttributes using
* DISTRIBUTED_NO_ACK scope.
*
- * @since 5.0
+ * @since GemFire 5.0
*/
+@Category(DistributedTest.class)
public class RegionReliabilityDistNoAckDUnitTest extends RegionReliabilityTestCase {
- public RegionReliabilityDistNoAckDUnitTest(String name) {
- super(name);
+ public RegionReliabilityDistNoAckDUnitTest() {
+ super();
}
protected Scope getRegionScope() {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionReliabilityGlobalDUnitTest.java
----------------------------------------------------------------------
diff --cc geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionReliabilityGlobalDUnitTest.java
index 7e4f229,3e44012..5ca3761
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionReliabilityGlobalDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionReliabilityGlobalDUnitTest.java
@@@ -31,13 -22,12 +31,13 @@@ import com.gemstone.gemfire.cache.*
* Tests region reliability defined by MembershipAttributes using
* GLOBAL scope.
*
- * @since 5.0
+ * @since GemFire 5.0
*/
+@Category(DistributedTest.class)
public class RegionReliabilityGlobalDUnitTest extends RegionReliabilityTestCase {
- public RegionReliabilityGlobalDUnitTest(String name) {
- super(name);
+ public RegionReliabilityGlobalDUnitTest() {
+ super();
}
protected Scope getRegionScope() {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionReliabilityListenerDUnitTest.java
----------------------------------------------------------------------
diff --cc geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionReliabilityListenerDUnitTest.java
index 5d7c413,fc088ee..614e541
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionReliabilityListenerDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionReliabilityListenerDUnitTest.java
@@@ -16,41 -16,22 +16,38 @@@
*/
package com.gemstone.gemfire.cache30;
- import org.junit.experimental.categories.Category;
- import org.junit.Test;
-
-import com.gemstone.gemfire.cache.*;
++import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+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 java.util.Set;
+
++import org.junit.Test;
++import org.junit.experimental.categories.Category;
++
+import com.gemstone.gemfire.cache.AttributesFactory;
+import com.gemstone.gemfire.cache.CacheException;
+import com.gemstone.gemfire.cache.LossAction;
+import com.gemstone.gemfire.cache.MembershipAttributes;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.RegionRoleListener;
+import com.gemstone.gemfire.cache.ResumptionAction;
+import com.gemstone.gemfire.cache.RoleEvent;
+import com.gemstone.gemfire.cache.Scope;
import com.gemstone.gemfire.cache.util.RegionRoleListenerAdapter;
import com.gemstone.gemfire.distributed.Role;
- import com.gemstone.gemfire.distributed.internal.DistributionConfig;
import com.gemstone.gemfire.distributed.internal.membership.InternalRole;
import com.gemstone.gemfire.test.dunit.Host;
import com.gemstone.gemfire.test.dunit.SerializableRunnable;
++import com.gemstone.gemfire.test.junit.categories.DistributedTest;
-import java.util.Properties;
-import java.util.Set;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
/**
* Tests the functionality of the {@link RegionRoleListener} class.
*
- * @since 5.0
+ * @since GemFire 5.0
*/
+@Category(DistributedTest.class)
public class RegionReliabilityListenerDUnitTest extends ReliabilityTestCase {
protected static transient Set rolesGain = null;
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionReliabilityTestCase.java
----------------------------------------------------------------------
diff --cc geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionReliabilityTestCase.java
index b29d3d1,bf5c2c8..ea369eb
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionReliabilityTestCase.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionReliabilityTestCase.java
@@@ -16,49 -16,7 +16,44 @@@
*/
package com.gemstone.gemfire.cache30;
- import org.junit.experimental.categories.Category;
- import org.junit.Test;
-
-import com.gemstone.gemfire.cache.*;
++import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+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.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
+import java.util.concurrent.locks.Lock;
+
++import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.cache.AttributesFactory;
+import com.gemstone.gemfire.cache.AttributesMutator;
+import com.gemstone.gemfire.cache.CacheException;
+import com.gemstone.gemfire.cache.CacheLoader;
+import com.gemstone.gemfire.cache.CacheLoaderException;
+import com.gemstone.gemfire.cache.CacheTransactionManager;
+import com.gemstone.gemfire.cache.CommitDistributionException;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.ExpirationAction;
+import com.gemstone.gemfire.cache.ExpirationAttributes;
+import com.gemstone.gemfire.cache.LoaderHelper;
+import com.gemstone.gemfire.cache.LossAction;
+import com.gemstone.gemfire.cache.MembershipAttributes;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAccessException;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.RegionDistributionException;
+import com.gemstone.gemfire.cache.RegionEvent;
+import com.gemstone.gemfire.cache.RegionMembershipListener;
+import com.gemstone.gemfire.cache.RegionReinitializedException;
+import com.gemstone.gemfire.cache.RequiredRoles;
+import com.gemstone.gemfire.cache.ResumptionAction;
+import com.gemstone.gemfire.cache.Scope;
import com.gemstone.gemfire.cache.query.Query;
import com.gemstone.gemfire.cache.query.QueryService;
import com.gemstone.gemfire.cache.util.RegionMembershipListenerAdapter;
@@@ -91,19 -44,19 +85,11 @@@ import com.gemstone.gemfire.test.junit.
*/
public abstract class RegionReliabilityTestCase extends ReliabilityTestCase {
- public RegionReliabilityTestCase() {
- super();
- public RegionReliabilityTestCase(String name) {
- super(name);
-- }
--
@Override
public final void preTearDownCacheTestCase() throws Exception {
DistributedCacheOperation.setBeforePutOutgoing(null);
}
-- // -------------------------------------------------------------------------
-- // Configuration and setup methods
-- // -------------------------------------------------------------------------
--
/** Returns scope to execute tests under. */
protected abstract Scope getRegionScope();
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionTestCase.java
----------------------------------------------------------------------
diff --cc geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionTestCase.java
index 194cd80,ac3d721..e31e97b
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionTestCase.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionTestCase.java
@@@ -82,9 -78,9 +82,9 @@@ import com.gemstone.gemfire.test.junit.
*
* TODO:davidw: Test {@link CacheStatistics}
*
- * @since 3.0
+ * @since GemFire 3.0
*/
-public abstract class RegionTestCase extends CacheTestCase {
+public abstract class RegionTestCase extends JUnit4CacheTestCase {
/** A <code>CacheListener</code> used by a test */
static TestCacheListener listener;
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/cache30/ReliabilityTestCase.java
----------------------------------------------------------------------
diff --cc geode-core/src/test/java/com/gemstone/gemfire/cache30/ReliabilityTestCase.java
index 4a25447,4ebde70..e89b760
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/ReliabilityTestCase.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/ReliabilityTestCase.java
@@@ -16,30 -16,21 +16,23 @@@
*/
package com.gemstone.gemfire.cache30;
- import org.junit.experimental.categories.Category;
- import org.junit.Test;
-
-import com.gemstone.gemfire.cache.*;
-import com.gemstone.gemfire.distributed.*;
-import java.util.*;
+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.Set;
+
- import com.gemstone.gemfire.cache.*;
- import com.gemstone.gemfire.distributed.*;
- import java.util.*;
++import com.gemstone.gemfire.cache.Region;
++import com.gemstone.gemfire.cache.RequiredRoles;
++import com.gemstone.gemfire.distributed.Role;
++import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
/**
* Provides functionality helpful to testing Reliability and RequiredRoles.
*
- * @since 5.0
+ * @since GemFire 5.0
*/
-public abstract class ReliabilityTestCase extends CacheTestCase {
-
- public ReliabilityTestCase(String name) {
- super(name);
- }
+public abstract class ReliabilityTestCase extends JUnit4CacheTestCase {
- public ReliabilityTestCase() {
- super();
- }
-
/** Asserts that the specified roles are missing */
protected void assertMissingRoles(String regionName, String[] roles) {
Region region = getRootRegion(regionName);
@@@ -58,10 -49,10 +51,7 @@@
assertTrue("Unexpected missing role: " + role.getName(), found);
}
}
--
++
protected void waitForMemberTimeout() {
-- // TODO implement me
}
--
}
--
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/cache30/RequiredRolesDUnitTest.java
----------------------------------------------------------------------
diff --cc geode-core/src/test/java/com/gemstone/gemfire/cache30/RequiredRolesDUnitTest.java
index 56e93ce,3163fd3..e73481d
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/RequiredRolesDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/RequiredRolesDUnitTest.java
@@@ -16,46 -16,24 +16,43 @@@
*/
package com.gemstone.gemfire.cache30;
- import org.junit.experimental.categories.Category;
- import org.junit.Test;
-
-import com.gemstone.gemfire.SystemFailure;
-import com.gemstone.gemfire.cache.*;
-import com.gemstone.gemfire.distributed.Role;
-import com.gemstone.gemfire.distributed.internal.membership.InternalRole;
-import com.gemstone.gemfire.test.dunit.*;
++import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+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.HashSet;
import java.util.Iterator;
import java.util.Properties;
import java.util.Set;
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
++import org.junit.Test;
++import org.junit.experimental.categories.Category;
++
+import com.gemstone.gemfire.SystemFailure;
+import com.gemstone.gemfire.cache.AttributesFactory;
+import com.gemstone.gemfire.cache.CacheException;
+import com.gemstone.gemfire.cache.LossAction;
+import com.gemstone.gemfire.cache.MembershipAttributes;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.RequiredRoles;
+import com.gemstone.gemfire.cache.ResumptionAction;
+import com.gemstone.gemfire.cache.Scope;
+import com.gemstone.gemfire.distributed.Role;
- import com.gemstone.gemfire.distributed.internal.DistributionConfig;
+import com.gemstone.gemfire.distributed.internal.membership.InternalRole;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.SerializableRunnable;
+import com.gemstone.gemfire.test.dunit.ThreadUtils;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
++import com.gemstone.gemfire.test.junit.categories.DistributedTest;
/**
* Tests the functionality of the {@link RequiredRoles} class.
*
- * @since 5.0
+ * @since GemFire 5.0
*/
+@Category(DistributedTest.class)
public class RequiredRolesDUnitTest extends ReliabilityTestCase {
protected transient volatile boolean startTestWaitForRequiredRoles = false;
@@@ -63,10 -41,10 +60,6 @@@
protected transient volatile boolean failTestWaitForRequiredRoles = false;
protected transient Set rolesTestWaitForRequiredRoles = new HashSet();
- public RequiredRolesDUnitTest() {
- super();
- public RequiredRolesDUnitTest(String name) {
- super(name);
-- }
--
/**
* Tests that RequiredRoles detects missing roles.
*/
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/cache30/RolePerformanceDUnitTest.java
----------------------------------------------------------------------
diff --cc geode-core/src/test/java/com/gemstone/gemfire/cache30/RolePerformanceDUnitTest.java
index 1eeb882,06e25d0..3e66792
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/RolePerformanceDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/RolePerformanceDUnitTest.java
@@@ -16,33 -16,25 +16,33 @@@
*/
package com.gemstone.gemfire.cache30;
-import com.gemstone.gemfire.cache.*;
-import com.gemstone.gemfire.test.dunit.Host;
-import com.gemstone.gemfire.test.dunit.LogWriterUtils;
-import com.gemstone.gemfire.test.dunit.SerializableRunnable;
++import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
import java.util.Properties;
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.cache.AttributesFactory;
+import com.gemstone.gemfire.cache.CacheException;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.Scope;
- import com.gemstone.gemfire.distributed.internal.DistributionConfig;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.SerializableRunnable;
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
/**
* Tests the performance of Regions when Roles are assigned.
*
- * @since 5.0
+ * @since GemFire 5.0
*/
-public class RolePerformanceDUnitTest extends CacheTestCase {
-
- public RolePerformanceDUnitTest(String name) {
- super(name);
- }
+@Category(DistributedTest.class)
+public class RolePerformanceDUnitTest extends JUnit4CacheTestCase {
/**
* Compares times required for series of puts with Roles assigned to
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/cache30/SlowRecDUnitTest.java
----------------------------------------------------------------------
diff --cc geode-core/src/test/java/com/gemstone/gemfire/cache30/SlowRecDUnitTest.java
index dbb8d21,2453c85..241bfae
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/SlowRecDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/SlowRecDUnitTest.java
@@@ -16,59 -16,38 +16,52 @@@
*/
package com.gemstone.gemfire.cache30;
-import com.gemstone.gemfire.SystemFailure;
-import com.gemstone.gemfire.cache.*;
-import com.gemstone.gemfire.cache.Region.Entry;
-import com.gemstone.gemfire.cache.util.CacheListenerAdapter;
-import com.gemstone.gemfire.distributed.internal.DM;
-import com.gemstone.gemfire.distributed.internal.DMStats;
-import com.gemstone.gemfire.internal.tcp.Connection;
-import com.gemstone.gemfire.test.dunit.*;
-import com.gemstone.gemfire.test.junit.categories.DistributedTest;
-import org.junit.Ignore;
--import org.junit.experimental.categories.Category;
- import org.junit.Test;
-
++import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+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.Iterator;
import java.util.LinkedList;
import java.util.Properties;
import java.util.Set;
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import org.junit.Ignore;
++import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
- import com.gemstone.gemfire.SystemFailure;
+import com.gemstone.gemfire.cache.AttributesFactory;
+import com.gemstone.gemfire.cache.CacheException;
+import com.gemstone.gemfire.cache.CacheListener;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.EntryEvent;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.Region.Entry;
+import com.gemstone.gemfire.cache.RegionEvent;
+import com.gemstone.gemfire.cache.Scope;
+import com.gemstone.gemfire.cache.util.CacheListenerAdapter;
+import com.gemstone.gemfire.distributed.internal.DM;
+import com.gemstone.gemfire.distributed.internal.DMStats;
+import com.gemstone.gemfire.internal.tcp.Connection;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.SerializableRunnable;
+import com.gemstone.gemfire.test.dunit.ThreadUtils;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
++import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
/**
* Test to make sure slow receiver queuing is working
*
- * @since 4.2.1
+ * @since GemFire 4.2.1
*/
- @Ignore("Test was disabled by renaming to DisabledTest")
@Category(DistributedTest.class)
+ @Ignore("Test was disabled by renaming to DisabledTest")
-public class SlowRecDUnitTest extends CacheTestCase {
+public class SlowRecDUnitTest extends JUnit4CacheTestCase {
- public SlowRecDUnitTest() {
- super();
- public SlowRecDUnitTest(String name) {
- super(name);
-- }
++ protected static Object lastCallback = null;
// this test has special config of its distributed system so
// the setUp and tearDown methods need to make sure we don't
@@@ -84,16 -63,16 +77,12 @@@
public final void postTearDownCacheTestCase() throws Exception {
disconnectAllFromDS();
}
--
-- ////////////////////// Test Methods //////////////////////
private VM getOtherVm() {
Host host = Host.getHost(0);
return host.getVM(0);
}
-- static protected Object lastCallback = null;
--
private void doCreateOtherVm(final Properties p, final boolean addListener) {
VM vm = getOtherVm();
vm.invoke(new CacheSerializableRunnable("create root") {
@@@ -114,24 -93,24 +103,20 @@@
} else {
CacheListener cl = new CacheListenerAdapter() {
public void afterCreate(EntryEvent event) {
--// getLogWriter().info("afterCreate " + event.getKey());
if (event.getCallbackArgument() != null) {
lastCallback = event.getCallbackArgument();
}
if (event.getKey().equals("sleepkey")) {
int sleepMs = ((Integer)event.getNewValue()).intValue();
--// getLogWriter().info("sleepkey sleeping for " + sleepMs);
try {Thread.sleep(sleepMs);} catch (InterruptedException ignore) {fail("interrupted");}
}
}
public void afterUpdate(EntryEvent event) {
--// getLogWriter().info("afterUpdate " + event.getKey());
if (event.getCallbackArgument() != null) {
lastCallback = event.getCallbackArgument();
}
if (event.getKey().equals("sleepkey")) {
int sleepMs = ((Integer)event.getNewValue()).intValue();
--// getLogWriter().info("sleepkey sleeping for " + sleepMs);
try {Thread.sleep(sleepMs);} catch (InterruptedException ignore) {fail("interrupted");}
}
}
@@@ -154,7 -133,7 +139,8 @@@
}
});
}
-- static protected final String CHECK_INVALID = "CHECK_INVALID";
++
++ protected static final String CHECK_INVALID = "CHECK_INVALID";
private void checkLastValueInOtherVm(final String lastValue, final Object lcb) {
VM vm = getOtherVm();
@@@ -202,8 -181,8 +188,6 @@@
}
};
Wait.waitForCriterion(ev, 50 * 1000, 200, true);
--// assertNotNull(re);
--// assertIndexDetailsEquals(null, value);
}
} else {
{
@@@ -264,8 -243,7 +248,8 @@@
* Make sure that noack puts to a receiver
* will eventually queue and then catch up.
*/
- public void testNoAck() throws CacheException {
+ @Test
- public void testNoAck() throws CacheException {
++ public void testNoAck() throws Exception {
final AttributesFactory factory = new AttributesFactory();
factory.setScope(Scope.DISTRIBUTED_NO_ACK);
final Region r = createRootRegion("slowrec", factory.create());
@@@ -283,7 -261,7 +267,6 @@@
final Object key = "key";
long queuedMsgs = stats.getAsyncQueuedMsgs();
long dequeuedMsgs = stats.getAsyncDequeuedMsgs();
--// long conflatedMsgs = stats.getAsyncConflatedMsgs();
long queueSize = stats.getAsyncQueueSize();
String lastValue = "";
final long intialQueuedMsgs = queuedMsgs;
@@@ -321,6 -299,6 +304,7 @@@
checkLastValueInOtherVm(lastValue, null);
}
}
++
/**
* Create a region named AckRegion with ACK scope
*/
@@@ -336,12 -314,11 +320,13 @@@
final Region r = createRootRegion("AckRegion", factory.create());
return r;
}
++
/**
* Make sure that noack puts to a receiver
* will eventually queue and then catch up with conflation
*/
- public void testNoAckConflation() throws CacheException {
+ @Test
- public void testNoAckConflation() throws CacheException {
++ public void testNoAckConflation() throws Exception {
final AttributesFactory factory = new AttributesFactory();
factory.setScope(Scope.DISTRIBUTED_NO_ACK);
factory.setEnableAsyncConflation(true);
@@@ -356,10 -333,10 +341,7 @@@
forceQueuing(r);
final Object key = "key";
int count = 0;
--// long queuedMsgs = stats.getAsyncQueuedMsgs();
--// long dequeuedMsgs = stats.getAsyncDequeuedMsgs();
final long initialConflatedMsgs = stats.getAsyncConflatedMsgs();
--// long queueSize = stats.getAsyncQueueSize();
String lastValue = "";
final long intialDeQueuedMsgs = stats.getAsyncDequeuedMsgs();
long start = 0;
@@@ -369,47 -346,46 +351,23 @@@
lastValue = value;
r.put(key, value);
count ++;
-- // getLogWriter().info("After " + count + " "
-- // + " puts queueSize=" + queueSize
-- // + " queuedMsgs=" + queuedMsgs
-- // + " dequeuedMsgs=" + dequeuedMsgs
-- // + " conflatedMsgs=" + conflatedMsgs);
}
start = System.currentTimeMillis();
} finally {
forceQueueFlush();
}
--// queueSize = stats.getAsyncQueueSize();
--// queuedMsgs = stats.getAsyncQueuedMsgs();
--
--// getLogWriter().info("After " + count + " "
--// + " puts slowrec mode kicked in by queuing "
--// + queuedMsgs + " for a total size of " + queueSize
--// + " conflatedMsgs=" + conflatedMsgs
--// + " dequeuedMsgs=" + dequeuedMsgs);
--// final long start = System.currentTimeMillis();
--// while (stats.getAsyncQueuedMsgs() > stats.getAsyncDequeuedMsgs()) {
--// try {Thread.sleep(100);} catch (InterruptedException ignore) {}
--// queueSize = stats.getAsyncQueueSize();
--// queuedMsgs = stats.getAsyncQueuedMsgs();
--// dequeuedMsgs = stats.getAsyncDequeuedMsgs();
--// conflatedMsgs = stats.getAsyncConflatedMsgs();
--// getLogWriter().info("After sleeping"
--// + " queueSize=" + queueSize
--// + " queuedMsgs=" + queuedMsgs
--// + " dequeuedMsgs=" + dequeuedMsgs
--// + " conflatedMsgs=" + conflatedMsgs);
final long finish = System.currentTimeMillis();
LogWriterUtils.getLogWriter().info("After " + (finish - start) + " ms async msgs where flushed. A total of " + (stats.getAsyncDequeuedMsgs()-intialDeQueuedMsgs) + " were flushed. Leaving a queue size of " + stats.getAsyncQueueSize() + ". The lastValue was " + lastValue);
checkLastValueInOtherVm(lastValue, null);
}
++
/**
* make sure ack does not hang
* make sure two ack updates do not conflate but are both queued
*/
- public void testAckConflation() throws CacheException {
+ @Test
- public void testAckConflation() throws CacheException {
++ public void testAckConflation() throws Exception {
final AttributesFactory factory = new AttributesFactory();
factory.setScope(Scope.DISTRIBUTED_NO_ACK);
factory.setEnableAsyncConflation(true);
@@@ -455,6 -431,6 +413,7 @@@
assertEquals(startQueuedMsgs+2, endQueuedMsgs);
}
}
++
/**
* Make sure that only sequences of updates are conflated
* Also checks that sending to a conflating region and non-conflating region
@@@ -462,8 -438,7 +421,8 @@@
* Test disabled because it intermittently fails due to race conditions
* in test. This has been fixed in congo's tests. See bug 35357.
*/
- public void _disabled_testConflationSequence() throws CacheException {
+ @Test
- public void testConflationSequence() throws CacheException {
++ public void testConflationSequence() throws Exception {
final AttributesFactory factory = new AttributesFactory();
factory.setScope(Scope.DISTRIBUTED_NO_ACK);
factory.setEnableAsyncConflation(true);
@@@ -498,8 -473,8 +457,6 @@@
String lastValue = value;
Object mylcb = null;
long initialConflatedMsgs = stats.getAsyncConflatedMsgs();
--// long initialDequeuedMsgs = stats.getAsyncDequeuedMsgs();
--// long dequeuedMsgs = stats.getAsyncDequeuedMsgs();
int endCount = count+60;
LogWriterUtils.getLogWriter().info("[testConflationSequence] about to build up queue");
@@@ -517,7 -492,7 +474,6 @@@
r.destroy(key, mylcb);
count ++;
lastValue = null;
--// dequeuedMsgs = stats.getAsyncDequeuedMsgs();
assertTrue(System.currentTimeMillis() < begin+1000*60*2);
}
assertEquals(initialConflatedMsgs, stats.getAsyncConflatedMsgs());
@@@ -528,8 -503,8 +484,6 @@@
LogWriterUtils.getLogWriter().info("[testConflationSequence] force queuing create-update-destroy");
forceQueuing(r);
initialConflatedMsgs = stats.getAsyncConflatedMsgs();
--// initialDequeuedMsgs = stats.getAsyncDequeuedMsgs();
--// dequeuedMsgs = stats.getAsyncDequeuedMsgs();
endCount = count + 40;
LogWriterUtils.getLogWriter().info("[testConflationSequence] create-update-destroy");
@@@ -544,7 -519,7 +498,6 @@@
r.put(key, value);
count ++;
r.localDestroy(key);
--// dequeuedMsgs = stats.getAsyncDequeuedMsgs();
assertTrue(System.currentTimeMillis() < begin+1000*60*2);
}
assertEquals(initialConflatedMsgs, stats.getAsyncConflatedMsgs());
@@@ -555,12 -530,12 +508,10 @@@
LogWriterUtils.getLogWriter().info("[testConflationSequence] force queuing update-invalidate");
forceQueuing(r);
initialConflatedMsgs = stats.getAsyncConflatedMsgs();
--// initialDequeuedMsgs = stats.getAsyncDequeuedMsgs();
value = "count=" + count;
lastValue = value;
r.create(key, value);
count++;
--// dequeuedMsgs = stats.getAsyncDequeuedMsgs();
endCount = count + 40;
LogWriterUtils.getLogWriter().info("[testConflationSequence] update-invalidate");
@@@ -573,7 -548,7 +524,6 @@@
r.invalidate(key);
count ++;
lastValue = CHECK_INVALID;
--// dequeuedMsgs = stats.getAsyncDequeuedMsgs();
assertTrue(System.currentTimeMillis() < begin+1000*60*2);
}
assertEquals(initialConflatedMsgs, stats.getAsyncConflatedMsgs());
@@@ -588,8 -563,8 +538,7 @@@
LogWriterUtils.getLogWriter().info("[testConflationSequence] conflate & no-conflate regions");
forceQueuing(r);
final int initialAsyncSocketWrites = stats.getAsyncSocketWrites();
--// initialDequeuedMsgs = stats.getAsyncDequeuedMsgs();
--
++
value = "count=" + count;
lastValue = value;
long conflatedMsgs = stats.getAsyncConflatedMsgs();
@@@ -611,7 -586,7 +560,6 @@@
assertEquals(queuedMsgs, stats.getAsyncQueuedMsgs());
assertEquals(conflatedMsgs, stats.getAsyncConflatedMsgs());
count++;
--// dequeuedMsgs = stats.getAsyncDequeuedMsgs();
endCount = count + 80;
begin = System.currentTimeMillis();
@@@ -641,7 -616,7 +589,6 @@@
queuedMsgs++;
assertEquals(queuedMsgs, stats.getAsyncQueuedMsgs());
assertEquals(conflatedMsgs, stats.getAsyncConflatedMsgs());
--// dequeuedMsgs = stats.getAsyncDequeuedMsgs();
assertTrue(System.currentTimeMillis() < begin+1000*60*2);
}
@@@ -649,11 -624,10 +596,12 @@@
LogWriterUtils.getLogWriter().info("[testConflationSequence] assert other vm");
checkLastValueInOtherVm(lastValue, null);
}
++
/**
* Make sure that exceeding the queue size limit causes a disconnect.
*/
- public void testSizeDisconnect() throws CacheException {
+ @Test
- public void testSizeDisconnect() throws CacheException {
++ public void testSizeDisconnect() throws Exception {
final String expected =
"com.gemstone.gemfire.internal.tcp.ConnectionException: Forced disconnect sent to" +
"||java.io.IOException: Broken pipe";
@@@ -672,11 -646,11 +620,10 @@@
// create receiver in vm0 with queuing enabled
Properties p = new Properties();
- p.setProperty("async-distribution-timeout", "5");
- p.setProperty("async-max-queue-size", "1"); // 1 meg
+ p.setProperty(ASYNC_DISTRIBUTION_TIMEOUT, "5");
+ p.setProperty(ASYNC_MAX_QUEUE_SIZE, "1"); // 1 meg
doCreateOtherVm(p, false);
--
final Object key = "key";
final int VALUE_SIZE = 1024 * 100; // .1M async-max-queue-size should give us 10 of these 100K msgs before queue full
final byte[] value = new byte[VALUE_SIZE];
@@@ -718,6 -692,6 +665,7 @@@
assertEquals(others, dm.getOtherDistributionManagerIds());
assertEquals(0, stats.getAsyncQueueSize());
}
++
/**
* Make sure that exceeding the async-queue-timeout causes a disconnect.<p>
* [bruce] This test was disabled when the SlowRecDUnitTest was re-enabled
@@@ -725,7 -699,7 +673,8 @@@
* June 2006 due to hangs. Some of the tests, like this one, still need
* work because the periodically (some quite often) fail.
*/
- public void testTimeoutDisconnect() throws CacheException {
- public void donottestTimeoutDisconnect() throws CacheException {
++ @Test
++ public void testTimeoutDisconnect() throws Exception {
final String expected =
"com.gemstone.gemfire.internal.tcp.ConnectionException: Forced disconnect sent to" +
"||java.io.IOException: Broken pipe";
@@@ -792,8 -766,8 +741,6 @@@
assertEquals(0, stats.getAsyncQueueSize());
}
-- // static helper methods ---------------------------------------------------
--
private static final String KEY_SLEEP = "KEY_SLEEP";
private static final String KEY_WAIT = "KEY_WAIT";
private static final String KEY_DISCONNECT = "KEY_DISCONNECT";
@@@ -921,18 -895,18 +868,11 @@@
* June 2006 r13222 in the trunk. This test is failing because conflation
* isn't kicking in for some reason.
*/
- public void testMultipleRegionConflation() throws Throwable {
- public void donottestMultipleRegionConflation() throws Throwable {
++ @Test
++ public void testMultipleRegionConflation() throws Exception {
try {
doTestMultipleRegionConflation();
}
-- catch (VirtualMachineError e) {
-- SystemFailure.initiateFailure(e);
-- throw e;
-- }
-- catch (Throwable t) {
-- LogWriterUtils.getLogWriter().error("Encountered exception: ", t);
-- throw t;
-- }
finally {
// make sure other vm was notified even if test failed
getOtherVm().invoke(new SerializableRunnable("Wake up other vm") {
@@@ -944,6 -918,6 +884,7 @@@
});
}
}
++
protected static ControlListener doTestMultipleRegionConflation_R1_Listener;
protected static ControlListener doTestMultipleRegionConflation_R2_Listener;
private void doTestMultipleRegionConflation() throws Exception {
@@@ -1143,19 -1117,18 +1084,11 @@@
/**
* Make sure a disconnect causes queue memory to be released.
*/
- public void testDisconnectCleanup() throws Throwable {
+ @Test
- public void testDisconnectCleanup() throws Throwable {
++ public void testDisconnectCleanup() throws Exception {
try {
doTestDisconnectCleanup();
}
-- catch (VirtualMachineError e) {
-- SystemFailure.initiateFailure(e);
-- throw e;
-- }
-- catch (Throwable t) {
-- LogWriterUtils.getLogWriter().error("Encountered exception: ", t);
-- throw t;
-- }
finally {
// make sure other vm was notified even if test failed
getOtherVm().invoke(new SerializableRunnable("Wake up other vm") {
@@@ -1167,6 -1140,6 +1100,7 @@@
});
}
}
++
protected static ControlListener doTestDisconnectCleanup_Listener;
private void doTestDisconnectCleanup() throws Exception {
final AttributesFactory factory = new AttributesFactory();
@@@ -1286,30 -1259,30 +1220,21 @@@
}
};
Wait.waitForCriterion(ev, 2 * 1000, 200, true);
--// getLogWriter().info("[testDisconnectCleanup] initialQueues=" +
--// initialQueues + " asyncQueues=" + stats.getAsyncQueues());
assertEquals(initialQueues, stats.getAsyncQueues());
}
/**
* Make sure a disconnect causes queue memory to be released.<p>
-- * [bruce] This test was disabled when the SlowRecDUnitTest was re-enabled
++ * [bruce] This test was disabled when the SlowRecDUnitTest was re-enabled
* in build.xml in the splitbrainNov07 branch. It had been disabled since
* June 2006 due to hangs. Some of the tests, like this one, still need
* work because the periodically (some quite often) fail.
-- */
- public void testPartialMessage() throws Throwable {
- public void donottestPartialMessage() throws Throwable {
++ */
++ @Test
++ public void testPartialMessage() throws Exception {
try {
doTestPartialMessage();
}
-- catch (VirtualMachineError e) {
-- SystemFailure.initiateFailure(e);
-- throw e;
-- }
-- catch (Throwable t) {
-- LogWriterUtils.getLogWriter().error("Encountered exception: ", t);
-- throw t;
-- }
finally {
// make sure other vm was notified even if test failed
getOtherVm().invoke(new SerializableRunnable("Wake up other vm") {
@@@ -1321,6 -1294,6 +1246,7 @@@
});
}
}
++
protected static ControlListener doTestPartialMessage_Listener;
private void doTestPartialMessage() throws Exception {
final AttributesFactory factory = new AttributesFactory();
@@@ -1331,9 -1304,9 +1257,7 @@@
final DMStats stats = dm.getStats();
// set others before vm0 connects
--// final Set others = dm.getOtherDistributionManagerIds();
long initialQueuedMsgs = stats.getAsyncQueuedMsgs();
--// int initialQueues = stats.getAsyncQueues();
// create receiver in vm0 with queuing enabled
final Properties p = new Properties();
@@@ -1387,11 -1360,11 +1311,6 @@@
count++;
r.put(key, value, new Integer(count));
if (count == partialId+1) {
--// long begin = System.currentTimeMillis();
--// while (stats.getAsyncQueues() < 1) {
--// pause(100);
--// assertFalse(System.currentTimeMillis() > begin+1000*10);
--// }
assertEquals(initialQueuedMsgs+2, stats.getAsyncQueuedMsgs());
assertEquals(0, stats.getAsyncConflatedMsgs());
} else if (count == partialId+2) {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/cache30/TXDistributedDUnitTest.java
----------------------------------------------------------------------
diff --cc geode-core/src/test/java/com/gemstone/gemfire/cache30/TXDistributedDUnitTest.java
index 73fe24c,8909511..de813ae
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/TXDistributedDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/TXDistributedDUnitTest.java
@@@ -26,38 -26,11 +26,39 @@@
* @see MultiVMRegionTestCase
*
*/
-
package com.gemstone.gemfire.cache30;
++import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.io.IOException;
+import java.io.Serializable;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Properties;
+import java.util.concurrent.CountDownLatch;
+
+import org.junit.Ignore;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
import com.gemstone.gemfire.SystemFailure;
-import com.gemstone.gemfire.cache.*;
+import com.gemstone.gemfire.cache.AttributesFactory;
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.CacheException;
+import com.gemstone.gemfire.cache.CacheLoader;
+import com.gemstone.gemfire.cache.CacheTransactionManager;
+import com.gemstone.gemfire.cache.CommitConflictException;
+import com.gemstone.gemfire.cache.CommitIncompleteException;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.DiskAccessException;
+import com.gemstone.gemfire.cache.LoaderHelper;
+import com.gemstone.gemfire.cache.MirrorType;
+import com.gemstone.gemfire.cache.Operation;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.Scope;
+import com.gemstone.gemfire.cache.TimeoutException;
import com.gemstone.gemfire.distributed.internal.ResourceEvent;
import com.gemstone.gemfire.distributed.internal.ResourceEventsListener;
import com.gemstone.gemfire.distributed.internal.locks.DLockBatch;
@@@ -532,11 -499,10 +533,9 @@@ public class TXDistributedDUnitTest ext
}
@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();
--// final TXManagerImpl txMgrImpl = (TXManagerImpl) txMgr;
final String rgnName = getUniqueName();
AttributesFactory factory = new AttributesFactory();
factory.setScope(Scope.DISTRIBUTED_ACK);
@@@ -1101,9 -1067,8 +1100,8 @@@
* 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();
Region rgn = getCache().createRegion(rgnName, getRegionAttributes());
rgn.create("key", null);
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/cache30/TXOrderDUnitTest.java
----------------------------------------------------------------------
diff --cc geode-core/src/test/java/com/gemstone/gemfire/cache30/TXOrderDUnitTest.java
index c97c04c,4236dc8..6d0fa35
--- 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,24 -16,14 +16,19 @@@
*/
package com.gemstone.gemfire.cache30;
- import org.junit.Ignore;
- 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;
import java.util.List;
--
import javax.naming.Context;
import javax.transaction.UserTransaction;
++import org.junit.Ignore;
++import org.junit.Test;
++import org.junit.experimental.categories.Category;
++
import com.gemstone.gemfire.CopyHelper;
import com.gemstone.gemfire.cache.AttributesFactory;
import com.gemstone.gemfire.cache.CacheEvent;
@@@ -65,22 -55,21 +60,27 @@@ import com.gemstone.gemfire.test.dunit.
import com.gemstone.gemfire.test.dunit.LogWriterUtils;
import com.gemstone.gemfire.test.dunit.SerializableCallable;
import com.gemstone.gemfire.test.dunit.VM;
++import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
++import com.gemstone.gemfire.test.junit.categories.DistributedTest;
/**
* Test the order of operations done on the farside of a tx.
*
- * @since 5.0
+ * @since GemFire 5.0
*/
-public class TXOrderDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class TXOrderDUnitTest extends JUnit4CacheTestCase {
+
++ private final int TEST_PUT = 0;
++ private final int TEST_INVALIDATE = 1;
++ private final int TEST_DESTROY = 2;
+
private transient Region r;
private transient DistributedMember otherId;
protected transient int invokeCount;
--
- public TXOrderDUnitTest() {
- super();
- public TXOrderDUnitTest(String name) {
- super(name);
-- }
++
++ List expectedKeys;
++ int clCount = 0;
private VM getOtherVm() {
Host host = Host.getHost(0);
@@@ -96,6 -85,6 +96,7 @@@
});
this.otherId = (DistributedMember)vm.invoke(() -> TXOrderDUnitTest.getVMDistributedMember());
}
++
private void doCommitOtherVm() {
VM vm = getOtherVm();
vm.invoke(new CacheSerializableRunnable("create root") {
@@@ -122,16 -111,16 +123,12 @@@
return InternalDistributedSystem.getAnyInstance().getDistributedMember();
}
-- ////////////////////// Test Methods //////////////////////
--
-- List expectedKeys;
-- int clCount = 0;
--
Object getCurrentExpectedKey() {
Object result = this.expectedKeys.get(this.clCount);
this.clCount += 1;
return result;
}
++
/**
* make sure listeners get invoked in correct order on far side of tx
*/
@@@ -178,11 -166,10 +175,11 @@@
}
/**
- * test bug#40870
- * @throws Exception
+ * Tests fix for #40870 Remote CacheListeners invoke afterCreate with Operation.LOCAL_LOAD_CREATE when create executed transactionally"
*/
- @Ignore("TODO")
- public void _testFarSideOpForLoad() throws Exception {
++ @Ignore("TODO: test is disabled")
+ @Test
+ public void testFarSideOpForLoad() throws Exception {
Host host = Host.getHost(0);
VM vm1 = host.getVM(0);
VM vm2 = host.getVM(1);
@@@ -293,9 -279,9 +290,11 @@@
vm1.invoke(verifyListener);
vm2.invoke(verifyListener);
}
--
-- class ExposedRegionTransactionListener extends TransactionListenerAdapter {
++
++ private static class ExposedRegionTransactionListener extends TransactionListenerAdapter {
++
private boolean exceptionOccurred = false;
++
@Override
public void afterCommit(TransactionEvent event) {
List<CacheEvent<?, ?>> events = event.getEvents();
@@@ -306,8 -292,8 +305,11 @@@
}
}
}
-- class ExposedRegionCacheListener extends CacheListenerAdapter {
++
++ private static class ExposedRegionCacheListener extends CacheListenerAdapter {
++
private boolean exceptionOccurred = false;
++
@Override
public void afterCreate(EntryEvent event) {
verifyRegion(event);
@@@ -323,14 -309,13 +325,10 @@@
}
}
-- private final int TEST_PUT = 0;
-- private final int TEST_INVALIDATE = 1;
-- private final int TEST_DESTROY = 2;
/**
* verify that queries on indexes work with transaction
-- * @throws Exception
*/
+ @Test
public void testFarSideIndexOnPut() throws Exception {
doTest(TEST_PUT);
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/cache30/TXRestrictionsDUnitTest.java
----------------------------------------------------------------------
diff --cc geode-core/src/test/java/com/gemstone/gemfire/cache30/TXRestrictionsDUnitTest.java
index 7d330cb,b4bff79..e4ccc34
--- 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,17 -26,8 +26,13 @@@
*/
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 org.junit.Test;
++import org.junit.experimental.categories.Category;
++
import com.gemstone.gemfire.cache.AttributesFactory;
import com.gemstone.gemfire.cache.CacheException;
import com.gemstone.gemfire.cache.CacheTransactionManager;
@@@ -48,12 -39,11 +44,11 @@@ import com.gemstone.gemfire.internal.OS
import com.gemstone.gemfire.test.dunit.Assert;
import com.gemstone.gemfire.test.dunit.Invoke;
import com.gemstone.gemfire.test.dunit.SerializableRunnable;
++import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
++import com.gemstone.gemfire.test.junit.categories.DistributedTest;
-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() {
AttributesFactory factory = new AttributesFactory();
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/distributed/LocatorDUnitTest.java
----------------------------------------------------------------------
diff --cc geode-core/src/test/java/com/gemstone/gemfire/distributed/LocatorDUnitTest.java
index 7c5a862,3e153e0..eb69543
--- a/geode-core/src/test/java/com/gemstone/gemfire/distributed/LocatorDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/distributed/LocatorDUnitTest.java
@@@ -62,10 -55,9 +64,10 @@@ import static com.gemstone.gemfire.dist
* Tests the ability of the {@link Locator} API to start and stop
* locators running in remote VMs.
*
- * @since 4.0
+ * @since GemFire 4.0
*/
-public class LocatorDUnitTest extends DistributedTestCase {
+@Category(DistributedTest.class)
+public class LocatorDUnitTest extends JUnit4DistributedTestCase {
private static volatile InternalDistributedSystem system = null;
@@@ -1842,9 -1819,8 +1844,9 @@@
* Tests starting, stopping, and restarting a locator. See bug
* 32856.
*
- * @since 4.1
+ * @since GemFire 4.1
*/
+ @Test
public void testRestartLocator() throws Exception {
disconnectAllFromDS();
port1 =
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/distributed/RoleDUnitTest.java
----------------------------------------------------------------------
diff --cc geode-core/src/test/java/com/gemstone/gemfire/distributed/RoleDUnitTest.java
index dc3f36f,55fc69b..ac3c23e
--- 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,17 -16,7 +16,17 @@@
*/
package com.gemstone.gemfire.distributed;
++import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.util.Iterator;
+import java.util.Properties;
+import java.util.Set;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
import com.gemstone.gemfire.distributed.internal.DM;
- import com.gemstone.gemfire.distributed.internal.DistributionConfig;
import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem;
import com.gemstone.gemfire.distributed.internal.membership.InternalDistributedMember;
import com.gemstone.gemfire.distributed.internal.membership.InternalRole;
@@@ -55,12 -55,12 +55,11 @@@ public class RoleDUnitTest extends JUni
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"};
--// final List rolesList = Arrays.asList(rolesArray);
--
++
distributionProperties = new Properties();
- distributionProperties.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
- distributionProperties.setProperty(DistributionConfig.LOCATORS_NAME, "");
- distributionProperties.setProperty(DistributionConfig.ROLES_NAME, rolesProp);
+ distributionProperties.setProperty(MCAST_PORT, "0");
+ distributionProperties.setProperty(LOCATORS, "");
+ distributionProperties.setProperty(ROLES, rolesProp);
InternalDistributedSystem system = getSystem(distributionProperties);
try {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/Bug40751DUnitTest.java
----------------------------------------------------------------------
diff --cc geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/Bug40751DUnitTest.java
index 06bfc5f,9aee361..4c22cfd
--- 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
@@@ -16,47 -16,25 +16,35 @@@
*/
package com.gemstone.gemfire.distributed.internal;
- import org.junit.experimental.categories.Category;
- import org.junit.Test;
-
-import com.gemstone.gemfire.DataSerializable;
-import com.gemstone.gemfire.ToDataException;
-import com.gemstone.gemfire.cache.*;
-import com.gemstone.gemfire.cache30.CacheTestCase;
-import com.gemstone.gemfire.test.dunit.*;
++import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+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;
- import java.util.HashMap;
- import java.util.Map;
import java.util.Properties;
-
- import com.gemstone.gemfire.*;
+
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
++import org.junit.Test;
++import org.junit.experimental.categories.Category;
++
++import com.gemstone.gemfire.DataSerializable;
++import com.gemstone.gemfire.ToDataException;
+import com.gemstone.gemfire.cache.AttributesFactory;
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.DataPolicy;
- import com.gemstone.gemfire.cache.InterestPolicy;
- import com.gemstone.gemfire.cache.PartitionAttributes;
- import com.gemstone.gemfire.cache.PartitionAttributesFactory;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.Scope;
- import com.gemstone.gemfire.cache.SubscriptionAttributes;
- import com.gemstone.gemfire.cache30.CacheTestCase;
- import com.gemstone.gemfire.internal.cache.lru.Sizeable;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.Invoke;
+import com.gemstone.gemfire.test.dunit.SerializableCallable;
+import com.gemstone.gemfire.test.dunit.SerializableRunnable;
+import com.gemstone.gemfire.test.dunit.VM;
++import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
++import com.gemstone.gemfire.test.junit.categories.DistributedTest;
-public class Bug40751DUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class Bug40751DUnitTest extends JUnit4CacheTestCase {
- public Bug40751DUnitTest() {
- super();
- public Bug40751DUnitTest(String name) {
- super(name);
-- }
--
@Override
public final void postTearDownCacheTestCase() throws Exception {
disconnectAllFromDS();