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/03/18 22:54:54 UTC
[08/11] incubator-geode git commit: GEODE-1050: add JUnit 4 versions
of DistributedTestCase and CacheTestCase
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/disttx/DistTXDebugDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/disttx/DistTXDebugDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/disttx/DistTXDebugDUnitTest.java
deleted file mode 100644
index dcb9ae7..0000000
--- a/geode-core/src/test/java/com/gemstone/gemfire/disttx/DistTXDebugDUnitTest.java
+++ /dev/null
@@ -1,1014 +0,0 @@
-/*
- * 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.disttx;
-
-import java.io.DataInput;
-import java.io.DataOutput;
-import java.io.IOException;
-import java.io.Serializable;
-import java.util.HashMap;
-import java.util.Properties;
-
-import com.gemstone.gemfire.DataSerializable;
-import com.gemstone.gemfire.DataSerializer;
-import com.gemstone.gemfire.cache.AttributesFactory;
-import com.gemstone.gemfire.cache.Cache;
-import com.gemstone.gemfire.cache.CacheException;
-import com.gemstone.gemfire.cache.CacheFactory;
-import com.gemstone.gemfire.cache.CacheTransactionManager;
-import com.gemstone.gemfire.cache.DataPolicy;
-import com.gemstone.gemfire.cache.EntryOperation;
-import com.gemstone.gemfire.cache.PartitionAttributes;
-import com.gemstone.gemfire.cache.PartitionAttributesFactory;
-import com.gemstone.gemfire.cache.PartitionResolver;
-import com.gemstone.gemfire.cache.Region;
-import com.gemstone.gemfire.cache.Scope;
-import com.gemstone.gemfire.cache30.CacheTestCase;
-import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem;
-import com.gemstone.gemfire.internal.cache.PartitionedRegion;
-import com.gemstone.gemfire.internal.cache.control.InternalResourceManager;
-import com.gemstone.gemfire.internal.cache.execute.CustomerIDPartitionResolver;
-import com.gemstone.gemfire.test.dunit.Host;
-import com.gemstone.gemfire.test.dunit.Invoke;
-import com.gemstone.gemfire.test.dunit.LogWriterUtils;
-import com.gemstone.gemfire.test.dunit.SerializableCallable;
-import com.gemstone.gemfire.test.dunit.SerializableRunnable;
-import com.gemstone.gemfire.test.dunit.VM;
-
-public class DistTXDebugDUnitTest extends CacheTestCase {
- VM accessor = null;
- VM dataStore1 = null;
- VM dataStore2 = null;
- VM dataStore3 = null;
-
- public DistTXDebugDUnitTest(String name) {
- super(name);
- }
-
- @Override
- public void setUp() throws Exception {
- super.setUp();
- Host host = Host.getHost(0);
- dataStore1 = host.getVM(0);
- dataStore2 = host.getVM(1);
- dataStore3 = host.getVM(2);
- accessor = host.getVM(3);
- }
-
- @Override
- protected final void postTearDownCacheTestCase() throws Exception {
- Invoke.invokeInEveryVM(new SerializableRunnable() {
- public void run() {
- InternalResourceManager.setResourceObserver(null);
- }
- });
- InternalResourceManager.setResourceObserver(null);
- }
-
- public static void createCacheInVm() {
- new DistTXDebugDUnitTest("temp").getCache();
- }
-
- protected void createCacheInAllVms() {
- dataStore1.invoke(() -> DistTXDebugDUnitTest.createCacheInVm());
- dataStore2.invoke(() -> DistTXDebugDUnitTest.createCacheInVm());
- dataStore3.invoke(() -> DistTXDebugDUnitTest.createCacheInVm());
- accessor.invoke(() -> DistTXDebugDUnitTest.createCacheInVm());
- }
-
- public static void createPR(String partitionedRegionName, Integer redundancy,
- Integer localMaxMemory, Integer totalNumBuckets, Object colocatedWith,
- Boolean isPartitionResolver) {
- createPR(partitionedRegionName, redundancy, localMaxMemory,
- totalNumBuckets, colocatedWith, isPartitionResolver,
- Boolean.TRUE/*Concurrency checks; By default is false*/);
- }
-
- public static void createPR(String partitionedRegionName, Integer redundancy,
- Integer localMaxMemory, Integer totalNumBuckets, Object colocatedWith,
- Boolean isPartitionResolver, Boolean concurrencyChecks) {
- PartitionAttributesFactory paf = new PartitionAttributesFactory();
-
- paf.setRedundantCopies(redundancy.intValue());
- if (localMaxMemory != null) {
- paf.setLocalMaxMemory(localMaxMemory.intValue());
- }
- if (totalNumBuckets != null) {
- paf.setTotalNumBuckets(totalNumBuckets.intValue());
- }
- if (colocatedWith != null) {
- paf.setColocatedWith((String) colocatedWith);
- }
- if (isPartitionResolver.booleanValue()) {
- paf.setPartitionResolver(new CustomerIDPartitionResolver(
- "CustomerIDPartitionResolver"));
- }
- PartitionAttributes prAttr = paf.create();
- AttributesFactory attr = new AttributesFactory();
- attr.setPartitionAttributes(prAttr);
- attr.setConcurrencyChecksEnabled(concurrencyChecks);
- // assertNotNull(basicGetCache());
- // Region pr = basicGetCache().createRegion(partitionedRegionName,
- // attr.create());
- assertNotNull(cache);
- Region pr = cache.createRegion(partitionedRegionName, attr.create());
- assertNotNull(pr);
- LogWriterUtils.getLogWriter().info(
- "Partitioned Region " + partitionedRegionName
- + " created Successfully :" + pr.toString());
- }
-
- protected void createPartitionedRegion(Object[] attributes) {
- dataStore1.invoke(DistTXDebugDUnitTest.class, "createPR", attributes);
- dataStore2.invoke(DistTXDebugDUnitTest.class, "createPR", attributes);
- dataStore3.invoke(DistTXDebugDUnitTest.class, "createPR", attributes);
- // make Local max memory = o for accessor
- attributes[2] = new Integer(0);
- accessor.invoke(DistTXDebugDUnitTest.class, "createPR", attributes);
- }
-
- public static void destroyPR(String partitionedRegionName) {
- // assertNotNull(basicGetCache());
- // Region pr = basicGetCache().getRegion(partitionedRegionName);
-
- assertNotNull(cache);
- Region pr = cache.getRegion(partitionedRegionName);
- assertNotNull(pr);
- LogWriterUtils.getLogWriter().info(
- "Destroying Partitioned Region " + partitionedRegionName);
- pr.destroyRegion();
- }
-
- public static void createRR(String replicatedRegionName, boolean empty) {
- AttributesFactory af = new AttributesFactory();
- af.setScope(Scope.DISTRIBUTED_ACK);
- if (empty) {
- af.setDataPolicy(DataPolicy.EMPTY);
- } else {
- af.setDataPolicy(DataPolicy.REPLICATE);
- }
- // Region rr = basicGetCache().createRegion(replicatedRegionName,
- // af.create());
- Region rr = cache.createRegion(replicatedRegionName, af.create());
- assertNotNull(rr);
- LogWriterUtils.getLogWriter().info(
- "Replicated Region " + replicatedRegionName + " created Successfully :"
- + rr.toString());
- }
-
- protected void createReplicatedRegion(Object[] attributes) {
- dataStore1.invoke(DistTXDebugDUnitTest.class, "createRR", attributes);
- dataStore2.invoke(DistTXDebugDUnitTest.class, "createRR", attributes);
- dataStore3.invoke(DistTXDebugDUnitTest.class, "createRR", attributes);
- // DataPolicy.EMPTY for accessor
- attributes[1] = Boolean.TRUE;
- accessor.invoke(DistTXDebugDUnitTest.class, "createRR", attributes);
- }
-
- public void testTXPR() throws Exception {
- createCacheInAllVms();
- Object[] prAttrs = new Object[] { "pregion1", 1, null, 3, null,
- Boolean.FALSE, Boolean.FALSE };
- createPartitionedRegion(prAttrs);
-
- SerializableCallable TxOps = new SerializableCallable("TxOps") {
- @Override
- public Object call() throws CacheException {
- // PartitionedRegion pr1 = (PartitionedRegion)
- // basicGetCache().getRegion(
- // "pregion1");
- PartitionedRegion pr1 = (PartitionedRegion) cache.getRegion("pregion1");
- // put some data (non tx ops)
- for (int i = 1; i <= 3; i++) {
- DummyKeyBasedRoutingResolver dummy = new DummyKeyBasedRoutingResolver(
- i);
- LogWriterUtils.getLogWriter().info(" calling pr.put");
- pr1.put(dummy, "1_entry__" + i);
- }
-
- // put in tx and commit
- // CacheTransactionManager ctx = basicGetCache()
- // .getCacheTransactionManager();
- CacheTransactionManager ctx = cache.getCacheTransactionManager();
- ctx.setDistributed(true);
- ctx.begin();
- for (int i = 1; i <= 3; i++) {
- DummyKeyBasedRoutingResolver dummy = new DummyKeyBasedRoutingResolver(
- i);
- LogWriterUtils.getLogWriter().info(" calling pr.put in tx 1");
- pr1.put(dummy, "2_entry__" + i);
- }
- ctx.commit();
-
- // verify the data
- for (int i = 1; i <= 3; i++) {
- DummyKeyBasedRoutingResolver dummy = new DummyKeyBasedRoutingResolver(
- i);
- LogWriterUtils.getLogWriter().info(" calling pr.get");
- assertEquals("2_entry__" + i, pr1.get(dummy));
- }
-
- // put data in tx and rollback
- ctx.begin();
- for (int i = 1; i <= 3; i++) {
- DummyKeyBasedRoutingResolver dummy = new DummyKeyBasedRoutingResolver(
- i);
- LogWriterUtils.getLogWriter().info(" calling pr.put in tx 2");
- pr1.put(dummy, "3_entry__" + i);
- }
- ctx.rollback();
-
- // verify the data
- for (int i = 1; i <= 3; i++) {
- DummyKeyBasedRoutingResolver dummy = new DummyKeyBasedRoutingResolver(
- i);
- LogWriterUtils.getLogWriter().info(" calling pr.get");
- assertEquals("2_entry__" + i, pr1.get(dummy));
- }
-
- // destroy data in tx and commit
- ctx.begin();
- for (int i = 1; i <= 3; i++) {
- DummyKeyBasedRoutingResolver dummy = new DummyKeyBasedRoutingResolver(
- i);
- LogWriterUtils.getLogWriter().info(" calling pr.destroy in tx 3");
- pr1.destroy(dummy);
- }
- ctx.commit();
-
- // verify the data
- for (int i = 1; i <= 3; i++) {
- DummyKeyBasedRoutingResolver dummy = new DummyKeyBasedRoutingResolver(
- i);
- LogWriterUtils.getLogWriter().info(" calling pr.get");
- assertEquals(null, pr1.get(dummy));
- }
-
- // verify data size on all replicas
- SerializableCallable verifySize = new SerializableCallable("getOps") {
- @Override
- public Object call() throws CacheException {
- PartitionedRegion pr1 = (PartitionedRegion) cache
- .getRegion("pregion1");
- LogWriterUtils.getLogWriter().info(
- " calling pr.getLocalSize " + pr1.getLocalSize());
- assertEquals(0, pr1.getLocalSize());
- return null;
- }
- };
- dataStore1.invoke(verifySize);
- dataStore2.invoke(verifySize);
- dataStore3.invoke(verifySize);
-
- return null;
- }
- };
-
- accessor.invoke(TxOps);
-
- accessor.invoke(() -> DistTXDebugDUnitTest.destroyPR( "pregion1" ));
- }
-
- public void testTXDestroy_invalidate() throws Exception {
- createCacheInAllVms();
- Object[] prAttrs = new Object[] { "pregion1", 1, null, 3, null,
- Boolean.FALSE, Boolean.FALSE };
- createPartitionedRegion(prAttrs);
-
- Object[] rrAttrs = new Object[] { "rregion1", Boolean.FALSE };
- createReplicatedRegion(rrAttrs);
-
- SerializableCallable TxOps = new SerializableCallable("TxOps") {
- @Override
- public Object call() throws CacheException {
- PartitionedRegion pr1 = (PartitionedRegion) cache.getRegion("pregion1");
- Region rr1 = cache.getRegion("rregion1");
-
- // put some data (non tx ops)
- for (int i = 1; i <= 6; i++) {
- DummyKeyBasedRoutingResolver dummy = new DummyKeyBasedRoutingResolver(
- i);
- LogWriterUtils.getLogWriter().info(" calling non-tx put");
- pr1.put(dummy, "1_entry__" + i);
- rr1.put(dummy, "1_entry__" + i);
- }
-
- CacheTransactionManager ctx = cache.getCacheTransactionManager();
- ctx.setDistributed(true);
- // destroy data in tx and commit
- ctx.begin();
- for (int i = 1; i <= 3; i++) {
- DummyKeyBasedRoutingResolver dummy = new DummyKeyBasedRoutingResolver(
- i);
- LogWriterUtils.getLogWriter().info(
- " calling pr1.destroy in tx key=" + dummy);
- pr1.destroy(dummy);
- LogWriterUtils.getLogWriter().info(" calling rr1.destroy in tx key=" + i);
- rr1.destroy(dummy);
- }
- for (int i = 4; i <= 6; i++) {
- DummyKeyBasedRoutingResolver dummy = new DummyKeyBasedRoutingResolver(
- i);
- LogWriterUtils.getLogWriter().info(
- " calling pr1.invalidate in tx key=" + dummy);
- pr1.invalidate(dummy);
- LogWriterUtils.getLogWriter().info(" calling rr1.invalidate in tx key=" + i);
- rr1.invalidate(dummy);
- }
- ctx.commit();
-
- // verify the data
- for (int i = 1; i <= 6; i++) {
- DummyKeyBasedRoutingResolver dummy = new DummyKeyBasedRoutingResolver(
- i);
- LogWriterUtils.getLogWriter().info(" calling pr1.get");
- assertEquals(null, pr1.get(dummy));
- LogWriterUtils.getLogWriter().info(" calling rr1.get");
- assertEquals(null, rr1.get(i));
- }
- return null;
- }
- };
-
- accessor.invoke(TxOps);
-
- // verify data size on all replicas
- SerializableCallable verifySize = new SerializableCallable("getOps") {
- @Override
- public Object call() throws CacheException {
- PartitionedRegion pr1 = (PartitionedRegion) cache.getRegion("pregion1");
- Region rr1 = cache.getRegion("rregion1");
- LogWriterUtils.getLogWriter().info(
- " calling pr1.getLocalSize " + pr1.getLocalSize());
- assertEquals(2, pr1.getLocalSize());
- LogWriterUtils.getLogWriter().info(" calling rr1.size " + rr1.size());
- assertEquals(3, rr1.size());
- return null;
- }
- };
- dataStore1.invoke(verifySize);
- dataStore2.invoke(verifySize);
- dataStore3.invoke(verifySize);
-
- accessor.invoke(() -> DistTXDebugDUnitTest.destroyPR( "pregion1" ));
- }
-
- public void testTXPR_RR() throws Exception {
- createCacheInAllVms();
- Object[] prAttrs = new Object[] { "pregion1", 1, null, 3, null,
- Boolean.FALSE, Boolean.FALSE };
- createPartitionedRegion(prAttrs);
-
- Object[] rrAttrs = new Object[] { "rregion1", Boolean.FALSE };
- createReplicatedRegion(rrAttrs);
-
- SerializableCallable TxOps = new SerializableCallable("TxOps") {
- @Override
- public Object call() throws CacheException {
- // PartitionedRegion pr1 = (PartitionedRegion)
- // basicGetCache().getRegion(
- // "pregion1");
- PartitionedRegion pr1 = (PartitionedRegion) cache.getRegion("pregion1");
- // Region rr1 = basicGetCache().getRegion("rregion1");
- Region rr1 = cache.getRegion("rregion1");
- // put some data (non tx ops)
- for (int i = 1; i <= 3; i++) {
- DummyKeyBasedRoutingResolver dummy = new DummyKeyBasedRoutingResolver(
- i);
- LogWriterUtils.getLogWriter().info(" calling pr.put non-tx PR1_entry__" + i);
- pr1.put(dummy, "PR1_entry__" + i);
- LogWriterUtils.getLogWriter().info(" calling rr.put non-tx RR1_entry__" + i);
- rr1.put(new Integer(i), "RR1_entry__" + i);
- }
-
- // put in tx and commit
- // CacheTransactionManager ctx = basicGetCache()
- // .getCacheTransactionManager();
- CacheTransactionManager ctx = cache.getCacheTransactionManager();
- ctx.setDistributed(true);
- ctx.begin();
- for (int i = 1; i <= 3; i++) {
- DummyKeyBasedRoutingResolver dummy = new DummyKeyBasedRoutingResolver(
- i);
- LogWriterUtils.getLogWriter().info(" calling pr.put in tx PR2_entry__" + i);
- pr1.put(dummy, "PR2_entry__" + i);
- LogWriterUtils.getLogWriter().info(" calling rr.put in tx RR2_entry__" + i);
- rr1.put(new Integer(i), "RR2_entry__" + i);
- }
- ctx.commit();
-
- // verify the data
- for (int i = 1; i <= 3; i++) {
- DummyKeyBasedRoutingResolver dummy = new DummyKeyBasedRoutingResolver(
- i);
- LogWriterUtils.getLogWriter().info(" calling pr.get PR2_entry__" + i);
- assertEquals("PR2_entry__" + i, pr1.get(dummy));
- LogWriterUtils.getLogWriter().info(" calling rr.get RR2_entry__" + i);
- assertEquals("RR2_entry__" + i, rr1.get(new Integer(i)));
- }
- return null;
- }
- };
-
- accessor.invoke(TxOps);
-
- // verify data size on all replicas
- SerializableCallable verifySize = new SerializableCallable("getOps") {
- @Override
- public Object call() throws CacheException {
- PartitionedRegion pr1 = (PartitionedRegion) cache.getRegion("pregion1");
- LogWriterUtils.getLogWriter().info(
- " calling pr.getLocalSize " + pr1.getLocalSize());
- assertEquals(2, pr1.getLocalSize());
-
- Region rr1 = cache.getRegion("rregion1");
- LogWriterUtils.getLogWriter()
- .info(" calling rr.getLocalSize " + rr1.size());
- assertEquals(3, rr1.size());
- return null;
- }
- };
- dataStore1.invoke(verifySize);
- dataStore2.invoke(verifySize);
- dataStore3.invoke(verifySize);
-
- accessor.invoke(() -> DistTXDebugDUnitTest.destroyPR( "pregion1" ));
- }
-
- public void testTXPR2() throws Exception {
- createCacheInAllVms();
- Object[] prAttrs = new Object[] { "pregion1", 1, null, 3, null,
- Boolean.FALSE, Boolean.FALSE };
- createPartitionedRegion(prAttrs);
-
- SerializableCallable TxOps = new SerializableCallable("TxOps") {
- @Override
- public Object call() throws CacheException {
- // PartitionedRegion pr1 = (PartitionedRegion)
- // basicGetCache().getRegion(
- // "pregion1");
- PartitionedRegion pr1 = (PartitionedRegion) cache.getRegion("pregion1");
-
- // put in tx and commit
- // CacheTransactionManager ctx = basicGetCache()
- // .getCacheTransactionManager();
- CacheTransactionManager ctx = cache.getCacheTransactionManager();
- ctx.setDistributed(true);
- ctx.begin();
- for (int i = 1; i <= 3; i++) {
- DummyKeyBasedRoutingResolver dummy = new DummyKeyBasedRoutingResolver(
- i);
- LogWriterUtils.getLogWriter().info(" calling pr.put in tx 1");
- pr1.put(dummy, "2_entry__" + i);
- }
- ctx.commit();
-
- // verify the data
- for (int i = 1; i <= 3; i++) {
- DummyKeyBasedRoutingResolver dummy = new DummyKeyBasedRoutingResolver(
- i);
- LogWriterUtils.getLogWriter().info(" calling pr.get " + pr1.get(dummy));
- assertEquals("2_entry__" + i, pr1.get(dummy));
- }
- return null;
- }
- };
-
- accessor.invoke(TxOps);
-
- SerializableCallable TxGetOps = new SerializableCallable("TxGetOps") {
- @Override
- public Object call() throws CacheException {
- PartitionedRegion pr1 = (PartitionedRegion) cache.getRegion("pregion1");
- CacheTransactionManager ctx = cache.getCacheTransactionManager();
- LogWriterUtils.getLogWriter().info(
- " calling pr.getLocalSize " + pr1.getLocalSize());
- assertEquals(2, pr1.getLocalSize());
- return null;
- }
- };
-
- dataStore1.invoke(TxGetOps);
- dataStore2.invoke(TxGetOps);
- dataStore3.invoke(TxGetOps);
-
- SerializableCallable TxRollbackOps = new SerializableCallable("TxOps") {
- @Override
- public Object call() throws CacheException {
- // PartitionedRegion pr1 = (PartitionedRegion)
- // basicGetCache().getRegion(
- // "pregion1");
- PartitionedRegion pr1 = (PartitionedRegion) cache.getRegion("pregion1");
-
- // put in tx and commit
- // CacheTransactionManager ctx = basicGetCache()
- // .getCacheTransactionManager();
- CacheTransactionManager ctx = cache.getCacheTransactionManager();
- ctx.setDistributed(true);
- ctx.begin();
- for (int i = 1; i <= 3; i++) {
- DummyKeyBasedRoutingResolver dummy = new DummyKeyBasedRoutingResolver(
- i);
- LogWriterUtils.getLogWriter().info(
- " calling pr.put in tx for rollback no_entry__" + i);
- pr1.put(dummy, "no_entry__" + i);
- }
- ctx.rollback();
-
- // verify the data
- for (int i = 1; i <= 3; i++) {
- DummyKeyBasedRoutingResolver dummy = new DummyKeyBasedRoutingResolver(
- i);
- LogWriterUtils.getLogWriter().info(
- " calling pr.get after rollback " + pr1.get(dummy));
- assertEquals("2_entry__" + i, pr1.get(dummy));
- }
- return null;
- }
- };
-
- accessor.invoke(TxRollbackOps);
-
- accessor.invoke(() -> DistTXDebugDUnitTest.destroyPR( "pregion1" ));
- }
-
- public void testTXPRRR2_create() throws Exception {
- createCacheInAllVms();
- Object[] prAttrs = new Object[] { "pregion1", 1, null, 3, null,
- Boolean.FALSE, Boolean.FALSE };
- createPartitionedRegion(prAttrs);
-
- Object[] rrAttrs = new Object[] { "rregion1", Boolean.FALSE };
- createReplicatedRegion(rrAttrs);
-
- SerializableCallable TxOps = new SerializableCallable("TxOps") {
- @Override
- public Object call() throws CacheException {
- PartitionedRegion pr1 = (PartitionedRegion) cache.getRegion("pregion1");
- Region rr1 = cache.getRegion("rregion1");
- CacheTransactionManager ctx = cache.getCacheTransactionManager();
- ctx.setDistributed(true);
- ctx.begin();
- for (int i = 1; i <= 3; i++) {
- DummyKeyBasedRoutingResolver dummy = new DummyKeyBasedRoutingResolver(
- i);
- LogWriterUtils.getLogWriter().info(" calling pr.create in tx 1");
- pr1.create(dummy, "2_entry__" + i);
-
- LogWriterUtils.getLogWriter().info(" calling rr.create " + "2_entry__" + i);
- rr1.create(new Integer(i), "2_entry__" + i);
- }
- ctx.commit();
-
- // verify the data
- for (int i = 1; i <= 3; i++) {
- DummyKeyBasedRoutingResolver dummy = new DummyKeyBasedRoutingResolver(
- i);
- LogWriterUtils.getLogWriter().info(" calling pr.get " + pr1.get(dummy));
- assertEquals("2_entry__" + i, pr1.get(dummy));
-
- LogWriterUtils.getLogWriter().info(
- " calling rr.get " + rr1.get(new Integer(i)));
- assertEquals("2_entry__" + i, rr1.get(new Integer(i)));
- }
- return null;
- }
- };
-
- accessor.invoke(TxOps);
-
- // verify data size on all replicas
- SerializableCallable verifySize = new SerializableCallable("getOps") {
- @Override
- public Object call() throws CacheException {
- Region rr1 = cache.getRegion("rregion1");
- LogWriterUtils.getLogWriter()
- .info(" calling rr.getLocalSize " + rr1.size());
- assertEquals(3, rr1.size());
-
- PartitionedRegion pr1 = (PartitionedRegion) cache.getRegion("pregion1");
- LogWriterUtils.getLogWriter().info(
- " calling pr.getLocalSize " + pr1.getLocalSize());
- assertEquals(2, pr1.getLocalSize());
- return null;
- }
- };
- dataStore1.invoke(verifySize);
- dataStore2.invoke(verifySize);
- dataStore3.invoke(verifySize);
- }
-
- public void testTXPRRR2_putall() throws Exception {
- createCacheInAllVms();
- Object[] prAttrs = new Object[] { "pregion1", 1, null, 3, null,
- Boolean.FALSE, Boolean.FALSE };
- createPartitionedRegion(prAttrs);
-
- Object[] rrAttrs = new Object[] { "rregion1", Boolean.FALSE };
- createReplicatedRegion(rrAttrs);
-
- SerializableCallable TxOps = new SerializableCallable("TxOps") {
- @Override
- public Object call() throws CacheException {
- PartitionedRegion pr1 = (PartitionedRegion) cache.getRegion("pregion1");
- Region rr1 = cache.getRegion("rregion1");
-
- CacheTransactionManager ctx = cache.getCacheTransactionManager();
- ctx.setDistributed(true);
- ctx.begin();
- HashMap<DummyKeyBasedRoutingResolver, String> phm = new HashMap<DummyKeyBasedRoutingResolver, String>();
- HashMap<Integer, String> rhm = new HashMap<Integer, String>();
- for (int i = 1; i <= 3; i++) {
- DummyKeyBasedRoutingResolver dummy = new DummyKeyBasedRoutingResolver(
- i);
- phm.put(dummy, "2_entry__" + i);
- rhm.put(i, "2_entry__" + i);
- }
- pr1.putAll(phm);
- rr1.putAll(rhm);
- ctx.commit();
-
- // verify the data
- for (int i = 1; i <= 3; i++) {
- DummyKeyBasedRoutingResolver dummy = new DummyKeyBasedRoutingResolver(
- i);
- LogWriterUtils.getLogWriter().info(" calling pr.get " + pr1.get(dummy));
- assertEquals("2_entry__" + i, pr1.get(dummy));
-
- LogWriterUtils.getLogWriter().info(
- " calling rr.get " + rr1.get(new Integer(i)));
- assertEquals("2_entry__" + i, rr1.get(new Integer(i)));
- }
- return null;
- }
- };
-
- accessor.invoke(TxOps);
-
- // verify data size on all replicas
- SerializableCallable verifySize = new SerializableCallable("getOps") {
- @Override
- public Object call() throws CacheException {
- Region rr1 = cache.getRegion("rregion1");
- LogWriterUtils.getLogWriter()
- .info(" calling rr.getLocalSize " + rr1.size());
- assertEquals(3, rr1.size());
-
- PartitionedRegion pr1 = (PartitionedRegion) cache.getRegion("pregion1");
- LogWriterUtils.getLogWriter().info(
- " calling pr.getLocalSize " + pr1.getLocalSize());
- assertEquals(2, pr1.getLocalSize());
- return null;
- }
- };
- dataStore1.invoke(verifySize);
- dataStore2.invoke(verifySize);
- dataStore3.invoke(verifySize);
-
-// accessor.invoke(TxOps);
- }
-
- public void testTXPR_putall() throws Exception {
- createCacheInAllVms();
- Object[] prAttrs = new Object[] { "pregion1", 1, null, 3, null,
- Boolean.FALSE, Boolean.FALSE };
- createPartitionedRegion(prAttrs);
-
- SerializableCallable TxOps = new SerializableCallable("TxOps") {
- @Override
- public Object call() throws CacheException {
- PartitionedRegion pr1 = (PartitionedRegion) cache.getRegion("pregion1");
-
- CacheTransactionManager ctx = cache.getCacheTransactionManager();
- ctx.setDistributed(true);
- ctx.begin();
- HashMap<DummyKeyBasedRoutingResolver, String> phm = new HashMap<DummyKeyBasedRoutingResolver, String>();
- HashMap<Integer, String> rhm = new HashMap<Integer, String>();
- for (int i = 1; i <= 3; i++) {
- DummyKeyBasedRoutingResolver dummy = new DummyKeyBasedRoutingResolver(
- i);
- phm.put(dummy, "2_entry__" + i);
- }
- pr1.putAll(phm);
- ctx.commit();
-
- // verify the data
- for (int i = 1; i <= 3; i++) {
- DummyKeyBasedRoutingResolver dummy = new DummyKeyBasedRoutingResolver(
- i);
- LogWriterUtils.getLogWriter().info(" calling pr.get " + pr1.get(dummy));
- assertEquals("2_entry__" + i, pr1.get(dummy));
-
- }
- return null;
- }
- };
-
-// dataStore1.invoke(TxOps);
- accessor.invoke(TxOps);
-
- // verify data size on all replicas
- SerializableCallable verifySize = new SerializableCallable("getOps") {
- @Override
- public Object call() throws CacheException {
- PartitionedRegion pr1 = (PartitionedRegion) cache.getRegion("pregion1");
- LogWriterUtils.getLogWriter().info(
- " calling pr.getLocalSize " + pr1.getLocalSize());
- assertEquals(2, pr1.getLocalSize());
- return null;
- }
- };
- dataStore1.invoke(verifySize);
- dataStore2.invoke(verifySize);
- dataStore3.invoke(verifySize);
-
-// accessor.invoke(TxOps);
- }
-
-
- public void testTXRR_removeAll() throws Exception {
- performRR_removeAllTest(false);
- }
-
- public void testTXRR_removeAll_dataNodeAsCoordinator() throws Exception {
- performRR_removeAllTest(true);
- }
-
- /**
- * @param dataNodeAsCoordinator TODO
- *
- */
- private void performRR_removeAllTest(boolean dataNodeAsCoordinator) {
- createCacheInAllVms();
- Object[] rrAttrs = new Object[] { "rregion1", Boolean.FALSE };
- createReplicatedRegion(rrAttrs);
-
- SerializableCallable TxOps = new SerializableCallable("TxOps") {
- @Override
- public Object call() throws CacheException {
- Region rr1 = cache.getRegion("rregion1");
- //put some data
- HashMap<Integer, String> rhm = new HashMap<Integer, String>();
- for (int i = 1; i <= 3; i++) {
- rhm.put(i, "2_entry__" + i);
- }
- rr1.putAll(rhm);
-
- CacheTransactionManager ctx = cache.getCacheTransactionManager();
- ctx.setDistributed(true);
- ctx.begin();
- rr1.removeAll(rhm.keySet());
-
- ctx.commit();
-
- // verify the data
- for (int i = 1; i <= 3; i++) {
- LogWriterUtils.getLogWriter().info(
- " calling rr.get " + rr1.get(new Integer(i)));
- assertEquals(null, rr1.get(new Integer(i)));
- }
- return null;
- }
- };
-
- if (dataNodeAsCoordinator) {
- dataStore1.invoke(TxOps);
- } else {
- accessor.invoke(TxOps);
- }
-
- // verify data size on all replicas
- SerializableCallable verifySize = new SerializableCallable("getOps") {
- @Override
- public Object call() throws CacheException {
- Region rr1 = cache.getRegion("rregion1");
- LogWriterUtils.getLogWriter()
- .info(" calling rr.getLocalSize " + rr1.size());
- assertEquals(0, rr1.size());
- return null;
- }
- };
- dataStore1.invoke(verifySize);
- dataStore2.invoke(verifySize);
- dataStore3.invoke(verifySize);
-
-// accessor.invoke(TxOps);
- }
-
- public void testTXPR_removeAll() throws Exception {
- createCacheInAllVms();
- Object[] prAttrs = new Object[] { "pregion1", 1, null, 3, null,
- Boolean.FALSE, Boolean.FALSE };
- createPartitionedRegion(prAttrs);
-
- SerializableCallable TxOps = new SerializableCallable("TxOps") {
- @Override
- public Object call() throws CacheException {
- PartitionedRegion pr1 = (PartitionedRegion) cache.getRegion("pregion1");
- HashMap<DummyKeyBasedRoutingResolver, String> phm = new HashMap<DummyKeyBasedRoutingResolver, String>();
- for (int i = 1; i <= 3; i++) {
- DummyKeyBasedRoutingResolver dummy = new DummyKeyBasedRoutingResolver(
- i);
- phm.put(dummy, "2_entry__" + i);
- }
- pr1.putAll(phm);
-
- CacheTransactionManager ctx = cache.getCacheTransactionManager();
- ctx.setDistributed(true);
- ctx.begin();
- pr1.removeAll(phm.keySet());
- ctx.commit();
-
- // verify the data
- for (int i = 1; i <= 3; i++) {
- DummyKeyBasedRoutingResolver dummy = new DummyKeyBasedRoutingResolver(
- i);
- LogWriterUtils.getLogWriter().info(" calling pr.get " + pr1.get(dummy));
- assertEquals(null, pr1.get(dummy));
- }
- return null;
- }
- };
-
- accessor.invoke(TxOps);
-
- // verify data size on all replicas
- SerializableCallable verifySize = new SerializableCallable("getOps") {
- @Override
- public Object call() throws CacheException {
- PartitionedRegion pr1 = (PartitionedRegion) cache.getRegion("pregion1");
- LogWriterUtils.getLogWriter().info(
- " calling pr.getLocalSize " + pr1.getLocalSize());
- assertEquals(0, pr1.getLocalSize());
- return null;
- }
- };
- dataStore1.invoke(verifySize);
- dataStore2.invoke(verifySize);
- dataStore3.invoke(verifySize);
-
-// accessor.invoke(TxOps);
- }
-
-
- public void performTXRRtestOps(boolean makeDatNodeAsCoordinator) {
- createCacheInAllVms();
- Object[] prAttrs = new Object[] { "pregion1", 1, null, 3, null,
- Boolean.FALSE, Boolean.FALSE };
- createPartitionedRegion(prAttrs);
-
- Object[] rrAttrs = new Object[] { "rregion1", Boolean.FALSE };
- createReplicatedRegion(rrAttrs);
-
- SerializableCallable TxOps = new SerializableCallable("TxOps") {
- @Override
- public Object call() throws CacheException {
- Region rr1 = cache.getRegion("rregion1");
- CacheTransactionManager ctx = cache.getCacheTransactionManager();
- ctx.setDistributed(true);
- ctx.begin();
- for (int i = 1; i <= 3; i++) {
- LogWriterUtils.getLogWriter().info(" calling rr.put " + "2_entry__" + i);
- rr1.put(new Integer(i), "2_entry__" + i);
- }
- ctx.commit();
-
- // verify the data
- for (int i = 1; i <= 3; i++) {
- LogWriterUtils.getLogWriter().info(
- " calling rr.get " + rr1.get(new Integer(i)));
- assertEquals("2_entry__" + i, rr1.get(new Integer(i)));
- }
- return null;
- }
- };
-
- if (makeDatNodeAsCoordinator) {
- dataStore1.invoke(TxOps);
- } else {
- accessor.invoke(TxOps);
- }
-
- // verify data size on all replicas
- SerializableCallable verifySize = new SerializableCallable("getOps") {
- @Override
- public Object call() throws CacheException {
- Region rr1 = cache.getRegion("rregion1");
- LogWriterUtils.getLogWriter()
- .info(" calling rr.getLocalSize " + rr1.size());
- assertEquals(3, rr1.size());
- return null;
- }
- };
- dataStore1.invoke(verifySize);
- dataStore2.invoke(verifySize);
- dataStore3.invoke(verifySize);
-
- SerializableCallable TxRollbackOps = new SerializableCallable("TxOps") {
- @Override
- public Object call() throws CacheException {
- Region rr1 = cache.getRegion("rregion1");
- CacheTransactionManager ctx = cache.getCacheTransactionManager();
- ctx.setDistributed(true);
- ctx.begin();
- for (int i = 1; i <= 3; i++) {
- LogWriterUtils.getLogWriter().info(
- " calling rr.put for rollback no_entry__" + i);
- rr1.put(new Integer(i), "no_entry__" + i);
- }
- ctx.rollback();
- ;
-
- // verify the data
- for (int i = 1; i <= 3; i++) {
- LogWriterUtils.getLogWriter().info(
- " calling rr.get after rollback "
- + rr1.get(new Integer(i)));
- assertEquals("2_entry__" + i, rr1.get(new Integer(i)));
- }
- return null;
- }
- };
-
- if (makeDatNodeAsCoordinator) {
- dataStore1.invoke(TxRollbackOps);
- } else {
- accessor.invoke(TxRollbackOps);
- }
- }
-
-
- public void testTXRR2() throws Exception {
- performTXRRtestOps(false); // actual test
- }
-
- public void testTXRR2_dataNodeAsCoordinator() throws Exception {
- performTXRRtestOps(true);
- }
-}
-
-class DummyKeyBasedRoutingResolver implements PartitionResolver,
- DataSerializable {
- Integer dummyID;
-
- public DummyKeyBasedRoutingResolver() {
- }
-
- public DummyKeyBasedRoutingResolver(int id) {
- this.dummyID = new Integer(id);
- }
-
- public String getName() {
- // TODO Auto-generated method stub
- return null;
- }
-
- public Serializable getRoutingObject(EntryOperation opDetails) {
- return (Serializable) opDetails.getKey();
- }
-
- public void close() {
- // TODO Auto-generated method stub
- }
-
- public void fromData(DataInput in) throws IOException, ClassNotFoundException {
- this.dummyID = DataSerializer.readInteger(in);
- }
-
- public void toData(DataOutput out) throws IOException {
- DataSerializer.writeInteger(this.dummyID, out);
- }
-
- @Override
- public int hashCode() {
- int i = this.dummyID.intValue();
- return i;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o)
- return true;
-
- if (!(o instanceof DummyKeyBasedRoutingResolver))
- return false;
-
- DummyKeyBasedRoutingResolver otherDummyID = (DummyKeyBasedRoutingResolver) o;
- return (otherDummyID.dummyID.equals(dummyID));
-
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/disttx/DistTXDistributedTestSuite.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/disttx/DistTXDistributedTestSuite.java b/geode-core/src/test/java/com/gemstone/gemfire/disttx/DistTXDistributedTestSuite.java
deleted file mode 100644
index 3b829c1..0000000
--- a/geode-core/src/test/java/com/gemstone/gemfire/disttx/DistTXDistributedTestSuite.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * 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.disttx;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- CacheMapDistTXDUnitTest.class,
- DistributedTransactionDUnitTest.class,
- DistTXDebugDUnitTest.class,
- DistTXOrderDUnitTest.class,
- DistTXPersistentDebugDUnitTest.class,
- DistTXRestrictionsDUnitTest.class,
- DistTXWithDeltaDUnitTest.class,
- PersistentPartitionedRegionWithDistTXDUnitTest.class,
- PRDistTXDUnitTest.class,
- PRDistTXWithVersionsDUnitTest.class
-})
-
-/**
- * Suite of tests for distributed transactions dunit tests
- * @author shirishd
- */
-public class DistTXDistributedTestSuite {
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/disttx/DistTXPersistentDebugDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/disttx/DistTXPersistentDebugDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/disttx/DistTXPersistentDebugDUnitTest.java
index 2cfeae7..097c37c 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/disttx/DistTXPersistentDebugDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/disttx/DistTXPersistentDebugDUnitTest.java
@@ -31,15 +31,14 @@ import com.gemstone.gemfire.test.dunit.Invoke;
import com.gemstone.gemfire.test.dunit.LogWriterUtils;
import com.gemstone.gemfire.test.dunit.SerializableCallable;
-public class DistTXPersistentDebugDUnitTest extends DistTXDebugDUnitTest {
+public class DistTXPersistentDebugDUnitTest extends DistTXDebugDUnitDisabledTest {
public DistTXPersistentDebugDUnitTest(String name) {
super(name);
}
@Override
- public void setUp() throws Exception {
- super.setUp();
+ public final void postSetUpDistTXDebugDUnitTest() throws Exception {
Invoke.invokeInEveryVM(new SerializableCallable() {
@Override
public Object call() throws Exception {
@@ -51,7 +50,7 @@ public class DistTXPersistentDebugDUnitTest extends DistTXDebugDUnitTest {
}
@Override
- protected final void preTearDownCacheTestCase() throws Exception {
+ public final void preTearDownCacheTestCase() throws Exception {
Invoke.invokeInEveryVM(new SerializableCallable() {
@Override
public Object call() throws Exception {
@@ -72,8 +71,8 @@ public class DistTXPersistentDebugDUnitTest extends DistTXDebugDUnitTest {
}
public static void createPersistentPR(String regionName) {
- assertNotNull(cache);
- cache.createRegion(regionName, getPersistentPRAttributes(1, -1, cache, 113, true));
+ assertNotNull(basicGetCache());
+ basicGetCache().createRegion(regionName, getPersistentPRAttributes(1, -1, basicGetCache(), 113, true));
}
protected static RegionAttributes getPersistentPRAttributes(final int redundancy, final int recoveryDelay,
@@ -105,11 +104,11 @@ public class DistTXPersistentDebugDUnitTest extends DistTXDebugDUnitTest {
SerializableCallable TxOps = new SerializableCallable() {
@Override
public Object call() throws Exception {
- CacheTransactionManager mgr = cache.getCacheTransactionManager();
+ CacheTransactionManager mgr = basicGetCache().getCacheTransactionManager();
mgr.setDistributed(true);
LogWriterUtils.getLogWriter().fine("SJ:TX BEGIN");
mgr.begin();
- Region<CustId, Customer> prRegion = cache.getRegion(regionName);
+ Region<CustId, Customer> prRegion = basicGetCache().getRegion(regionName);
CustId custIdOne = new CustId(1);
Customer customerOne = new Customer("name1", "addr1");
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/disttx/DistributedTransactionDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/disttx/DistributedTransactionDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/disttx/DistributedTransactionDUnitTest.java
index ab8fad4..5b1a736 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/disttx/DistributedTransactionDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/disttx/DistributedTransactionDUnitTest.java
@@ -80,8 +80,7 @@ public class DistributedTransactionDUnitTest extends CacheTestCase {
final protected String CUSTOMER_RR = "customerRRRegion";
@Override
- public void setUp() throws Exception{
- super.setUp();
+ public final void postSetUp() throws Exception{
Invoke.invokeInEveryVM(new SerializableCallable() {
@Override
public Object call() throws Exception {
@@ -90,14 +89,6 @@ public class DistributedTransactionDUnitTest extends CacheTestCase {
}
});
-// this.invokeInEveryVM(new SerializableCallable() {
-// @Override
-// public Object call() throws Exception {
-// System.setProperty("gemfire.log-level", "fine");
-// return null;
-// }
-// });
-
Invoke.invokeInEveryVM(new SerializableCallable() {
@Override
public Object call() throws Exception {
@@ -109,7 +100,7 @@ public class DistributedTransactionDUnitTest extends CacheTestCase {
}
@Override
- protected final void preTearDownCacheTestCase() throws Exception {
+ public final void preTearDownCacheTestCase() throws Exception {
Invoke.invokeInEveryVM(new SerializableCallable() {
@Override
public Object call() throws Exception {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/BackwardCompatibilitySerializationDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/BackwardCompatibilitySerializationDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/BackwardCompatibilitySerializationDUnitTest.java
index f1e5dda..3197dc0 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/BackwardCompatibilitySerializationDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/BackwardCompatibilitySerializationDUnitTest.java
@@ -61,16 +61,16 @@ public class BackwardCompatibilitySerializationDUnitTest extends CacheTestCase {
super(name);
}
- @Before
- public void setUp() {
+ @Override
+ public final void postSetUp() {
baos = new ByteArrayOutputStream();
// register TestMessage using an existing dsfid
DSFIDFactory.registerDSFID(DataSerializableFixedID.PUTALL_VERSIONS_LIST,
TestMessage.class);
}
- @After
- protected final void preTearDownCacheTestCase() {
+ @Override
+ public final void preTearDownCacheTestCase() {
resetFlags();
// reset the class mapped to the dsfid
DSFIDFactory.registerDSFID(DataSerializableFixedID.PUTALL_VERSIONS_LIST,
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/JarDeployerDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/JarDeployerDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/JarDeployerDUnitTest.java
index 5895a7d..5139a6f 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/JarDeployerDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/JarDeployerDUnitTest.java
@@ -66,7 +66,7 @@ public class JarDeployerDUnitTest extends CacheTestCase {
}
@Override
- protected final void preTearDownCacheTestCase() throws Exception {
+ public final void preTearDownCacheTestCase() throws Exception {
JarDeployer jarDeployer = new JarDeployer();
for (JarClassLoader jarClassLoader : jarDeployer.findJarClassLoaders()) {
if (jarClassLoader.getJarName().startsWith("JarDeployerDUnit")) {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/BackupDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/BackupDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/BackupDUnitTest.java
index 3ad768e..62a74d6 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/BackupDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/BackupDUnitTest.java
@@ -80,7 +80,7 @@ public class BackupDUnitTest extends PersistentPartitionedRegionTestBase {
}
@Override
- protected final void preTearDownCacheTestCase() throws Exception {
+ public final void preTearDownCacheTestCase() throws Exception {
StringBuilder failures = new StringBuilder();
FileUtil.delete(getBackupDir(), failures);
if (failures.length() > 0) {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug33359DUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug33359DUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug33359DUnitTest.java
index df09027..6857fa7 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug33359DUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug33359DUnitTest.java
@@ -61,8 +61,7 @@ public class Bug33359DUnitTest extends DistributedTestCase {
static boolean flag = false;
@Override
- public void setUp() throws Exception {
- super.setUp();
+ public final void postSetUp() throws Exception {
Host host = Host.getHost(0);
VM vm0 = host.getVM(0);
VM vm1 = host.getVM(1);
@@ -72,7 +71,7 @@ public class Bug33359DUnitTest extends DistributedTestCase {
}
@Override
- protected final void preTearDown(){
+ public final void preTearDown(){
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/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug33726DUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug33726DUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug33726DUnitTest.java
index e41d072..16443b3 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug33726DUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug33726DUnitTest.java
@@ -45,7 +45,7 @@ public class Bug33726DUnitTest extends DistributedTestCase {
}
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
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/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug37241DUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug37241DUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug37241DUnitTest.java
index 788be04..1b4ca3b 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug37241DUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug37241DUnitTest.java
@@ -58,13 +58,11 @@ public class Bug37241DUnitTest extends DistributedTestCase
super(name);
}
- public void setUp() throws Exception
- {
- super.setUp();
+ @Override
+ public final void postSetUp() throws Exception {
final Host host = Host.getHost(0);
server1 = host.getVM(0);
server2 = host.getVM(1);
-
}
/*
@@ -222,7 +220,7 @@ public class Bug37241DUnitTest extends DistributedTestCase
}
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
server1.invoke(() -> Bug37241DUnitTest.closeCache());
server2.invoke(() -> Bug37241DUnitTest.closeCache());
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug37377DUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug37377DUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug37377DUnitTest.java
index 766ecd4..0cb3bba 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug37377DUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug37377DUnitTest.java
@@ -86,19 +86,15 @@ public class Bug37377DUnitTest extends CacheTestCase
dirs[1] = file2;
}
- public void setUp() throws Exception
- {
- super.setUp();
+ @Override
+ public final void postSetUp() throws Exception {
final Host host = Host.getHost(0);
vm0 = host.getVM(0);
vm1 = host.getVM(1);
-
}
@Override
- protected final void preTearDownCacheTestCase() throws Exception
- {
-
+ public final void preTearDownCacheTestCase() throws Exception {
vm1.invoke(destroyRegion());
vm0.invoke(destroyRegion());
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug39079DUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug39079DUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug39079DUnitTest.java
index 81e603c..ac11257 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug39079DUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug39079DUnitTest.java
@@ -94,8 +94,8 @@ public class Bug39079DUnitTest extends CacheTestCase {
dirs[1] = file2;
}
- public void setUp() throws Exception {
- super.setUp();
+ @Override
+ public final void postSetUp() throws Exception {
final Host host = Host.getHost(0);
vm0 = host.getVM(0);
vm1 = host.getVM(1);
@@ -103,7 +103,6 @@ public class Bug39079DUnitTest extends CacheTestCase {
vm0.invoke(() -> Bug39079DUnitTest.ignorePreAllocate( Boolean.TRUE ));
vm1.invoke(() -> Bug39079DUnitTest.ignorePreAllocate( Boolean.TRUE ));
}
-
/**
* This method is used to create Cache in VM0
@@ -179,7 +178,7 @@ public class Bug39079DUnitTest extends CacheTestCase {
}
@Override
- protected final void postTearDownCacheTestCase() throws Exception {
+ public final void postTearDownCacheTestCase() throws Exception {
disconnectAllFromDS();
vm0.invoke(() -> Bug39079DUnitTest.ignorePreAllocate( Boolean.FALSE ));
@@ -311,9 +310,9 @@ public class Bug39079DUnitTest extends CacheTestCase {
vm0.invoke(() -> Bug39079DUnitTest.validateRuningBridgeServerList());
// close server cache
- vm0.invoke(() -> Bug39079DUnitTest.closeCache());
+ vm0.invoke(() -> Bug39079DUnitTest.closeCacheAndDisconnect());
// close client cache
- vm1.invoke(() -> Bug39079DUnitTest.closeCache());
+ vm1.invoke(() -> Bug39079DUnitTest.closeCacheAndDisconnect());
}
public static Integer createServerCache() throws Exception
@@ -335,7 +334,7 @@ public class Bug39079DUnitTest extends CacheTestCase {
return new Integer(bs1.getPort());
}
- public static void closeCache()
+ public static void closeCacheAndDisconnect()
{
if (gemfirecache != null && !gemfirecache.isClosed()) {
gemfirecache.close();
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug40299DUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug40299DUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug40299DUnitTest.java
index 60f9bd5..b73957a 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug40299DUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug40299DUnitTest.java
@@ -77,16 +77,14 @@ public class Bug40299DUnitTest extends CacheTestCase
super(name);
}
- public void setUp() throws Exception
- {
- super.setUp();
+ @Override
+ public final void postSetUp() throws Exception {
final Host host = Host.getHost(0);
vm0 = host.getVM(0);
}
@Override
- protected final void preTearDownCacheTestCase() throws Exception
- {
+ public final void preTearDownCacheTestCase() throws Exception {
vm0.invoke(destroyRegion());
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug41091DUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug41091DUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug41091DUnitTest.java
index a03f035..882c7c6 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug41091DUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug41091DUnitTest.java
@@ -58,7 +58,7 @@ public class Bug41091DUnitTest extends CacheTestCase {
}
@Override
- protected final void postTearDownCacheTestCase() throws Exception {
+ public final void postTearDownCacheTestCase() throws Exception {
disconnectAllFromDS();
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug41733DUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug41733DUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug41733DUnitTest.java
index cbd503f..75e4375 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug41733DUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug41733DUnitTest.java
@@ -58,7 +58,7 @@ public class Bug41733DUnitTest extends CacheTestCase {
@Override
- protected final void preTearDownCacheTestCase() throws Exception {
+ public final void preTearDownCacheTestCase() throws Exception {
disconnectAllFromDS();
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug41957DUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug41957DUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug41957DUnitTest.java
index a16a9c3..3b459f6 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug41957DUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug41957DUnitTest.java
@@ -56,7 +56,7 @@ import com.gemstone.gemfire.test.dunit.VM;
}
@Override
- protected final void postTearDownCacheTestCase() throws Exception {
+ public final void postTearDownCacheTestCase() throws Exception {
disconnectAllFromDS();
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug45164DUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug45164DUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug45164DUnitTest.java
index 371df3f..7a6ff90 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug45164DUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug45164DUnitTest.java
@@ -70,9 +70,9 @@ public class Bug45164DUnitTest extends CacheTestCase {
async1.getResult();
async2.getResult();
}
-
- public void setUp() throws Exception {
- super.setUp();
+
+ @Override
+ public final void postSetUp() throws Exception {
SerializableRunnable create = new SerializableRunnable() {
@Override
public void run() {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug47667DUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug47667DUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug47667DUnitTest.java
index 097aeb5..de43c29 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug47667DUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug47667DUnitTest.java
@@ -38,8 +38,7 @@ public class Bug47667DUnitTest extends LocatorTestBase {
}
@Override
- public void setUp() throws Exception {
- super.setUp();
+ public final void postSetUp() throws Exception {
disconnectAllFromDS();
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/CacheAdvisorDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/CacheAdvisorDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/CacheAdvisorDUnitTest.java
index eb64e93..4dc18cf 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/CacheAdvisorDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/CacheAdvisorDUnitTest.java
@@ -66,9 +66,9 @@ public class CacheAdvisorDUnitTest extends CacheTestCase {
DistributedSystem ds = cache.getDistributedSystem();
return ((InternalDistributedSystem)ds).getDistributionManager().getId();
}
-
- public void setUp() throws Exception {
- super.setUp();
+
+ @Override
+ public final void postSetUp() throws Exception {
List vmList = new ArrayList();
List idList = new ArrayList();
for (int h = 0; h < Host.getHostCount(); h++) {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ClearDAckDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ClearDAckDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ClearDAckDUnitTest.java
index 7c8327e..889775a 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ClearDAckDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ClearDAckDUnitTest.java
@@ -66,8 +66,7 @@ public class ClearDAckDUnitTest extends DistributedTestCase {
DistributedMember vm0ID, vm1ID;
@Override
- public void setUp() throws Exception {
- super.setUp();
+ public final void postSetUp() throws Exception {
Host host = Host.getHost(0);
VM vm0 = host.getVM(0);
VM vm1 = host.getVM(1);
@@ -77,7 +76,7 @@ public class ClearDAckDUnitTest extends DistributedTestCase {
}
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
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/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ClearGlobalDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ClearGlobalDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ClearGlobalDUnitTest.java
index 0c94795..b7795c2 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ClearGlobalDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ClearGlobalDUnitTest.java
@@ -76,8 +76,8 @@ public class ClearGlobalDUnitTest extends DistributedTestCase
/** name of the test region */
private static final String REGION_NAME = "ClearGlobalDUnitTest_Region";
- public void setUp()throws Exception {
- super.setUp();
+ @Override
+ public final void postSetUp()throws Exception {
Host host = Host.getHost(0);
server1 = host.getVM(0);
server1.invoke(() -> ClearGlobalDUnitTest.createCacheServer1());
@@ -86,7 +86,7 @@ public class ClearGlobalDUnitTest extends DistributedTestCase
}
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
server1.invoke(() -> ClearGlobalDUnitTest.closeCache());
resetClearCallBack();
closeCache();
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ClientServerGetAllDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ClientServerGetAllDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ClientServerGetAllDUnitTest.java
index 803593e..6cd8597 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ClientServerGetAllDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ClientServerGetAllDUnitTest.java
@@ -61,7 +61,7 @@ import com.gemstone.gemfire.test.dunit.VM;
}
@Override
- protected final void postTearDownCacheTestCase() throws Exception {
+ public final void postTearDownCacheTestCase() throws Exception {
disconnectAllFromDS();
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ClientServerInvalidAndDestroyedEntryDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ClientServerInvalidAndDestroyedEntryDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ClientServerInvalidAndDestroyedEntryDUnitTest.java
index e5ec301..8b9050f 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ClientServerInvalidAndDestroyedEntryDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ClientServerInvalidAndDestroyedEntryDUnitTest.java
@@ -60,9 +60,9 @@ public class ClientServerInvalidAndDestroyedEntryDUnitTest extends CacheTestCase
public ClientServerInvalidAndDestroyedEntryDUnitTest(String name) {
super(name);
}
-
- public void setUp() throws Exception {
- super.setUp();
+
+ @Override
+ public final void postSetUp() throws Exception {
disconnectAllFromDS();
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ClientServerTransactionCCEDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ClientServerTransactionCCEDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ClientServerTransactionCCEDUnitTest.java
index 6f76fc8..c343afc 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ClientServerTransactionCCEDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ClientServerTransactionCCEDUnitTest.java
@@ -36,15 +36,14 @@ import com.gemstone.gemfire.test.dunit.VM;
public class ClientServerTransactionCCEDUnitTest extends
ClientServerTransactionDUnitTest {
-
- public void setUp() throws Exception {
- super.setUp();
+
+ protected final void postSetUpClientServerTransactionDUnitTest() throws Exception {
IgnoredException.addIgnoredException("Connection reset");
IgnoredException.addIgnoredException("SocketTimeoutException");
IgnoredException.addIgnoredException("ServerConnectivityException");
IgnoredException.addIgnoredException("Socket Closed");
-
}
+
/**
*
*/
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ClientServerTransactionDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ClientServerTransactionDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ClientServerTransactionDUnitTest.java
index 28e6419..1d8d9a4 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ClientServerTransactionDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ClientServerTransactionDUnitTest.java
@@ -110,10 +110,14 @@ public class ClientServerTransactionDUnitTest extends RemoteTransactionDUnitTest
public ClientServerTransactionDUnitTest(String name) {
super(name);
}
-
- public void setUp() throws Exception {
- super.setUp();
+
+ @Override
+ public final void postSetUp() throws Exception {
IgnoredException.addIgnoredException("java.net.SocketException");
+ postSetUpClientServerTransactionDUnitTest();
+ }
+
+ protected void postSetUpClientServerTransactionDUnitTest() throws Exception {
}
private Integer createRegionsAndStartServer(VM vm, boolean accessor) {
@@ -152,7 +156,7 @@ public class ClientServerTransactionDUnitTest extends RemoteTransactionDUnitTest
Properties props = getDistributedSystemProperties();
props.put("mcast-port", "0");
props.remove("locators");
- system = (InternalDistributedSystem)DistributedSystem.connect(props);
+ InternalDistributedSystem system = getSystem(props);
Cache cache = CacheFactory.create(system);
cache.createRegion(OTHER_REGION,af.create());
if (startServer) {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ConcurrentDestroySubRegionDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ConcurrentDestroySubRegionDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ConcurrentDestroySubRegionDUnitTest.java
index 2a7c0b5..354cc24 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ConcurrentDestroySubRegionDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ConcurrentDestroySubRegionDUnitTest.java
@@ -36,8 +36,7 @@ import com.gemstone.gemfire.test.dunit.VM;
public class ConcurrentDestroySubRegionDUnitTest extends CacheTestCase {
@Override
- public void setUp() throws Exception {
- super.setUp();
+ public final void postSetUp() throws Exception {
// this test expects to be able to create a region named "region"
// but other tests seem to leave regions around, so we need
// to create a new cache
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ConnectDisconnectDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ConnectDisconnectDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ConnectDisconnectDUnitTest.java
index 7a29e65..680fa84 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ConnectDisconnectDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ConnectDisconnectDUnitTest.java
@@ -112,7 +112,7 @@ public class ConnectDisconnectDUnitTest extends CacheTestCase {
}
@Override
- protected final void postTearDownCacheTestCase() throws Exception {
+ public final void postTearDownCacheTestCase() throws Exception {
if (locatorPorts != null) {
DistributedTestUtils.deleteLocatorStateFile(locatorPorts);
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DeltaPropagationDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DeltaPropagationDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DeltaPropagationDUnitTest.java
index b502992..3a49515 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DeltaPropagationDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DeltaPropagationDUnitTest.java
@@ -149,9 +149,8 @@ public class DeltaPropagationDUnitTest extends DistributedTestCase {
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
-
+ @Override
+ public final void postSetUp() throws Exception {
final Host host = Host.getHost(0);
VM0 = host.getVM(0);
VM1 = host.getVM(1);
@@ -166,7 +165,7 @@ public class DeltaPropagationDUnitTest extends DistributedTestCase {
}
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
DeltaPropagationDUnitTest.closeCache();
VM2.invoke(() -> DeltaPropagationDUnitTest.closeCache());
VM3.invoke(() -> DeltaPropagationDUnitTest.closeCache());
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DeltaPropagationStatsDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DeltaPropagationStatsDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DeltaPropagationStatsDUnitTest.java
index f383199..fabd69a 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DeltaPropagationStatsDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DeltaPropagationStatsDUnitTest.java
@@ -85,8 +85,8 @@ public class DeltaPropagationStatsDUnitTest extends DistributedTestCase {
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
+ @Override
+ public final void postSetUp() throws Exception {
final Host host = Host.getHost(0);
vm0 = host.getVM(0);
vm1 = host.getVM(1);
@@ -95,7 +95,7 @@ public class DeltaPropagationStatsDUnitTest extends DistributedTestCase {
}
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
lastKeyReceived = false;
vm0.invoke(() -> DeltaPropagationStatsDUnitTest.resetLastKeyReceived());
vm1.invoke(() -> DeltaPropagationStatsDUnitTest.resetLastKeyReceived());
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegByteArrayDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegByteArrayDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegByteArrayDUnitTest.java
index a49dbec..2690cd1 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegByteArrayDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DiskRegByteArrayDUnitTest.java
@@ -75,13 +75,10 @@ public class DiskRegByteArrayDUnitTest extends CacheTestCase {
dirs[1] = file2;
dirs[2] = file3;
dirs[3] = file4;
-
}
-
-
+
@Override
- public void setUp() throws Exception {
- super.setUp();
+ public final void postSetUp() throws Exception {
Host host = Host.getHost(0);
VM vm0 = host.getVM(0);
VM vm1 = host.getVM(1);
@@ -90,7 +87,7 @@ public class DiskRegByteArrayDUnitTest extends CacheTestCase {
}
@Override
- protected final void postTearDownCacheTestCase() throws Exception {
+ public final void postTearDownCacheTestCase() throws Exception {
cache = null;
Invoke.invokeInEveryVM(new SerializableRunnable() { public void run() { cache = null; } });
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DistrbutedRegionProfileOffHeapDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DistrbutedRegionProfileOffHeapDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DistrbutedRegionProfileOffHeapDUnitTest.java
index 6ce3ffd..b9c90dc 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DistrbutedRegionProfileOffHeapDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DistrbutedRegionProfileOffHeapDUnitTest.java
@@ -40,7 +40,7 @@ public class DistrbutedRegionProfileOffHeapDUnitTest extends CacheTestCase {
}
@Override
- protected final void preTearDownCacheTestCase() throws Exception {
+ public final void preTearDownCacheTestCase() throws Exception {
SerializableRunnable checkOrphans = new SerializableRunnable() {
@Override
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DistributedCacheTestCase.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DistributedCacheTestCase.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DistributedCacheTestCase.java
index 99abf49..d3f28d6 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DistributedCacheTestCase.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/DistributedCacheTestCase.java
@@ -53,15 +53,15 @@ public abstract class DistributedCacheTestCase
super(name);
}
- public void setUp() throws Exception {
- setUp(true);
+ @Override
+ public final void postSetUp() throws Exception {
+ setUpDistributedCacheTestCase(true);
}
/**
* Creates the {@link Cache} and root region in each remote VM
* and, if createLocalCache, in this VM.
*/
- protected void setUp(boolean createLocalCache) throws Exception {
- super.setUp();
+ private final void setUpDistributedCacheTestCase(boolean createLocalCache) throws Exception {
if (createLocalCache) {
try {
remoteCreateCache();
@@ -105,7 +105,7 @@ public abstract class DistributedCacheTestCase
* Closes the cache in this VM and each remote VM
*/
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
StringBuffer problems = new StringBuffer();
if (cache != null) {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/EventTrackerDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/EventTrackerDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/EventTrackerDUnitTest.java
index 5fbc537..fa15370 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/EventTrackerDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/EventTrackerDUnitTest.java
@@ -79,7 +79,7 @@ public class EventTrackerDUnitTest extends CacheTestCase {
}
@Override
- protected final void postTearDownCacheTestCase() throws Exception {
+ public final void postTearDownCacheTestCase() throws Exception {
disconnectAllFromDS();
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/EvictionObjectSizerDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/EvictionObjectSizerDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/EvictionObjectSizerDUnitTest.java
index 18346b7..2eee95f 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/EvictionObjectSizerDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/EvictionObjectSizerDUnitTest.java
@@ -58,11 +58,6 @@ public class EvictionObjectSizerDUnitTest extends CacheTestCase {
super(name);
}
- @Override
- public void setUp() throws Exception {
- super.setUp();
- }
-
/**
* Without object sizer
*/
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/EvictionStatsDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/EvictionStatsDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/EvictionStatsDUnitTest.java
index 819afdf..e820e1f 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/EvictionStatsDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/EvictionStatsDUnitTest.java
@@ -67,8 +67,8 @@ public class EvictionStatsDUnitTest extends CacheTestCase {
// TODO Auto-generated constructor stub
}
- public void setUp() throws Exception {
- super.setUp();
+ @Override
+ public final void postSetUp() throws Exception {
Host host = Host.getHost(0);
dataStore1 = host.getVM(0);
dataStore2 = host.getVM(1);
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/EvictionTestBase.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/EvictionTestBase.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/EvictionTestBase.java
index 5416862..ec8d46c 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/EvictionTestBase.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/EvictionTestBase.java
@@ -78,9 +78,7 @@ public class EvictionTestBase extends CacheTestCase {
}
@Override
- public void setUp() throws Exception {
- super.setUp();
-
+ public final void postSetUp() throws Exception {
Host host = Host.getHost(0);
dataStore1 = host.getVM(0);
dataStore2 = host.getVM(1);
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/GIIDeltaDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/GIIDeltaDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/GIIDeltaDUnitTest.java
index e8dbe56..f3b0742 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/GIIDeltaDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/GIIDeltaDUnitTest.java
@@ -98,8 +98,8 @@ public class GIIDeltaDUnitTest extends CacheTestCase {
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
+ @Override
+ public final void postSetUp() throws Exception {
Invoke.invokeInEveryVM(GIIDeltaDUnitTest.class,"setRegionName", new Object[]{getUniqueName()});
setRegionName(getUniqueName());
}
@@ -109,7 +109,7 @@ public class GIIDeltaDUnitTest extends CacheTestCase {
}
@Override
- protected final void preTearDownCacheTestCase() throws Exception {
+ public final void preTearDownCacheTestCase() throws Exception {
P.invoke(() -> GIIDeltaDUnitTest.resetSlowGII());
R.invoke(() -> GIIDeltaDUnitTest.resetSlowGII());
P.invoke(() -> InitialImageOperation.resetAllGIITestHooks());
@@ -122,7 +122,7 @@ public class GIIDeltaDUnitTest extends CacheTestCase {
}
@Override
- protected final void postTearDownCacheTestCase() throws Exception {
+ public final void postTearDownCacheTestCase() throws Exception {
// clean up the test hook, which can be moved to CacheTestCase
DistributedCacheOperation.SLOW_DISTRIBUTION_MS = 0;
if (expectedEx != null) {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/GIIFlowControlDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/GIIFlowControlDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/GIIFlowControlDUnitTest.java
index e2d4af6..80c582e 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/GIIFlowControlDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/GIIFlowControlDUnitTest.java
@@ -59,7 +59,7 @@ public class GIIFlowControlDUnitTest extends CacheTestCase {
}
@Override
- protected final void preTearDownCacheTestCase() throws Exception {
+ public final void preTearDownCacheTestCase() throws Exception {
Invoke.invokeInEveryVM(new SerializableRunnable("reset chunk size") {
public void run() {
InitialImageOperation.CHUNK_SIZE_IN_BYTES = origChunkSize;
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/HAOverflowMemObjectSizerDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/HAOverflowMemObjectSizerDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/HAOverflowMemObjectSizerDUnitTest.java
index 69f73ec..0046959 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/HAOverflowMemObjectSizerDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/HAOverflowMemObjectSizerDUnitTest.java
@@ -86,16 +86,16 @@ public class HAOverflowMemObjectSizerDUnitTest extends DistributedTestCase {
super(name);
}
- public void setUp() throws Exception {
+ @Override
+ public final void postSetUp() throws Exception {
disconnectAllFromDS();
- super.setUp();
Host host = Host.getHost(0);
client = host.getVM(1);
serverVM = host.getVM(3);
}
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
serverVM.invoke(() -> ConflationDUnitTest.unsetIsSlowStart());
client.invoke(() -> HAOverflowMemObjectSizerDUnitTest.closeCache());
serverVM.invoke(() -> HAOverflowMemObjectSizerDUnitTest.closeCache());
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/IncrementalBackupDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/IncrementalBackupDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/IncrementalBackupDUnitTest.java
index c8f0933..f95ae50 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/IncrementalBackupDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/IncrementalBackupDUnitTest.java
@@ -655,8 +655,8 @@ public class IncrementalBackupDUnitTest extends CacheTestCase {
* 1. Add partitioned persistent region to all members.
* 2. Fills region with data.
*/
- public void setUp() throws Exception {
- super.setUp();
+ @Override
+ public final void postSetUp() throws Exception {
createDataRegions();
createRegions.run();
loadMoreData();
@@ -668,7 +668,7 @@ public class IncrementalBackupDUnitTest extends CacheTestCase {
* Removes backup directories (and all backup data).
*/
@Override
- protected final void preTearDownCacheTestCase() throws Exception {
+ public final void preTearDownCacheTestCase() throws Exception {
FileUtil.delete(getIncremental2Dir());
FileUtil.delete(getIncrementalDir());
FileUtil.delete(getBaselineDir());
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/InterruptClientServerDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/InterruptClientServerDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/InterruptClientServerDUnitTest.java
index fdf2a5b..0a8c63f 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/InterruptClientServerDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/InterruptClientServerDUnitTest.java
@@ -56,7 +56,7 @@ public class InterruptClientServerDUnitTest extends CacheTestCase {
@Override
- protected final void preTearDownCacheTestCase() throws Exception {
+ public final void preTearDownCacheTestCase() throws Exception {
Invoke.invokeInEveryVM(new SerializableCallable() {
@Override
@@ -218,7 +218,7 @@ public class InterruptClientServerDUnitTest extends CacheTestCase {
return vm.invoke(new SerializableCallable() {
@Override
public Object call() throws Exception {
- assertFalse(cache.isClosed());
+ assertFalse(basicGetCache().isClosed());
Region<Object, Object> region = getCache().getRegion("region");
return region.get(0);
}