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/09 17:05:54 UTC
[37/51] [partial] incubator-geode git commit: GEODE-837: update tests
from JUnit3 to JUnit4
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionTestCase.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionTestCase.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionTestCase.java
index ac3d721..e31e97b 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionTestCase.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionTestCase.java
@@ -16,6 +16,8 @@
*/
package com.gemstone.gemfire.cache30;
+import static org.junit.Assert.*;
+
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
@@ -32,6 +34,7 @@ import java.util.Properties;
import java.util.Set;
import java.util.TreeSet;
+import org.junit.Test;
import org.junit.experimental.categories.Category;
import com.gemstone.gemfire.LogWriter;
@@ -65,6 +68,7 @@ import com.gemstone.gemfire.test.dunit.Invoke;
import com.gemstone.gemfire.test.dunit.VM;
import com.gemstone.gemfire.test.dunit.Wait;
import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
import com.gemstone.gemfire.test.junit.categories.FlakyTest;
/**
@@ -80,7 +84,7 @@ import com.gemstone.gemfire.test.junit.categories.FlakyTest;
*
* @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;
@@ -106,10 +110,6 @@ public abstract class RegionTestCase extends CacheTestCase {
subrgnWriter = null;
}
- public RegionTestCase(String name) {
- super(name);
- }
-
@Override
public final void postTearDownCacheTestCase() throws Exception {
cleanup();
@@ -120,8 +120,6 @@ public abstract class RegionTestCase extends CacheTestCase {
protected void postTearDownRegionTestCase() throws Exception {
}
- //////// Helper methods
-
/**
* Returns a region with the given name and the attributes for this
* test.
@@ -146,7 +144,6 @@ public abstract class RegionTestCase extends CacheTestCase {
*/
protected abstract RegionAttributes getRegionAttributes();
-
/** pauses only if no ack */
protected void pauseIfNecessary() {
}
@@ -162,14 +159,13 @@ public abstract class RegionTestCase extends CacheTestCase {
// Only needed for no-ack regions
}
- ////////////////////// Test Methods //////////////////////
-
/**
* Tests that creating an entry in a region actually creates it
*
* @see Region#containsKey
* @see Region#containsValueForKey
*/
+ @Test
public void testContainsKey() throws CacheException {
String name = this.getUniqueName();
Region region = createRegion(name);
@@ -204,6 +200,7 @@ public abstract class RegionTestCase extends CacheTestCase {
* @see Region#getEntry
* @see Region#create
*/
+ @Test
public void testBadRegionAccess() throws CacheException {
String name = this.getUniqueName();
Region region = createRegion(name);
@@ -238,6 +235,7 @@ public abstract class RegionTestCase extends CacheTestCase {
* Tests that {@link Region#put} on a previously non-existent region
* entry creates it.
*/
+ @Test
public void testPutNonExistentEntry() throws CacheException {
String name = this.getUniqueName();
Region region = createRegion(name);
@@ -284,6 +282,7 @@ public abstract class RegionTestCase extends CacheTestCase {
* Tests that sending <code>null</code> to various APIs throws the
* appropriate exception.
*/
+ @Test
public void testNulls() throws CacheException {
if (!supportsSubregions()) {
return;
@@ -388,6 +387,7 @@ public abstract class RegionTestCase extends CacheTestCase {
* Region's {@link Region#getStatistics statistics}, so the region
* must have been created with statistics enabled.
*/
+ @Test
public void testCreateSubregions() throws CacheException {
if (!supportsSubregions()) {
return;
@@ -441,6 +441,7 @@ public abstract class RegionTestCase extends CacheTestCase {
* Tests {@link Region#destroy destroying} an entry and attempting
* to access it afterwards.
*/
+ @Test
public void testDestroyEntry() throws CacheException {
String name = this.getUniqueName();
Object key = name;
@@ -529,6 +530,7 @@ public abstract class RegionTestCase extends CacheTestCase {
*
* @see Region#destroyRegion
*/
+ @Test
public void testDestroyRegion() throws CacheException {
if (!supportsSubregions()) {
return;
@@ -828,6 +830,7 @@ public abstract class RegionTestCase extends CacheTestCase {
/**
* Tests the {@link Region#entries} method without recursion
*/
+ @Test
public void testEntries() throws CacheException {
String name = this.getUniqueName();
Region region = createRegion(name);
@@ -908,6 +911,7 @@ public abstract class RegionTestCase extends CacheTestCase {
/**
* Tests the {@link Region#entries} method with recursion
*/
+ @Test
public void testEntriesRecursive() throws CacheException {
if (!supportsSubregions()) {
return;
@@ -972,6 +976,7 @@ public abstract class RegionTestCase extends CacheTestCase {
/**
* Tests the {@link Region#getCache} method (for what it's worth)
*/
+ @Test
public void testGetCache() throws CacheException {
String name = this.getUniqueName();
Region region = createRegion(name);
@@ -981,6 +986,7 @@ public abstract class RegionTestCase extends CacheTestCase {
/**
* Tests the {@link Region#getName} method
*/
+ @Test
public void testGetName() throws CacheException {
String name = this.getUniqueName();
Region region = createRegion(name);
@@ -992,6 +998,7 @@ public abstract class RegionTestCase extends CacheTestCase {
/**
* Tests the {@link Region#getFullPath} method
*/
+ @Test
public void testGetPathFromRoot() throws CacheException {
if (!supportsSubregions()) {
return;
@@ -1011,6 +1018,7 @@ public abstract class RegionTestCase extends CacheTestCase {
/**
* Tests the {@link Region#getParentRegion} method
*/
+ @Test
public void testGetParentRegion() throws CacheException {
if (!supportsSubregions()) {
return;
@@ -1033,6 +1041,7 @@ public abstract class RegionTestCase extends CacheTestCase {
*
* @see Region#setUserAttribute
*/
+ @Test
public void testRegionUserAttribute() throws CacheException {
String name = this.getUniqueName();
Object value = "USER_ATTRIBUTE";
@@ -1047,6 +1056,7 @@ public abstract class RegionTestCase extends CacheTestCase {
/**
* Tests a region entry's user attribute
*/
+ @Test
public void testEntryUserAttribute() throws CacheException {
String name = this.getUniqueName();
String key = "KEY";
@@ -1067,6 +1077,7 @@ public abstract class RegionTestCase extends CacheTestCase {
/**
* Tests invalidating a region entry
*/
+ @Test
public void testInvalidateEntry() throws CacheException {
String name = this.getUniqueName();
Object key = "KEY";
@@ -1094,6 +1105,7 @@ public abstract class RegionTestCase extends CacheTestCase {
/**
* Tests invalidating an entire region
*/
+ @Test
public void testInvalidateRegion() throws CacheException {
String name = this.getUniqueName();
@@ -1131,6 +1143,7 @@ public abstract class RegionTestCase extends CacheTestCase {
/**
* Tests the {@link Region#keys} method.
*/
+ @Test
public void testKeys() throws CacheException {
String name = this.getUniqueName();
@@ -1186,6 +1199,7 @@ public abstract class RegionTestCase extends CacheTestCase {
* attempting to access it afterwards. (Not too useful with a
* <code>LOCAL</code> region.)
*/
+ @Test
public void testLocalDestroyEntry() throws CacheException {
if (!supportsLocalDestroyAndLocalInvalidate()) {
return;
@@ -1278,6 +1292,7 @@ public abstract class RegionTestCase extends CacheTestCase {
*
* @see Region#localDestroyRegion
*/
+ @Test
public void testLocalDestroyRegion() throws CacheException {
String name = this.getUniqueName();
Object key = "KEY";
@@ -1574,6 +1589,7 @@ public abstract class RegionTestCase extends CacheTestCase {
* Tests closing a region, and checks different behavior when this is a disk
* region with persistBackup.
*/
+ @Test
public void testCloseRegion() throws CacheException {
// @todo added a remote region to make sure close just does a localDestroy
@@ -1663,6 +1679,7 @@ public abstract class RegionTestCase extends CacheTestCase {
/**
* Tests locally invalidating a region entry
*/
+ @Test
public void testLocalInvalidateEntry() throws CacheException {
if (!supportsLocalDestroyAndLocalInvalidate()) {
return;
@@ -1692,6 +1709,7 @@ public abstract class RegionTestCase extends CacheTestCase {
/**
* Tests locally invalidating an entire region
*/
+ @Test
public void testLocalInvalidateRegion() throws CacheException {
String name = this.getUniqueName();
@@ -1729,6 +1747,7 @@ public abstract class RegionTestCase extends CacheTestCase {
/**
* Tests the {@link Region#subregions} method without recursion
*/
+ @Test
public void testSubregions() throws CacheException {
if (!supportsSubregions()) {
return;
@@ -1788,6 +1807,7 @@ public abstract class RegionTestCase extends CacheTestCase {
/**
* Tests the {@link Region#subregions} method with recursion
*/
+ @Test
public void testSubregionsRecursive() throws CacheException {
if (!supportsSubregions()) {
return;
@@ -1856,6 +1876,7 @@ public abstract class RegionTestCase extends CacheTestCase {
/**
* Tests the {@link Region#values} method without recursion
*/
+ @Test
public void testValues() throws CacheException {
String name = this.getUniqueName();
System.err.println("testValues region name is " + name);
@@ -2116,6 +2137,7 @@ public abstract class RegionTestCase extends CacheTestCase {
* Tests that an entry in a region expires with an
* invalidation after a given time to live.
*/
+ @Test
public void testEntryTtlInvalidate()
throws CacheException {
@@ -2162,6 +2184,7 @@ public abstract class RegionTestCase extends CacheTestCase {
/**
* Verify that special entries expire but other entries in the region don't
*/
+ @Test
public void testCustomEntryTtl1() {
final String name = this.getUniqueName();
@@ -2218,6 +2241,7 @@ public abstract class RegionTestCase extends CacheTestCase {
/**
* Verify that special entries don't expire but other entries in the region do
*/
+ @Test
public void testCustomEntryTtl2() {
final String name = this.getUniqueName();
@@ -2299,6 +2323,7 @@ public abstract class RegionTestCase extends CacheTestCase {
* Expire an entry with a custom expiration. Set a new custom expiration, create the
* same entry again, make sure it observes the <em>new</em> expiration
*/
+ @Test
public void testCustomEntryTtl3() {
final String name = this.getUniqueName();
@@ -2418,6 +2443,7 @@ public abstract class RegionTestCase extends CacheTestCase {
* Then mutate the region expiration configuration and confirm
* that the entry's expiration time is rescheduled.
*/
+ @Test
public void testEntryTtl3() {
final String name = this.getUniqueName();
// test no longer waits for this expiration to happen
@@ -2601,6 +2627,7 @@ public abstract class RegionTestCase extends CacheTestCase {
* Tests that an entry whose value is loaded into a region
* expires with an invalidation after a given time to live.
*/
+ @Test
public void testEntryFromLoadTtlInvalidate()
throws CacheException, InterruptedException {
@@ -2650,6 +2677,7 @@ public abstract class RegionTestCase extends CacheTestCase {
* Tests that an entry in a region expires with a destroy
* after a given time to live.
*/
+ @Test
public void testEntryTtlDestroy()
throws CacheException, InterruptedException {
@@ -2693,6 +2721,7 @@ public abstract class RegionTestCase extends CacheTestCase {
* Tests that a region expires with an invalidation after a
* given time to live.
*/
+ @Test
public void testRegionTtlInvalidate()
throws CacheException, InterruptedException {
@@ -2747,6 +2776,7 @@ public abstract class RegionTestCase extends CacheTestCase {
* Tests that a region expires with a destruction after a
* given time to live.
*/
+ @Test
public void testRegionTtlDestroy()
throws CacheException, InterruptedException {
@@ -2792,6 +2822,7 @@ public abstract class RegionTestCase extends CacheTestCase {
* Tests that an entry in a local region that remains idle for a
* given amount of time is invalidated.
*/
+ @Test
public void testEntryIdleInvalidate()
throws CacheException, InterruptedException {
@@ -2891,6 +2922,7 @@ public abstract class RegionTestCase extends CacheTestCase {
/**
* Verify that special entries expire but other entries in the region don't
*/
+ @Test
public void testCustomEntryIdleTimeout1() {
final String name = this.getUniqueName();
@@ -2969,6 +3001,7 @@ public abstract class RegionTestCase extends CacheTestCase {
/**
* Verify that special entries don't expire but other entries in the region do
*/
+ @Test
public void testCustomEntryIdleTimeout2() {
final String name = this.getUniqueName();
@@ -3052,6 +3085,7 @@ public abstract class RegionTestCase extends CacheTestCase {
* Then mutate the region expiration configuration and confirm
* that the entry's expiration time is rescheduled.
*/
+ @Test
public void testCustomEntryIdleTimeout3() {
final String name = this.getUniqueName();
// test no longer waits for this expiration to happen
@@ -3139,6 +3173,7 @@ public abstract class RegionTestCase extends CacheTestCase {
* Then mutate the region expiration configuration and confirm
* that the entry's expiration time is rescheduled.
*/
+ @Test
public void testEntryIdleTimeout3() {
final String name = this.getUniqueName();
// test no longer waits for this expiration to happen
@@ -3370,6 +3405,7 @@ public abstract class RegionTestCase extends CacheTestCase {
/**
* Verify that expiry is calculatod only once on an entry
*/
+ @Test
public void testCustomIdleOnce() {
final String name = this.getUniqueName();
@@ -3445,6 +3481,7 @@ public abstract class RegionTestCase extends CacheTestCase {
/**
* Verify that a get or put resets the idle time on an entry
*/
+ @Test
public void testCustomEntryIdleReset() {
final String name = this.getUniqueName();
@@ -3508,6 +3545,7 @@ public abstract class RegionTestCase extends CacheTestCase {
* given amount of time is destroyed.
*/
@Category(FlakyTest.class) // GEODE-706: time sensitive, expiration, waitForDestroy, EXPIRY_MS_PROPERTY, short timeout
+ @Test
public void testEntryIdleDestroy() throws Exception {
final String name = this.getUniqueName();
@@ -3569,6 +3607,7 @@ public abstract class RegionTestCase extends CacheTestCase {
* Verify that accessing an entry resets its idle time
* @throws Exception
*/
+ @Test
public void testEntryIdleReset() throws Exception {
final String name = this.getUniqueName();
@@ -3624,6 +3663,7 @@ public abstract class RegionTestCase extends CacheTestCase {
}
}
+ @Test
public void testEntryExpirationAfterMutate()
throws CacheException, InterruptedException {
@@ -3681,6 +3721,7 @@ public abstract class RegionTestCase extends CacheTestCase {
* Verify that accessing an entry does not delay expiration due
* to TTL
*/
+ @Test
public void testEntryIdleTtl() {
final String name = this.getUniqueName();
@@ -3720,6 +3761,7 @@ public abstract class RegionTestCase extends CacheTestCase {
}
}
+ @Test
public void testRegionExpirationAfterMutate()
throws CacheException, InterruptedException {
@@ -3780,6 +3822,7 @@ public abstract class RegionTestCase extends CacheTestCase {
* time is invalidated. Also tests that accessing an entry of a
* region or a subregion counts as an access.
*/
+ @Test
public void testRegionIdleInvalidate()
throws InterruptedException, CacheException {
@@ -3888,6 +3931,7 @@ public abstract class RegionTestCase extends CacheTestCase {
* Tests that a region expires with a destruction after a
* given idle time.
*/
+ @Test
public void testRegionIdleDestroy()
throws CacheException, InterruptedException {
@@ -3933,6 +3977,7 @@ public abstract class RegionTestCase extends CacheTestCase {
public static Region preSnapshotRegion = null;
private final static int MAX_KEYS = 10;
+ @Test
public void testSnapshot() throws IOException, CacheException, ClassNotFoundException {
final String name = this.getUniqueName();
@@ -3997,6 +4042,7 @@ public abstract class RegionTestCase extends CacheTestCase {
}
}
+ @Test
public void testRootSnapshot() throws IOException, CacheException, ClassNotFoundException {
final String name = this.getUniqueName();
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/ReliabilityTestCase.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/ReliabilityTestCase.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/ReliabilityTestCase.java
index 4ebde70..e89b760 100644
--- 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,20 +16,22 @@
*/
package com.gemstone.gemfire.cache30;
-import com.gemstone.gemfire.cache.*;
-import com.gemstone.gemfire.distributed.*;
-import java.util.*;
+import static org.junit.Assert.*;
+
+import java.util.Iterator;
+import java.util.Set;
+
+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 GemFire 5.0
*/
-public abstract class ReliabilityTestCase extends CacheTestCase {
-
- public ReliabilityTestCase(String name) {
- super(name);
- }
+public abstract class ReliabilityTestCase extends JUnit4CacheTestCase {
/** Asserts that the specified roles are missing */
protected void assertMissingRoles(String regionName, String[] roles) {
@@ -49,10 +51,7 @@ public abstract class ReliabilityTestCase extends CacheTestCase {
assertTrue("Unexpected missing role: " + role.getName(), found);
}
}
-
+
protected void waitForMemberTimeout() {
- // TODO implement me
}
-
}
-
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/RemoveAllMultiVmDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/RemoveAllMultiVmDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/RemoveAllMultiVmDUnitTest.java
index c1b5e48..74c66ef 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/RemoveAllMultiVmDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/RemoveAllMultiVmDUnitTest.java
@@ -22,10 +22,15 @@
*/
package com.gemstone.gemfire.cache30;
+import static org.junit.Assert.*;
+
import java.util.Arrays;
import java.util.Collections;
import java.util.Properties;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
import com.gemstone.gemfire.cache.AttributesFactory;
import com.gemstone.gemfire.cache.Cache;
import com.gemstone.gemfire.cache.CacheException;
@@ -36,21 +41,18 @@ import com.gemstone.gemfire.cache.Region;
import com.gemstone.gemfire.cache.RegionAttributes;
import com.gemstone.gemfire.cache.Scope;
import com.gemstone.gemfire.distributed.DistributedSystem;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
import com.gemstone.gemfire.test.dunit.Host;
import com.gemstone.gemfire.test.dunit.Invoke;
import com.gemstone.gemfire.test.dunit.SerializableRunnable;
import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
/**
*
*/
-public class RemoveAllMultiVmDUnitTest extends DistributedTestCase {
-
- /** Creates a new instance of RemoveAllMultiVmDUnitTest */
- public RemoveAllMultiVmDUnitTest(String name) {
- super(name);
- }
+@Category(DistributedTest.class)
+public class RemoveAllMultiVmDUnitTest extends JUnit4DistributedTestCase { // TODO: reformat
static Cache cache;
static Properties props = new Properties();
@@ -82,7 +84,7 @@ public class RemoveAllMultiVmDUnitTest extends DistributedTestCase {
public static void createCache(){
try{
- ds = (new RemoveAllMultiVmDUnitTest("temp")).getSystem(props);
+ ds = (new RemoveAllMultiVmDUnitTest()).getSystem(props);
cache = CacheFactory.create(ds);
AttributesFactory factory = new AttributesFactory();
factory.setScope(Scope.DISTRIBUTED_ACK);
@@ -120,7 +122,8 @@ public class RemoveAllMultiVmDUnitTest extends DistributedTestCase {
//tests methods
- public void testLocalRemoveAll(){
+ @Test
+ public void testLocalRemoveAll(){
Host host = Host.getHost(0);
VM vm0 = host.getVM(0);
@@ -151,7 +154,8 @@ public class RemoveAllMultiVmDUnitTest extends DistributedTestCase {
} );
}
- public void testLocalTxRemoveAll(){
+ @Test
+ public void testLocalTxRemoveAll(){
Host host = Host.getHost(0);
VM vm0 = host.getVM(0);
@@ -187,7 +191,8 @@ public class RemoveAllMultiVmDUnitTest extends DistributedTestCase {
} );
}
- public void testDistributedRemoveAll(){
+ @Test
+ public void testDistributedRemoveAll(){
Host host = Host.getHost(0);
VM vm0 = host.getVM(0);
VM vm1 = host.getVM(1);
@@ -236,7 +241,8 @@ public class RemoveAllMultiVmDUnitTest extends DistributedTestCase {
}
} );
}
- public void testDistributedTxRemoveAll(){
+ @Test
+ public void testDistributedTxRemoveAll(){
Host host = Host.getHost(0);
VM vm0 = host.getVM(0);
VM vm1 = host.getVM(1);
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/RequiredRolesDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/RequiredRolesDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/RequiredRolesDUnitTest.java
index 3163fd3..e73481d 100644
--- 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,24 +16,43 @@
*/
package com.gemstone.gemfire.cache30;
-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 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.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 GemFire 5.0
*/
+@Category(DistributedTest.class)
public class RequiredRolesDUnitTest extends ReliabilityTestCase {
protected transient volatile boolean startTestWaitForRequiredRoles = false;
@@ -41,13 +60,10 @@ public class RequiredRolesDUnitTest extends ReliabilityTestCase {
protected transient volatile boolean failTestWaitForRequiredRoles = false;
protected transient Set rolesTestWaitForRequiredRoles = new HashSet();
- public RequiredRolesDUnitTest(String name) {
- super(name);
- }
-
/**
* Tests that RequiredRoles detects missing roles.
*/
+ @Test
public void testRequiredRolesInLoss() throws Exception {
String name = this.getUniqueName();
@@ -107,6 +123,7 @@ public class RequiredRolesDUnitTest extends ReliabilityTestCase {
/**
* Tests RequiredRoles.waitForRequiredRoles().
*/
+ @Test
public void testWaitForRequiredRoles() throws Exception {
final String name = this.getUniqueName();
final int vm0 = 0;
@@ -285,6 +302,7 @@ public class RequiredRolesDUnitTest extends ReliabilityTestCase {
/**
* Tests RequiredRoles.isRoleInRegionMembership().
*/
+ @Test
public void testIsRoleInRegionMembership() throws Exception {
final String name = this.getUniqueName();
final int vm0 = 0;
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/RolePerformanceDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/RolePerformanceDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/RolePerformanceDUnitTest.java
index 06e25d0..3e66792 100644
--- 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,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.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 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
@@ -42,6 +50,7 @@ public class RolePerformanceDUnitTest extends CacheTestCase {
* <p>
* Up to 10 attempts will be made before failing.
*/
+ @Test
public void testRolePerformance() {
int maxAttempts = 10;
for (int i = 1; i <= maxAttempts; i++) {
@@ -54,7 +63,7 @@ public class RolePerformanceDUnitTest extends CacheTestCase {
break;
}
// only catch assertion failures...
- catch (junit.framework.AssertionFailedError e) {
+ catch (AssertionError e) {
if (i == maxAttempts) {
throw e;
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/SearchAndLoadDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/SearchAndLoadDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/SearchAndLoadDUnitTest.java
index d564fca..f8e2172 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/SearchAndLoadDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/SearchAndLoadDUnitTest.java
@@ -16,9 +16,14 @@
*/
package com.gemstone.gemfire.cache30;
+import static org.junit.Assert.*;
+
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
+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.CacheLoader;
@@ -35,19 +40,20 @@ import com.gemstone.gemfire.cache.Scope;
import com.gemstone.gemfire.cache.TimeoutException;
import com.gemstone.gemfire.test.dunit.Assert;
import com.gemstone.gemfire.test.dunit.AsyncInvocation;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
import com.gemstone.gemfire.test.dunit.Host;
import com.gemstone.gemfire.test.dunit.IgnoredException;
-import com.gemstone.gemfire.test.dunit.Invoke;
import com.gemstone.gemfire.test.dunit.LogWriterUtils;
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;
/**
* This class tests various search load and write scenarios for distributed regions
*/
+@Category(DistributedTest.class)
@SuppressWarnings({"deprecation", "unchecked", "rawtypes", "serial"})
-public class SearchAndLoadDUnitTest extends CacheTestCase {
+public class SearchAndLoadDUnitTest extends JUnit4CacheTestCase {
static boolean loaderInvoked;
static boolean remoteLoaderInvoked;
@@ -72,10 +78,6 @@ public class SearchAndLoadDUnitTest extends CacheTestCase {
static final CountDownLatch readyForExceptionLatch = new CountDownLatch(1);
static final CountDownLatch loaderInvokedLatch = new CountDownLatch(1);
- public SearchAndLoadDUnitTest(String name) {
- super(name);
- }
-
@Override
public final void preTearDownCacheTestCase() throws Exception {
for (int h = 0; h < Host.getHostCount(); h++) {
@@ -110,6 +112,7 @@ public class SearchAndLoadDUnitTest extends CacheTestCase {
return factory.create();
}
+ @Test
public void testNetSearch()
throws CacheException, InterruptedException {
@@ -209,6 +212,7 @@ public class SearchAndLoadDUnitTest extends CacheTestCase {
* return a value. Both threads then validate that they received the expected
* result.
*/
+ @Test
public void testConcurrentLoad() throws Throwable {
Host host = Host.getHost(0);
@@ -352,6 +356,7 @@ public class SearchAndLoadDUnitTest extends CacheTestCase {
}
+ @Test
public void testNetLoadNoLoaders() throws CacheException, InterruptedException {
Host host = Host.getHost(0);
VM vm0 = host.getVM(0);
@@ -392,10 +397,10 @@ public class SearchAndLoadDUnitTest extends CacheTestCase {
}
+ @Test
public void testNetLoad()
throws CacheException, InterruptedException {
- Invoke.invokeInEveryVM(DistributedTestCase.class,
- "disconnectFromDS");
+ disconnectAllFromDS();
Host host = Host.getHost(0);
VM vm0 = host.getVM(0);
@@ -487,10 +492,10 @@ public class SearchAndLoadDUnitTest extends CacheTestCase {
* Confirm that a netLoad that returns null will NOT allow other netLoad methods
* to be called.
*/
+ @Test
public void testEmptyNetLoad()
throws CacheException, InterruptedException {
- Invoke.invokeInEveryVM(DistributedTestCase.class,
- "disconnectFromDS");
+ disconnectAllFromDS();
Host host = Host.getHost(0);
VM vm0 = host.getVM(0);
@@ -607,6 +612,7 @@ public class SearchAndLoadDUnitTest extends CacheTestCase {
return new Integer(remoteLoaderInvokedCount);
}
+ @Test
public void testLocalLoad()
throws CacheException, InterruptedException {
@@ -691,6 +697,7 @@ public class SearchAndLoadDUnitTest extends CacheTestCase {
}
+ @Test
public void testNetWrite()
throws CacheException, InterruptedException {
@@ -783,6 +790,7 @@ public class SearchAndLoadDUnitTest extends CacheTestCase {
}
+ @Test
public void testOneHopNetWrite() throws CacheException, InterruptedException {
Host host = Host.getHost(0);
@@ -892,6 +900,7 @@ public class SearchAndLoadDUnitTest extends CacheTestCase {
/** same as the previous test but the cache writer is in a third, non-replicated, vm */
+ @Test
public void testOneHopNetWriteRemoteWriter() throws CacheException, InterruptedException {
Host host = Host.getHost(0);
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/cache30/SlowRecDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/SlowRecDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/SlowRecDUnitTest.java
index 2453c85..241bfae 100644
--- 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,17 +16,8 @@
*/
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 static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
import java.io.Serializable;
import java.util.Iterator;
@@ -34,7 +25,32 @@ 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.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
@@ -43,11 +59,9 @@ import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties
*/
@Category(DistributedTest.class)
@Ignore("Test was disabled by renaming to DisabledTest")
-public class SlowRecDUnitTest extends CacheTestCase {
+public class SlowRecDUnitTest extends JUnit4CacheTestCase {
- 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
@@ -63,16 +77,12 @@ public class SlowRecDUnitTest extends CacheTestCase {
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") {
@@ -93,24 +103,20 @@ public class SlowRecDUnitTest extends CacheTestCase {
} 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");}
}
}
@@ -133,7 +139,8 @@ public class SlowRecDUnitTest extends CacheTestCase {
}
});
}
- 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();
@@ -181,8 +188,6 @@ public class SlowRecDUnitTest extends CacheTestCase {
}
};
Wait.waitForCriterion(ev, 50 * 1000, 200, true);
-// assertNotNull(re);
-// assertIndexDetailsEquals(null, value);
}
} else {
{
@@ -243,7 +248,8 @@ public class SlowRecDUnitTest extends CacheTestCase {
* 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 Exception {
final AttributesFactory factory = new AttributesFactory();
factory.setScope(Scope.DISTRIBUTED_NO_ACK);
final Region r = createRootRegion("slowrec", factory.create());
@@ -261,7 +267,6 @@ public class SlowRecDUnitTest extends CacheTestCase {
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;
@@ -299,6 +304,7 @@ public class SlowRecDUnitTest extends CacheTestCase {
checkLastValueInOtherVm(lastValue, null);
}
}
+
/**
* Create a region named AckRegion with ACK scope
*/
@@ -314,11 +320,13 @@ public class SlowRecDUnitTest extends CacheTestCase {
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 Exception {
final AttributesFactory factory = new AttributesFactory();
factory.setScope(Scope.DISTRIBUTED_NO_ACK);
factory.setEnableAsyncConflation(true);
@@ -333,10 +341,7 @@ public class SlowRecDUnitTest extends CacheTestCase {
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;
@@ -346,46 +351,23 @@ public class SlowRecDUnitTest extends CacheTestCase {
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 Exception {
final AttributesFactory factory = new AttributesFactory();
factory.setScope(Scope.DISTRIBUTED_NO_ACK);
factory.setEnableAsyncConflation(true);
@@ -431,6 +413,7 @@ public class SlowRecDUnitTest extends CacheTestCase {
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
@@ -438,7 +421,8 @@ public class SlowRecDUnitTest extends CacheTestCase {
* 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 Exception {
final AttributesFactory factory = new AttributesFactory();
factory.setScope(Scope.DISTRIBUTED_NO_ACK);
factory.setEnableAsyncConflation(true);
@@ -473,8 +457,6 @@ public class SlowRecDUnitTest extends CacheTestCase {
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");
@@ -492,7 +474,6 @@ public class SlowRecDUnitTest extends CacheTestCase {
r.destroy(key, mylcb);
count ++;
lastValue = null;
-// dequeuedMsgs = stats.getAsyncDequeuedMsgs();
assertTrue(System.currentTimeMillis() < begin+1000*60*2);
}
assertEquals(initialConflatedMsgs, stats.getAsyncConflatedMsgs());
@@ -503,8 +484,6 @@ public class SlowRecDUnitTest extends CacheTestCase {
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");
@@ -519,7 +498,6 @@ public class SlowRecDUnitTest extends CacheTestCase {
r.put(key, value);
count ++;
r.localDestroy(key);
-// dequeuedMsgs = stats.getAsyncDequeuedMsgs();
assertTrue(System.currentTimeMillis() < begin+1000*60*2);
}
assertEquals(initialConflatedMsgs, stats.getAsyncConflatedMsgs());
@@ -530,12 +508,10 @@ public class SlowRecDUnitTest extends CacheTestCase {
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");
@@ -548,7 +524,6 @@ public class SlowRecDUnitTest extends CacheTestCase {
r.invalidate(key);
count ++;
lastValue = CHECK_INVALID;
-// dequeuedMsgs = stats.getAsyncDequeuedMsgs();
assertTrue(System.currentTimeMillis() < begin+1000*60*2);
}
assertEquals(initialConflatedMsgs, stats.getAsyncConflatedMsgs());
@@ -563,8 +538,7 @@ public class SlowRecDUnitTest extends CacheTestCase {
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();
@@ -586,7 +560,6 @@ public class SlowRecDUnitTest extends CacheTestCase {
assertEquals(queuedMsgs, stats.getAsyncQueuedMsgs());
assertEquals(conflatedMsgs, stats.getAsyncConflatedMsgs());
count++;
-// dequeuedMsgs = stats.getAsyncDequeuedMsgs();
endCount = count + 80;
begin = System.currentTimeMillis();
@@ -616,7 +589,6 @@ public class SlowRecDUnitTest extends CacheTestCase {
queuedMsgs++;
assertEquals(queuedMsgs, stats.getAsyncQueuedMsgs());
assertEquals(conflatedMsgs, stats.getAsyncConflatedMsgs());
-// dequeuedMsgs = stats.getAsyncDequeuedMsgs();
assertTrue(System.currentTimeMillis() < begin+1000*60*2);
}
@@ -624,10 +596,12 @@ public class SlowRecDUnitTest extends CacheTestCase {
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 Exception {
final String expected =
"com.gemstone.gemfire.internal.tcp.ConnectionException: Forced disconnect sent to" +
"||java.io.IOException: Broken pipe";
@@ -650,7 +624,6 @@ public class SlowRecDUnitTest extends CacheTestCase {
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];
@@ -692,6 +665,7 @@ public class SlowRecDUnitTest extends CacheTestCase {
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
@@ -699,7 +673,8 @@ public class SlowRecDUnitTest extends CacheTestCase {
* June 2006 due to hangs. Some of the tests, like this one, still need
* work because the periodically (some quite often) fail.
*/
- 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";
@@ -766,8 +741,6 @@ public class SlowRecDUnitTest extends CacheTestCase {
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";
@@ -895,18 +868,11 @@ public class SlowRecDUnitTest extends CacheTestCase {
* June 2006 r13222 in the trunk. This test is failing because conflation
* isn't kicking in for some reason.
*/
- 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") {
@@ -918,6 +884,7 @@ public class SlowRecDUnitTest extends CacheTestCase {
});
}
}
+
protected static ControlListener doTestMultipleRegionConflation_R1_Listener;
protected static ControlListener doTestMultipleRegionConflation_R2_Listener;
private void doTestMultipleRegionConflation() throws Exception {
@@ -1117,18 +1084,11 @@ public class SlowRecDUnitTest extends CacheTestCase {
/**
* Make sure a disconnect causes queue memory to be released.
*/
- public void testDisconnectCleanup() throws Throwable {
+ @Test
+ 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") {
@@ -1140,6 +1100,7 @@ public class SlowRecDUnitTest extends CacheTestCase {
});
}
}
+
protected static ControlListener doTestDisconnectCleanup_Listener;
private void doTestDisconnectCleanup() throws Exception {
final AttributesFactory factory = new AttributesFactory();
@@ -1259,30 +1220,21 @@ public class SlowRecDUnitTest extends CacheTestCase {
}
};
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 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") {
@@ -1294,6 +1246,7 @@ public class SlowRecDUnitTest extends CacheTestCase {
});
}
}
+
protected static ControlListener doTestPartialMessage_Listener;
private void doTestPartialMessage() throws Exception {
final AttributesFactory factory = new AttributesFactory();
@@ -1304,9 +1257,7 @@ public class SlowRecDUnitTest extends CacheTestCase {
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();
@@ -1360,11 +1311,6 @@ public class SlowRecDUnitTest extends CacheTestCase {
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/b914df23/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 8909511..de813ae 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
@@ -26,42 +26,73 @@
* @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;
import com.gemstone.gemfire.distributed.internal.locks.DLockService;
import com.gemstone.gemfire.distributed.internal.membership.InternalDistributedMember;
import com.gemstone.gemfire.distributed.internal.membership.gms.MembershipManagerHelper;
-import com.gemstone.gemfire.internal.cache.*;
+import com.gemstone.gemfire.internal.cache.CommitReplyException;
+import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
+import com.gemstone.gemfire.internal.cache.InternalRegionArguments;
+import com.gemstone.gemfire.internal.cache.LocalRegion;
+import com.gemstone.gemfire.internal.cache.RegionEntry;
+import com.gemstone.gemfire.internal.cache.TXManagerImpl;
+import com.gemstone.gemfire.internal.cache.TXState;
+import com.gemstone.gemfire.internal.cache.TXStateInterface;
+import com.gemstone.gemfire.internal.cache.TXStateProxyImpl;
import com.gemstone.gemfire.internal.cache.locks.TXLockBatch;
import com.gemstone.gemfire.internal.cache.locks.TXLockService;
import com.gemstone.gemfire.internal.cache.locks.TXLockServiceImpl;
-import com.gemstone.gemfire.test.dunit.*;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.IgnoredException;
+import com.gemstone.gemfire.test.dunit.Invoke;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.SerializableCallable;
+import com.gemstone.gemfire.test.dunit.SerializableRunnable;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
import com.gemstone.gemfire.test.junit.categories.FlakyTest;
-import junit.framework.AssertionFailedError;
-import org.junit.Ignore;
-import org.junit.experimental.categories.Category;
-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 static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
-
-//import com.gemstone.gemfire.internal.cache.locks.TXLockId;
-
-public class TXDistributedDUnitTest extends CacheTestCase {
- public TXDistributedDUnitTest(String name) {
- super(name);
- }
+@Category(DistributedTest.class)
+public class TXDistributedDUnitTest extends JUnit4CacheTestCase {
protected RegionAttributes getRegionAttributes() {
return this.getRegionAttributes(Scope.DISTRIBUTED_ACK);
@@ -79,6 +110,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();
@@ -178,6 +210,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";
@@ -420,6 +453,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();
@@ -499,10 +533,9 @@ 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();
-// final TXManagerImpl txMgrImpl = (TXManagerImpl) txMgr;
final String rgnName = getUniqueName();
AttributesFactory factory = new AttributesFactory();
factory.setScope(Scope.DISTRIBUTED_ACK);
@@ -714,7 +747,7 @@ public class TXDistributedDUnitTest extends CacheTestCase {
assertNotNull(re);
assertEquals("val1_3", re.getValue());
break;
- } catch (AssertionFailedError e) {
+ } catch (AssertionError e) {
if (giveUp > System.currentTimeMillis()) {
throw e;
}
@@ -1067,8 +1100,8 @@ 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();
Region rgn = getCache().createRegion(rgnName, getRegionAttributes());
rgn.create("key", null);
@@ -1282,8 +1315,9 @@ public class TXDistributedDUnitTest extends CacheTestCase {
}
}
- @Ignore("Disabled for 51260")
- public void DISABLED_testRemoteCommitFailure() {
+ @Ignore("TODO: Disabled for #51260")
+ @Test
+ public void testRemoteCommitFailure() throws Exception {
try {
disconnectAllFromDS();
final String rgnName1= getUniqueName() + "_1";
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/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 4236dc8..6d0fa35 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,14 +16,19 @@
*/
package com.gemstone.gemfire.cache30;
+import static org.junit.Assert.*;
+
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;
@@ -55,21 +60,27 @@ import com.gemstone.gemfire.test.dunit.Host;
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 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(String name) {
- super(name);
- }
+
+ List expectedKeys;
+ int clCount = 0;
private VM getOtherVm() {
Host host = Host.getHost(0);
@@ -85,6 +96,7 @@ public class TXOrderDUnitTest extends CacheTestCase {
});
this.otherId = (DistributedMember)vm.invoke(() -> TXOrderDUnitTest.getVMDistributedMember());
}
+
private void doCommitOtherVm() {
VM vm = getOtherVm();
vm.invoke(new CacheSerializableRunnable("create root") {
@@ -111,19 +123,16 @@ public class TXOrderDUnitTest extends CacheTestCase {
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
*/
+ @Test
public void testFarSideOrder() throws CacheException {
initOtherId();
AttributesFactory af = new AttributesFactory();
@@ -166,10 +175,11 @@ public class TXOrderDUnitTest extends CacheTestCase {
}
/**
- * test bug#40870
- * @throws Exception
+ * Tests fix for #40870 Remote CacheListeners invoke afterCreate with Operation.LOCAL_LOAD_CREATE when create executed transactionally"
*/
- 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);
@@ -226,6 +236,7 @@ public class TXOrderDUnitTest extends CacheTestCase {
});
}
+ @Test
public void testInternalRegionNotExposed() {
Host host = Host.getHost(0);
VM vm1 = host.getVM(0);
@@ -279,9 +290,11 @@ public class TXOrderDUnitTest extends CacheTestCase {
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();
@@ -292,8 +305,11 @@ public class TXOrderDUnitTest extends CacheTestCase {
}
}
}
- class ExposedRegionCacheListener extends CacheListenerAdapter {
+
+ private static class ExposedRegionCacheListener extends CacheListenerAdapter {
+
private boolean exceptionOccurred = false;
+
@Override
public void afterCreate(EntryEvent event) {
verifyRegion(event);
@@ -309,21 +325,20 @@ public class TXOrderDUnitTest extends CacheTestCase {
}
}
- 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);
}
+ @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/b914df23/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 b4bff79..e4ccc34 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,8 +26,13 @@
*/
package com.gemstone.gemfire.cache30;
+import static org.junit.Assert.*;
+
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;
@@ -39,11 +44,11 @@ import com.gemstone.gemfire.internal.OSProcess;
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 {
protected RegionAttributes getRegionAttributes() {
AttributesFactory factory = new AttributesFactory();
@@ -69,6 +74,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/b914df23/geode-core/src/test/java/com/gemstone/gemfire/codeAnalysis/ClassAndMethodDetails.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/codeAnalysis/ClassAndMethodDetails.java b/geode-core/src/test/java/com/gemstone/gemfire/codeAnalysis/ClassAndMethodDetails.java
index a5dfb12..7e87621 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/codeAnalysis/ClassAndMethodDetails.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/codeAnalysis/ClassAndMethodDetails.java
@@ -1,20 +1,21 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package com.gemstone.gemfire.codeAnalysis;
+
import java.io.IOException;
import java.io.LineNumberReader;
import java.util.ArrayList;
@@ -23,21 +24,18 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import junit.framework.Assert;
-
import com.gemstone.gemfire.codeAnalysis.decode.CompiledClass;
import com.gemstone.gemfire.codeAnalysis.decode.CompiledCode;
import com.gemstone.gemfire.codeAnalysis.decode.CompiledMethod;
-
/**
* A class used to store the names of dataserializable classes and the sizes
* of their toData/fromData methods.
- *
- *
*/
public class ClassAndMethodDetails implements Comparable {
+
static String[] hexChars;
+
public String className;
public Map<String, byte[]> methodCode = new HashMap<String, byte[]>();
@@ -150,4 +148,4 @@ public class ClassAndMethodDetails implements Comparable {
public int compareTo(Object other) {
return this.className.compareTo(((ClassAndMethodDetails)other).className);
}
-}
+}