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:47 UTC
[01/11] incubator-geode git commit: GEODE-1050: add JUnit 4 versions
of DistributedTestCase and CacheTestCase
Repository: incubator-geode
Updated Branches:
refs/heads/develop 09cd33025 -> 57c8600be
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/WANLocatorServerDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/WANLocatorServerDUnitTest.java b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/WANLocatorServerDUnitTest.java
index 54773ad..bd0c118 100644
--- a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/WANLocatorServerDUnitTest.java
+++ b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/WANLocatorServerDUnitTest.java
@@ -47,10 +47,9 @@ public class WANLocatorServerDUnitTest extends WANTestBase {
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
+ @Override
+ protected final void postSetUpWANTestBase() throws Exception {
final Host host = Host.getHost(0);
-
}
public void test_3Locators_2Servers() {
@@ -95,7 +94,7 @@ public class WANLocatorServerDUnitTest extends WANTestBase {
public static void createLocator(Integer port1, Integer port2, Integer port3,
Integer startingPort) {
WANTestBase test = new WANTestBase(getTestMethodName());
- Properties props = new Properties();
+ Properties props = test.getDistributedSystemProperties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
props.setProperty(DistributionConfig.DISTRIBUTED_SYSTEM_ID_NAME, "" + 1);
props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + port1
@@ -108,7 +107,7 @@ public class WANLocatorServerDUnitTest extends WANTestBase {
public static void createReceiver(Integer port1, Integer port2, Integer port3) {
WANTestBase test = new WANTestBase(getTestMethodName());
- Properties props = new Properties();
+ Properties props = test.getDistributedSystemProperties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + port1
+ "],localhost[" + port2 + "],localhost[" + port3 + "]");
@@ -133,7 +132,7 @@ public class WANLocatorServerDUnitTest extends WANTestBase {
public static void createServer(Integer port1, Integer port2, Integer port3) {
WANTestBase test = new WANTestBase(getTestMethodName());
- Properties props = new Properties();
+ Properties props = test.getDistributedSystemProperties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + port1
+ "],localhost[" + port2 + "],localhost[" + port3 + "]");
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/WANSSLDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/WANSSLDUnitTest.java b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/WANSSLDUnitTest.java
index 3df01ef..7331147 100644
--- a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/WANSSLDUnitTest.java
+++ b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/WANSSLDUnitTest.java
@@ -28,10 +28,6 @@ public class WANSSLDUnitTest extends WANTestBase{
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
- }
-
public void testSenderSSLReceiverSSL(){
Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 ));
Integer nyPort = (Integer)vm1.invoke(() -> WANTestBase.createFirstRemoteLocator( 2, lnPort ));
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/WanAutoDiscoveryDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/WanAutoDiscoveryDUnitTest.java b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/WanAutoDiscoveryDUnitTest.java
index 42788d9..73c7e1d 100644
--- a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/WanAutoDiscoveryDUnitTest.java
+++ b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/WanAutoDiscoveryDUnitTest.java
@@ -39,10 +39,9 @@ public class WanAutoDiscoveryDUnitTest extends WANTestBase {
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
+ @Override
+ protected void postSetUpWANTestBase() throws Exception {
final Host host = Host.getHost(0);
-
}
/**
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/WanValidationsDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/WanValidationsDUnitTest.java b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/WanValidationsDUnitTest.java
index 3d0c01b..dbe9844 100644
--- a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/WanValidationsDUnitTest.java
+++ b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/WanValidationsDUnitTest.java
@@ -41,10 +41,6 @@ public class WanValidationsDUnitTest extends WANTestBase {
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
- }
-
/**
* Test to make sure that serial sender Ids configured in Distributed Region
* is same across all DR nodes TODO : Should this validation hold tru now.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/parallel/ParallelGatewaySenderOperationsDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/parallel/ParallelGatewaySenderOperationsDUnitTest.java b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/parallel/ParallelGatewaySenderOperationsDUnitTest.java
index f929d89..258918f 100644
--- a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/parallel/ParallelGatewaySenderOperationsDUnitTest.java
+++ b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/parallel/ParallelGatewaySenderOperationsDUnitTest.java
@@ -42,9 +42,9 @@ public class ParallelGatewaySenderOperationsDUnitTest extends WANTestBase {
public ParallelGatewaySenderOperationsDUnitTest(String name) {
super(name);
}
-
- public void setUp() throws Exception {
- super.setUp();
+
+ @Override
+ protected final void postSetUpWANTestBase() throws Exception {
IgnoredException.addIgnoredException("Broken pipe||Unexpected IOException");
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/parallel/ParallelGatewaySenderQueueOverflowDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/parallel/ParallelGatewaySenderQueueOverflowDUnitTest.java b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/parallel/ParallelGatewaySenderQueueOverflowDUnitTest.java
index 5e0142c..a54d776 100644
--- a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/parallel/ParallelGatewaySenderQueueOverflowDUnitTest.java
+++ b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/parallel/ParallelGatewaySenderQueueOverflowDUnitTest.java
@@ -57,10 +57,6 @@ public class ParallelGatewaySenderQueueOverflowDUnitTest extends WANTestBase {
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
- }
-
public void testParallelSenderQueueEventsOverflow_NoDiskStoreSpecified() throws Exception {
Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 ));
Integer nyPort = (Integer)vm1.invoke(() -> WANTestBase.createFirstRemoteLocator( 2, lnPort ));
@@ -412,7 +408,7 @@ public class ParallelGatewaySenderQueueOverflowDUnitTest extends WANTestBase {
Integer remoteLocPort = (Integer)vm1.invoke(() -> WANTestBase.createFirstRemoteLocator( 2, localLocPort ));
WANTestBase test = new WANTestBase(getTestMethodName());
- Properties props = new Properties();
+ Properties props = test.getDistributedSystemProperties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + localLocPort + "]");
InternalDistributedSystem ds = test.getSystem(props);
@@ -475,7 +471,7 @@ public class ParallelGatewaySenderQueueOverflowDUnitTest extends WANTestBase {
Integer remoteLocPort = (Integer)vm1.invoke(() -> WANTestBase.createFirstRemoteLocator( 2, localLocPort ));
WANTestBase test = new WANTestBase(getTestMethodName());
- Properties props = new Properties();
+ Properties props = test.getDistributedSystemProperties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + localLocPort + "]");
InternalDistributedSystem ds = test.getSystem(props);
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/parallel/ParallelWANConflationDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/parallel/ParallelWANConflationDUnitTest.java b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/parallel/ParallelWANConflationDUnitTest.java
index b3c3445..6454e35 100644
--- a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/parallel/ParallelWANConflationDUnitTest.java
+++ b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/parallel/ParallelWANConflationDUnitTest.java
@@ -35,8 +35,8 @@ public class ParallelWANConflationDUnitTest extends WANTestBase {
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
+ @Override
+ protected final void postSetUpWANTestBase() throws Exception {
IgnoredException.addIgnoredException("java.net.ConnectException");
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/parallel/ParallelWANPersistenceEnabledGatewaySenderDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/parallel/ParallelWANPersistenceEnabledGatewaySenderDUnitTest.java b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/parallel/ParallelWANPersistenceEnabledGatewaySenderDUnitTest.java
index a29a210..fd1f0ee 100644
--- a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/parallel/ParallelWANPersistenceEnabledGatewaySenderDUnitTest.java
+++ b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/parallel/ParallelWANPersistenceEnabledGatewaySenderDUnitTest.java
@@ -40,9 +40,9 @@ public class ParallelWANPersistenceEnabledGatewaySenderDUnitTest extends
public ParallelWANPersistenceEnabledGatewaySenderDUnitTest(String name) {
super(name);
}
-
- public void setUp() throws Exception {
- super.setUp();
+
+ @Override
+ protected final void postSetUpWANTestBase() throws Exception {
//The restart tests log this string
IgnoredException.addIgnoredException("failed accepting client connection");
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/parallel/ParallelWANPropagationClientServerDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/parallel/ParallelWANPropagationClientServerDUnitTest.java b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/parallel/ParallelWANPropagationClientServerDUnitTest.java
index f01d36f..e8a5e4e 100644
--- a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/parallel/ParallelWANPropagationClientServerDUnitTest.java
+++ b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/parallel/ParallelWANPropagationClientServerDUnitTest.java
@@ -30,10 +30,6 @@ public class ParallelWANPropagationClientServerDUnitTest extends WANTestBase {
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
- }
-
/**
* Normal happy scenario test case.
*
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/parallel/ParallelWANPropagationConcurrentOpsDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/parallel/ParallelWANPropagationConcurrentOpsDUnitTest.java b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/parallel/ParallelWANPropagationConcurrentOpsDUnitTest.java
index 8f3042a..8ae5d0b 100644
--- a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/parallel/ParallelWANPropagationConcurrentOpsDUnitTest.java
+++ b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/parallel/ParallelWANPropagationConcurrentOpsDUnitTest.java
@@ -32,10 +32,6 @@ public class ParallelWANPropagationConcurrentOpsDUnitTest extends WANTestBase {
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
- }
-
/**
* Normal propagation scenario test case for a PR with only one bucket.
* This has been added for bug# 44284.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/parallel/ParallelWANPropagationDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/parallel/ParallelWANPropagationDUnitTest.java b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/parallel/ParallelWANPropagationDUnitTest.java
index 474231c..40eb0de 100644
--- a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/parallel/ParallelWANPropagationDUnitTest.java
+++ b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/parallel/ParallelWANPropagationDUnitTest.java
@@ -44,10 +44,6 @@ public class ParallelWANPropagationDUnitTest extends WANTestBase {
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
- }
-
public void test_ParallelGatewaySenderMetaRegionNotExposedToUser_Bug44216() {
Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 ));
Integer nyPort = (Integer)vm1.invoke(() -> WANTestBase.createFirstRemoteLocator( 2, lnPort ));
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/parallel/ParallelWANPropagationLoopBackDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/parallel/ParallelWANPropagationLoopBackDUnitTest.java b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/parallel/ParallelWANPropagationLoopBackDUnitTest.java
index 4dd9b20..b921c88 100644
--- a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/parallel/ParallelWANPropagationLoopBackDUnitTest.java
+++ b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/parallel/ParallelWANPropagationLoopBackDUnitTest.java
@@ -32,10 +32,6 @@ public class ParallelWANPropagationLoopBackDUnitTest extends WANTestBase {
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
- }
-
/**
* Test loop back issue between 2 WAN sites (LN & NY). LN -> NY -> LN.
* Site1 (LN): vm2, vm4, vm5
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/parallel/ParallelWANStatsDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/parallel/ParallelWANStatsDUnitTest.java b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/parallel/ParallelWANStatsDUnitTest.java
index f1c8b1c..55fd5ad 100644
--- a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/parallel/ParallelWANStatsDUnitTest.java
+++ b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/parallel/ParallelWANStatsDUnitTest.java
@@ -38,8 +38,8 @@ public class ParallelWANStatsDUnitTest extends WANTestBase{
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
+ @Override
+ protected final void postSetUpWANTestBase() throws Exception {
this.testName = getTestMethodName();
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/serial/SerialGatewaySenderDistributedDeadlockDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/serial/SerialGatewaySenderDistributedDeadlockDUnitTest.java b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/serial/SerialGatewaySenderDistributedDeadlockDUnitTest.java
index 8e3a760..93979f0 100644
--- a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/serial/SerialGatewaySenderDistributedDeadlockDUnitTest.java
+++ b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/serial/SerialGatewaySenderDistributedDeadlockDUnitTest.java
@@ -40,10 +40,6 @@ public class SerialGatewaySenderDistributedDeadlockDUnitTest extends WANTestBase
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
- }
-
//Uses replicated regions and conserve-sockets=false
public void testPrimarySendersOnDifferentVMsReplicated() throws Exception {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/serial/SerialGatewaySenderEventListenerDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/serial/SerialGatewaySenderEventListenerDUnitTest.java b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/serial/SerialGatewaySenderEventListenerDUnitTest.java
index 90dde8c..755b6f3 100644
--- a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/serial/SerialGatewaySenderEventListenerDUnitTest.java
+++ b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/serial/SerialGatewaySenderEventListenerDUnitTest.java
@@ -43,10 +43,6 @@ public class SerialGatewaySenderEventListenerDUnitTest extends WANTestBase {
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
- }
-
/**
* Test validates whether the listener attached receives all the events.
* this test hangs after the Darrel's checkin 36685. Need to work with Darrel.Commenting it out so that test suit will not hang
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/serial/SerialGatewaySenderOperationsDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/serial/SerialGatewaySenderOperationsDUnitTest.java b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/serial/SerialGatewaySenderOperationsDUnitTest.java
index c824eb6..ea6de11 100644
--- a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/serial/SerialGatewaySenderOperationsDUnitTest.java
+++ b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/serial/SerialGatewaySenderOperationsDUnitTest.java
@@ -52,8 +52,8 @@ public class SerialGatewaySenderOperationsDUnitTest extends WANTestBase {
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
+ @Override
+ protected final void postSetUpWANTestBase() throws Exception {
IgnoredException.addIgnoredException("Broken pipe");
IgnoredException.addIgnoredException("Connection reset");
IgnoredException.addIgnoredException("Unexpected IOException");
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/serial/SerialGatewaySenderQueueDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/serial/SerialGatewaySenderQueueDUnitTest.java b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/serial/SerialGatewaySenderQueueDUnitTest.java
index 1bf132b..c4ceb21 100644
--- a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/serial/SerialGatewaySenderQueueDUnitTest.java
+++ b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/serial/SerialGatewaySenderQueueDUnitTest.java
@@ -54,11 +54,6 @@ public class SerialGatewaySenderQueueDUnitTest extends WANTestBase{
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
- }
-
-
public void testPrimarySecondaryQueueDrainInOrder_RR() throws Exception {
Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 ));
@@ -222,7 +217,7 @@ public class SerialGatewaySenderQueueDUnitTest extends WANTestBase{
Integer remoteLocPort = (Integer) vm1.invoke(() -> WANTestBase.createFirstRemoteLocator( 2, localLocPort ));
WANTestBase test = new WANTestBase(getTestMethodName());
- Properties props = new Properties();
+ Properties props = test.getDistributedSystemProperties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost["
+ localLocPort + "]");
@@ -286,7 +281,7 @@ public class SerialGatewaySenderQueueDUnitTest extends WANTestBase{
Integer remoteLocPort = (Integer)vm1.invoke(() -> WANTestBase.createFirstRemoteLocator( 2, localLocPort ));
WANTestBase test = new WANTestBase(getTestMethodName());
- Properties props = new Properties();
+ Properties props = test.getDistributedSystemProperties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + localLocPort + "]");
InternalDistributedSystem ds = test.getSystem(props);
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/serial/SerialWANPersistenceEnabledGatewaySenderDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/serial/SerialWANPersistenceEnabledGatewaySenderDUnitTest.java b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/serial/SerialWANPersistenceEnabledGatewaySenderDUnitTest.java
index 591d3d5..2f6fd0e 100644
--- a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/serial/SerialWANPersistenceEnabledGatewaySenderDUnitTest.java
+++ b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/serial/SerialWANPersistenceEnabledGatewaySenderDUnitTest.java
@@ -35,10 +35,6 @@ public class SerialWANPersistenceEnabledGatewaySenderDUnitTest extends
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
- }
-
/**
* Just enable the persistence for GatewaySender and see if it remote site
* receives all the events.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/serial/SerialWANPropagationLoopBackDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/serial/SerialWANPropagationLoopBackDUnitTest.java b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/serial/SerialWANPropagationLoopBackDUnitTest.java
index bd971ce..b1fb8d9 100644
--- a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/serial/SerialWANPropagationLoopBackDUnitTest.java
+++ b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/serial/SerialWANPropagationLoopBackDUnitTest.java
@@ -32,10 +32,6 @@ public class SerialWANPropagationLoopBackDUnitTest extends WANTestBase {
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
- }
-
public void testReplicatedSerialPropagationLoopBack() throws Exception {
Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 ));
Integer nyPort = (Integer)vm1.invoke(() -> WANTestBase.createFirstRemoteLocator( 2, lnPort ));
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/serial/SerialWANPropogationDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/serial/SerialWANPropogationDUnitTest.java b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/serial/SerialWANPropogationDUnitTest.java
index d89c864..a272eeb 100644
--- a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/serial/SerialWANPropogationDUnitTest.java
+++ b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/serial/SerialWANPropogationDUnitTest.java
@@ -39,8 +39,8 @@ public class SerialWANPropogationDUnitTest extends WANTestBase {
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
+ @Override
+ public final void postSetUpWANTestBase() throws Exception {
IgnoredException.addIgnoredException("Connection reset");
IgnoredException.addIgnoredException("Broken pipe");
IgnoredException.addIgnoredException("Connection refused");
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/serial/SerialWANPropogation_PartitionedRegionDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/serial/SerialWANPropogation_PartitionedRegionDUnitTest.java b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/serial/SerialWANPropogation_PartitionedRegionDUnitTest.java
index 89749dc..126e737 100644
--- a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/serial/SerialWANPropogation_PartitionedRegionDUnitTest.java
+++ b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/serial/SerialWANPropogation_PartitionedRegionDUnitTest.java
@@ -32,11 +32,6 @@ public class SerialWANPropogation_PartitionedRegionDUnitTest extends WANTestBase
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
- }
-
-
public void testPartitionedSerialPropagation() throws Exception {
Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 ));
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/serial/SerialWANPropogationsFeatureDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/serial/SerialWANPropogationsFeatureDUnitTest.java b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/serial/SerialWANPropogationsFeatureDUnitTest.java
index 18eb081..5846e75 100644
--- a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/serial/SerialWANPropogationsFeatureDUnitTest.java
+++ b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/serial/SerialWANPropogationsFeatureDUnitTest.java
@@ -28,10 +28,6 @@ public class SerialWANPropogationsFeatureDUnitTest extends WANTestBase{
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
- }
-
public void testSerialReplicatedWanWithOverflow() {
Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 ));
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/serial/SerialWANStatsDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/serial/SerialWANStatsDUnitTest.java b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/serial/SerialWANStatsDUnitTest.java
index 85aae7f..6602104 100644
--- a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/serial/SerialWANStatsDUnitTest.java
+++ b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/serial/SerialWANStatsDUnitTest.java
@@ -37,8 +37,8 @@ public class SerialWANStatsDUnitTest extends WANTestBase {
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
+ @Override
+ protected final void postSetUpWANTestBase() throws Exception {
this.testName = getTestMethodName();
addIgnoredException("java.net.ConnectException");
addIgnoredException("java.net.SocketException");
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/wancommand/WANCommandTestBase.java
----------------------------------------------------------------------
diff --git a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/wancommand/WANCommandTestBase.java b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/wancommand/WANCommandTestBase.java
index f7d1987..9bfce05 100644
--- a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/wancommand/WANCommandTestBase.java
+++ b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/wancommand/WANCommandTestBase.java
@@ -71,8 +71,8 @@ public class WANCommandTestBase extends CliCommandTestBase{
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);
@@ -88,7 +88,7 @@ public class WANCommandTestBase extends CliCommandTestBase{
public static Integer createFirstLocatorWithDSId(int dsId) {
WANCommandTestBase test = new WANCommandTestBase(getTestMethodName());
int port = AvailablePortHelper.getRandomAvailablePortForDUnitSite();
- Properties props = new Properties();
+ Properties props = test.getDistributedSystemProperties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME,"0");
props.setProperty(DistributionConfig.DISTRIBUTED_SYSTEM_ID_NAME, ""+dsId);
props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + port + "]");
@@ -101,7 +101,7 @@ public class WANCommandTestBase extends CliCommandTestBase{
public static Integer createFirstRemoteLocator(int dsId, int remoteLocPort) {
WANCommandTestBase test = new WANCommandTestBase(getTestMethodName());
int port = AvailablePortHelper.getRandomAvailablePortForDUnitSite();
- Properties props = new Properties();
+ Properties props = test.getDistributedSystemProperties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME,"0");
props.setProperty(DistributionConfig.DISTRIBUTED_SYSTEM_ID_NAME, ""+dsId);
props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + port + "]");
@@ -113,7 +113,7 @@ public class WANCommandTestBase extends CliCommandTestBase{
public static void createCache(Integer locPort){
WANCommandTestBase test = new WANCommandTestBase(getTestMethodName());
- Properties props = new Properties();
+ Properties props = test.getDistributedSystemProperties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + locPort + "]");
InternalDistributedSystem ds = test.getSystem(props);
@@ -122,7 +122,7 @@ public class WANCommandTestBase extends CliCommandTestBase{
public static void createCacheWithGroups(Integer locPort, String groups){
WANCommandTestBase test = new WANCommandTestBase(getTestMethodName());
- Properties props = new Properties();
+ Properties props = test.getDistributedSystemProperties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + locPort + "]");
props.setProperty(DistributionConfig.GROUPS_NAME, groups);
@@ -215,7 +215,7 @@ public class WANCommandTestBase extends CliCommandTestBase{
public static int createAndStartReceiver(int locPort) {
WANCommandTestBase test = new WANCommandTestBase(getTestMethodName());
- Properties props = new Properties();
+ Properties props = test.getDistributedSystemProperties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + locPort
+ "]");
@@ -239,7 +239,7 @@ public class WANCommandTestBase extends CliCommandTestBase{
public static int createReceiver(int locPort) {
WANCommandTestBase test = new WANCommandTestBase(getTestMethodName());
- Properties props = new Properties();
+ Properties props = test.getDistributedSystemProperties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + locPort
+ "]");
@@ -257,7 +257,7 @@ public class WANCommandTestBase extends CliCommandTestBase{
public static int createReceiverWithGroup(int locPort, String groups) {
WANCommandTestBase test = new WANCommandTestBase(getTestMethodName());
- Properties props = new Properties();
+ Properties props = test.getDistributedSystemProperties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + locPort
+ "]");
@@ -297,7 +297,7 @@ public class WANCommandTestBase extends CliCommandTestBase{
public static int createAndStartReceiverWithGroup(int locPort, String groups) {
WANCommandTestBase test = new WANCommandTestBase(getTestMethodName());
- Properties props = new Properties();
+ Properties props = test.getDistributedSystemProperties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + locPort
+ "]");
@@ -492,19 +492,19 @@ public class WANCommandTestBase extends CliCommandTestBase{
}
@Override
- protected final void postTearDownCacheTestCase() throws Exception {
- closeCache();
- vm0.invoke(() -> WANCommandTestBase.closeCache());
- vm1.invoke(() -> WANCommandTestBase.closeCache());
- vm2.invoke(() -> WANCommandTestBase.closeCache());
- vm3.invoke(() -> WANCommandTestBase.closeCache());
- vm4.invoke(() -> WANCommandTestBase.closeCache());
- vm5.invoke(() -> WANCommandTestBase.closeCache());
- vm6.invoke(() -> WANCommandTestBase.closeCache());
- vm7.invoke(() -> WANCommandTestBase.closeCache());
+ public final void postTearDownCacheTestCase() throws Exception {
+ closeCacheAndDisconnect();
+ vm0.invoke(() -> WANCommandTestBase.closeCacheAndDisconnect());
+ vm1.invoke(() -> WANCommandTestBase.closeCacheAndDisconnect());
+ vm2.invoke(() -> WANCommandTestBase.closeCacheAndDisconnect());
+ vm3.invoke(() -> WANCommandTestBase.closeCacheAndDisconnect());
+ vm4.invoke(() -> WANCommandTestBase.closeCacheAndDisconnect());
+ vm5.invoke(() -> WANCommandTestBase.closeCacheAndDisconnect());
+ vm6.invoke(() -> WANCommandTestBase.closeCacheAndDisconnect());
+ vm7.invoke(() -> WANCommandTestBase.closeCacheAndDisconnect());
}
- public static void closeCache() {
+ public static void closeCacheAndDisconnect() {
if (cache != null && !cache.isClosed()) {
cache.close();
cache.getDistributedSystem().disconnect();
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/wancommand/WanCommandCreateGatewayReceiverDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/wancommand/WanCommandCreateGatewayReceiverDUnitTest.java b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/wancommand/WanCommandCreateGatewayReceiverDUnitTest.java
index b885071..1122059 100644
--- a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/wancommand/WanCommandCreateGatewayReceiverDUnitTest.java
+++ b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/wancommand/WanCommandCreateGatewayReceiverDUnitTest.java
@@ -44,10 +44,6 @@ public class WanCommandCreateGatewayReceiverDUnitTest extends
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
- }
-
/**
* GatewayReceiver with all default attributes
*/
@@ -56,7 +52,7 @@ public class WanCommandCreateGatewayReceiverDUnitTest extends
VM puneLocator = Host.getLocator();
int punePort = (Integer)puneLocator.invoke(() -> WANCommandTestBase.getLocatorPort());
- Properties props = new Properties();
+ Properties props = getDistributedSystemProperties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + punePort
+ "]");
@@ -118,7 +114,7 @@ public class WanCommandCreateGatewayReceiverDUnitTest extends
VM puneLocator = Host.getLocator();
int punePort = (Integer)puneLocator.invoke(() -> WANCommandTestBase.getLocatorPort());
- Properties props = new Properties();
+ Properties props = getDistributedSystemProperties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + punePort
+ "]");
@@ -174,7 +170,7 @@ public class WanCommandCreateGatewayReceiverDUnitTest extends
VM puneLocator = Host.getLocator();
int punePort = (Integer)puneLocator.invoke(() -> WANCommandTestBase.getLocatorPort());
- Properties props = new Properties();
+ Properties props = getDistributedSystemProperties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + punePort
+ "]");
@@ -234,7 +230,7 @@ public class WanCommandCreateGatewayReceiverDUnitTest extends
VM puneLocator = Host.getLocator();
int punePort = (Integer)puneLocator.invoke(() -> WANCommandTestBase.getLocatorPort());
- Properties props = new Properties();
+ Properties props = getDistributedSystemProperties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + punePort
+ "]");
@@ -297,7 +293,7 @@ public class WanCommandCreateGatewayReceiverDUnitTest extends
VM puneLocator = Host.getLocator();
int punePort = (Integer)puneLocator.invoke(() -> WANCommandTestBase.getLocatorPort());
- Properties props = new Properties();
+ Properties props = getDistributedSystemProperties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + punePort
+ "]");
@@ -345,7 +341,7 @@ public class WanCommandCreateGatewayReceiverDUnitTest extends
VM puneLocator = Host.getLocator();
int punePort = (Integer)puneLocator.invoke(() -> WANCommandTestBase.getLocatorPort());
- Properties props = new Properties();
+ Properties props = getDistributedSystemProperties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + punePort
+ "]");
@@ -400,7 +396,7 @@ public class WanCommandCreateGatewayReceiverDUnitTest extends
VM puneLocator = Host.getLocator();
int punePort = (Integer)puneLocator.invoke(() -> WANCommandTestBase.getLocatorPort());
- Properties props = new Properties();
+ Properties props = getDistributedSystemProperties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + punePort
+ "]");
@@ -458,7 +454,7 @@ public class WanCommandCreateGatewayReceiverDUnitTest extends
VM puneLocator = Host.getLocator();
int punePort = (Integer)puneLocator.invoke(() -> WANCommandTestBase.getLocatorPort());
- Properties props = new Properties();
+ Properties props = getDistributedSystemProperties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + punePort
+ "]");
@@ -516,7 +512,7 @@ public class WanCommandCreateGatewayReceiverDUnitTest extends
VM puneLocator = Host.getLocator();
int punePort = (Integer)puneLocator.invoke(() -> WANCommandTestBase.getLocatorPort());
- Properties props = new Properties();
+ Properties props = getDistributedSystemProperties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + punePort
+ "]");
@@ -571,7 +567,7 @@ public class WanCommandCreateGatewayReceiverDUnitTest extends
VM puneLocator = Host.getLocator();
int punePort = (Integer)puneLocator.invoke(() -> WANCommandTestBase.getLocatorPort());
- Properties props = new Properties();
+ Properties props = getDistributedSystemProperties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + punePort
+ "]");
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/wancommand/WanCommandCreateGatewaySenderDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/wancommand/WanCommandCreateGatewaySenderDUnitTest.java b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/wancommand/WanCommandCreateGatewaySenderDUnitTest.java
index 2106257..2c99ad3 100644
--- a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/wancommand/WanCommandCreateGatewaySenderDUnitTest.java
+++ b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/wancommand/WanCommandCreateGatewaySenderDUnitTest.java
@@ -41,10 +41,6 @@ public class WanCommandCreateGatewaySenderDUnitTest extends WANCommandTestBase {
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
- }
-
private CommandResult executeCommandWithIgnoredExceptions(String command) {
final IgnoredException exln = IgnoredException.addIgnoredException("Could not connect");
try {
@@ -63,7 +59,7 @@ public class WanCommandCreateGatewaySenderDUnitTest extends WANCommandTestBase {
Integer punePort = (Integer) vm1.invoke(() -> WANCommandTestBase.createFirstLocatorWithDSId( 1 ));
- Properties props = new Properties();
+ Properties props = getDistributedSystemProperties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
props.setProperty(DistributionConfig.DISTRIBUTED_SYSTEM_ID_NAME, "1");
props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + punePort + "]");
@@ -111,7 +107,7 @@ public class WanCommandCreateGatewaySenderDUnitTest extends WANCommandTestBase {
Integer punePort = (Integer) vm1.invoke(() -> WANCommandTestBase.createFirstLocatorWithDSId( 1 ));
- Properties props = new Properties();
+ Properties props = getDistributedSystemProperties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
props.setProperty(DistributionConfig.DISTRIBUTED_SYSTEM_ID_NAME, "1");
props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + punePort + "]");
@@ -182,7 +178,7 @@ public class WanCommandCreateGatewaySenderDUnitTest extends WANCommandTestBase {
Integer punePort = (Integer) vm1.invoke(() -> WANCommandTestBase.createFirstLocatorWithDSId( 1 ));
- Properties props = new Properties();
+ Properties props = getDistributedSystemProperties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
props.setProperty(DistributionConfig.DISTRIBUTED_SYSTEM_ID_NAME, "1");
props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + punePort + "]");
@@ -238,7 +234,7 @@ public class WanCommandCreateGatewaySenderDUnitTest extends WANCommandTestBase {
Integer punePort = (Integer) vm1.invoke(() -> WANCommandTestBase.createFirstLocatorWithDSId( 1 ));
- Properties props = new Properties();
+ Properties props = getDistributedSystemProperties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
props.setProperty(DistributionConfig.DISTRIBUTED_SYSTEM_ID_NAME, "1");
props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + punePort + "]");
@@ -312,7 +308,7 @@ public class WanCommandCreateGatewaySenderDUnitTest extends WANCommandTestBase {
Integer punePort = (Integer) vm1.invoke(() -> WANCommandTestBase.createFirstLocatorWithDSId( 1 ));
- Properties props = new Properties();
+ Properties props = getDistributedSystemProperties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
props.setProperty(DistributionConfig.DISTRIBUTED_SYSTEM_ID_NAME, "1");
props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + punePort + "]");
@@ -384,7 +380,7 @@ public class WanCommandCreateGatewaySenderDUnitTest extends WANCommandTestBase {
Integer punePort = (Integer) vm1.invoke(() -> WANCommandTestBase.createFirstLocatorWithDSId( 1 ));
- Properties props = new Properties();
+ Properties props = getDistributedSystemProperties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
props.setProperty(DistributionConfig.DISTRIBUTED_SYSTEM_ID_NAME, "1");
props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + punePort + "]");
@@ -448,7 +444,7 @@ public class WanCommandCreateGatewaySenderDUnitTest extends WANCommandTestBase {
Integer punePort = (Integer) vm1.invoke(() -> WANCommandTestBase.createFirstLocatorWithDSId( 1 ));
- Properties props = new Properties();
+ Properties props = getDistributedSystemProperties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
props.setProperty(DistributionConfig.DISTRIBUTED_SYSTEM_ID_NAME, "1");
props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + punePort + "]");
@@ -512,7 +508,7 @@ public class WanCommandCreateGatewaySenderDUnitTest extends WANCommandTestBase {
Integer punePort = (Integer) vm1.invoke(() -> WANCommandTestBase.createFirstLocatorWithDSId( 1 ));
- Properties props = new Properties();
+ Properties props = getDistributedSystemProperties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
props.setProperty(DistributionConfig.DISTRIBUTED_SYSTEM_ID_NAME, "1");
props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + punePort + "]");
@@ -573,7 +569,7 @@ public class WanCommandCreateGatewaySenderDUnitTest extends WANCommandTestBase {
Integer punePort = (Integer) vm1.invoke(() -> WANCommandTestBase.createFirstLocatorWithDSId( 1 ));
- Properties props = new Properties();
+ Properties props = getDistributedSystemProperties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
props.setProperty(DistributionConfig.DISTRIBUTED_SYSTEM_ID_NAME, "1");
props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + punePort + "]");
@@ -641,7 +637,7 @@ public class WanCommandCreateGatewaySenderDUnitTest extends WANCommandTestBase {
Integer punePort = (Integer) vm1.invoke(() -> WANCommandTestBase.createFirstLocatorWithDSId( 1 ));
- Properties props = new Properties();
+ Properties props = getDistributedSystemProperties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
props.setProperty(DistributionConfig.DISTRIBUTED_SYSTEM_ID_NAME, "1");
props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + punePort
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/wancommand/WanCommandGatewayReceiverStartDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/wancommand/WanCommandGatewayReceiverStartDUnitTest.java b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/wancommand/WanCommandGatewayReceiverStartDUnitTest.java
index 1ef7f11..6f26e3b 100644
--- a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/wancommand/WanCommandGatewayReceiverStartDUnitTest.java
+++ b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/wancommand/WanCommandGatewayReceiverStartDUnitTest.java
@@ -39,10 +39,6 @@ public class WanCommandGatewayReceiverStartDUnitTest extends WANCommandTestBase{
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
- }
-
/**
* Test wan commands for error in input 1> start gateway-sender command needs
* only one of member or group.
@@ -52,7 +48,7 @@ public class WanCommandGatewayReceiverStartDUnitTest extends WANCommandTestBase{
VM puneLocator = Host.getLocator();
int punePort = (Integer) puneLocator.invoke(() -> WANCommandTestBase.getLocatorPort());
- Properties props = new Properties();
+ Properties props = getDistributedSystemProperties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + punePort + "]");
createDefaultSetup(props);
@@ -84,7 +80,7 @@ public class WanCommandGatewayReceiverStartDUnitTest extends WANCommandTestBase{
VM puneLocator = Host.getLocator();
int punePort = (Integer) puneLocator.invoke(() -> WANCommandTestBase.getLocatorPort());
- Properties props = new Properties();
+ Properties props = getDistributedSystemProperties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + punePort + "]");
createDefaultSetup(props);
@@ -129,7 +125,7 @@ public class WanCommandGatewayReceiverStartDUnitTest extends WANCommandTestBase{
VM puneLocator = Host.getLocator();
int punePort = (Integer) puneLocator.invoke(() -> WANCommandTestBase.getLocatorPort());
- Properties props = new Properties();
+ Properties props = getDistributedSystemProperties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + punePort + "]");
createDefaultSetup(props);
@@ -174,7 +170,7 @@ public class WanCommandGatewayReceiverStartDUnitTest extends WANCommandTestBase{
VM puneLocator = Host.getLocator();
int punePort = (Integer) puneLocator.invoke(() -> WANCommandTestBase.getLocatorPort());
- Properties props = new Properties();
+ Properties props = getDistributedSystemProperties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + punePort + "]");
createDefaultSetup(props);
@@ -224,7 +220,7 @@ public class WanCommandGatewayReceiverStartDUnitTest extends WANCommandTestBase{
VM puneLocator = Host.getLocator();
int punePort = (Integer) puneLocator.invoke(() -> WANCommandTestBase.getLocatorPort());
- Properties props = new Properties();
+ Properties props = getDistributedSystemProperties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + punePort + "]");
createDefaultSetup(props);
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/wancommand/WanCommandGatewayReceiverStopDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/wancommand/WanCommandGatewayReceiverStopDUnitTest.java b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/wancommand/WanCommandGatewayReceiverStopDUnitTest.java
index 08bd07d..82ca3ba 100644
--- a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/wancommand/WanCommandGatewayReceiverStopDUnitTest.java
+++ b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/wancommand/WanCommandGatewayReceiverStopDUnitTest.java
@@ -39,10 +39,6 @@ public class WanCommandGatewayReceiverStopDUnitTest extends WANCommandTestBase {
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
- }
-
/**
* Test wan commands for error in input 1> start gateway-sender command needs
* only one of member or group.
@@ -52,7 +48,7 @@ public class WanCommandGatewayReceiverStopDUnitTest extends WANCommandTestBase {
VM puneLocator = Host.getLocator();
int punePort = (Integer) puneLocator.invoke(() -> WANCommandTestBase.getLocatorPort());
- Properties props = new Properties();
+ Properties props = getDistributedSystemProperties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + punePort + "]");
createDefaultSetup(props);
@@ -85,7 +81,7 @@ public class WanCommandGatewayReceiverStopDUnitTest extends WANCommandTestBase {
VM puneLocator = Host.getLocator();
int punePort = (Integer) puneLocator.invoke(() -> WANCommandTestBase.getLocatorPort());
- Properties props = new Properties();
+ Properties props = getDistributedSystemProperties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + punePort + "]");
createDefaultSetup(props);
@@ -132,7 +128,7 @@ public class WanCommandGatewayReceiverStopDUnitTest extends WANCommandTestBase {
VM puneLocator = Host.getLocator();
int punePort = (Integer) puneLocator.invoke(() -> WANCommandTestBase.getLocatorPort());
- Properties props = new Properties();
+ Properties props = getDistributedSystemProperties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + punePort + "]");
createDefaultSetup(props);
@@ -178,7 +174,7 @@ public class WanCommandGatewayReceiverStopDUnitTest extends WANCommandTestBase {
VM puneLocator = Host.getLocator();
int punePort = (Integer) puneLocator.invoke(() -> WANCommandTestBase.getLocatorPort());
- Properties props = new Properties();
+ Properties props = getDistributedSystemProperties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + punePort + "]");
createDefaultSetup(props);
@@ -229,7 +225,7 @@ public class WanCommandGatewayReceiverStopDUnitTest extends WANCommandTestBase {
VM puneLocator = Host.getLocator();
int punePort = (Integer) puneLocator.invoke(() -> WANCommandTestBase.getLocatorPort());
- Properties props = new Properties();
+ Properties props = getDistributedSystemProperties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + punePort + "]");
createDefaultSetup(props);
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/wancommand/WanCommandGatewaySenderStartDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/wancommand/WanCommandGatewaySenderStartDUnitTest.java b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/wancommand/WanCommandGatewaySenderStartDUnitTest.java
index 7e6a06d..a10a926 100644
--- a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/wancommand/WanCommandGatewaySenderStartDUnitTest.java
+++ b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/wancommand/WanCommandGatewaySenderStartDUnitTest.java
@@ -38,10 +38,6 @@ public class WanCommandGatewaySenderStartDUnitTest extends WANCommandTestBase {
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
- }
-
/**
* Test wan commands for error in input 1> start gateway-sender command needs
* only one of member or group.
@@ -50,7 +46,7 @@ public class WanCommandGatewaySenderStartDUnitTest extends WANCommandTestBase {
Integer punePort = (Integer) vm1.invoke(() -> WANCommandTestBase.createFirstLocatorWithDSId( 1 ));
- Properties props = new Properties();
+ Properties props = getDistributedSystemProperties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
props.setProperty(DistributionConfig.DISTRIBUTED_SYSTEM_ID_NAME, "1");
props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + punePort + "]");
@@ -94,7 +90,7 @@ public class WanCommandGatewaySenderStartDUnitTest extends WANCommandTestBase {
Integer punePort = (Integer) vm1.invoke(() -> WANCommandTestBase.createFirstLocatorWithDSId( 1 ));
- Properties props = new Properties();
+ Properties props = getDistributedSystemProperties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
props.setProperty(DistributionConfig.DISTRIBUTED_SYSTEM_ID_NAME, "1");
props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + punePort + "]");
@@ -154,7 +150,7 @@ public class WanCommandGatewaySenderStartDUnitTest extends WANCommandTestBase {
Integer punePort = (Integer) vm1.invoke(() -> WANCommandTestBase.createFirstLocatorWithDSId( 1 ));
- Properties props = new Properties();
+ Properties props = getDistributedSystemProperties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
props.setProperty(DistributionConfig.DISTRIBUTED_SYSTEM_ID_NAME, "1");
props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + punePort + "]");
@@ -197,7 +193,7 @@ public class WanCommandGatewaySenderStartDUnitTest extends WANCommandTestBase {
Integer punePort = (Integer) vm1.invoke(() -> WANCommandTestBase.createFirstLocatorWithDSId( 1 ));
- Properties props = new Properties();
+ Properties props = getDistributedSystemProperties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
props.setProperty(DistributionConfig.DISTRIBUTED_SYSTEM_ID_NAME, "1");
props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + punePort + "]");
@@ -263,7 +259,7 @@ public class WanCommandGatewaySenderStartDUnitTest extends WANCommandTestBase {
Integer punePort = (Integer) vm1.invoke(() -> WANCommandTestBase.createFirstLocatorWithDSId( 1 ));
- Properties props = new Properties();
+ Properties props = getDistributedSystemProperties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
props.setProperty(DistributionConfig.DISTRIBUTED_SYSTEM_ID_NAME, "1");
props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + punePort + "]");
@@ -344,7 +340,7 @@ public class WanCommandGatewaySenderStartDUnitTest extends WANCommandTestBase {
Integer punePort = (Integer) vm1.invoke(() -> WANCommandTestBase.createFirstLocatorWithDSId( 1 ));
- Properties props = new Properties();
+ Properties props = getDistributedSystemProperties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
props.setProperty(DistributionConfig.DISTRIBUTED_SYSTEM_ID_NAME, "1");
props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + punePort + "]");
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/wancommand/WanCommandGatewaySenderStopDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/wancommand/WanCommandGatewaySenderStopDUnitTest.java b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/wancommand/WanCommandGatewaySenderStopDUnitTest.java
index 7c90d34..f0e51bf 100644
--- a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/wancommand/WanCommandGatewaySenderStopDUnitTest.java
+++ b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/wancommand/WanCommandGatewaySenderStopDUnitTest.java
@@ -38,10 +38,6 @@ public class WanCommandGatewaySenderStopDUnitTest extends WANCommandTestBase {
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
- }
-
private CommandResult executeCommandWithIgnoredExceptions(String command) {
final IgnoredException exln = IgnoredException.addIgnoredException("Could not connect");
CommandResult commandResult = executeCommand(command);
@@ -54,7 +50,7 @@ public class WanCommandGatewaySenderStopDUnitTest extends WANCommandTestBase {
Integer punePort = (Integer) vm1.invoke(() -> WANCommandTestBase.createFirstLocatorWithDSId( 1 ));
- Properties props = new Properties();
+ Properties props = getDistributedSystemProperties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
props.setProperty(DistributionConfig.DISTRIBUTED_SYSTEM_ID_NAME, "1");
props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + punePort + "]");
@@ -88,7 +84,7 @@ public class WanCommandGatewaySenderStopDUnitTest extends WANCommandTestBase {
Integer punePort = (Integer) vm1.invoke(() -> WANCommandTestBase.createFirstLocatorWithDSId( 1 ));
- Properties props = new Properties();
+ Properties props = getDistributedSystemProperties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
props.setProperty(DistributionConfig.DISTRIBUTED_SYSTEM_ID_NAME, "1");
props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + punePort + "]");
@@ -153,7 +149,7 @@ public class WanCommandGatewaySenderStopDUnitTest extends WANCommandTestBase {
Integer punePort = (Integer) vm1.invoke(() -> WANCommandTestBase.createFirstLocatorWithDSId( 1 ));
- Properties props = new Properties();
+ Properties props = getDistributedSystemProperties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
props.setProperty(DistributionConfig.DISTRIBUTED_SYSTEM_ID_NAME, "1");
props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + punePort + "]");
@@ -198,7 +194,7 @@ public class WanCommandGatewaySenderStopDUnitTest extends WANCommandTestBase {
Integer punePort = (Integer) vm1.invoke(() -> WANCommandTestBase.createFirstLocatorWithDSId( 1 ));
- Properties props = new Properties();
+ Properties props = getDistributedSystemProperties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
props.setProperty(DistributionConfig.DISTRIBUTED_SYSTEM_ID_NAME, "1");
props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + punePort + "]");
@@ -270,7 +266,7 @@ public class WanCommandGatewaySenderStopDUnitTest extends WANCommandTestBase {
Integer punePort = (Integer) vm1.invoke(() -> WANCommandTestBase.createFirstLocatorWithDSId( 1 ));
- Properties props = new Properties();
+ Properties props = getDistributedSystemProperties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
props.setProperty(DistributionConfig.DISTRIBUTED_SYSTEM_ID_NAME, "1");
props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + punePort + "]");
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/wancommand/WanCommandListDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/wancommand/WanCommandListDUnitTest.java b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/wancommand/WanCommandListDUnitTest.java
index d54895d..8880348 100644
--- a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/wancommand/WanCommandListDUnitTest.java
+++ b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/wancommand/WanCommandListDUnitTest.java
@@ -38,15 +38,11 @@ public class WanCommandListDUnitTest extends WANCommandTestBase {
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
- }
-
public void testListGatewayWithNoSenderReceiver() {
Integer punePort = (Integer) vm1.invoke(() -> WANCommandTestBase.createFirstLocatorWithDSId( 1 ));
- Properties props = new Properties();
+ Properties props = getDistributedSystemProperties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
props.setProperty(DistributionConfig.DISTRIBUTED_SYSTEM_ID_NAME, "1");
props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + punePort + "]");
@@ -75,7 +71,7 @@ public class WanCommandListDUnitTest extends WANCommandTestBase {
Integer punePort = (Integer) vm1.invoke(() -> WANCommandTestBase.createFirstLocatorWithDSId( 1 ));
- Properties props = new Properties();
+ Properties props = getDistributedSystemProperties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
props.setProperty(DistributionConfig.DISTRIBUTED_SYSTEM_ID_NAME, "1");
props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + punePort + "]");
@@ -127,7 +123,7 @@ public class WanCommandListDUnitTest extends WANCommandTestBase {
Integer lnPort = (Integer) vm1.invoke(() -> WANCommandTestBase.createFirstLocatorWithDSId( 1 ));
- Properties props = new Properties();
+ Properties props = getDistributedSystemProperties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
props.setProperty(DistributionConfig.DISTRIBUTED_SYSTEM_ID_NAME, "1");
props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + lnPort + "]");
@@ -176,7 +172,7 @@ public class WanCommandListDUnitTest extends WANCommandTestBase {
Integer lnPort = (Integer) vm1.invoke(() -> WANCommandTestBase.createFirstLocatorWithDSId( 1 ));
- Properties props = new Properties();
+ Properties props = getDistributedSystemProperties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
props.setProperty(DistributionConfig.DISTRIBUTED_SYSTEM_ID_NAME, "1");
props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + lnPort + "]");
@@ -237,7 +233,7 @@ public class WanCommandListDUnitTest extends WANCommandTestBase {
Integer lnPort = (Integer) vm1.invoke(() -> WANCommandTestBase.createFirstLocatorWithDSId( 1 ));
- Properties props = new Properties();
+ Properties props = getDistributedSystemProperties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
props.setProperty(DistributionConfig.DISTRIBUTED_SYSTEM_ID_NAME, "1");
props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + lnPort + "]");
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/wancommand/WanCommandPauseResumeDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/wancommand/WanCommandPauseResumeDUnitTest.java b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/wancommand/WanCommandPauseResumeDUnitTest.java
index a1e806b..360f2ab 100644
--- a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/wancommand/WanCommandPauseResumeDUnitTest.java
+++ b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/wancommand/WanCommandPauseResumeDUnitTest.java
@@ -37,15 +37,11 @@ public class WanCommandPauseResumeDUnitTest extends WANCommandTestBase {
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
- }
-
public void testPauseGatewaySender_ErrorConditions() {
Integer punePort = (Integer) vm1.invoke(() -> WANCommandTestBase.createFirstLocatorWithDSId( 1 ));
- Properties props = new Properties();
+ Properties props = getDistributedSystemProperties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
props.setProperty(DistributionConfig.DISTRIBUTED_SYSTEM_ID_NAME, "1");
props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + punePort + "]");
@@ -79,7 +75,7 @@ public class WanCommandPauseResumeDUnitTest extends WANCommandTestBase {
Integer punePort = (Integer) vm1.invoke(() -> WANCommandTestBase.createFirstLocatorWithDSId( 1 ));
- Properties props = new Properties();
+ Properties props = getDistributedSystemProperties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
props.setProperty(DistributionConfig.DISTRIBUTED_SYSTEM_ID_NAME, "1");
props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + punePort + "]");
@@ -144,7 +140,7 @@ public class WanCommandPauseResumeDUnitTest extends WANCommandTestBase {
Integer punePort = (Integer) vm1.invoke(() -> WANCommandTestBase.createFirstLocatorWithDSId( 1 ));
- Properties props = new Properties();
+ Properties props = getDistributedSystemProperties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
props.setProperty(DistributionConfig.DISTRIBUTED_SYSTEM_ID_NAME, "1");
props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + punePort + "]");
@@ -189,7 +185,7 @@ public class WanCommandPauseResumeDUnitTest extends WANCommandTestBase {
Integer punePort = (Integer) vm1.invoke(() -> WANCommandTestBase.createFirstLocatorWithDSId( 1 ));
- Properties props = new Properties();
+ Properties props = getDistributedSystemProperties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
props.setProperty(DistributionConfig.DISTRIBUTED_SYSTEM_ID_NAME, "1");
props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + punePort + "]");
@@ -260,7 +256,7 @@ public class WanCommandPauseResumeDUnitTest extends WANCommandTestBase {
Integer punePort = (Integer) vm1.invoke(() -> WANCommandTestBase.createFirstLocatorWithDSId( 1 ));
- Properties props = new Properties();
+ Properties props = getDistributedSystemProperties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
props.setProperty(DistributionConfig.DISTRIBUTED_SYSTEM_ID_NAME, "1");
props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + punePort + "]");
@@ -343,7 +339,7 @@ public class WanCommandPauseResumeDUnitTest extends WANCommandTestBase {
Integer punePort = (Integer) vm1.invoke(() -> WANCommandTestBase.createFirstLocatorWithDSId( 1 ));
- Properties props = new Properties();
+ Properties props = getDistributedSystemProperties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
props.setProperty(DistributionConfig.DISTRIBUTED_SYSTEM_ID_NAME, "1");
props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + punePort + "]");
@@ -378,7 +374,7 @@ public class WanCommandPauseResumeDUnitTest extends WANCommandTestBase {
Integer punePort = (Integer) vm1.invoke(() -> WANCommandTestBase.createFirstLocatorWithDSId( 1 ));
- Properties props = new Properties();
+ Properties props = getDistributedSystemProperties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
props.setProperty(DistributionConfig.DISTRIBUTED_SYSTEM_ID_NAME, "1");
props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + punePort + "]");
@@ -454,7 +450,7 @@ public class WanCommandPauseResumeDUnitTest extends WANCommandTestBase {
Integer punePort = (Integer) vm1.invoke(() -> WANCommandTestBase.createFirstLocatorWithDSId( 1 ));
- Properties props = new Properties();
+ Properties props = getDistributedSystemProperties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
props.setProperty(DistributionConfig.DISTRIBUTED_SYSTEM_ID_NAME, "1");
props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + punePort + "]");
@@ -504,7 +500,7 @@ public class WanCommandPauseResumeDUnitTest extends WANCommandTestBase {
Integer punePort = (Integer) vm1.invoke(() -> WANCommandTestBase.createFirstLocatorWithDSId( 1 ));
- Properties props = new Properties();
+ Properties props = getDistributedSystemProperties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
props.setProperty(DistributionConfig.DISTRIBUTED_SYSTEM_ID_NAME, "1");
props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + punePort + "]");
@@ -585,7 +581,7 @@ public class WanCommandPauseResumeDUnitTest extends WANCommandTestBase {
Integer punePort = (Integer) vm1.invoke(() -> WANCommandTestBase.createFirstLocatorWithDSId( 1 ));
- Properties props = new Properties();
+ Properties props = getDistributedSystemProperties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
props.setProperty(DistributionConfig.DISTRIBUTED_SYSTEM_ID_NAME, "1");
props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + punePort + "]");
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/wancommand/WanCommandStatusDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/wancommand/WanCommandStatusDUnitTest.java b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/wancommand/WanCommandStatusDUnitTest.java
index d01c4c7..12d81d7 100644
--- a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/wancommand/WanCommandStatusDUnitTest.java
+++ b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/wancommand/WanCommandStatusDUnitTest.java
@@ -38,15 +38,11 @@ public class WanCommandStatusDUnitTest extends WANCommandTestBase{
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
- }
-
public void testGatewaySenderStatus(){
Integer lnPort = (Integer) vm1.invoke(() -> WANCommandTestBase.createFirstLocatorWithDSId( 1 ));
- Properties props = new Properties();
+ Properties props = getDistributedSystemProperties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + lnPort + "]");
createDefaultSetup(props);
@@ -136,7 +132,7 @@ public class WanCommandStatusDUnitTest extends WANCommandTestBase{
Integer lnPort = (Integer) vm1.invoke(() -> WANCommandTestBase.createFirstLocatorWithDSId( 1 ));
- Properties props = new Properties();
+ Properties props = getDistributedSystemProperties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + lnPort + "]");
createDefaultSetup(props);
@@ -236,7 +232,7 @@ public class WanCommandStatusDUnitTest extends WANCommandTestBase{
Integer lnPort = (Integer) vm1.invoke(() -> WANCommandTestBase.createFirstLocatorWithDSId( 1 ));
- Properties props = new Properties();
+ Properties props = getDistributedSystemProperties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + lnPort + "]");
createDefaultSetup(props);
@@ -329,7 +325,7 @@ public class WanCommandStatusDUnitTest extends WANCommandTestBase{
Integer lnPort = (Integer) vm1.invoke(() -> WANCommandTestBase.createFirstLocatorWithDSId( 1 ));
- Properties props = new Properties();
+ Properties props = getDistributedSystemProperties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + lnPort + "]");
createDefaultSetup(props);
@@ -405,7 +401,7 @@ public class WanCommandStatusDUnitTest extends WANCommandTestBase{
Integer lnPort = (Integer) vm1.invoke(() -> WANCommandTestBase.createFirstLocatorWithDSId( 1 ));
- Properties props = new Properties();
+ Properties props = getDistributedSystemProperties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + lnPort + "]");
createDefaultSetup(props);
@@ -478,7 +474,7 @@ public class WanCommandStatusDUnitTest extends WANCommandTestBase{
Integer lnPort = (Integer) vm1.invoke(() -> WANCommandTestBase.createFirstLocatorWithDSId( 1 ));
- Properties props = new Properties();
+ Properties props = getDistributedSystemProperties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + lnPort + "]");
createDefaultSetup(props);
[11/11] incubator-geode git commit: GEODE-1050: add JUnit 4 versions
of DistributedTestCase and CacheTestCase
Posted by kl...@apache.org.
GEODE-1050: add JUnit 4 versions of DistributedTestCase and CacheTestCase
* refactor DistributedTestCase into two implementations that delegate: JUnit3DistributedTestCase and JUnit4DistributedTestCase
* refactor CacheTestCase into two implementations that delegate: JUnit3CacheTestCase and JUnit4CacheTestCase
* refactor super.setUp() hierarchy into template method chain like tearDown()
* change all variables in CacheTestCase and DistributedTestCase to private and use methods to access them
* change some tests to use getDistributedSystemProperties() and getSystem()
Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/57c8600b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/57c8600b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/57c8600b
Branch: refs/heads/develop
Commit: 57c8600be29ab1d61f499f4e53c40e2fe3f8c605
Parents: 09cd330
Author: Kirk Lund <kl...@apache.org>
Authored: Fri Mar 18 14:45:06 2016 -0700
Committer: Kirk Lund <kl...@apache.org>
Committed: Fri Mar 18 14:45:06 2016 -0700
----------------------------------------------------------------------
.../LauncherLifecycleCommandsDUnitTest.java | 7 +-
...stAPIOnRegionFunctionExecutionDUnitTest.java | 64 +-
.../web/controllers/RestAPITestBase.java | 15 +-
.../RestAPIsAndInterOpsDUnitTest.java | 4 +-
...tAPIsOnGroupsFunctionExecutionDUnitTest.java | 4 -
...APIsOnMembersFunctionExecutionDUnitTest.java | 5 -
.../controllers/RestAPIsWithSSLDUnitTest.java | 4 +-
.../cache/CacheRegionClearStatsDUnitTest.java | 6 +-
.../cache/ClientServerTimeSyncDUnitTest.java | 4 +-
.../cache/ConnectionPoolAndLoaderDUnitTest.java | 6 +-
.../cache/ConnectionPoolAutoDUnitTest.java | 7 +-
.../gemfire/cache/ConnectionPoolDUnitTest.java | 10 +-
.../ClientServerRegisterInterestsDUnitTest.java | 5 +-
.../internal/AutoConnectionSourceDUnitTest.java | 6 +-
.../CacheServerSSLConnectionDUnitTest.java | 130 +--
.../cache/client/internal/LocatorTestBase.java | 2 +-
.../internal/SSLNoClientAuthDUnitTest.java | 7 +-
.../management/MemoryThresholdsDUnitTest.java | 3 +-
.../MemoryThresholdsOffHeapDUnitTest.java | 6 +-
.../query/dunit/CompactRangeIndexDUnitTest.java | 9 +-
.../cache/query/dunit/HashIndexDUnitTest.java | 6 +-
...itionedRegionCompactRangeIndexDUnitTest.java | 7 +-
.../dunit/QueryDataInconsistencyDUnitTest.java | 13 +-
.../dunit/QueryIndexUsingXMLDUnitTest.java | 26 +-
.../QueryUsingFunctionContextDUnitTest.java | 12 +-
.../query/dunit/QueryUsingPoolDUnitTest.java | 27 +-
.../cache/query/dunit/RemoteQueryDUnitTest.java | 43 +-
...esourceManagerWithQueryMonitorDUnitTest.java | 3 +-
...pdateWithInplaceObjectModFalseDUnitTest.java | 5 +-
...ConcurrentIndexUpdateWithoutWLDUnitTest.java | 6 +-
.../index/CopyOnReadIndexDUnitTest.java | 10 +-
.../index/MultiIndexCreationDUnitTest.java | 8 +-
.../index/PutAllWithIndexPerfDUnitTest.java | 6 +-
.../snapshot/ParallelSnapshotDUnitTest.java | 8 +-
.../snapshot/SnapshotByteArrayDUnitTest.java | 6 +-
.../cache/snapshot/SnapshotDUnitTest.java | 6 +-
.../snapshot/SnapshotPerformanceDUnitTest.java | 6 +-
.../gemfire/cache30/CacheMapTxnDUnitTest.java | 9 +-
.../gemstone/gemfire/cache30/CacheTestCase.java | 623 +----------
.../gemfire/cache30/CacheXmlTestCase.java | 8 +-
.../cache30/CachedAllEventsDUnitTest.java | 26 +-
.../cache30/ClearMultiVmCallBkDUnitTest.java | 6 +-
.../gemfire/cache30/ClearMultiVmDUnitTest.java | 5 +-
.../cache30/ClientMembershipDUnitTest.java | 10 +-
.../ClientRegisterInterestDUnitTest.java | 2 +-
.../cache30/ClientServerCCEDUnitTest.java | 2 +-
.../gemfire/cache30/ClientServerTestCase.java | 15 +-
.../cache30/DistAckMapMethodsDUnitTest.java | 5 +-
...tedAckOverflowRegionCCEOffHeapDUnitTest.java | 2 +-
...dAckPersistentRegionCCEOffHeapDUnitTest.java | 2 +-
...DistributedAckRegionCCEOffHeapDUnitTest.java | 2 +-
.../DistributedAckRegionOffHeapDUnitTest.java | 2 +-
.../DistributedMulticastRegionDUnitTest.java | 5 +-
...stributedNoAckRegionCCEOffHeapDUnitTest.java | 2 +-
.../DistributedNoAckRegionOffHeapDUnitTest.java | 2 +-
.../gemfire/cache30/DynamicRegionDUnitTest.java | 8 +-
.../GlobalRegionCCEOffHeapDUnitTest.java | 2 +-
.../cache30/GlobalRegionOffHeapDUnitTest.java | 2 +-
.../gemfire/cache30/MultiVMRegionTestCase.java | 13 +-
.../OffHeapLRUEvictionControllerDUnitTest.java | 2 +-
.../PartitionedRegionOffHeapDUnitTest.java | 2 +-
.../cache30/PutAllCallBkRemoteVMDUnitTest.java | 5 +-
.../cache30/PutAllCallBkSingleVMDUnitTest.java | 5 +-
.../gemfire/cache30/PutAllMultiVmDUnitTest.java | 5 +-
.../gemfire/cache30/ReconnectDUnitTest.java | 17 +-
.../ReconnectedCacheServerDUnitTest.java | 23 +-
.../RegionMembershipListenerDUnitTest.java | 7 +-
.../cache30/RegionReliabilityTestCase.java | 2 +-
.../gemfire/cache30/RegionTestCase.java | 2 +-
.../cache30/RemoveAllMultiVmDUnitTest.java | 5 +-
.../gemfire/cache30/SearchAndLoadDUnitTest.java | 2 +-
.../gemfire/cache30/SlowRecDUnitTest.java | 13 +-
.../gemfire/cache30/TXDistributedDUnitTest.java | 4 +-
.../distributed/DistributedMemberDUnitTest.java | 39 +-
.../distributed/DistributedSystemDUnitTest.java | 76 +-
.../distributed/HostedLocatorsDUnitTest.java | 7 +-
.../gemfire/distributed/LocatorDUnitTest.java | 15 +-
.../distributed/SystemAdminDUnitTest.java | 47 +-
.../distributed/internal/Bug40751DUnitTest.java | 2 +-
.../ConsoleDistributionManagerDUnitTest.java | 8 +-
.../internal/DistributionAdvisorDUnitTest.java | 8 +-
.../internal/DistributionManagerDUnitTest.java | 42 +-
.../internal/ProductUseLogDUnitTest.java | 66 +-
.../GemFireDeadlockDetectorDUnitTest.java | 2 +-
.../TcpServerBackwardCompatDUnitTest.java | 5 +-
.../gemfire/disttx/CacheMapDistTXDUnitTest.java | 17 +-
.../disttx/DistTXDebugDUnitDisabledTest.java | 1016 ++++++++++++++++++
.../gemfire/disttx/DistTXDebugDUnitTest.java | 1014 -----------------
.../disttx/DistTXDistributedTestSuite.java | 42 -
.../disttx/DistTXPersistentDebugDUnitTest.java | 15 +-
.../disttx/DistributedTransactionDUnitTest.java | 13 +-
...wardCompatibilitySerializationDUnitTest.java | 8 +-
.../gemfire/internal/JarDeployerDUnitTest.java | 2 +-
.../gemfire/internal/cache/BackupDUnitTest.java | 2 +-
.../internal/cache/Bug33359DUnitTest.java | 5 +-
.../internal/cache/Bug33726DUnitTest.java | 2 +-
.../internal/cache/Bug37241DUnitTest.java | 8 +-
.../internal/cache/Bug37377DUnitTest.java | 10 +-
.../internal/cache/Bug39079DUnitTest.java | 13 +-
.../internal/cache/Bug40299DUnitTest.java | 8 +-
.../internal/cache/Bug41091DUnitTest.java | 2 +-
.../internal/cache/Bug41733DUnitTest.java | 2 +-
.../internal/cache/Bug41957DUnitTest.java | 2 +-
.../internal/cache/Bug45164DUnitTest.java | 6 +-
.../internal/cache/Bug47667DUnitTest.java | 3 +-
.../internal/cache/CacheAdvisorDUnitTest.java | 6 +-
.../internal/cache/ClearDAckDUnitTest.java | 5 +-
.../internal/cache/ClearGlobalDUnitTest.java | 6 +-
.../cache/ClientServerGetAllDUnitTest.java | 2 +-
...ServerInvalidAndDestroyedEntryDUnitTest.java | 6 +-
.../ClientServerTransactionCCEDUnitTest.java | 7 +-
.../cache/ClientServerTransactionDUnitTest.java | 12 +-
.../ConcurrentDestroySubRegionDUnitTest.java | 3 +-
.../cache/ConnectDisconnectDUnitTest.java | 2 +-
.../cache/DeltaPropagationDUnitTest.java | 7 +-
.../cache/DeltaPropagationStatsDUnitTest.java | 6 +-
.../cache/DiskRegByteArrayDUnitTest.java | 9 +-
...DistrbutedRegionProfileOffHeapDUnitTest.java | 2 +-
.../cache/DistributedCacheTestCase.java | 10 +-
.../internal/cache/EventTrackerDUnitTest.java | 2 +-
.../cache/EvictionObjectSizerDUnitTest.java | 5 -
.../internal/cache/EvictionStatsDUnitTest.java | 4 +-
.../internal/cache/EvictionTestBase.java | 4 +-
.../internal/cache/GIIDeltaDUnitTest.java | 8 +-
.../internal/cache/GIIFlowControlDUnitTest.java | 2 +-
.../HAOverflowMemObjectSizerDUnitTest.java | 6 +-
.../cache/IncrementalBackupDUnitTest.java | 6 +-
.../cache/InterruptClientServerDUnitTest.java | 4 +-
.../internal/cache/InterruptsDUnitTest.java | 4 +-
.../cache/OffHeapEvictionDUnitTest.java | 2 +-
.../cache/OffHeapEvictionStatsDUnitTest.java | 2 +-
.../cache/P2PDeltaPropagationDUnitTest.java | 9 +-
.../cache/PartitionedRegionAPIDUnitTest.java | 43 +-
...gionBucketCreationDistributionDUnitTest.java | 67 +-
.../cache/PartitionedRegionDUnitTestCase.java | 2 +-
...rtitionedRegionDelayedRecoveryDUnitTest.java | 2 +-
...rtitionedRegionOffHeapEvictionDUnitTest.java | 2 +-
...artitionedRegionRedundancyZoneDUnitTest.java | 2 +-
.../PartitionedRegionSingleHopDUnitTest.java | 22 +-
...RegionSingleHopWithServerGroupDUnitTest.java | 21 +-
.../internal/cache/PutAllDAckDUnitTest.java | 5 +-
.../internal/cache/PutAllGlobalDUnitTest.java | 5 +-
.../cache/RemoteTransactionDUnitTest.java | 14 +-
.../internal/cache/RemoveAllDAckDUnitTest.java | 5 +-
.../internal/cache/RemoveDAckDUnitTest.java | 5 +-
.../internal/cache/RemoveGlobalDUnitTest.java | 5 +-
.../internal/cache/SingleHopStatsDUnitTest.java | 20 +-
.../internal/cache/SystemFailureDUnitTest.java | 6 +-
.../control/RebalanceOperationDUnitTest.java | 2 +-
.../cache/execute/Bug51193DUnitTest.java | 6 +-
.../ClientServerFunctionExecutionDUnitTest.java | 5 +-
.../execute/ColocationFailoverDUnitTest.java | 6 +-
...ributedRegionFunctionExecutionDUnitTest.java | 5 +-
.../execute/FunctionServiceStatsDUnitTest.java | 4 +-
.../cache/execute/LocalDataSetDUnitTest.java | 18 +-
.../execute/LocalDataSetIndexingDUnitTest.java | 3 +-
.../LocalFunctionExecutionDUnitTest.java | 13 +-
.../MemberFunctionExecutionDUnitTest.java | 7 +-
.../MultiRegionFunctionExecutionDUnitTest.java | 7 +-
.../OnGroupsFunctionExecutionDUnitTest.java | 2 +-
...ntServerFunctionExecutionNoAckDUnitTest.java | 3 -
...tServerRegionFunctionExecutionDUnitTest.java | 5 -
...egionFunctionExecutionFailoverDUnitTest.java | 3 +-
...onFunctionExecutionNoSingleHopDUnitTest.java | 4 -
...onExecutionSelectorNoSingleHopDUnitTest.java | 4 -
...gionFunctionExecutionSingleHopDUnitTest.java | 3 +-
.../cache/execute/PRClientServerTestBase.java | 22 +-
.../cache/execute/PRColocationDUnitTest.java | 5 +-
.../cache/execute/PRTransactionDUnitTest.java | 2 +-
.../execute/SingleHopGetAllPutAllDUnitTest.java | 5 -
.../cache/ha/Bug36853EventsExpiryDUnitTest.java | 20 +-
.../internal/cache/ha/Bug48571DUnitTest.java | 6 +-
.../internal/cache/ha/Bug48879DUnitTest.java | 6 +-
.../cache/ha/EventIdOptimizationDUnitTest.java | 7 +-
.../internal/cache/ha/FailoverDUnitTest.java | 7 +-
.../internal/cache/ha/HABugInPutDUnitTest.java | 11 +-
.../internal/cache/ha/HAClearDUnitTest.java | 8 +-
.../cache/ha/HAConflationDUnitTest.java | 46 +-
.../internal/cache/ha/HADuplicateDUnitTest.java | 7 +-
.../cache/ha/HAEventIdPropagationDUnitTest.java | 7 +-
.../internal/cache/ha/HAExpiryDUnitTest.java | 8 +-
.../internal/cache/ha/HAGIIBugDUnitTest.java | 8 +-
.../internal/cache/ha/HAGIIDUnitTest.java | 7 +-
.../cache/ha/HARQueueNewImplDUnitTest.java | 7 +-
.../internal/cache/ha/HARegionDUnitTest.java | 7 +-
.../cache/ha/HARegionQueueDUnitTest.java | 7 +-
.../cache/ha/HASlowReceiverDUnitTest.java | 7 +-
.../ha/OperationsPropagationDUnitTest.java | 8 +-
.../internal/cache/ha/PutAllDUnitTest.java | 7 +-
.../internal/cache/ha/StatsBugDUnitTest.java | 7 +-
.../cache/locks/TXLockServiceDUnitTest.java | 7 +-
.../cache/partitioned/Bug43684DUnitTest.java | 6 +-
.../cache/partitioned/Bug47388DUnitTest.java | 6 +-
.../cache/partitioned/Bug51400DUnitTest.java | 7 +-
.../partitioned/PartitionResolverDUnitTest.java | 6 +-
.../PartitionedRegionLoaderWriterDUnitTest.java | 5 -
...tentColocatedPartitionedRegionDUnitTest.java | 8 +-
.../PersistentPartitionedRegionTestBase.java | 7 +-
...rtitionedRegionWithTransactionDUnitTest.java | 6 +-
.../cache/partitioned/ShutdownAllDUnitTest.java | 4 +-
.../fixed/FixedPartitioningDUnitTest.java | 5 +-
.../fixed/FixedPartitioningTestBase.java | 2 +-
...ngWithColocationAndPersistenceDUnitTest.java | 5 +-
.../PersistentReplicatedTestBase.java | 5 +-
.../internal/cache/tier/Bug40396DUnitTest.java | 6 +-
...mpatibilityHigherVersionClientDUnitTest.java | 5 +-
.../cache/tier/sockets/Bug36269DUnitTest.java | 7 +-
.../cache/tier/sockets/Bug36457DUnitTest.java | 8 +-
.../cache/tier/sockets/Bug36805DUnitTest.java | 8 +-
.../cache/tier/sockets/Bug36829DUnitTest.java | 6 +-
.../cache/tier/sockets/Bug36995DUnitTest.java | 8 +-
.../cache/tier/sockets/Bug37210DUnitTest.java | 8 +-
.../cache/tier/sockets/Bug37805DUnitTest.java | 6 +-
.../CacheServerTransactionsDUnitTest.java | 7 +-
.../tier/sockets/ClearPropagationDUnitTest.java | 7 +-
.../tier/sockets/ClientConflationDUnitTest.java | 6 +-
.../sockets/ClientInterestNotifyDUnitTest.java | 10 +-
.../tier/sockets/ClientServerMiscDUnitTest.java | 13 +-
.../cache/tier/sockets/ConflationDUnitTest.java | 6 +-
.../DataSerializerPropogationDUnitTest.java | 5 +-
.../DestroyEntryPropagationDUnitTest.java | 8 +-
.../sockets/DurableClientBug39997DUnitTest.java | 16 +-
.../DurableClientQueueSizeDUnitTest.java | 5 +-
.../DurableClientReconnectDUnitTest.java | 8 +-
.../sockets/DurableClientStatsDUnitTest.java | 5 +-
.../sockets/DurableRegistrationDUnitTest.java | 6 +-
.../sockets/DurableResponseMatrixDUnitTest.java | 7 +-
.../sockets/EventIDVerificationDUnitTest.java | 8 +-
.../EventIDVerificationInP2PDUnitTest.java | 7 +-
...ForceInvalidateOffHeapEvictionDUnitTest.java | 2 +-
.../cache/tier/sockets/HABug36738DUnitTest.java | 178 +--
.../cache/tier/sockets/HAInterestTestCase.java | 5 +-
.../sockets/HAStartupAndFailoverDUnitTest.java | 9 +-
.../InstantiatorPropagationDUnitTest.java | 6 +-
.../tier/sockets/InterestListDUnitTest.java | 8 +-
.../sockets/InterestListEndpointDUnitTest.java | 7 +-
.../sockets/InterestListFailoverDUnitTest.java | 6 +-
.../sockets/InterestListRecoveryDUnitTest.java | 7 +-
.../sockets/InterestRegrListenerDUnitTest.java | 6 +-
.../sockets/InterestResultPolicyDUnitTest.java | 7 +-
.../sockets/NewRegionAttributesDUnitTest.java | 6 +-
.../tier/sockets/RedundancyLevelTestBase.java | 8 +-
.../tier/sockets/RegionCloseDUnitTest.java | 8 +-
...erInterestBeforeRegionCreationDUnitTest.java | 11 +-
.../sockets/RegisterInterestKeysDUnitTest.java | 7 +-
.../sockets/ReliableMessagingDUnitTest.java | 10 +-
.../sockets/UnregisterInterestDUnitTest.java | 6 +-
.../sockets/UpdatePropagationDUnitTest.java | 7 +-
.../VerifyEventIDGenerationInP2PDUnitTest.java | 7 +-
...UpdatesFromNonInterestEndPointDUnitTest.java | 9 +-
.../cache/wan/AsyncEventQueueTestBase.java | 32 +-
.../asyncqueue/AsyncEventListenerDUnitTest.java | 4 -
.../AsyncEventQueueStatsDUnitTest.java | 4 -
.../ConcurrentAsyncEventQueueDUnitTest.java | 4 -
.../CommonParallelAsyncEventQueueDUnitTest.java | 4 -
.../CompressionCacheConfigDUnitTest.java | 5 -
.../CompressionCacheListenerDUnitTest.java | 5 +-
.../CompressionRegionConfigDUnitTest.java | 5 -
.../CompressionRegionFactoryDUnitTest.java | 5 -
.../CompressionRegionOperationsDUnitTest.java | 6 +-
.../internal/jta/dunit/ExceptionsDUnitTest.java | 6 +-
.../jta/dunit/IdleTimeOutDUnitTest.java | 6 +-
.../jta/dunit/MaxPoolSizeDUnitTest.java | 6 +-
.../jta/dunit/TransactionTimeOutDUnitTest.java | 6 +-
.../dunit/TxnManagerMultiThreadDUnitTest.java | 7 +-
.../internal/jta/dunit/TxnTimeOutDUnitTest.java | 10 +-
.../offheap/OutOfOffHeapMemoryDUnitTest.java | 9 +-
.../process/LocalProcessLauncherDUnitTest.java | 3 +-
.../statistics/StatisticsDUnitTest.java | 9 +-
.../management/CacheManagementDUnitTest.java | 5 -
.../management/ClientHealthStatsDUnitTest.java | 9 +-
.../management/CompositeTypeTestDUnitTest.java | 5 -
.../management/DLockManagementDUnitTest.java | 5 -
.../management/DiskManagementDUnitTest.java | 5 +-
.../management/DistributedSystemDUnitTest.java | 6 -
.../management/LocatorManagementDUnitTest.java | 4 +-
.../gemfire/management/ManagementTestBase.java | 12 +-
.../MemberMBeanAttributesDUnitTest.java | 5 -
.../management/OffHeapManagementDUnitTest.java | 5 +-
.../gemfire/management/QueryDataDUnitTest.java | 6 +-
.../management/RegionManagementDUnitTest.java | 5 -
...ersalMembershipListenerAdapterDUnitTest.java | 6 +-
.../stats/DistributedSystemStatsDUnitTest.java | 6 +-
.../internal/cli/CliUtilDUnitTest.java | 2 +-
.../cli/commands/CliCommandTestBase.java | 6 +-
.../cli/commands/ConfigCommandsDUnitTest.java | 2 +-
.../cli/commands/DeployCommandsDUnitTest.java | 4 +-
...WithCacheLoaderDuringCacheMissDUnitTest.java | 4 +-
...stAndDescribeDiskStoreCommandsDUnitTest.java | 3 +-
.../cli/commands/ListIndexCommandDUnitTest.java | 3 +-
.../cli/commands/MemberCommandsDUnitTest.java | 5 +-
.../cli/commands/QueueCommandsDUnitTest.java | 4 +-
.../SharedConfigurationCommandsDUnitTest.java | 2 +-
.../cli/commands/ShellCommandsDUnitTest.java | 4 +-
.../cli/commands/ShowDeadlockDUnitTest.java | 7 +-
.../cli/commands/UserCommandsDUnitTest.java | 5 +-
.../SharedConfigurationDUnitTest.java | 2 +-
.../internal/pulse/TestClientIdsDUnitTest.java | 6 +-
.../internal/pulse/TestFunctionsDUnitTest.java | 5 -
.../internal/pulse/TestHeapDUnitTest.java | 7 +-
.../internal/pulse/TestLocatorsDUnitTest.java | 5 -
.../pulse/TestSubscriptionsDUnitTest.java | 6 +-
.../ClientsWithVersioningRetryDUnitTest.java | 5 +-
.../pdx/JSONPdxClientServerDUnitTest.java | 2 +-
.../gemfire/pdx/PdxSerializableDUnitTest.java | 6 -
.../gemfire/pdx/PdxTypeExportDUnitTest.java | 6 +-
.../gemfire/redis/RedisDistDUnitTest.java | 5 +-
.../security/ClientAuthenticationDUnitTest.java | 6 +-
.../security/ClientAuthorizationDUnitTest.java | 6 +-
.../security/ClientMultiUserAuthzDUnitTest.java | 7 +-
.../DeltaClientAuthorizationDUnitTest.java | 6 +-
.../DeltaClientPostAuthorizationDUnitTest.java | 7 +-
.../security/P2PAuthenticationDUnitTest.java | 5 +-
.../gemfire/security/SecurityTestUtil.java | 10 +-
.../gemfire/test/dunit/DistributedTestCase.java | 503 +--------
.../dunit/cache/internal/CacheTestFixture.java | 40 +
.../cache/internal/JUnit3CacheTestCase.java | 223 ++++
.../cache/internal/JUnit4CacheTestCase.java | 567 ++++++++++
.../dunit/internal/DistributedTestFixture.java | 87 ++
.../internal/JUnit3DistributedTestCase.java | 247 +++++
.../internal/JUnit4DistributedTestCase.java | 610 +++++++++++
.../internal/tests/JUnit3BasicDUnitTest.java | 189 ++++
.../JUnit3GetDefaultDiskStoreNameDUnitTest.java | 66 ++
.../tests/JUnit3GetTestMethodNameDUnitTest.java | 53 +
.../dunit/internal/tests/JUnit3VMDUnitTest.java | 192 ++++
.../internal/tests/JUnit4BasicDUnitTest.java | 202 ++++
.../JUnit4GetDefaultDiskStoreNameDUnitTest.java | 65 ++
.../tests/JUnit4GetTestMethodNameDUnitTest.java | 52 +
.../dunit/internal/tests/JUnit4VMDUnitTest.java | 200 ++++
.../test/dunit/tests/BasicDUnitTest.java | 201 ++--
.../tests/GetDefaultDiskStoreNameDUnitTest.java | 12 +-
.../dunit/tests/GetTestMethodNameDUnitTest.java | 8 +-
...ingGetPropertiesDisconnectsAllDUnitTest.java | 57 +
.../gemfire/test/dunit/tests/VMDUnitTest.java | 192 ++--
.../cache/query/cq/dunit/CqDataDUnitTest.java | 12 +-
.../dunit/CqDataOptimizedExecuteDUnitTest.java | 8 +-
.../cq/dunit/CqDataUsingPoolDUnitTest.java | 18 +-
...qDataUsingPoolOptimizedExecuteDUnitTest.java | 12 +-
.../cache/query/cq/dunit/CqPerfDUnitTest.java | 9 +-
.../cq/dunit/CqPerfUsingPoolDUnitTest.java | 9 +-
.../cache/query/cq/dunit/CqQueryDUnitTest.java | 12 +-
.../dunit/CqQueryOptimizedExecuteDUnitTest.java | 8 +-
.../cq/dunit/CqQueryUsingPoolDUnitTest.java | 12 +-
...QueryUsingPoolOptimizedExecuteDUnitTest.java | 6 +-
.../cq/dunit/CqResultSetUsingPoolDUnitTest.java | 20 +-
...ltSetUsingPoolOptimizedExecuteDUnitTest.java | 8 +-
.../cache/query/cq/dunit/CqStatsDUnitTest.java | 12 +-
.../dunit/CqStatsOptimizedExecuteDUnitTest.java | 8 +-
.../cq/dunit/CqStatsUsingPoolDUnitTest.java | 12 +-
...StatsUsingPoolOptimizedExecuteDUnitTest.java | 8 +-
...dRegionCqQueryOptimizedExecuteDUnitTest.java | 6 +-
.../PrCqUsingPoolOptimizedExecuteDUnitTest.java | 8 +-
.../cache/query/dunit/PdxQueryCQTestBase.java | 2 +-
.../query/dunit/QueryMonitorDUnitTest.java | 2 +-
.../cache/snapshot/ClientSnapshotDUnitTest.java | 6 +-
.../cache/PRDeltaPropagationDUnitTest.java | 6 +-
.../cache/RemoteCQTransactionDUnitTest.java | 2 +-
.../internal/cache/ha/CQListGIIDUnitTest.java | 7 +-
.../cache/ha/HADispatcherDUnitTest.java | 8 +-
.../sockets/ClientToServerDeltaDUnitTest.java | 5 +-
.../DeltaPropagationWithCQDUnitTest.java | 6 +-
...ToRegionRelationCQRegistrationDUnitTest.java | 6 +-
.../sockets/DurableClientCrashDUnitTest.java | 4 +-
.../tier/sockets/DurableClientTestCase.java | 11 +-
.../CacheServerManagementDUnitTest.java | 4 +-
.../cli/commands/ClientCommandsDUnitTest.java | 2 +-
.../DurableClientCommandsDUnitTest.java | 2 +-
.../internal/pulse/TestCQDUnitTest.java | 5 -
.../internal/pulse/TestClientsDUnitTest.java | 5 -
.../internal/pulse/TestServerDUnitTest.java | 5 -
.../ClientAuthorizationTwoDUnitTest.java | 6 +-
.../security/ClientAuthzObjectModDUnitTest.java | 10 +-
.../ClientCQPostAuthorizationDUnitTest.java | 7 +-
.../ClientPostAuthorizationDUnitTest.java | 7 +-
.../gemfire/security/MultiuserAPIDUnitTest.java | 6 +-
.../MultiuserDurableCQAuthzDUnitTest.java | 4 +-
.../LuceneFunctionReadPathDUnitTest.java | 3 +-
.../internal/cache/UpdateVersionDUnitTest.java | 10 +-
.../gemfire/internal/cache/wan/WANTestBase.java | 85 +-
...oncurrentParallelGatewaySenderDUnitTest.java | 4 -
...allelGatewaySenderOperation_1_DUnitTest.java | 6 +-
...allelGatewaySenderOperation_2_DUnitTest.java | 6 +-
.../cache/wan/disttx/DistTXWANDUnitTest.java | 6 +-
...wWANConcurrencyCheckForDestroyDUnitTest.java | 4 -
.../cache/wan/misc/PDXNewWanDUnitTest.java | 4 -
.../SenderWithTransportFilterDUnitTest.java | 6 +-
...downAllPersistentGatewaySenderDUnitTest.java | 3 +-
.../wan/misc/WANLocatorServerDUnitTest.java | 11 +-
.../cache/wan/misc/WANSSLDUnitTest.java | 4 -
.../wan/misc/WanAutoDiscoveryDUnitTest.java | 5 +-
.../cache/wan/misc/WanValidationsDUnitTest.java | 4 -
...arallelGatewaySenderOperationsDUnitTest.java | 6 +-
...llelGatewaySenderQueueOverflowDUnitTest.java | 8 +-
.../ParallelWANConflationDUnitTest.java | 4 +-
...ersistenceEnabledGatewaySenderDUnitTest.java | 6 +-
...llelWANPropagationClientServerDUnitTest.java | 4 -
...lelWANPropagationConcurrentOpsDUnitTest.java | 4 -
.../ParallelWANPropagationDUnitTest.java | 4 -
...ParallelWANPropagationLoopBackDUnitTest.java | 4 -
.../wan/parallel/ParallelWANStatsDUnitTest.java | 4 +-
...tewaySenderDistributedDeadlockDUnitTest.java | 4 -
...rialGatewaySenderEventListenerDUnitTest.java | 4 -
.../SerialGatewaySenderOperationsDUnitTest.java | 4 +-
.../SerialGatewaySenderQueueDUnitTest.java | 9 +-
...ersistenceEnabledGatewaySenderDUnitTest.java | 4 -
.../SerialWANPropagationLoopBackDUnitTest.java | 4 -
.../serial/SerialWANPropogationDUnitTest.java | 4 +-
...NPropogation_PartitionedRegionDUnitTest.java | 5 -
.../SerialWANPropogationsFeatureDUnitTest.java | 4 -
.../wan/serial/SerialWANStatsDUnitTest.java | 4 +-
.../wan/wancommand/WANCommandTestBase.java | 42 +-
...anCommandCreateGatewayReceiverDUnitTest.java | 24 +-
.../WanCommandCreateGatewaySenderDUnitTest.java | 24 +-
...WanCommandGatewayReceiverStartDUnitTest.java | 14 +-
.../WanCommandGatewayReceiverStopDUnitTest.java | 14 +-
.../WanCommandGatewaySenderStartDUnitTest.java | 16 +-
.../WanCommandGatewaySenderStopDUnitTest.java | 14 +-
.../wan/wancommand/WanCommandListDUnitTest.java | 14 +-
.../WanCommandPauseResumeDUnitTest.java | 24 +-
.../wancommand/WanCommandStatusDUnitTest.java | 16 +-
420 files changed, 5646 insertions(+), 4402 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-assembly/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/LauncherLifecycleCommandsDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-assembly/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/LauncherLifecycleCommandsDUnitTest.java b/geode-assembly/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/LauncherLifecycleCommandsDUnitTest.java
index f0eaaac..36f63b0 100644
--- a/geode-assembly/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/LauncherLifecycleCommandsDUnitTest.java
+++ b/geode-assembly/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/LauncherLifecycleCommandsDUnitTest.java
@@ -145,12 +145,7 @@ public class LauncherLifecycleCommandsDUnitTest extends CliCommandTestBase {
}
@Override
- public void setUp() throws Exception {
- super.setUp();
- }
-
- @Override
- protected final void postTearDown() throws Exception {
+ public final void postTearDown() throws Exception {
LauncherLifecycleCommands launcherLifecycleCommands = new LauncherLifecycleCommands();
Integer pid;
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPIOnRegionFunctionExecutionDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPIOnRegionFunctionExecutionDUnitTest.java b/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPIOnRegionFunctionExecutionDUnitTest.java
index ed622e8..d04a1b1 100644
--- a/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPIOnRegionFunctionExecutionDUnitTest.java
+++ b/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPIOnRegionFunctionExecutionDUnitTest.java
@@ -50,10 +50,6 @@ public class RestAPIOnRegionFunctionExecutionDUnitTest extends RestAPITestBase {
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
- }
-
private class SampleFunction extends RestFunctionTemplate {
public static final String Id = "SampleFunction";
@@ -63,22 +59,22 @@ public class RestAPIOnRegionFunctionExecutionDUnitTest extends RestAPITestBase {
if (context instanceof RegionFunctionContext) {
RegionFunctionContext rfContext = (RegionFunctionContext) context;
rfContext.getDataSet().getCache().getLogger()
- .info("Executing function : SampleFunction.execute(hasResult=true) with filter: " + rfContext.getFilter() + " " + rfContext);
+ .info("Executing function : SampleFunction.execute(hasResult=true) with filter: " + rfContext.getFilter() + " " + rfContext);
if (rfContext.getArguments() instanceof Boolean) {
/* return rfContext.getArguments(); */
if (hasResult()) {
rfContext.getResultSender().lastResult(
- (Serializable) rfContext.getArguments());
+ (Serializable) rfContext.getArguments());
} else {
rfContext
- .getDataSet()
- .getCache()
- .getLogger()
- .info(
- "Executing function : SampleFunction.execute(hasResult=false) " + rfContext);
+ .getDataSet()
+ .getCache()
+ .getLogger()
+ .info(
+ "Executing function : SampleFunction.execute(hasResult=false) " + rfContext);
while (true && !rfContext.getDataSet().isDestroyed()) {
rfContext.getDataSet().getCache().getLogger()
- .info("For Bug43513 ");
+ .info("For Bug43513 ");
try {
Thread.sleep(100);
} catch (InterruptedException ie) {
@@ -95,7 +91,7 @@ public class RestAPIOnRegionFunctionExecutionDUnitTest extends RestAPITestBase {
Thread.sleep(2000);
} catch (InterruptedException e) {
rfContext.getDataSet().getCache().getLogger()
- .warning("Got Exception : Thread Interrupted" + e);
+ .warning("Got Exception : Thread Interrupted" + e);
}
}
if (PartitionRegionHelper.isPartitionedRegion(rfContext.getDataSet())) {
@@ -105,11 +101,11 @@ public class RestAPIOnRegionFunctionExecutionDUnitTest extends RestAPITestBase {
* rfContext).get(key);
*/
rfContext.getResultSender().lastResult(
- (Serializable) PartitionRegionHelper.getLocalDataForContext(
- rfContext).get(key));
+ (Serializable) PartitionRegionHelper.getLocalDataForContext(
+ rfContext).get(key));
} else {
rfContext.getResultSender().lastResult(
- (Serializable) rfContext.getDataSet().get(key));
+ (Serializable) rfContext.getDataSet().get(key));
}
/* return (Serializable)rfContext.getDataSet().get(key); */
} else if (rfContext.getArguments() instanceof Set) {
@@ -117,7 +113,7 @@ public class RestAPIOnRegionFunctionExecutionDUnitTest extends RestAPITestBase {
ArrayList vals = new ArrayList();
for (Object key : origKeys) {
Object val = PartitionRegionHelper
- .getLocalDataForContext(rfContext).get(key);
+ .getLocalDataForContext(rfContext).get(key);
if (val != null) {
vals.add(val);
}
@@ -141,10 +137,10 @@ public class RestAPIOnRegionFunctionExecutionDUnitTest extends RestAPITestBase {
DistributedSystem ds = InternalDistributedSystem.getAnyInstance();
LogWriter logger = ds.getLogWriter();
logger.info("Executing in SampleFunction on Server : "
- + ds.getDistributedMember() + "with Context : " + context);
+ + ds.getDistributedMember() + "with Context : " + context);
while (ds.isConnected()) {
logger
- .fine("Just executing function in infinite loop for Bug43513");
+ .fine("Just executing function in infinite loop for Bug43513");
try {
Thread.sleep(250);
} catch (InterruptedException e) {
@@ -187,7 +183,7 @@ public class RestAPIOnRegionFunctionExecutionDUnitTest extends RestAPITestBase {
private boolean createPeerWithPR() {
RegionAttributes ra = PartitionedRegionTestHelper.createRegionAttrsForPR(0,
- 10);
+ 10);
AttributesFactory raf = new AttributesFactory(ra);
PartitionAttributesImpl pa = new PartitionAttributesImpl();
pa.setAll(ra.getPartitionAttributes());
@@ -313,13 +309,13 @@ public class RestAPIOnRegionFunctionExecutionDUnitTest extends RestAPITestBase {
vm3.invoke("populatePRRegion",() -> populatePRRegion());
String jsonBody = "["
- + "{\"@type\": \"double\",\"@value\": 210}"
- + ",{\"@type\":\"com.gemstone.gemfire.rest.internal.web.controllers.Item\","
- + "\"itemNo\":\"599\",\"description\":\"Part X Free on Bumper Offer\","
- + "\"quantity\":\"2\","
- + "\"unitprice\":\"5\","
- + "\"totalprice\":\"10.00\"}"
- + "]";
+ + "{\"@type\": \"double\",\"@value\": 210}"
+ + ",{\"@type\":\"com.gemstone.gemfire.rest.internal.web.controllers.Item\","
+ + "\"itemNo\":\"599\",\"description\":\"Part X Free on Bumper Offer\","
+ + "\"quantity\":\"2\","
+ + "\"unitprice\":\"5\","
+ + "\"totalprice\":\"10.00\"}"
+ + "]";
CloseableHttpResponse response = executeFunctionThroughRestCall("SampleFunction", PR_REGION_NAME, null, jsonBody, null, null);
assertEquals(200, response.getStatusLine().getStatusCode());
@@ -329,13 +325,13 @@ public class RestAPIOnRegionFunctionExecutionDUnitTest extends RestAPITestBase {
assertCorrectInvocationCount(4, vm0, vm1, vm2, vm3);
jsonBody = "["
- + "{\"@type\": \"double\",\"@value\": 220}"
- + ",{\"@type\":\"com.gemstone.gemfire.rest.internal.web.controllers.Item\","
- + "\"itemNo\":\"609\",\"description\":\"Part X Free on Bumper Offer\","
- + "\"quantity\":\"3\","
- + "\"unitprice\":\"9\","
- + "\"totalprice\":\"12.00\"}"
- + "]";
+ + "{\"@type\": \"double\",\"@value\": 220}"
+ + ",{\"@type\":\"com.gemstone.gemfire.rest.internal.web.controllers.Item\","
+ + "\"itemNo\":\"609\",\"description\":\"Part X Free on Bumper Offer\","
+ + "\"quantity\":\"3\","
+ + "\"unitprice\":\"9\","
+ + "\"totalprice\":\"12.00\"}"
+ + "]";
resetInvocationCounts(vm0,vm1,vm2,vm3);
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPITestBase.java
----------------------------------------------------------------------
diff --git a/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPITestBase.java b/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPITestBase.java
index ba709b7..fc71fd8 100644
--- a/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPITestBase.java
+++ b/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPITestBase.java
@@ -60,14 +60,13 @@ public class RestAPITestBase extends DistributedTestCase {
}
@Override
- public void setUp() throws Exception {
- super.setUp();
+ public final void postSetUp() throws Exception {
disconnectAllFromDS();
AgentUtil agentUtil = new AgentUtil(GemFireVersion.getGemFireVersion());
if (agentUtil.findWarLocation("geode-web-api") == null) {
fail("unable to locate geode-web-api WAR file");
}
- Wait.pause(1000);
+ Wait.pause(1000); // TODO: replace this with Awaitility
final Host host = Host.getHost(0);
vm0 = host.getVM(0);
vm1 = host.getVM(1);
@@ -76,13 +75,17 @@ public class RestAPITestBase extends DistributedTestCase {
// gradle sets a property telling us where the build is located
final String buildDir = System.getProperty("geode.build.dir", System.getProperty("user.dir"));
Invoke.invokeInEveryVM(() -> System.setProperty("geode.build.dir", buildDir));
+ postSetUpRestAPITestBase();
+ }
+
+ protected void postSetUpRestAPITestBase() throws Exception {
}
/**
* close the clients and teh servers
*/
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
vm0.invoke(() -> closeCache());
vm1.invoke(() -> closeCache());
vm2.invoke(() -> closeCache());
@@ -128,7 +131,7 @@ public class RestAPITestBase extends DistributedTestCase {
}
protected CloseableHttpResponse executeFunctionThroughRestCall(String function, String regionName, String filter, String jsonBody, String groups,
- String members) {
+ String members) {
LogWriterUtils.getLogWriter().info("Entering executeFunctionThroughRestCall");
try {
CloseableHttpClient httpclient = HttpClients.createDefault();
@@ -196,7 +199,7 @@ public class RestAPITestBase extends DistributedTestCase {
HttpEntity entity = response.getEntity();
InputStream content = entity.getContent();
BufferedReader reader = new BufferedReader(new InputStreamReader(
- content));
+ content));
String line;
StringBuffer sb = new StringBuffer();
while ((line = reader.readLine()) != null) {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPIsAndInterOpsDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPIsAndInterOpsDUnitTest.java b/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPIsAndInterOpsDUnitTest.java
index 0245fa0..fcdf5aa 100644
--- a/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPIsAndInterOpsDUnitTest.java
+++ b/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPIsAndInterOpsDUnitTest.java
@@ -170,9 +170,9 @@ public class RestAPIsAndInterOpsDUnitTest extends LocatorTestBase {
}
- public void setUp() throws Exception {
+ @Override
+ public final void preSetUp() throws Exception {
disconnectAllFromDS();
- super.setUp();
}
@Override
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPIsOnGroupsFunctionExecutionDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPIsOnGroupsFunctionExecutionDUnitTest.java b/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPIsOnGroupsFunctionExecutionDUnitTest.java
index 0419c78..61e0925 100644
--- a/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPIsOnGroupsFunctionExecutionDUnitTest.java
+++ b/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPIsOnGroupsFunctionExecutionDUnitTest.java
@@ -33,10 +33,6 @@ public class RestAPIsOnGroupsFunctionExecutionDUnitTest extends RestAPITestBase
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
- }
-
@Override
protected String getFunctionID() {
return OnGroupsFunction.Id;
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPIsOnMembersFunctionExecutionDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPIsOnMembersFunctionExecutionDUnitTest.java b/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPIsOnMembersFunctionExecutionDUnitTest.java
index f8bf20e..ca01830 100644
--- a/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPIsOnMembersFunctionExecutionDUnitTest.java
+++ b/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPIsOnMembersFunctionExecutionDUnitTest.java
@@ -38,11 +38,6 @@ public class RestAPIsOnMembersFunctionExecutionDUnitTest extends RestAPITestBase
super(name);
}
- @Override
- public void setUp() throws Exception {
- super.setUp();
- }
-
private class OnMembersFunction extends RestFunctionTemplate {
public static final String Id = "OnMembersFunction";
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPIsWithSSLDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPIsWithSSLDUnitTest.java b/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPIsWithSSLDUnitTest.java
index 29aab32..852591f 100644
--- a/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPIsWithSSLDUnitTest.java
+++ b/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPIsWithSSLDUnitTest.java
@@ -89,9 +89,9 @@ public class RestAPIsWithSSLDUnitTest extends LocatorTestBase {
}
- public void setUp() throws Exception {
+ @Override
+ public final void preSetUp() throws Exception {
disconnectAllFromDS();
- super.setUp();
}
@Override
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/cache/CacheRegionClearStatsDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/CacheRegionClearStatsDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/CacheRegionClearStatsDUnitTest.java
index 88a32a3..73edcd2 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/CacheRegionClearStatsDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/CacheRegionClearStatsDUnitTest.java
@@ -61,8 +61,8 @@ public class CacheRegionClearStatsDUnitTest 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);
client1 = host.getVM(1);
@@ -187,7 +187,7 @@ public class CacheRegionClearStatsDUnitTest extends DistributedTestCase {
}
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
client1.invoke(() -> CacheRegionClearStatsDUnitTest.closeCache());
// then close the servers
server1.invoke(() -> CacheRegionClearStatsDUnitTest.closeCache());
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/cache/ClientServerTimeSyncDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/ClientServerTimeSyncDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/ClientServerTimeSyncDUnitTest.java
index 8b04ab5..12f5340 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/ClientServerTimeSyncDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/ClientServerTimeSyncDUnitTest.java
@@ -74,7 +74,7 @@ public class ClientServerTimeSyncDUnitTest extends CacheTestCase {
}
// now set an artificial time offset for the test
- system.getClock().setCacheTimeOffset(null, TEST_OFFSET, true);
+ basicGetSystem().getClock().setCacheTimeOffset(null, TEST_OFFSET, true);
LogWriterUtils.getLogWriter().info("Done creating and starting CacheServer on port " + server.getPort());
return server.getPort();
@@ -151,7 +151,7 @@ public class ClientServerTimeSyncDUnitTest extends CacheTestCase {
}
// now set an artificial time offset for the test
- system.getClock().setCacheTimeOffset(null, -TEST_OFFSET, true);
+ basicGetSystem().getClock().setCacheTimeOffset(null, -TEST_OFFSET, true);
LogWriterUtils.getLogWriter().info("Done creating and starting CacheServer on port " + server.getPort());
return server.getPort();
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/cache/ConnectionPoolAndLoaderDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/ConnectionPoolAndLoaderDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/ConnectionPoolAndLoaderDUnitTest.java
index ee382ab..9ce5bed 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/ConnectionPoolAndLoaderDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/ConnectionPoolAndLoaderDUnitTest.java
@@ -48,12 +48,8 @@ public class ConnectionPoolAndLoaderDUnitTest extends CacheTestCase {
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
- }
-
@Override
- protected final void preTearDownCacheTestCase() {
+ public final void preTearDownCacheTestCase() {
//TODO grid. This is a hack. The next dunit test to run after
//this one is the ConnectionPoolAutoDUnit test. That ends up calling
//getSystem() with no arguments and expects to get a system without
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/cache/ConnectionPoolAutoDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/ConnectionPoolAutoDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/ConnectionPoolAutoDUnitTest.java
index bf5a22c..3b43ab8 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/ConnectionPoolAutoDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/ConnectionPoolAutoDUnitTest.java
@@ -29,10 +29,9 @@ public class ConnectionPoolAutoDUnitTest extends ConnectionPoolDUnitTest {
public ConnectionPoolAutoDUnitTest(String name) {
super(name);
}
-
- public void setUp() throws Exception {
- super.setUp();
- // TODO Auto-generated method stub
+
+ @Override
+ protected final void postSetUpConnectionPoolDUnitTest() throws Exception {
ClientServerTestCase.AUTO_LOAD_BALANCE = true;
Invoke.invokeInEveryVM(new SerializableRunnable("setupAutoMode") {
public void run() {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/cache/ConnectionPoolDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/ConnectionPoolDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/ConnectionPoolDUnitTest.java
index e09a4c9..2acab3a 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/ConnectionPoolDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/ConnectionPoolDUnitTest.java
@@ -106,8 +106,8 @@ public class ConnectionPoolDUnitTest extends CacheTestCase {
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
+ @Override
+ public final void postSetUp() throws Exception {
// avoid IllegalStateException from HandShake by connecting all vms to
// system before creating pool
getSystem();
@@ -116,10 +116,14 @@ public class ConnectionPoolDUnitTest extends CacheTestCase {
getSystem();
}
});
+ postSetUpConnectionPoolDUnitTest();
+ }
+
+ protected void postSetUpConnectionPoolDUnitTest() throws Exception {
}
@Override
- protected final void postTearDownCacheTestCase() throws Exception {
+ public final void postTearDownCacheTestCase() throws Exception {
Invoke.invokeInEveryVM(new SerializableRunnable() {
public void run() {
Map pools = PoolManager.getAll();
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/cache/client/ClientServerRegisterInterestsDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/client/ClientServerRegisterInterestsDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/client/ClientServerRegisterInterestsDUnitTest.java
index 58844b0..1b7eb78 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/client/ClientServerRegisterInterestsDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/client/ClientServerRegisterInterestsDUnitTest.java
@@ -65,15 +65,14 @@ public class ClientServerRegisterInterestsDUnitTest extends DistributedTestCase
}
@Override
- public void setUp() throws Exception {
- super.setUp();
+ public final void postSetUp() throws Exception {
disconnectAllFromDS();
setupGemFireCacheServer();
IgnoredException.addIgnoredException("java.net.ConnectException");
}
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
serverPort.set(0);
entryEvents.clear();
gemfireServerVm.invoke(new SerializableRunnable() {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/cache/client/internal/AutoConnectionSourceDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/client/internal/AutoConnectionSourceDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/client/internal/AutoConnectionSourceDUnitTest.java
index 03368de..a38bc05 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/client/internal/AutoConnectionSourceDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/client/internal/AutoConnectionSourceDUnitTest.java
@@ -55,9 +55,9 @@ public class AutoConnectionSourceDUnitTest extends LocatorTestBase {
protected static final Object BRIDGE_LISTENER = "BRIDGE_LISTENER";
private static final long MAX_WAIT = 60000;
-
- public void setUp() throws Exception {
- super.setUp();
+
+ @Override
+ public final void postSetUp() throws Exception {
IgnoredException.addIgnoredException("NoAvailableLocatorsException");
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/cache/client/internal/CacheServerSSLConnectionDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/client/internal/CacheServerSSLConnectionDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/client/internal/CacheServerSSLConnectionDUnitTest.java
index c59ed4f..15f5d52 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/client/internal/CacheServerSSLConnectionDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/client/internal/CacheServerSSLConnectionDUnitTest.java
@@ -43,7 +43,7 @@ import com.gemstone.gemfire.util.test.TestUtil;
* Tests cacheserver ssl support added. See https://svn.gemstone.com/trac/gemfire/ticket/48995 for details
*/
public class CacheServerSSLConnectionDUnitTest extends DistributedTestCase {
-
+
private static final long serialVersionUID = 1L;
private static final String TRUSTED_STORE = "trusted.keystore";
@@ -60,14 +60,14 @@ public class CacheServerSSLConnectionDUnitTest extends DistributedTestCase {
private int cacheServerPort;
private String hostName;
- public void setUp() throws Exception {
+ @Override
+ public final void preSetUp() throws Exception {
disconnectAllFromDS();
- super.setUp();
}
public CacheServerSSLConnectionDUnitTest(String name) {
super(name);
- }
+ }
public Cache createCache(Properties props) throws Exception
{
@@ -79,7 +79,7 @@ public class CacheServerSSLConnectionDUnitTest extends DistributedTestCase {
}
return cache;
}
-
+
private void createServer() throws IOException{
cacheServerPort = AvailablePortHelper.getRandomAvailableTCPPort();
cacheServer = cache.addCacheServer();
@@ -87,20 +87,20 @@ public class CacheServerSSLConnectionDUnitTest extends DistributedTestCase {
cacheServer.start();
hostName = cacheServer.getHostnameForClients();
}
-
+
public int getCacheServerPort(){
return cacheServerPort;
}
-
+
public String getCacheServerHost(){
return hostName;
}
-
+
public void stopCacheServer(){
this.cacheServer.stop();
}
-
-
+
+
@SuppressWarnings("rawtypes")
public void setUpServerVM(boolean cacheServerSslenabled) throws Exception {
Properties gemFireProps = new Properties();
@@ -109,14 +109,14 @@ public class CacheServerSSLConnectionDUnitTest extends DistributedTestCase {
String cacheServerSslciphers = "any";
boolean cacheServerSslRequireAuth = true;
gemFireProps.put(DistributionConfig.SERVER_SSL_ENABLED_NAME,
- String.valueOf(cacheServerSslenabled));
+ String.valueOf(cacheServerSslenabled));
gemFireProps.put(DistributionConfig.SERVER_SSL_PROTOCOLS_NAME,
- cacheServerSslprotocols);
+ cacheServerSslprotocols);
gemFireProps.put(DistributionConfig.SERVER_SSL_CIPHERS_NAME,
- cacheServerSslciphers);
+ cacheServerSslciphers);
gemFireProps.put(
- DistributionConfig.SERVER_SSL_REQUIRE_AUTHENTICATION_NAME,
- String.valueOf(cacheServerSslRequireAuth));
+ DistributionConfig.SERVER_SSL_REQUIRE_AUTHENTICATION_NAME,
+ String.valueOf(cacheServerSslRequireAuth));
String keyStore = TestUtil.getResourcePath(CacheServerSSLConnectionDUnitTest.class, SERVER_KEY_STORE);
String trustStore = TestUtil.getResourcePath(CacheServerSSLConnectionDUnitTest.class, SERVER_TRUST_STORE);
@@ -125,21 +125,21 @@ public class CacheServerSSLConnectionDUnitTest extends DistributedTestCase {
gemFireProps.put(DistributionConfig.SERVER_SSL_KEYSTORE_PASSWORD_NAME, "password");
gemFireProps.put(DistributionConfig.SERVER_SSL_TRUSTSTORE_NAME, trustStore);
gemFireProps.put(DistributionConfig.SERVER_SSL_TRUSTSTORE_PASSWORD_NAME, "password");
-
+
StringWriter sw = new StringWriter();
PrintWriter writer = new PrintWriter(sw);
gemFireProps.list(writer);
System.out.println("Starting cacheserver ds with following properties \n" + sw);
createCache(gemFireProps);
-
+
RegionFactory factory = cache.createRegionFactory(RegionShortcut.REPLICATE);
Region r = factory.create("serverRegion");
r.put("serverkey", "servervalue");
}
-
+
public void setUpClientVM(String host, int port,
- boolean cacheServerSslenabled, boolean cacheServerSslRequireAuth,
- String keyStore, String trustStore, boolean subscription) {
+ boolean cacheServerSslenabled, boolean cacheServerSslRequireAuth,
+ String keyStore, String trustStore, boolean subscription) {
Properties gemFireProps = new Properties();
@@ -150,14 +150,14 @@ public class CacheServerSSLConnectionDUnitTest extends DistributedTestCase {
String trustStorePath = TestUtil.getResourcePath(CacheServerSSLConnectionDUnitTest.class, trustStore);
//using new server-ssl-* properties
gemFireProps.put(DistributionConfig.SERVER_SSL_ENABLED_NAME,
- String.valueOf(cacheServerSslenabled));
+ String.valueOf(cacheServerSslenabled));
gemFireProps.put(DistributionConfig.SERVER_SSL_PROTOCOLS_NAME,
- cacheServerSslprotocols);
+ cacheServerSslprotocols);
gemFireProps.put(DistributionConfig.SERVER_SSL_CIPHERS_NAME,
- cacheServerSslciphers);
+ cacheServerSslciphers);
gemFireProps.put(
- DistributionConfig.SERVER_SSL_REQUIRE_AUTHENTICATION_NAME,
- String.valueOf(cacheServerSslRequireAuth));
+ DistributionConfig.SERVER_SSL_REQUIRE_AUTHENTICATION_NAME,
+ String.valueOf(cacheServerSslRequireAuth));
gemFireProps.put(DistributionConfig.SERVER_SSL_KEYSTORE_TYPE_NAME, "jks");
gemFireProps.put(DistributionConfig.SERVER_SSL_KEYSTORE_NAME, keyStorePath);
@@ -169,90 +169,90 @@ public class CacheServerSSLConnectionDUnitTest extends DistributedTestCase {
PrintWriter writer = new PrintWriter(sw);
gemFireProps.list(writer);
System.out.println("Starting client ds with following properties \n" + sw.getBuffer());
-
+
ClientCacheFactory clientCacheFactory = new ClientCacheFactory(gemFireProps);
clientCacheFactory.setPoolSubscriptionEnabled(subscription).addPoolServer(host, port);
clientCache = clientCacheFactory.create();
-
+
ClientRegionFactory<String,String> regionFactory = clientCache.createClientRegionFactory(ClientRegionShortcut.PROXY);
- Region<String, String> region = regionFactory.create("serverRegion");
+ Region<String, String> region = regionFactory.create("serverRegion");
assertNotNull(region);
}
-
+
public void doClientRegionTest(){
Region<String, String> region = clientCache.getRegion("serverRegion");
assertEquals("servervalue",region.get("serverkey"));
region.put("clientkey", "clientvalue");
assertEquals("clientvalue",region.get("clientkey"));
}
-
+
public void doServerRegionTest(){
Region<String, String> region = cache.getRegion("serverRegion");
- assertEquals("servervalue",region.get("serverkey"));
+ assertEquals("servervalue",region.get("serverkey"));
assertEquals("clientvalue",region.get("clientkey"));
}
-
-
+
+
public static void setUpServerVMTask(boolean cacheServerSslenabled) throws Exception{
instance.setUpServerVM(cacheServerSslenabled);
}
-
+
public static void createServerTask() throws Exception {
instance.createServer();
}
-
+
public static void setUpClientVMTask(String host, int port,
- boolean cacheServerSslenabled, boolean cacheServerSslRequireAuth, String keyStore, String trustStore)
- throws Exception {
+ boolean cacheServerSslenabled, boolean cacheServerSslRequireAuth, String keyStore, String trustStore)
+ throws Exception {
instance.setUpClientVM(host, port, cacheServerSslenabled,
- cacheServerSslRequireAuth, keyStore, trustStore, true);
+ cacheServerSslRequireAuth, keyStore, trustStore, true);
}
public static void setUpClientVMTaskNoSubscription(String host, int port,
- boolean cacheServerSslenabled, boolean cacheServerSslRequireAuth, String keyStore, String trustStore)
- throws Exception {
+ boolean cacheServerSslenabled, boolean cacheServerSslRequireAuth, String keyStore, String trustStore)
+ throws Exception {
instance.setUpClientVM(host, port, cacheServerSslenabled,
- cacheServerSslRequireAuth, keyStore, trustStore, false);
+ cacheServerSslRequireAuth, keyStore, trustStore, false);
}
-
+
public static void doClientRegionTestTask() {
instance.doClientRegionTest();
}
-
+
public static void doServerRegionTestTask() {
instance.doServerRegionTest();
}
-
+
public static Object[] getCacheServerEndPointTask() { // TODO: avoid Object[]
Object[] array = new Object[2];
array[0] = instance.getCacheServerHost();
array[1] = instance.getCacheServerPort();
return array;
}
-
+
public static void closeCacheTask(){
if (instance != null && instance.cache != null) {
instance.cache.close();
}
}
-
+
public static void closeClientCacheTask(){
if (instance != null && instance.clientCache != null) {
instance.clientCache.close();
}
}
-
+
public void testCacheServerSSL() throws Exception {
final Host host = Host.getHost(0);
VM serverVM = host.getVM(1);
VM clientVM = host.getVM(2);
-
+
boolean cacheServerSslenabled = true;
boolean cacheClientSslenabled = true;
boolean cacheClientSslRequireAuth = true;
-
+
serverVM.invoke(() -> setUpServerVMTask(cacheServerSslenabled));
serverVM.invoke(() -> createServerTask());
-
+
Object array[] = (Object[])serverVM.invoke(() -> getCacheServerEndPointTask());
String hostName = (String)array[0];
int port = (Integer) array[1];
@@ -260,22 +260,22 @@ public class CacheServerSSLConnectionDUnitTest extends DistributedTestCase {
clientVM.invoke(() -> setUpClientVMTask(hostName, port, cacheClientSslenabled, cacheClientSslRequireAuth, CLIENT_KEY_STORE, CLIENT_TRUST_STORE));
clientVM.invoke(() -> doClientRegionTestTask());
serverVM.invoke(() -> doServerRegionTestTask());
-
+
}
-
-
+
+
public void testNonSSLClient() throws Exception {
final Host host = Host.getHost(0);
VM serverVM = host.getVM(1);
VM clientVM = host.getVM(2);
-
+
boolean cacheServerSslenabled = true;
boolean cacheClientSslenabled = false;
boolean cacheClientSslRequireAuth = true;
-
+
serverVM.invoke(() -> setUpServerVMTask(cacheServerSslenabled));
serverVM.invoke(() -> createServerTask());
-
+
Object array[] = (Object[])serverVM.invoke(() -> getCacheServerEndPointTask());
String hostName = (String)array[0];
int port = (Integer) array[1];
@@ -298,14 +298,14 @@ public class CacheServerSSLConnectionDUnitTest extends DistributedTestCase {
} else {
//getLogWriter().error("Unexpected exception ", e);
fail("Unexpected Exception: " + e + " expected: "
- + AuthenticationRequiredException.class);
+ + AuthenticationRequiredException.class);
}
} finally {
expect.remove();
expect2.remove();
}
}
-
+
public void testSSLClientWithNoAuth() throws Exception {
final Host host = Host.getHost(0);
VM serverVM = host.getVM(1);
@@ -337,23 +337,23 @@ public class CacheServerSSLConnectionDUnitTest extends DistributedTestCase {
} else {
//getLogWriter().error("Unexpected exception ", e);
fail("Unexpected Exception...expected "
- + AuthenticationRequiredException.class);
+ + AuthenticationRequiredException.class);
}
}
}
-
+
public void testSSLClientWithNonSSLServer() throws Exception {
final Host host = Host.getHost(0);
VM serverVM = host.getVM(1);
VM clientVM = host.getVM(2);
-
+
boolean cacheServerSslenabled = false;
boolean cacheClientSslenabled = true;
boolean cacheClientSslRequireAuth = true;
-
+
serverVM.invoke(() -> setUpServerVMTask(cacheServerSslenabled));
serverVM.invoke(() -> createServerTask());
-
+
Object array[] = (Object[])serverVM.invoke(() -> getCacheServerEndPointTask());
String hostName = (String)array[0];
int port = (Integer) array[1];
@@ -371,9 +371,9 @@ public class CacheServerSSLConnectionDUnitTest extends DistributedTestCase {
expect.remove();
}
}
-
+
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
final Host host = Host.getHost(0);
VM serverVM = host.getVM(1);
VM clientVM = host.getVM(2);
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/cache/client/internal/LocatorTestBase.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/client/internal/LocatorTestBase.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/client/internal/LocatorTestBase.java
index a89d648..74822d5 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/client/internal/LocatorTestBase.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/client/internal/LocatorTestBase.java
@@ -72,7 +72,7 @@ public abstract class LocatorTestBase extends DistributedTestCase {
}
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
SerializableRunnable tearDown = new SerializableRunnable("tearDown") {
public void run() {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/cache/client/internal/SSLNoClientAuthDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/client/internal/SSLNoClientAuthDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/client/internal/SSLNoClientAuthDUnitTest.java
index e23fb76..dd146a6 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/client/internal/SSLNoClientAuthDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/client/internal/SSLNoClientAuthDUnitTest.java
@@ -54,10 +54,9 @@ public class SSLNoClientAuthDUnitTest extends DistributedTestCase {
private static SSLNoClientAuthDUnitTest instance = new SSLNoClientAuthDUnitTest("SSLNoClientAuthDUnitTest");
-
- public void setUp() throws Exception {
+ @Override
+ public final void preSetUp() throws Exception {
disconnectAllFromDS();
- super.setUp();
}
public SSLNoClientAuthDUnitTest(String name) {
@@ -267,7 +266,7 @@ public class SSLNoClientAuthDUnitTest extends DistributedTestCase {
}
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
final Host host = Host.getHost(0);
VM serverVM = host.getVM(1);
VM clientVM = host.getVM(2);
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/cache/management/MemoryThresholdsDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/management/MemoryThresholdsDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/management/MemoryThresholdsDUnitTest.java
index c93848b..17529b8 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/management/MemoryThresholdsDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/management/MemoryThresholdsDUnitTest.java
@@ -135,8 +135,7 @@ public class MemoryThresholdsDUnitTest extends ClientServerTestCase {
}
@Override
- public void setUp() throws Exception {
- super.setUp();
+ protected final void postSetUpClientServerTestCase() throws Exception {
Invoke.invokeInEveryVM(this.setHeapMemoryMonitorTestMode);
IgnoredException.addIgnoredException(expectedEx);
IgnoredException.addIgnoredException(expectedBelow);
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/cache/management/MemoryThresholdsOffHeapDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/management/MemoryThresholdsOffHeapDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/management/MemoryThresholdsOffHeapDUnitTest.java
index 3cf7b09..7c61788 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/management/MemoryThresholdsOffHeapDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/management/MemoryThresholdsOffHeapDUnitTest.java
@@ -105,16 +105,12 @@ public class MemoryThresholdsOffHeapDUnitTest extends ClientServerTestCase {
super(name);
}
-
-
@Override
- public void setUp() throws Exception {
+ public final void postSetUpClientServerTestCase() throws Exception {
IgnoredException.addIgnoredException(expectedEx);
IgnoredException.addIgnoredException(expectedBelow);
}
-
-
@Override
protected void preTearDownClientServerTestCase() throws Exception {
Invoke.invokeInEveryVM(this.resetResourceManager);
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/CompactRangeIndexDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/CompactRangeIndexDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/CompactRangeIndexDUnitTest.java
index df655a2..86f629d 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/CompactRangeIndexDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/CompactRangeIndexDUnitTest.java
@@ -45,8 +45,8 @@ public class CompactRangeIndexDUnitTest extends DistributedTestCase{
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
+ @Override
+ public final void postSetUp() throws Exception {
getSystem();
Invoke.invokeInEveryVM(new SerializableRunnable("getSystem") {
public void run() {
@@ -60,8 +60,7 @@ public class CompactRangeIndexDUnitTest extends DistributedTestCase{
utils.createReplicateRegion("exampleRegion", vm0);
utils.createIndex(vm0,"type", "\"type\"", "/exampleRegion");
}
-
-
+
/*
* Tests that the message component of the exception is not null
*/
@@ -178,7 +177,7 @@ public class CompactRangeIndexDUnitTest extends DistributedTestCase{
}
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
Thread.sleep(5000);
removeHook();
utils.closeServer(vm0);
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/HashIndexDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/HashIndexDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/HashIndexDUnitTest.java
index 76f850d..4db6fc0 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/HashIndexDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/HashIndexDUnitTest.java
@@ -39,8 +39,8 @@ public class HashIndexDUnitTest extends DistributedTestCase{
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
+ @Override
+ public final void postSetUp() throws Exception {
getSystem();
Invoke.invokeInEveryVM(new SerializableRunnable("getSystem") {
public void run() {
@@ -134,7 +134,7 @@ public class HashIndexDUnitTest extends DistributedTestCase{
}
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
Thread.sleep(5000);
utils.closeServer(vm0);
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/PartitionedRegionCompactRangeIndexDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/PartitionedRegionCompactRangeIndexDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/PartitionedRegionCompactRangeIndexDUnitTest.java
index 8be017c..3e746e7 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/PartitionedRegionCompactRangeIndexDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/PartitionedRegionCompactRangeIndexDUnitTest.java
@@ -15,6 +15,7 @@
* limitations under the License.
*/
package com.gemstone.gemfire.cache.query.dunit;
+
import java.io.File;
import java.util.HashMap;
import java.util.Map;
@@ -54,12 +55,12 @@ public class PartitionedRegionCompactRangeIndexDUnitTest extends DistributedTest
return props;
}
- public void setUp() throws Exception {
- this.disconnectAllFromDS();
+ public void postSetUp() throws Exception {
+ disconnectAllFromDS();
}
@Override
- protected void preTearDown() throws Exception {
+ public 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/cache/query/dunit/QueryDataInconsistencyDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryDataInconsistencyDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryDataInconsistencyDUnitTest.java
index 0227836..5c4f982 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryDataInconsistencyDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryDataInconsistencyDUnitTest.java
@@ -95,18 +95,13 @@ public class QueryDataInconsistencyDUnitTest extends CacheTestCase {
}
@Override
- protected final void preTearDownCacheTestCase() throws Exception {
- Invoke.invokeInEveryVM(CacheTestCase.class, "disconnectFromDS");
- }
-
- @Override
- protected final void postTearDownCacheTestCase() throws Exception {
- Invoke.invokeInEveryVM(QueryObserverHolder.class, "reset");
+ public final void postTearDownCacheTestCase() throws Exception {
+ Invoke.invokeInEveryVM(() -> disconnectFromDS());
+ Invoke.invokeInEveryVM(() -> QueryObserverHolder.reset());
}
@Override
- public void setUp() throws Exception {
- super.setUp();
+ public final void postSetUp() throws Exception {
Host host = Host.getHost(0);
server = host.getVM(0);
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryIndexUsingXMLDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryIndexUsingXMLDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryIndexUsingXMLDUnitTest.java
index 5e9df71..6e4ed11 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryIndexUsingXMLDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryIndexUsingXMLDUnitTest.java
@@ -58,6 +58,7 @@ import com.gemstone.gemfire.cache30.CertifiableTestCacheListener;
import com.gemstone.gemfire.distributed.DistributedSystem;
import com.gemstone.gemfire.distributed.internal.DistributionConfig;
import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem;
+import com.gemstone.gemfire.internal.FileUtil;
import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
import com.gemstone.gemfire.internal.cache.LocalRegion;
import com.gemstone.gemfire.internal.cache.PartitionedRegion;
@@ -132,27 +133,18 @@ public class QueryIndexUsingXMLDUnitTest extends CacheTestCase {
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
+ @Override
+ public final void postSetUp() throws Exception {
//Workaround for #52008
IgnoredException.addIgnoredException("Failed to create index");
}
@Override
- protected final void postTearDownCacheTestCase() throws Exception {
- // Get the disk store name.
- GemFireCacheImpl cache = (GemFireCacheImpl)getCache();
- String diskStoreName = cache.getDefaultDiskStoreName();
-
- //reset TestHook
+ public final void postTearDownCacheTestCase() throws Exception {
+ // avoid creating a new cache just to get the diskstore name
Invoke.invokeInEveryVM(resetTestHook());
- // close the cache.
- closeCache();
disconnectFromDS();
-
- // remove the disk store.
- File diskDir = new File(diskStoreName).getAbsoluteFile();
- com.gemstone.gemfire.internal.FileUtil.delete(diskDir);
+ FileUtil.delete(new File(GemFireCacheImpl.DEFAULT_DS_NAME).getAbsoluteFile());
}
/**
@@ -945,12 +937,12 @@ public class QueryIndexUsingXMLDUnitTest extends CacheTestCase {
public final InternalDistributedSystem getSystem(String diskStoreId) {
new Exception("TEST DEBUG###" + diskStoreId).printStackTrace();
- if (system == null || !system.isConnected()) {
+ if (basicGetSystem() == null || !basicGetSystem().isConnected()) {
// Figure out our distributed system properties
Properties p = DistributedTestUtils.getAllDistributedSystemProperties(getDistributedSystemProperties());
- system = (InternalDistributedSystem)DistributedSystem.connect(p);
+ getSystem(p);
}
- return system;
+ return basicGetSystem();
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryUsingFunctionContextDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryUsingFunctionContextDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryUsingFunctionContextDUnitTest.java
index 1e3e973..f19e7f0 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryUsingFunctionContextDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryUsingFunctionContextDUnitTest.java
@@ -135,20 +135,19 @@ public class QueryUsingFunctionContextDUnitTest extends CacheTestCase {
}
@Override
- protected final void preTearDownCacheTestCase() throws Exception {
- Invoke.invokeInEveryVM(CacheTestCase.class, "disconnectFromDS");
+ public final void preTearDownCacheTestCase() throws Exception {
+ Invoke.invokeInEveryVM(() -> disconnectFromDS());
}
@Override
- protected final void postTearDownCacheTestCase() throws Exception {
- Invoke.invokeInEveryVM(QueryObserverHolder.class, "reset");
+ public final void postTearDownCacheTestCase() throws Exception {
+ Invoke.invokeInEveryVM(() -> QueryObserverHolder.reset());
cache = null;
Invoke.invokeInEveryVM(new SerializableRunnable() { public void run() { cache = null; } });
}
@Override
- public void setUp() throws Exception {
- super.setUp();
+ public final void postSetUp() throws Exception {
Host host = Host.getHost(0);
server1 = host.getVM(0);
server2 = host.getVM(1);
@@ -159,7 +158,6 @@ public class QueryUsingFunctionContextDUnitTest extends CacheTestCase {
registerFunctionOnServers();
}
-
/**
* Test on Replicated Region.
*/
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryUsingPoolDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryUsingPoolDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryUsingPoolDUnitTest.java
index 4df1f81..cddfa83 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryUsingPoolDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryUsingPoolDUnitTest.java
@@ -97,15 +97,14 @@ public class QueryUsingPoolDUnitTest extends CacheTestCase {
//////// Test Methods
@Override
- public void setUp() throws Exception {
- super.setUp();
+ public final void postSetUp() throws Exception {
disconnectAllFromDS();
IgnoredException.addIgnoredException("Connection reset");
IgnoredException.addIgnoredException("Socket input is shutdown");
}
@Override
- protected final void postTearDownCacheTestCase() throws Exception {
+ public final void postTearDownCacheTestCase() throws Exception {
disconnectAllFromDS();
}
@@ -171,7 +170,7 @@ public class QueryUsingPoolDUnitTest extends CacheTestCase {
public void run2() throws CacheException {
Properties config = new Properties();
config.setProperty("locators", "localhost["+DistributedTestUtils.getDUnitLocatorPort()+"]");
- system = (InternalDistributedSystem) DistributedSystem.connect(config);
+ InternalDistributedSystem system = getSystem(config);
AttributesFactory factory = new AttributesFactory();
factory.setScope(Scope.LOCAL);
createRegion(name, rootRegionName, factory.create());
@@ -308,7 +307,7 @@ public class QueryUsingPoolDUnitTest extends CacheTestCase {
public void run2() throws CacheException {
Properties config = new Properties();
config.setProperty("locators", "localhost["+DistributedTestUtils.getDUnitLocatorPort()+"]");
- system = (InternalDistributedSystem) DistributedSystem.connect(config);
+ getSystem(config);
AttributesFactory factory = new AttributesFactory();
factory.setScope(Scope.LOCAL);
createRegion(name, factory.create());
@@ -440,7 +439,7 @@ public class QueryUsingPoolDUnitTest extends CacheTestCase {
public void run2() throws CacheException {
Properties config = new Properties();
config.setProperty("locators", "localhost["+DistributedTestUtils.getDUnitLocatorPort()+"]");
- system = (InternalDistributedSystem) DistributedSystem.connect(config);
+ getSystem(config);
AttributesFactory factory = new AttributesFactory();
factory.setScope(Scope.LOCAL);
createRegion(name, factory.create());
@@ -577,7 +576,7 @@ public class QueryUsingPoolDUnitTest extends CacheTestCase {
public void run2() throws CacheException {
Properties config = new Properties();
config.setProperty("mcast-port", "0");
- system = (InternalDistributedSystem) DistributedSystem.connect(config);
+ getSystem(config);
getCache();
AttributesFactory factory = new AttributesFactory();
factory.setScope(Scope.LOCAL);
@@ -636,7 +635,7 @@ public class QueryUsingPoolDUnitTest extends CacheTestCase {
public void run2() throws CacheException {
Properties config = new Properties();
config.setProperty("locators", "localhost["+DistributedTestUtils.getDUnitLocatorPort()+"]");
- system = (InternalDistributedSystem) DistributedSystem.connect(config);
+ getSystem(config);
AttributesFactory factory = new AttributesFactory();
factory.setScope(Scope.LOCAL);
createRegion(name, factory.create());
@@ -1666,7 +1665,7 @@ public class QueryUsingPoolDUnitTest extends CacheTestCase {
public void run2() throws CacheException {
Properties config = new Properties();
config.setProperty("locators", "localhost["+DistributedTestUtils.getDUnitLocatorPort()+"]");
- system = (InternalDistributedSystem) DistributedSystem.connect(config);
+ getSystem(config);
AttributesFactory factory = new AttributesFactory();
factory.setScope(Scope.LOCAL);
createRegion(name+"1", factory.create());
@@ -1769,7 +1768,7 @@ public class QueryUsingPoolDUnitTest extends CacheTestCase {
public void run2() throws CacheException {
Properties config = new Properties();
config.setProperty("locators", "localhost["+DistributedTestUtils.getDUnitLocatorPort()+"]");
- system = (InternalDistributedSystem) DistributedSystem.connect(config);
+ getSystem(config);
AttributesFactory factory = new AttributesFactory();
factory.setScope(Scope.LOCAL);
createRegion(name, factory.create());
@@ -1907,7 +1906,7 @@ public class QueryUsingPoolDUnitTest extends CacheTestCase {
public void run2() throws CacheException {
Properties config = new Properties();
config.setProperty("locators", "localhost["+DistributedTestUtils.getDUnitLocatorPort()+"]");
- system = (InternalDistributedSystem) DistributedSystem.connect(config);
+ getSystem(config);
Wait.pause(1000);
try {
@@ -2003,7 +2002,7 @@ public class QueryUsingPoolDUnitTest extends CacheTestCase {
public void run2() throws CacheException {
Properties config = new Properties();
config.setProperty("locators", "localhost["+DistributedTestUtils.getDUnitLocatorPort()+"]");
- system = (InternalDistributedSystem) DistributedSystem.connect(config);
+ getSystem(config);
AttributesFactory factory = new AttributesFactory();
factory.setScope(Scope.LOCAL);
createRegion(name, factory.create());
@@ -2161,7 +2160,7 @@ public class QueryUsingPoolDUnitTest extends CacheTestCase {
public void run2() throws CacheException {
Properties config = new Properties();
config.setProperty("locators", "localhost["+DistributedTestUtils.getDUnitLocatorPort()+"]");
- system = (InternalDistributedSystem) DistributedSystem.connect(config);
+ getSystem(config);
Wait.pause(1000);
try {
@@ -2377,7 +2376,7 @@ public class QueryUsingPoolDUnitTest extends CacheTestCase {
protected void configAndStartBridgeServer() {
Properties config = new Properties();
config.setProperty("locators", "localhost["+DistributedTestUtils.getDUnitLocatorPort()+"]");
- system = (InternalDistributedSystem) DistributedSystem.connect(config);
+ getSystem(config);
AttributesFactory factory = new AttributesFactory();
factory.setScope(Scope.LOCAL);
createRegion(this.regionName, this.rootRegionName, factory.create());
[08/11] incubator-geode git commit: GEODE-1050: add JUnit 4 versions
of DistributedTestCase and CacheTestCase
Posted by kl...@apache.org.
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);
}
[07/11] incubator-geode git commit: GEODE-1050: add JUnit 4 versions
of DistributedTestCase and CacheTestCase
Posted by kl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/InterruptsDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/InterruptsDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/InterruptsDUnitTest.java
index 6a0ffba..be41318 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/InterruptsDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/InterruptsDUnitTest.java
@@ -51,7 +51,7 @@ public class InterruptsDUnitTest extends CacheTestCase {
@Override
- protected final void preTearDownCacheTestCase() throws Exception {
+ public final void preTearDownCacheTestCase() throws Exception {
Invoke.invokeInEveryVM(new SerializableCallable() {
@Override
@@ -179,7 +179,7 @@ public class InterruptsDUnitTest 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);
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/OffHeapEvictionDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/OffHeapEvictionDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/OffHeapEvictionDUnitTest.java
index 708b983..43a824a 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/OffHeapEvictionDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/OffHeapEvictionDUnitTest.java
@@ -43,7 +43,7 @@ public class OffHeapEvictionDUnitTest extends EvictionDUnitTest {
}
@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/OffHeapEvictionStatsDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/OffHeapEvictionStatsDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/OffHeapEvictionStatsDUnitTest.java
index f574e99..f64374c 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/OffHeapEvictionStatsDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/OffHeapEvictionStatsDUnitTest.java
@@ -39,7 +39,7 @@ public class OffHeapEvictionStatsDUnitTest extends EvictionStatsDUnitTest {
}
@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/P2PDeltaPropagationDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/P2PDeltaPropagationDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/P2PDeltaPropagationDUnitTest.java
index 4889f0f..21f5c05 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/P2PDeltaPropagationDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/P2PDeltaPropagationDUnitTest.java
@@ -399,10 +399,9 @@ public class P2PDeltaPropagationDUnitTest extends DistributedTestCase
{
assertFalse(check);
}
-
- 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);
@@ -496,7 +495,7 @@ public class P2PDeltaPropagationDUnitTest extends DistributedTestCase
}
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
closeCache();
server1.invoke(() -> P2PDeltaPropagationDUnitTest.closeCache());
server2.invoke(() -> P2PDeltaPropagationDUnitTest.closeCache());
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionAPIDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionAPIDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionAPIDUnitTest.java
index 466dfa4..a23baf6 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionAPIDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionAPIDUnitTest.java
@@ -16,12 +16,6 @@
*/
package com.gemstone.gemfire.internal.cache;
-/**
- * This is a dunit test for PartitionedRegion creation and Region API's
- * functionality. This test is performed for different region scopes - D_ACK and
- * D_NO_ACK for PartitionedRegion.
- */
-
import java.util.Iterator;
import java.util.NoSuchElementException;
import java.util.Properties;
@@ -51,8 +45,12 @@ import com.gemstone.gemfire.test.dunit.LogWriterUtils;
import com.gemstone.gemfire.test.dunit.SerializableRunnable;
import com.gemstone.gemfire.test.dunit.VM;
-public class PartitionedRegionAPIDUnitTest extends
- PartitionedRegionDUnitTestCase {
+/**
+ * This is a dunit test for PartitionedRegion creation and Region API's
+ * functionality. This test is performed for different region scopes - D_ACK and
+ * D_NO_ACK for PartitionedRegion.
+ */
+public class PartitionedRegionAPIDUnitTest extends PartitionedRegionDUnitTestCase {
public PartitionedRegionAPIDUnitTest(String name) {
super(name);
@@ -1431,34 +1429,7 @@ public class PartitionedRegionAPIDUnitTest extends
});
}
- protected CacheSerializableRunnable addExceptionTag1(final String expectedException) {
- CacheSerializableRunnable addExceptionTag = new CacheSerializableRunnable(
- "addExceptionTag") {
- public void run2()
- {
- getCache().getLogger().info(
- "<ExpectedException action=add>" + expectedException
- + "</ExpectedException>");
- }
- };
-
- return addExceptionTag;
- }
-
- protected CacheSerializableRunnable removeExceptionTag1(final String expectedException) {
- CacheSerializableRunnable removeExceptionTag = new CacheSerializableRunnable(
- "removeExceptionTag") {
- public void run2() throws CacheException {
- getCache().getLogger().info(
- "<ExpectedException action=remove>" + expectedException
- + "</ExpectedException>");
- }
- };
- return removeExceptionTag;
- }
-
-
- public void testCacherLoaderHelper() throws Exception
+ public void testCacherLoaderHelper() throws Exception
{
final String rName = getUniqueName();
Host host = Host.getHost(0);
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionBucketCreationDistributionDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionBucketCreationDistributionDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionBucketCreationDistributionDUnitTest.java
index 79669b2..f59c832 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionBucketCreationDistributionDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionBucketCreationDistributionDUnitTest.java
@@ -21,11 +21,14 @@ import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import java.util.NoSuchElementException;
+import java.util.Properties;
import java.util.Set;
import com.gemstone.gemfire.cache.AttributesFactory;
import com.gemstone.gemfire.cache.Cache;
import com.gemstone.gemfire.cache.CacheException;
+import com.gemstone.gemfire.cache.CacheExistsException;
+import com.gemstone.gemfire.cache.CacheFactory;
import com.gemstone.gemfire.cache.MirrorType;
import com.gemstone.gemfire.cache.PartitionAttributes;
import com.gemstone.gemfire.cache.PartitionAttributesFactory;
@@ -34,6 +37,8 @@ import com.gemstone.gemfire.cache.Region;
import com.gemstone.gemfire.cache.RegionAttributes;
import com.gemstone.gemfire.cache.Scope;
import com.gemstone.gemfire.cache30.CacheSerializableRunnable;
+import com.gemstone.gemfire.distributed.internal.DistributionConfig;
+import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem;
import com.gemstone.gemfire.internal.cache.PartitionedRegionDataStore.BucketVisitor;
import com.gemstone.gemfire.test.dunit.Assert;
import com.gemstone.gemfire.test.dunit.AsyncInvocation;
@@ -465,20 +470,70 @@ public class PartitionedRegionBucketCreationDistributionDUnitTest extends
* redundancy-zone = "zone"
*/
public void testEnforceUniqueHostForLonerDistributedSystem() {
- Cache cache = createLonerCacheWithEnforceUniqueHost();
-
- AttributesFactory attr = new AttributesFactory();
+ Cache myCache = createLonerCacheWithEnforceUniqueHost();
+ try {
+ AttributesFactory attr = new AttributesFactory();
PartitionAttributesFactory paf = new PartitionAttributesFactory();
PartitionAttributes prAttr = paf.create();
attr.setPartitionAttributes(prAttr);
RegionAttributes regionAttribs = attr.create();
- Region region = cache.createRegion("PR1", regionAttribs);
-
+ Region region = myCache.createRegion("PR1", regionAttribs);
+
for (int i = 0; i < 113; i++) {
- region.put("Key_" + i, new Integer(i));
+ region.put("Key_" + i, new Integer(i));
}
//verify region size
assertEquals(113, region.size());
+ } finally {
+ myCache.close();
+ myCache.getDistributedSystem().disconnect();
+ }
+ }
+
+ /**
+ * Creates the <code>Cache</code> for this test that is not connected
+ * to other members.
+ *
+ * <p>Used by test {@link #testEnforceUniqueHostForLonerDistributedSystem()}.
+ * Moved from DistributedTestCase to this test is the exclusive caller.
+ *
+ * <p>Added specifically to test scenario of defect #47181.
+ */
+ private final Cache createLonerCacheWithEnforceUniqueHost() {
+ Cache myCache = null;
+ try {
+ System.setProperty("gemfire.DISABLE_DISCONNECT_DS_ON_CACHE_CLOSE", "true");
+ myCache = CacheFactory.create(getLonerSystemWithEnforceUniqueHost());
+ } catch (CacheExistsException e) {
+ Assert.fail("the cache already exists", e);
+
+ } catch (RuntimeException ex) {
+ throw ex;
+
+ } catch (Exception ex) {
+ Assert.fail("Checked exception while initializing cache??", ex);
+ } finally {
+ System.clearProperty("gemfire.DISABLE_DISCONNECT_DS_ON_CACHE_CLOSE");
+ }
+ return myCache;
+ }
+
+ /**
+ * Returns a loner distributed system in combination with enforceUniqueHost
+ * and redundancyZone properties.
+ *
+ * <p>Used by test {@link #testEnforceUniqueHostForLonerDistributedSystem()}.
+ * Moved from DistributedTestCase to this test is the exclusive caller.
+ *
+ * <p>Added specifically to test scenario of defect #47181.
+ */
+ private final InternalDistributedSystem getLonerSystemWithEnforceUniqueHost() {
+ Properties props = getDistributedSystemProperties();
+ props.put(DistributionConfig.MCAST_PORT_NAME, "0");
+ props.put(DistributionConfig.LOCATORS_NAME, "");
+ props.put(DistributionConfig.ENFORCE_UNIQUE_HOST_NAME, "true");
+ props.put(DistributionConfig.REDUNDANCY_ZONE_NAME, "zone1");
+ return getSystem(props);
}
/**
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionDUnitTestCase.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionDUnitTestCase.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionDUnitTestCase.java
index cd6e980..f401e0d 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionDUnitTestCase.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionDUnitTestCase.java
@@ -93,7 +93,7 @@ public class PartitionedRegionDUnitTestCase extends CacheTestCase
* because we want to destroy any existing PartitionedRegions)
*/
@Override
- protected final void preTearDownCacheTestCase() throws Exception {
+ public final void preTearDownCacheTestCase() throws Exception {
preTearDownPartitionedRegionDUnitTest();
closeCache();
Invoke.invokeInEveryVM(CacheTestCase.class, "closeCache");
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionDelayedRecoveryDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionDelayedRecoveryDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionDelayedRecoveryDUnitTest.java
index 337e6ce..23709ad 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionDelayedRecoveryDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionDelayedRecoveryDUnitTest.java
@@ -45,7 +45,7 @@ public class PartitionedRegionDelayedRecoveryDUnitTest extends CacheTestCase {
}
@Override
- protected final void postTearDownCacheTestCase() throws Exception {
+ public final void postTearDownCacheTestCase() throws Exception {
Invoke.invokeInEveryVM(new SerializableRunnable() {
public void run() {
InternalResourceManager.setResourceObserver(null);
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionOffHeapEvictionDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionOffHeapEvictionDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionOffHeapEvictionDUnitTest.java
index 002a5f6..046d787 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionOffHeapEvictionDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionOffHeapEvictionDUnitTest.java
@@ -34,7 +34,7 @@ public class PartitionedRegionOffHeapEvictionDUnitTest extends
}
@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/PartitionedRegionRedundancyZoneDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionRedundancyZoneDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionRedundancyZoneDUnitTest.java
index c112539..027ae30 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionRedundancyZoneDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionRedundancyZoneDUnitTest.java
@@ -36,7 +36,7 @@ import com.gemstone.gemfire.test.dunit.VM;
public class PartitionedRegionRedundancyZoneDUnitTest extends CacheTestCase {
@Override
- protected final void postTearDownCacheTestCase() throws Exception {
+ public final void postTearDownCacheTestCase() throws Exception {
// this makes sure we don't leave anything for the next tests
// Tests that set redundancy zones causes other jvms connected
// to the ds to have "enforce-unique-hosts" set to true.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionSingleHopDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionSingleHopDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionSingleHopDUnitTest.java
index 558dd0b..636075c 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionSingleHopDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionSingleHopDUnitTest.java
@@ -108,8 +108,8 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
+ @Override
+ public final void postSetUp() throws Exception {
IgnoredException.addIgnoredException("Connection refused");
Host host = Host.getHost(0);
member0 = host.getVM(0);
@@ -119,9 +119,9 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
}
@Override
- protected final void postTearDownCacheTestCase() throws Exception {
+ public final void postTearDownCacheTestCase() throws Exception {
try {
- closeCache();
+ closeCacheAndDisconnect();
member0 = null;
member1 = null;
@@ -134,7 +134,7 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
}
}
- public static void closeCache() {
+ public static void closeCacheAndDisconnect() {
if (cache != null && !cache.isClosed()) {
cache.close();
cache.getDistributedSystem().disconnect();
@@ -913,8 +913,8 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
member2.invoke(() -> PartitionedRegionSingleHopDUnitTest.verifyMetadata(clientMap));
member3.invoke(() -> PartitionedRegionSingleHopDUnitTest.verifyMetadata(clientMap));
- member0.invoke(() -> PartitionedRegionSingleHopDUnitTest.closeCache());
- member1.invoke(() -> PartitionedRegionSingleHopDUnitTest.closeCache());
+ member0.invoke(() -> PartitionedRegionSingleHopDUnitTest.closeCacheAndDisconnect());
+ member1.invoke(() -> PartitionedRegionSingleHopDUnitTest.closeCacheAndDisconnect());
// member0.invoke(() -> PartitionedRegionSingleHopDUnitTest.createServerOnPort(3,4,port0 ));
// member1.invoke(() -> PartitionedRegionSingleHopDUnitTest.createServerOnPort(3,4,port1 ));
@@ -1114,10 +1114,10 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase {
createClient(port0, port1, port2, port3);
fetchAndValidateMetadata();
- member0.invoke(() -> PartitionedRegionSingleHopDUnitTest.closeCache());
- member1.invoke(() -> PartitionedRegionSingleHopDUnitTest.closeCache());
- member2.invoke(() -> PartitionedRegionSingleHopDUnitTest.closeCache());
- member3.invoke(() -> PartitionedRegionSingleHopDUnitTest.closeCache());
+ member0.invoke(() -> PartitionedRegionSingleHopDUnitTest.closeCacheAndDisconnect());
+ member1.invoke(() -> PartitionedRegionSingleHopDUnitTest.closeCacheAndDisconnect());
+ member2.invoke(() -> PartitionedRegionSingleHopDUnitTest.closeCacheAndDisconnect());
+ member3.invoke(() -> PartitionedRegionSingleHopDUnitTest.closeCacheAndDisconnect());
Wait.pause(1000); //let client detect that servers are dead through ping
AsyncInvocation m3 = member3.invokeAsync(() -> PartitionedRegionSingleHopDUnitTest.createPersistentPrsAndServerOnPort( 3, 4,port3 ));
AsyncInvocation m2 = member2.invokeAsync(() -> PartitionedRegionSingleHopDUnitTest.createPersistentPrsAndServerOnPort( 3, 4,port2 ));
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionSingleHopWithServerGroupDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionSingleHopWithServerGroupDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionSingleHopWithServerGroupDUnitTest.java
index 5c9e643..4508b25 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionSingleHopWithServerGroupDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionSingleHopWithServerGroupDUnitTest.java
@@ -114,9 +114,8 @@ public class PartitionedRegionSingleHopWithServerGroupDUnitTest extends CacheTes
super(name);
}
-
- public void setUp() throws Exception {
- super.setUp();
+ @Override
+ public final void postSetUp() throws Exception {
Host host = Host.getHost(0);
member0 = host.getVM(0);
member1 = host.getVM(1);
@@ -126,17 +125,17 @@ public class PartitionedRegionSingleHopWithServerGroupDUnitTest extends CacheTes
}
@Override
- protected final void preTearDownCacheTestCase() throws Exception {
+ public final void preTearDownCacheTestCase() throws Exception {
// close the clients first
- member0.invoke(() -> PartitionedRegionSingleHopWithServerGroupDUnitTest.closeCache());
- member1.invoke(() -> PartitionedRegionSingleHopWithServerGroupDUnitTest.closeCache());
- member2.invoke(() -> PartitionedRegionSingleHopWithServerGroupDUnitTest.closeCache());
- member3.invoke(() -> PartitionedRegionSingleHopWithServerGroupDUnitTest.closeCache());
- closeCache();
+ member0.invoke(() -> PartitionedRegionSingleHopWithServerGroupDUnitTest.closeCacheAndDisconnect());
+ member1.invoke(() -> PartitionedRegionSingleHopWithServerGroupDUnitTest.closeCacheAndDisconnect());
+ member2.invoke(() -> PartitionedRegionSingleHopWithServerGroupDUnitTest.closeCacheAndDisconnect());
+ member3.invoke(() -> PartitionedRegionSingleHopWithServerGroupDUnitTest.closeCacheAndDisconnect());
+ closeCacheAndDisconnect();
}
@Override
- protected final void postTearDownCacheTestCase() throws Exception {
+ public final void postTearDownCacheTestCase() throws Exception {
try {
member0 = null;
member1 = null;
@@ -161,7 +160,7 @@ public class PartitionedRegionSingleHopWithServerGroupDUnitTest extends CacheTes
}
}
- public static void closeCache() {
+ public static void closeCacheAndDisconnect() {
resetHonourServerGroupsInPRSingleHop();
if (cache != null && !cache.isClosed()) {
cache.close();
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PutAllDAckDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PutAllDAckDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PutAllDAckDUnitTest.java
index ba8fd66..1611272 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PutAllDAckDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PutAllDAckDUnitTest.java
@@ -66,8 +66,7 @@ public class PutAllDAckDUnitTest 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);
@@ -77,7 +76,7 @@ public class PutAllDAckDUnitTest 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/PutAllGlobalDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PutAllGlobalDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PutAllGlobalDUnitTest.java
index 8326ec5..a41e4a9 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PutAllGlobalDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PutAllGlobalDUnitTest.java
@@ -82,8 +82,7 @@ public class PutAllGlobalDUnitTest 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);
@@ -93,7 +92,7 @@ public class PutAllGlobalDUnitTest 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/RemoteTransactionDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/RemoteTransactionDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/RemoteTransactionDUnitTest.java
index 81b2a73..07c6fd1 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/RemoteTransactionDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/RemoteTransactionDUnitTest.java
@@ -152,7 +152,7 @@ public class RemoteTransactionDUnitTest extends CacheTestCase {
}
@Override
- protected final void preTearDownCacheTestCase() throws Exception {
+ public final void preTearDownCacheTestCase() throws Exception {
try {
Invoke.invokeInEveryVM(verifyNoTxState);
} finally {
@@ -2421,7 +2421,7 @@ public class RemoteTransactionDUnitTest extends CacheTestCase {
FunctionService.onRegion(custRegion).execute(TXFunction.id).getResult();
break;
case OnMember:
- FunctionService.onMembers(system).execute(TXFunction.id).getResult();
+ FunctionService.onMembers(basicGetSystem()).execute(TXFunction.id).getResult();
break;
}
fail("Expected exception not thrown");
@@ -2440,7 +2440,7 @@ public class RemoteTransactionDUnitTest extends CacheTestCase {
break;
case OnMember:
DistributedMember owner = custRegion.getOwnerForKey(custRegion.getKeyInfo(expectedCustId));
- FunctionService.onMember(system, owner).execute(TXFunction.id).getResult();
+ FunctionService.onMember(basicGetSystem(), owner).execute(TXFunction.id).getResult();
break;
}
TXStateProxy tx = mgr.internalSuspend();
@@ -2484,7 +2484,7 @@ public class RemoteTransactionDUnitTest extends CacheTestCase {
break;
case OnMember:
DistributedMember owner = custRegion.getOwnerForKey(custRegion.getKeyInfo(expectedCustId));
- FunctionService.onMember(system, owner).execute(TXFunction.id).getResult();
+ FunctionService.onMember(basicGetSystem(), owner).execute(TXFunction.id).getResult();
break;
}
TXStateProxy tx = mgr.internalSuspend();
@@ -2738,11 +2738,11 @@ public class RemoteTransactionDUnitTest extends CacheTestCase {
Set<DistributedMember> members = new HashSet<DistributedMember>();
members.add(ds1);members.add(ds2);
try {
- FunctionService.onMembers(system, members).execute(TXFunction.id).getResult();
+ FunctionService.onMembers(basicGetSystem(), members).execute(TXFunction.id).getResult();
fail("expected exception not thrown");
} catch (TransactionException expected) {
}
- FunctionService.onMember(system, owner).execute(TXFunction.id).getResult();
+ FunctionService.onMember(basicGetSystem(), owner).execute(TXFunction.id).getResult();
assertEquals(expectedCustomer, pr.get(expectedCustId));
TXStateProxy tx = mgr.internalSuspend();
assertNull(pr.get(expectedCustId));
@@ -2831,7 +2831,7 @@ public class RemoteTransactionDUnitTest extends CacheTestCase {
} catch (TransactionDataRebalancedException expected) {
}
try {
- FunctionService.onMember(system, ds2).execute(TXFunction.id).getResult();
+ FunctionService.onMember(basicGetSystem(), ds2).execute(TXFunction.id).getResult();
fail("expected exception not thrown");
} catch (TransactionDataNotColocatedException expected) {
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/RemoveAllDAckDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/RemoveAllDAckDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/RemoveAllDAckDUnitTest.java
index 5f51cbd..9b9543b 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/RemoveAllDAckDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/RemoveAllDAckDUnitTest.java
@@ -63,8 +63,7 @@ public class RemoveAllDAckDUnitTest 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);
@@ -74,7 +73,7 @@ public class RemoveAllDAckDUnitTest 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/RemoveDAckDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/RemoveDAckDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/RemoveDAckDUnitTest.java
index 5f60779..4a9eb03 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/RemoveDAckDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/RemoveDAckDUnitTest.java
@@ -59,8 +59,7 @@ public class RemoveDAckDUnitTest 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);
@@ -70,7 +69,7 @@ public class RemoveDAckDUnitTest 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/RemoveGlobalDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/RemoveGlobalDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/RemoveGlobalDUnitTest.java
index c25c24d..9bce9c4 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/RemoveGlobalDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/RemoveGlobalDUnitTest.java
@@ -64,8 +64,7 @@ public class RemoveGlobalDUnitTest extends DistributedTestCase {
static VM vm1 = null;
@Override
- public void setUp() throws Exception {
- super.setUp();
+ public final void postSetUp() throws Exception {
Host host = Host.getHost(0);
vm0 = host.getVM(0);
vm1 = host.getVM(1);
@@ -74,7 +73,7 @@ public class RemoveGlobalDUnitTest extends DistributedTestCase {
}
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
vm0.invoke(() -> RemoveGlobalDUnitTest.resetFlag());
vm1.invoke(() -> RemoveGlobalDUnitTest.resetFlag());
vm0.invoke(() -> RemoveGlobalDUnitTest.closeCache());
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/SingleHopStatsDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/SingleHopStatsDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/SingleHopStatsDUnitTest.java
index 01522bf..c702d9f 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/SingleHopStatsDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/SingleHopStatsDUnitTest.java
@@ -102,8 +102,8 @@ public class SingleHopStatsDUnitTest 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);
member0 = host.getVM(0);
member1 = host.getVM(1);
@@ -112,17 +112,17 @@ public class SingleHopStatsDUnitTest extends CacheTestCase{
}
@Override
- protected final void preTearDownCacheTestCase() throws Exception {
+ public final void preTearDownCacheTestCase() throws Exception {
// close the clients first
- member0.invoke(() -> SingleHopStatsDUnitTest.closeCache());
- member1.invoke(() -> SingleHopStatsDUnitTest.closeCache());
- member2.invoke(() -> SingleHopStatsDUnitTest.closeCache());
- member3.invoke(() -> SingleHopStatsDUnitTest.closeCache());
- closeCache();
+ member0.invoke(() -> SingleHopStatsDUnitTest.closeCacheAndDisconnect());
+ member1.invoke(() -> SingleHopStatsDUnitTest.closeCacheAndDisconnect());
+ member2.invoke(() -> SingleHopStatsDUnitTest.closeCacheAndDisconnect());
+ member3.invoke(() -> SingleHopStatsDUnitTest.closeCacheAndDisconnect());
+ closeCacheAndDisconnect();
}
@Override
- protected final void postTearDownCacheTestCase() throws Exception {
+ public final void postTearDownCacheTestCase() throws Exception {
try {
member0 = null;
member1 = null;
@@ -137,7 +137,7 @@ public class SingleHopStatsDUnitTest extends CacheTestCase{
}
}
- public static void closeCache() {
+ public static void closeCacheAndDisconnect() {
if (cache != null && !cache.isClosed()) {
cache.close();
cache.getDistributedSystem().disconnect();
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/SystemFailureDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/SystemFailureDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/SystemFailureDUnitTest.java
index 43fc6a5..8bd9fcc 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/SystemFailureDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/SystemFailureDUnitTest.java
@@ -396,7 +396,7 @@ public class SystemFailureDUnitTest extends DistributedCacheTestCase {
return ((Boolean)o).booleanValue();
}
- protected static Boolean verifyConnected() {
+ protected Boolean verifyConnected() {
if (SystemFailure.getFailure() != null) {
com.gemstone.gemfire.test.dunit.Assert.fail("System failure present!", SystemFailure.getFailure());
return Boolean.FALSE;
@@ -409,11 +409,11 @@ public class SystemFailureDUnitTest extends DistributedCacheTestCase {
// Let's inspect the distributed system. It should also
// be connected.
- if (system.getCancelCriterion().cancelInProgress() != null) {
+ if (basicGetSystem().getCancelCriterion().cancelInProgress() != null) {
fail("distributed system cancel in progress");
return Boolean.FALSE;
}
- if (!system.isConnected()) {
+ if (!basicGetSystem().isConnected()) {
fail("distributed system not connected");
return Boolean.FALSE;
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/control/RebalanceOperationDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/control/RebalanceOperationDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/control/RebalanceOperationDUnitTest.java
index f7275b7..6b7216e 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/control/RebalanceOperationDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/control/RebalanceOperationDUnitTest.java
@@ -94,7 +94,7 @@ public class RebalanceOperationDUnitTest extends CacheTestCase {
private static final long MAX_WAIT = 60;
@Override
- protected final void postTearDownCacheTestCase() throws Exception {
+ public final void postTearDownCacheTestCase() throws Exception {
Invoke.invokeInEveryVM(new SerializableRunnable() {
public void run() {
InternalResourceManager.setResourceObserver(null);
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/Bug51193DUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/Bug51193DUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/Bug51193DUnitTest.java
index de58569..9a7fb8b 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/Bug51193DUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/Bug51193DUnitTest.java
@@ -62,16 +62,14 @@ public class Bug51193DUnitTest extends DistributedTestCase {
private VM client0;
@Override
- public void setUp() throws Exception {
- super.setUp();
+ public final void postSetUp() throws Exception {
Host host = Host.getHost(0);
server0 = host.getVM(0);
client0 = host.getVM(1);
-
}
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
closeCache();
server0.invoke(() -> Bug51193DUnitTest.closeCache());
client0.invoke(() -> Bug51193DUnitTest.closeCache());
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/ClientServerFunctionExecutionDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/ClientServerFunctionExecutionDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/ClientServerFunctionExecutionDUnitTest.java
index 821407f..67d66b7 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/ClientServerFunctionExecutionDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/ClientServerFunctionExecutionDUnitTest.java
@@ -62,12 +62,11 @@ public class ClientServerFunctionExecutionDUnitTest extends PRClientServerTestBa
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
+ @Override
+ protected final void postSetUpPRClientServerTestBase() throws Exception {
IgnoredException.addIgnoredException("java.net.ConnectException");
}
-
public void test_Bug_43126_Function_Not_Registered()
throws InterruptedException {
createScenario();
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/ColocationFailoverDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/ColocationFailoverDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/ColocationFailoverDUnitTest.java
index 089c301..11eefd0 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/ColocationFailoverDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/ColocationFailoverDUnitTest.java
@@ -77,8 +77,8 @@ public class ColocationFailoverDUnitTest extends DistributedTestCase {
super(name);
}
- 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);
@@ -469,7 +469,7 @@ public class ColocationFailoverDUnitTest extends DistributedTestCase {
}
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
closeCache();
Invoke.invokeInEveryVM(new SerializableRunnable() {
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/execute/DistributedRegionFunctionExecutionDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/DistributedRegionFunctionExecutionDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/DistributedRegionFunctionExecutionDUnitTest.java
index 56d94e0..8205765 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/DistributedRegionFunctionExecutionDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/DistributedRegionFunctionExecutionDUnitTest.java
@@ -91,8 +91,7 @@ public class DistributedRegionFunctionExecutionDUnitTest extends
}
@Override
- public void setUp() throws Exception {
- super.setUp();
+ public final void postSetUp() throws Exception {
Host host = Host.getHost(0);
replicate1 = host.getVM(0);
replicate2 = host.getVM(1);
@@ -101,7 +100,7 @@ public class DistributedRegionFunctionExecutionDUnitTest extends
}
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
// this test creates a cache that is incompatible with CacheTestCase,
// so we need to close it and null out the cache variable
disconnectAllFromDS();
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/FunctionServiceStatsDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/FunctionServiceStatsDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/FunctionServiceStatsDUnitTest.java
index 9edb736..6db487b 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/FunctionServiceStatsDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/FunctionServiceStatsDUnitTest.java
@@ -118,8 +118,8 @@ public class FunctionServiceStatsDUnitTest extends PRClientServerTestBase{
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
+ @Override
+ protected final void postSetUpPRClientServerTestBase() throws Exception {
//Make sure stats to linger from a previous test
disconnectAllFromDS();
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/LocalDataSetDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/LocalDataSetDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/LocalDataSetDUnitTest.java
index f55970f..850f925 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/LocalDataSetDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/LocalDataSetDUnitTest.java
@@ -74,8 +74,8 @@ public class LocalDataSetDUnitTest extends CacheTestCase {
super(name);
}
- 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);
@@ -103,7 +103,7 @@ public class LocalDataSetDUnitTest extends CacheTestCase {
SerializableCallable installHook = new SerializableCallable() {
public Object call() throws Exception {
- PartitionedRegion pr = (PartitionedRegion)cache.getRegion("CustomerPR");
+ PartitionedRegion pr = (PartitionedRegion)basicGetCache().getRegion("CustomerPR");
Runnable r = new ReadHook();
pr.getDataStore().setBucketReadHook(r);
return null;
@@ -112,7 +112,7 @@ public class LocalDataSetDUnitTest extends CacheTestCase {
invokeInAllDataStores(installHook);
accessor.invoke(new SerializableCallable() {
public Object call() throws Exception {
- Region region = cache.getRegion("CustomerPR");
+ Region region = basicGetCache().getRegion("CustomerPR");
Set filter = new HashSet();
filter.add("1");
FunctionService.onRegion(region).withFilter(filter).execute(IterateFunction.id, true, false, true).getResult();
@@ -248,7 +248,7 @@ public class LocalDataSetDUnitTest extends CacheTestCase {
public void createCache() {
try {
getCache();
- assertNotNull(cache);
+ assertNotNull(basicGetCache());
}
catch (Exception e) {
Assert.fail("Failed while creating the cache", e);
@@ -299,10 +299,10 @@ public class LocalDataSetDUnitTest extends CacheTestCase {
.setPartitionResolver(new LDSPartitionResolver()).create();
AttributesFactory attr = new AttributesFactory();
attr.setPartitionAttributes(prAttr);
- assertNotNull(cache);
+ assertNotNull(basicGetCache());
if (partitionedRegionName.equals("CustomerPR")) {
- customerPR = cache.createRegion(partitionedRegionName, attr.create());
+ customerPR = basicGetCache().createRegion(partitionedRegionName, attr.create());
assertNotNull(customerPR);
LogWriterUtils.getLogWriter().info(
"Partitioned Region " + partitionedRegionName
@@ -310,7 +310,7 @@ public class LocalDataSetDUnitTest extends CacheTestCase {
}
if (partitionedRegionName.equals("OrderPR")) {
- orderPR = cache.createRegion(partitionedRegionName, attr.create());
+ orderPR = basicGetCache().createRegion(partitionedRegionName, attr.create());
assertNotNull(orderPR);
LogWriterUtils.getLogWriter().info(
"Partitioned Region " + partitionedRegionName
@@ -319,7 +319,7 @@ public class LocalDataSetDUnitTest extends CacheTestCase {
}
if (partitionedRegionName.equals("ShipmentPR")) {
- shipmentPR = cache.createRegion(partitionedRegionName, attr.create());
+ shipmentPR = basicGetCache().createRegion(partitionedRegionName, attr.create());
assertNotNull(shipmentPR);
LogWriterUtils.getLogWriter().info(
"Partitioned Region " + partitionedRegionName
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/LocalDataSetIndexingDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/LocalDataSetIndexingDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/LocalDataSetIndexingDUnitTest.java
index 1d933e3..27aeae6 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/LocalDataSetIndexingDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/LocalDataSetIndexingDUnitTest.java
@@ -86,8 +86,7 @@ public class LocalDataSetIndexingDUnitTest 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/execute/LocalFunctionExecutionDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/LocalFunctionExecutionDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/LocalFunctionExecutionDUnitTest.java
index e36aacd..1c47ffd 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/LocalFunctionExecutionDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/LocalFunctionExecutionDUnitTest.java
@@ -55,13 +55,12 @@ public class LocalFunctionExecutionDUnitTest extends DistributedTestCase{
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
+ @Override
+ public final void postSetUp() throws Exception {
Host host = Host.getHost(0);
dataStore1 = host.getVM(0);
}
-
-
+
public void testLocalDataSetPR(){
dataStore1.invoke(() -> LocalFunctionExecutionDUnitTest.createCacheInVm());
Object args[] = new Object[] { "testRegion", new Integer(1), new Integer(50),
@@ -158,8 +157,8 @@ public class LocalFunctionExecutionDUnitTest extends DistributedTestCase{
try {
Function function1 = new TestFunction(true,TestFunction.TEST_FUNCTION_EXCEPTION);
FunctionService.registerFunction(function1);
- DistributedMember localmember = system.getDistributedMember();
- ResultCollector rc = FunctionService.onMember(system, localmember).withArgs(Boolean.TRUE).execute(function1.getId());
+ DistributedMember localmember = getSystemStatic().getDistributedMember();
+ ResultCollector rc = FunctionService.onMember(getSystemStatic(), localmember).withArgs(Boolean.TRUE).execute(function1.getId());
rc.getResult();
Assert.fail("Exception should occur",new Exception("Test Failed"));
}
@@ -170,7 +169,7 @@ public class LocalFunctionExecutionDUnitTest extends DistributedTestCase{
}
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
if(cache != null) {
cache.close();
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/MemberFunctionExecutionDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/MemberFunctionExecutionDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/MemberFunctionExecutionDUnitTest.java
index abad8d8..ada68c9 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/MemberFunctionExecutionDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/MemberFunctionExecutionDUnitTest.java
@@ -73,8 +73,7 @@ public class MemberFunctionExecutionDUnitTest extends CacheTestCase {
}
@Override
- public void setUp() throws Exception {
- super.setUp();
+ public final void postSetUp() throws Exception {
Host host = Host.getHost(0);
member1 = host.getVM(0);
member2 = host.getVM(1);
@@ -658,7 +657,7 @@ public class MemberFunctionExecutionDUnitTest extends CacheTestCase {
}
@Override
- protected final void preTearDownCacheTestCase() throws Exception {
+ public final void preTearDownCacheTestCase() throws Exception {
List<VM> members = new ArrayList<VM>(4);
members.add(member1); members.add(member2); members.add(member3); members.add(member4);
for (VM member: members) {
@@ -667,7 +666,7 @@ public class MemberFunctionExecutionDUnitTest 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/execute/MultiRegionFunctionExecutionDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/MultiRegionFunctionExecutionDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/MultiRegionFunctionExecutionDUnitTest.java
index 7f9d918..a129af9 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/MultiRegionFunctionExecutionDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/MultiRegionFunctionExecutionDUnitTest.java
@@ -61,9 +61,8 @@ public class MultiRegionFunctionExecutionDUnitTest extends CacheTestCase {
super(name);
}
- public void setUp() throws Exception {
-
- super.setUp();
+ @Override
+ public final void postSetUp() throws Exception {
Host host = Host.getHost(0);
vm0 = host.getVM(0);
vm1 = host.getVM(1);
@@ -72,7 +71,7 @@ public class MultiRegionFunctionExecutionDUnitTest 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/execute/OnGroupsFunctionExecutionDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/OnGroupsFunctionExecutionDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/OnGroupsFunctionExecutionDUnitTest.java
index 3cc34d8..c77a201 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/OnGroupsFunctionExecutionDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/OnGroupsFunctionExecutionDUnitTest.java
@@ -64,7 +64,7 @@ public class OnGroupsFunctionExecutionDUnitTest extends DistributedTestCase {
}
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() 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/cache/execute/PRClientServerFunctionExecutionNoAckDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRClientServerFunctionExecutionNoAckDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRClientServerFunctionExecutionNoAckDUnitTest.java
index 80d59ed..0c33b5f 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRClientServerFunctionExecutionNoAckDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRClientServerFunctionExecutionNoAckDUnitTest.java
@@ -51,9 +51,6 @@ public class PRClientServerFunctionExecutionNoAckDUnitTest extends PRClientServe
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
- }
/*
* Execution of the function on server using the name of the function
*/
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRClientServerRegionFunctionExecutionDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRClientServerRegionFunctionExecutionDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRClientServerRegionFunctionExecutionDUnitTest.java
index 0104e7a..ed61274 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRClientServerRegionFunctionExecutionDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRClientServerRegionFunctionExecutionDUnitTest.java
@@ -81,11 +81,6 @@ public class PRClientServerRegionFunctionExecutionDUnitTest extends PRClientServ
super(name);
}
- @Override
- public void setUp() throws Exception {
- super.setUp();
- }
-
public void test_Bug_43126_Function_Not_Registered()
throws InterruptedException {
createScenario();
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRClientServerRegionFunctionExecutionFailoverDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRClientServerRegionFunctionExecutionFailoverDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRClientServerRegionFunctionExecutionFailoverDUnitTest.java
index 1164543..d139bbf 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRClientServerRegionFunctionExecutionFailoverDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRClientServerRegionFunctionExecutionFailoverDUnitTest.java
@@ -67,8 +67,7 @@ public class PRClientServerRegionFunctionExecutionFailoverDUnitTest extends
}
@Override
- public void setUp() throws Exception {
- super.setUp();
+ protected void postSetUpPRClientServerTestBase() throws Exception {
IgnoredException.addIgnoredException("Connection reset");
IgnoredException.addIgnoredException("SocketTimeoutException");
IgnoredException.addIgnoredException("ServerConnectivityException");
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRClientServerRegionFunctionExecutionNoSingleHopDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRClientServerRegionFunctionExecutionNoSingleHopDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRClientServerRegionFunctionExecutionNoSingleHopDUnitTest.java
index ffcac65..cd54be6 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRClientServerRegionFunctionExecutionNoSingleHopDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRClientServerRegionFunctionExecutionNoSingleHopDUnitTest.java
@@ -69,10 +69,6 @@ public class PRClientServerRegionFunctionExecutionNoSingleHopDUnitTest extends
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
- }
-
/*
* Execution of the function on server with
*/
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRClientServerRegionFunctionExecutionSelectorNoSingleHopDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRClientServerRegionFunctionExecutionSelectorNoSingleHopDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRClientServerRegionFunctionExecutionSelectorNoSingleHopDUnitTest.java
index 5a17f4d..482ab9a 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRClientServerRegionFunctionExecutionSelectorNoSingleHopDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRClientServerRegionFunctionExecutionSelectorNoSingleHopDUnitTest.java
@@ -69,10 +69,6 @@ public class PRClientServerRegionFunctionExecutionSelectorNoSingleHopDUnitTest e
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
- }
-
/*
* Execution of the function on server with
*/
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRClientServerRegionFunctionExecutionSingleHopDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRClientServerRegionFunctionExecutionSingleHopDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRClientServerRegionFunctionExecutionSingleHopDUnitTest.java
index 84da524..1f65ad2 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRClientServerRegionFunctionExecutionSingleHopDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRClientServerRegionFunctionExecutionSingleHopDUnitTest.java
@@ -67,11 +67,10 @@ import com.gemstone.gemfire.test.dunit.WaitCriterion;
}
@Override
- public void setUp() throws Exception {
+ public final void preSetUp() throws Exception {
//Workaround for bug #52004
IgnoredException.addIgnoredException("InternalFunctionInvocationTargetException");
IgnoredException.addIgnoredException("Connection refused");
- super.setUp();
}
/*
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRClientServerTestBase.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRClientServerTestBase.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRClientServerTestBase.java
index 560d305..88d0222 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRClientServerTestBase.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRClientServerTestBase.java
@@ -110,13 +110,17 @@ public class PRClientServerTestBase extends CacheTestCase {
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
+ @Override
+ public final void postSetUp() throws Exception {
Host host = Host.getHost(0);
server1 = host.getVM(0);
server2 = host.getVM(1);
server3 = host.getVM(2);
client = host.getVM(3);
+ postSetUpPRClientServerTestBase();
+ }
+
+ protected void postSetUpPRClientServerTestBase() throws Exception {
}
public ArrayList createCommonServerAttributes(String regionName,
@@ -682,15 +686,15 @@ public class PRClientServerTestBase extends CacheTestCase {
}
@Override
- protected final void postTearDownCacheTestCase() throws Exception {
- closeCache();
- client.invoke(() -> PRClientServerTestBase.closeCache());
- server1.invoke(() -> PRClientServerTestBase.closeCache());
- server2.invoke(() -> PRClientServerTestBase.closeCache());
- server3.invoke(() -> PRClientServerTestBase.closeCache());
+ public final void postTearDownCacheTestCase() throws Exception {
+ closeCacheAndDisconnect();
+ client.invoke(() -> PRClientServerTestBase.closeCacheAndDisconnect());
+ server1.invoke(() -> PRClientServerTestBase.closeCacheAndDisconnect());
+ server2.invoke(() -> PRClientServerTestBase.closeCacheAndDisconnect());
+ server3.invoke(() -> PRClientServerTestBase.closeCacheAndDisconnect());
}
- public static void closeCache() {
+ public static void closeCacheAndDisconnect() {
if (cache != null && !cache.isClosed()) {
cache.close();
cache.getDistributedSystem().disconnect();
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRColocationDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRColocationDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRColocationDUnitTest.java
index 839d78c..6c5dc9f 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRColocationDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRColocationDUnitTest.java
@@ -118,8 +118,7 @@ public class PRColocationDUnitTest extends CacheTestCase {
}
@Override
- public void setUp() throws Exception {
- super.setUp();
+ public final void postSetUp() throws Exception {
disconnectAllFromDS(); // isolate this test from others to avoid periodic CacheExistsExceptions
Host host = Host.getHost(0);
dataStore1 = host.getVM(0);
@@ -2556,7 +2555,7 @@ public class PRColocationDUnitTest extends CacheTestCase {
}
@Override
- protected final void postTearDownCacheTestCase() throws Exception {
+ public final void postTearDownCacheTestCase() throws Exception {
Invoke.invokeInEveryVM(new SerializableRunnable() {
public void run() {
InternalResourceManager.setResourceObserver(null);
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRTransactionDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRTransactionDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRTransactionDUnitTest.java
index 15cf753..102d52d 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRTransactionDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRTransactionDUnitTest.java
@@ -665,7 +665,7 @@ public class PRTransactionDUnitTest extends PRColocationDUnitTest {
}
@Override
- protected final void preTearDownCacheTestCase() throws Exception {
+ public final void preTearDownCacheTestCase() throws Exception {
Invoke.invokeInEveryVM(verifyNoTxState);
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/SingleHopGetAllPutAllDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/SingleHopGetAllPutAllDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/SingleHopGetAllPutAllDUnitTest.java
index 863e260..f2ab3e2 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/SingleHopGetAllPutAllDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/SingleHopGetAllPutAllDUnitTest.java
@@ -45,11 +45,6 @@ public class SingleHopGetAllPutAllDUnitTest extends PRClientServerTestBase{
}
- @Override
- public void setUp() throws Exception {
- super.setUp();
- }
-
/*
* Do a getAll from client and see if all the values are returned.
* Will also have to see if the function was routed from client to all the servers
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/Bug36853EventsExpiryDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/Bug36853EventsExpiryDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/Bug36853EventsExpiryDUnitTest.java
index cee0304..714fe49 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/Bug36853EventsExpiryDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/Bug36853EventsExpiryDUnitTest.java
@@ -102,10 +102,13 @@ public class Bug36853EventsExpiryDUnitTest extends CacheTestCase
* @throws Exception -
* thrown in any problem occurs in setUp
*/
- public void setUp() throws Exception
- {
+ @Override
+ public final void preSetUp() throws Exception {
disconnectAllFromDS();
- super.setUp();
+ }
+
+ @Override
+ public final void postSetUp() throws Exception {
final Host host = Host.getHost(0);
server = host.getVM(0);
client = host.getVM(1);
@@ -113,7 +116,6 @@ public class Bug36853EventsExpiryDUnitTest extends CacheTestCase
int PORT2 = ((Integer)server.invoke(() -> Bug36853EventsExpiryDUnitTest.createServerCache())).intValue();
client.invoke(() -> Bug36853EventsExpiryDUnitTest.createClientCache( NetworkUtils.getServerHostName(host), new Integer(PORT2) ));
-
}
/**
@@ -279,9 +281,9 @@ public class Bug36853EventsExpiryDUnitTest extends CacheTestCase
* Closes the cache
*
*/
- public static void closeCache()
+ public static void unSetExpiryTimeAndCloseCache()
{
- System.setProperty(HARegionQueue.REGION_ENTRY_EXPIRY_TIME, "");
+ System.clearProperty(HARegionQueue.REGION_ENTRY_EXPIRY_TIME);
CacheTestCase.closeCache();
}
@@ -292,12 +294,12 @@ public class Bug36853EventsExpiryDUnitTest extends CacheTestCase
* thrown if any problem occurs in closing client and server caches.
*/
@Override
- protected final void preTearDownCacheTestCase() throws Exception
+ public final void preTearDownCacheTestCase() throws Exception
{
// close client
- client.invoke(() -> Bug36853EventsExpiryDUnitTest.closeCache());
+ client.invoke(() -> Bug36853EventsExpiryDUnitTest.unSetExpiryTimeAndCloseCache());
// close server
- server.invoke(() -> Bug36853EventsExpiryDUnitTest.closeCache());
+ server.invoke(() -> Bug36853EventsExpiryDUnitTest.unSetExpiryTimeAndCloseCache());
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/Bug48571DUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/Bug48571DUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/Bug48571DUnitTest.java
index e5acf27..09ed9a5 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/Bug48571DUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/Bug48571DUnitTest.java
@@ -62,15 +62,15 @@ public class Bug48571DUnitTest extends DistributedTestCase {
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
+ @Override
+ public final void postSetUp() throws Exception {
final Host host = Host.getHost(0);
server = host.getVM(0);
client = host.getVM(1);
}
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
reset();
server.invoke(() -> Bug48571DUnitTest.reset());
client.invoke(() -> Bug48571DUnitTest.reset());
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/Bug48879DUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/Bug48879DUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/Bug48879DUnitTest.java
index 636333a..fef1ef9 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/Bug48879DUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/Bug48879DUnitTest.java
@@ -52,8 +52,8 @@ public class Bug48879DUnitTest extends DistributedTestCase {
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
+ @Override
+ public final void postSetUp() throws Exception {
disconnectAllFromDS();
Host host = Host.getHost(0);
vm0 = host.getVM(0); // server1
@@ -66,7 +66,7 @@ public class Bug48879DUnitTest extends DistributedTestCase {
}
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
closeCache();
vm0.invoke(() -> Bug48879DUnitTest.closeCache());
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/EventIdOptimizationDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/EventIdOptimizationDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/EventIdOptimizationDUnitTest.java
index b4fbc58..89a385c 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/EventIdOptimizationDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/EventIdOptimizationDUnitTest.java
@@ -159,8 +159,8 @@ public class EventIdOptimizationDUnitTest extends DistributedTestCase
* @throws Exception -
* thrown in any problem occurs in setUp
*/
- public void setUp() throws Exception {
- super.setUp();
+ @Override
+ public final void postSetUp() throws Exception {
disconnectAllFromDS();
final Host host = Host.getHost(0);
@@ -174,7 +174,6 @@ public class EventIdOptimizationDUnitTest extends DistributedTestCase
client1.invoke(() -> EventIdOptimizationDUnitTest.createClientCache1( NetworkUtils.getServerHostName(host), new Integer(PORT1) ));
client2.invoke(() -> EventIdOptimizationDUnitTest.createClientCache2( NetworkUtils.getServerHostName(host), new Integer(PORT2) ));
-
}
/**
@@ -499,7 +498,7 @@ public class EventIdOptimizationDUnitTest extends DistributedTestCase
* Closes the caches on clients and servers
*/
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
// close client
client1.invoke(() -> EventIdOptimizationDUnitTest.closeCache());
client2.invoke(() -> EventIdOptimizationDUnitTest.closeCache());
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/FailoverDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/FailoverDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/FailoverDUnitTest.java
index 90e9703..ac14478 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/FailoverDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/FailoverDUnitTest.java
@@ -76,9 +76,8 @@ public class FailoverDUnitTest 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);
@@ -325,7 +324,7 @@ public class FailoverDUnitTest extends DistributedTestCase
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
// close the clients first
closeCache();
// then close the servers
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HABugInPutDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HABugInPutDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HABugInPutDUnitTest.java
index 4adb2a8..53dc338 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HABugInPutDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HABugInPutDUnitTest.java
@@ -70,10 +70,9 @@ public class HABugInPutDUnitTest extends DistributedTestCase
super(name);
}
- public void setUp() throws Exception
- {
- super.setUp();
- final Host host = Host.getHost(0);
+ @Override
+ public final void postSetUp() throws Exception {
+ final Host host = Host.getHost(0);
// Server1 VM
server1 = host.getVM(0);
@@ -96,12 +95,10 @@ public class HABugInPutDUnitTest extends DistributedTestCase
NetworkUtils.getServerHostName(host), new Integer(PORT1), new Integer(PORT2) ));
client2.invoke(() -> HABugInPutDUnitTest.createClientCache(
NetworkUtils.getServerHostName(host), new Integer(PORT1), new Integer(PORT2) ));
- //Boolean.getBoolean("")
-
}
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
client1.invoke(() -> HABugInPutDUnitTest.closeCache());
client2.invoke(() -> HABugInPutDUnitTest.closeCache());
// close server
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAClearDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAClearDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAClearDUnitTest.java
index bb2ca69..3a23140 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAClearDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAClearDUnitTest.java
@@ -85,9 +85,8 @@ public class HAClearDUnitTest 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);
@@ -101,11 +100,10 @@ public class HAClearDUnitTest extends DistributedTestCase
client2 = host.getVM(3);
CacheObserverHolder.setInstance(new CacheObserverAdapter());
-
}
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
client1.invoke(() -> HAClearDUnitTest.closeCache());
client2.invoke(() -> HAClearDUnitTest.closeCache());
server1.invoke(() -> HAClearDUnitTest.closeCache());
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAConflationDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAConflationDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAConflationDUnitTest.java
index 212a798..1d027bf 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAConflationDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAConflationDUnitTest.java
@@ -97,9 +97,8 @@ public class HAConflationDUnitTest extends CacheTestCase
super(name);
}
- public void setUp() throws Exception
- {
- super.setUp();
+ @Override
+ public final void postSetUp() throws Exception {
final Host host = Host.getHost(0);
// Server1 VM
server1 = host.getVM(0);
@@ -111,21 +110,20 @@ public class HAConflationDUnitTest extends CacheTestCase
server1.invoke(() -> ConflationDUnitTest.setIsSlowStart());
server1.invoke(() -> HAConflationDUnitTest.makeDispatcherSlow());
client1.invoke(() -> HAConflationDUnitTest.createClientCache( NetworkUtils.getServerHostName(host), new Integer(PORT1), new Boolean(true) ));
-
}
@Override
- protected final void postTearDownCacheTestCase() throws Exception {
- client1.invoke(() -> HAConflationDUnitTest.closeCache());
+ public final void postTearDownCacheTestCase() throws Exception {
+ client1.invoke(() -> HAConflationDUnitTest.closeCacheAndDisconnect());
// close server
- server1.invoke(() -> HAConflationDUnitTest.closeCache());
+ server1.invoke(() -> HAConflationDUnitTest.closeCacheAndDisconnect());
}
- public static void closeCache()
+ public static void closeCacheAndDisconnect()
{
- if (cache != null && !cache.isClosed()) {
- cache.close();
- cache.getDistributedSystem().disconnect();
+ if (basicGetCache() != null && !basicGetCache().isClosed()) {
+ basicGetCache().close();
+ basicGetCache().getDistributedSystem().disconnect();
}
}
@@ -212,11 +210,11 @@ public class HAConflationDUnitTest extends CacheTestCase
"putFromServer") {
public void run2() throws CacheException
{
- Region region = cache.getRegion(Region.SEPARATOR + regionName);
+ Region region = basicGetCache().getRegion(Region.SEPARATOR + regionName);
assertNotNull(region);
- cache.getLogger().info("starting put()");
+ basicGetCache().getLogger().info("starting put()");
region.put(key, value);
- cache.getLogger().info("finished put()");
+ basicGetCache().getLogger().info("finished put()");
}
};
@@ -229,10 +227,10 @@ public class HAConflationDUnitTest extends CacheTestCase
"invalidateFromServer") {
public void run2() throws CacheException
{
- Region region = cache.getRegion(Region.SEPARATOR + regionName);
+ Region region = basicGetCache().getRegion(Region.SEPARATOR + regionName);
assertNotNull(region);
region.invalidate(key);
- cache.getLogger().info("done invalidate() successfully");
+ basicGetCache().getLogger().info("done invalidate() successfully");
}
};
@@ -246,10 +244,10 @@ public class HAConflationDUnitTest extends CacheTestCase
"performDestroy") {
public void run2() throws CacheException
{
- Region region = cache.getRegion(Region.SEPARATOR + regionName);
+ Region region = basicGetCache().getRegion(Region.SEPARATOR + regionName);
assertNotNull(region);
region.destroy(key);
- cache.getLogger().info("done destroy successfully");
+ basicGetCache().getLogger().info("done destroy successfully");
}
};
@@ -302,8 +300,8 @@ public class HAConflationDUnitTest extends CacheTestCase
assertNotNull(ds);
ds.disconnect();
ds = getSystem(props);
- cache = CacheFactory.create(ds);
- assertNotNull(cache);
+ getCache();
+ assertNotNull(basicGetCache());
}
public static void createClientCache(String host, Integer port1, Boolean isListenerPresent)
@@ -323,8 +321,8 @@ public class HAConflationDUnitTest extends CacheTestCase
factory.setCacheListener(clientListener);
}
RegionAttributes attrs = factory.create();
- cache.createRegion(regionName, attrs);
- Region region = cache.getRegion(Region.SEPARATOR + regionName);
+ basicGetCache().createRegion(regionName, attrs);
+ Region region = basicGetCache().getRegion(Region.SEPARATOR + regionName);
assertNotNull(region);
region.registerInterest(KEY1);
@@ -349,8 +347,8 @@ public class HAConflationDUnitTest extends CacheTestCase
factory.setCacheListener(serverListener);
}
RegionAttributes attrs = factory.create();
- cache.createRegion(regionName, attrs);
- CacheServerImpl server = (CacheServerImpl)cache.addCacheServer();
+ basicGetCache().createRegion(regionName, attrs);
+ CacheServerImpl server = (CacheServerImpl)basicGetCache().addCacheServer();
assertNotNull(server);
int port = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
server.setPort(port);
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HADuplicateDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HADuplicateDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HADuplicateDUnitTest.java
index 1d18390..937b2cc 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HADuplicateDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HADuplicateDUnitTest.java
@@ -89,9 +89,8 @@ public class HADuplicateDUnitTest 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);
@@ -104,7 +103,7 @@ public class HADuplicateDUnitTest extends DistributedTestCase
}
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
client1.invoke(() -> HADuplicateDUnitTest.closeCache());
// close server
server1.invoke(() -> HADuplicateDUnitTest.reSetQRMslow());
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAEventIdPropagationDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAEventIdPropagationDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAEventIdPropagationDUnitTest.java
index 4753fb7..153ee20 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAEventIdPropagationDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAEventIdPropagationDUnitTest.java
@@ -87,9 +87,8 @@ public class HAEventIdPropagationDUnitTest extends DistributedTestCase
}
/** get the hosts and the VMs * */
- public void setUp() throws Exception
- {
- super.setUp();
+ @Override
+ public final void postSetUp() throws Exception {
final Host host = Host.getHost(0);
server1 = host.getVM(0);
server1.invoke(() -> ConflationDUnitTest.unsetIsSlowStart());
@@ -98,7 +97,7 @@ public class HAEventIdPropagationDUnitTest extends DistributedTestCase
/** close the caches* */
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
client1.invoke(() -> HAEventIdPropagationDUnitTest.closeCache());
// close server
server1.invoke(() -> HAEventIdPropagationDUnitTest.closeCache());
[10/11] incubator-geode git commit: GEODE-1050: add JUnit 4 versions
of DistributedTestCase and CacheTestCase
Posted by kl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/RemoteQueryDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/RemoteQueryDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/RemoteQueryDUnitTest.java
index 09fd945..d144c00 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/RemoteQueryDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/RemoteQueryDUnitTest.java
@@ -73,13 +73,12 @@ public class RemoteQueryDUnitTest extends CacheTestCase {
//////// Test Methods
@Override
- public void setUp() throws Exception {
- super.setUp();
+ public final void postSetUp() throws Exception {
disconnectAllFromDS();
}
@Override
- protected final void postTearDownCacheTestCase() throws Exception {
+ public final void postTearDownCacheTestCase() throws Exception {
disconnectAllFromDS();
}
@@ -99,7 +98,7 @@ public class RemoteQueryDUnitTest extends CacheTestCase {
public void run2() throws CacheException {
Properties config = new Properties();
config.setProperty("locators", "localhost["+DistributedTestUtils.getDUnitLocatorPort()+"]");
- system = (InternalDistributedSystem) DistributedSystem.connect(config);
+ InternalDistributedSystem system = getSystem(config);
AttributesFactory factory = new AttributesFactory();
factory.setScope(Scope.LOCAL);
createRegion(name, factory.create());
@@ -129,7 +128,7 @@ public class RemoteQueryDUnitTest extends CacheTestCase {
public void run2() throws CacheException {
Properties config = new Properties();
config.setProperty("mcast-port", "0");
- system = (InternalDistributedSystem) DistributedSystem.connect(config);
+ getSystem(config);
getCache();
AttributesFactory factory = new AttributesFactory();
factory.setScope(Scope.LOCAL);
@@ -242,7 +241,7 @@ public class RemoteQueryDUnitTest extends CacheTestCase {
public void run2() throws CacheException {
Properties config = new Properties();
config.setProperty("locators", "localhost["+DistributedTestUtils.getDUnitLocatorPort()+"]");
- system = (InternalDistributedSystem) DistributedSystem.connect(config);
+ getSystem(config);
AttributesFactory factory = new AttributesFactory();
factory.setScope(Scope.LOCAL);
createRegion(name, factory.create());
@@ -272,7 +271,7 @@ public class RemoteQueryDUnitTest extends CacheTestCase {
public void run2() throws CacheException {
Properties config = new Properties();
config.setProperty("mcast-port", "0");
- system = (InternalDistributedSystem) DistributedSystem.connect(config);
+ getSystem(config);
getCache();
AttributesFactory factory = new AttributesFactory();
factory.setScope(Scope.LOCAL);
@@ -370,7 +369,7 @@ public class RemoteQueryDUnitTest extends CacheTestCase {
public void run2() throws CacheException {
Properties config = new Properties();
config.setProperty("locators", "localhost["+DistributedTestUtils.getDUnitLocatorPort()+"]");
- system = (InternalDistributedSystem) DistributedSystem.connect(config);
+ getSystem(config);
AttributesFactory factory = new AttributesFactory();
factory.setScope(Scope.LOCAL);
createRegion(name, factory.create());
@@ -400,7 +399,7 @@ public class RemoteQueryDUnitTest extends CacheTestCase {
public void run2() throws CacheException {
Properties config = new Properties();
config.setProperty("mcast-port", "0");
- system = (InternalDistributedSystem) DistributedSystem.connect(config);
+ getSystem(config);
getCache();
AttributesFactory factory = new AttributesFactory();
factory.setScope(Scope.LOCAL);
@@ -496,7 +495,7 @@ public class RemoteQueryDUnitTest extends CacheTestCase {
public void run2() throws CacheException {
Properties config = new Properties();
config.setProperty("locators", "localhost["+DistributedTestUtils.getDUnitLocatorPort()+"]");
- system = (InternalDistributedSystem) DistributedSystem.connect(config);
+ getSystem(config);
AttributesFactory factory = new AttributesFactory();
factory.setScope(Scope.LOCAL);
createRegion(name, factory.create());
@@ -633,7 +632,7 @@ public class RemoteQueryDUnitTest extends CacheTestCase {
public void run2() throws CacheException {
Properties config = new Properties();
config.setProperty("mcast-port", "0");
- system = (InternalDistributedSystem) DistributedSystem.connect(config);
+ getSystem(config);
getCache();
AttributesFactory factory = new AttributesFactory();
factory.setScope(Scope.LOCAL);
@@ -690,7 +689,7 @@ public class RemoteQueryDUnitTest extends CacheTestCase {
public void run2() throws CacheException {
Properties config = new Properties();
config.setProperty("locators", "localhost["+DistributedTestUtils.getDUnitLocatorPort()+"]");
- system = (InternalDistributedSystem) DistributedSystem.connect(config);
+ getSystem(config);
AttributesFactory factory = new AttributesFactory();
factory.setScope(Scope.LOCAL);
createRegion(name, factory.create());
@@ -720,7 +719,7 @@ public class RemoteQueryDUnitTest extends CacheTestCase {
public void run2() throws CacheException {
Properties config = new Properties();
config.setProperty("mcast-port", "0");
- system = (InternalDistributedSystem) DistributedSystem.connect(config);
+ getSystem(config);
getCache();
AttributesFactory factory = new AttributesFactory();
factory.setScope(Scope.LOCAL);
@@ -855,7 +854,7 @@ public class RemoteQueryDUnitTest extends CacheTestCase {
public void run2() throws CacheException {
Properties config = new Properties();
config.setProperty("locators", "localhost["+DistributedTestUtils.getDUnitLocatorPort()+"]");
- system = (InternalDistributedSystem) DistributedSystem.connect(config);
+ getSystem(config);
AttributesFactory factory = new AttributesFactory();
factory.setScope(Scope.LOCAL);
createRegion(name+"1", factory.create());
@@ -890,7 +889,7 @@ public class RemoteQueryDUnitTest extends CacheTestCase {
public void run2() throws CacheException {
Properties config = new Properties();
config.setProperty("mcast-port", "0");
- system = (InternalDistributedSystem) DistributedSystem.connect(config);
+ getSystem(config);
getCache();
AttributesFactory factory = new AttributesFactory();
factory.setScope(Scope.LOCAL);
@@ -956,7 +955,7 @@ public class RemoteQueryDUnitTest extends CacheTestCase {
public void run2() throws CacheException {
Properties config = new Properties();
config.setProperty("locators", "localhost["+DistributedTestUtils.getDUnitLocatorPort()+"]");
- system = (InternalDistributedSystem) DistributedSystem.connect(config);
+ getSystem(config);
AttributesFactory factory = new AttributesFactory();
factory.setScope(Scope.LOCAL);
createRegion(name, factory.create());
@@ -986,7 +985,7 @@ public class RemoteQueryDUnitTest extends CacheTestCase {
public void run2() throws CacheException {
Properties config = new Properties();
config.setProperty("mcast-port", "0");
- system = (InternalDistributedSystem) DistributedSystem.connect(config);
+ getSystem(config);
PoolManager.createFactory().addServer(host0, port).setSubscriptionEnabled(true).create("clientPool");
getCache();
AttributesFactory factory = new AttributesFactory();
@@ -1001,7 +1000,7 @@ public class RemoteQueryDUnitTest extends CacheTestCase {
public void run2() throws CacheException {
Properties config = new Properties();
config.setProperty("mcast-port", "0");
- system = (InternalDistributedSystem) DistributedSystem.connect(config);
+ getSystem(config);
PoolManager.createFactory().addServer(host0, port).setSubscriptionEnabled(true).create("clientPool");
getCache();
AttributesFactory factory = new AttributesFactory();
@@ -1115,7 +1114,7 @@ public class RemoteQueryDUnitTest extends CacheTestCase {
public void run2() throws CacheException {
Properties config = new Properties();
config.setProperty("locators", "localhost["+DistributedTestUtils.getDUnitLocatorPort()+"]");
- system = (InternalDistributedSystem) DistributedSystem.connect(config);
+ getSystem(config);
AttributesFactory factory = new AttributesFactory();
factory.setScope(Scope.LOCAL);
createRegion(name, factory.createRegionAttributes());
@@ -1145,7 +1144,7 @@ public class RemoteQueryDUnitTest extends CacheTestCase {
public void run2() throws CacheException {
Properties config = new Properties();
config.setProperty("mcast-port", "0");
- system = (InternalDistributedSystem) DistributedSystem.connect(config);
+ getSystem(config);
PoolManager.createFactory().addServer(host0, port).setSubscriptionEnabled(true).create("clientPool");
getCache();
AttributesFactory factory = new AttributesFactory();
@@ -1219,7 +1218,7 @@ public class RemoteQueryDUnitTest extends CacheTestCase {
public void run2() throws CacheException {
Properties config = new Properties();
config.setProperty("locators", "localhost["+DistributedTestUtils.getDUnitLocatorPort()+"]");
- system = (InternalDistributedSystem) DistributedSystem.connect(config);
+ getSystem(config);
AttributesFactory factory = new AttributesFactory();
factory.setScope(Scope.LOCAL);
final Region region = createRegion(name, factory.createRegionAttributes());
@@ -1256,7 +1255,7 @@ public class RemoteQueryDUnitTest extends CacheTestCase {
public void run2() throws CacheException {
Properties config = new Properties();
config.setProperty("mcast-port", "0");
- system = (InternalDistributedSystem) DistributedSystem.connect(config);
+ getSystem(config);
PoolManager.createFactory().addServer(host0, port).setSubscriptionEnabled(true).create("clientPool");
getCache();
AttributesFactory factory = new AttributesFactory();
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/ResourceManagerWithQueryMonitorDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/ResourceManagerWithQueryMonitorDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/ResourceManagerWithQueryMonitorDUnitTest.java
index 85ae9aa..8b392cb 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/ResourceManagerWithQueryMonitorDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/ResourceManagerWithQueryMonitorDUnitTest.java
@@ -86,8 +86,7 @@ public class ResourceManagerWithQueryMonitorDUnitTest extends ClientServerTestCa
}
@Override
- public void setUp() throws Exception {
- super.setUp();
+ public final void postSetUpClientServerTestCase() throws Exception {
Invoke.invokeInEveryVM(this.setHeapMemoryMonitorTestMode);
IgnoredException.addIgnoredException("above heap critical threshold");
IgnoredException.addIgnoredException("below heap critical threshold");
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/ConcurrentIndexUpdateWithInplaceObjectModFalseDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/ConcurrentIndexUpdateWithInplaceObjectModFalseDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/ConcurrentIndexUpdateWithInplaceObjectModFalseDUnitTest.java
index 6cbbef2..c6c103f 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/ConcurrentIndexUpdateWithInplaceObjectModFalseDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/ConcurrentIndexUpdateWithInplaceObjectModFalseDUnitTest.java
@@ -91,7 +91,7 @@ public class ConcurrentIndexUpdateWithInplaceObjectModFalseDUnitTest extends
}
@Override
- public void setUp() throws Exception {
+ public final void preSetUp() throws Exception {
Invoke.invokeInEveryVM(new CacheSerializableRunnable("Set INPLACE_OBJECT_MODIFICATION false") {
@Override
@@ -100,7 +100,6 @@ public class ConcurrentIndexUpdateWithInplaceObjectModFalseDUnitTest extends
IndexManager.INPLACE_OBJECT_MODIFICATION_FOR_TEST = true;
}
});
- super.setUp();
}
/**
@@ -108,7 +107,7 @@ public class ConcurrentIndexUpdateWithInplaceObjectModFalseDUnitTest extends
* (mainly because we want to destroy any existing PartitionedRegions)
*/
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
Invoke.invokeInEveryVM(new CacheSerializableRunnable("Set INPLACE_OBJECT_MODIFICATION false") {
@Override
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/ConcurrentIndexUpdateWithoutWLDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/ConcurrentIndexUpdateWithoutWLDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/ConcurrentIndexUpdateWithoutWLDUnitTest.java
index 2ac564a..4cf42de 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/ConcurrentIndexUpdateWithoutWLDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/ConcurrentIndexUpdateWithoutWLDUnitTest.java
@@ -93,9 +93,9 @@ public class ConcurrentIndexUpdateWithoutWLDUnitTest extends
* (mainly because we want to destroy any existing PartitionedRegions)
*/
@Override
- protected final void preTearDown() throws Exception {
- Invoke.invokeInEveryVM(ConcurrentIndexUpdateWithoutWLDUnitTest.class, "destroyRegions");
- Invoke.invokeInEveryVM(CacheTestCase.class, "closeCache");
+ public final void preTearDown() throws Exception {
+ Invoke.invokeInEveryVM(() -> ConcurrentIndexUpdateWithoutWLDUnitTest.destroyRegions());
+ Invoke.invokeInEveryVM(() -> CacheTestCase.closeCache());
}
public static synchronized void destroyRegions() {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/CopyOnReadIndexDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/CopyOnReadIndexDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/CopyOnReadIndexDUnitTest.java
index d44c7f6..18c73dc 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/CopyOnReadIndexDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/CopyOnReadIndexDUnitTest.java
@@ -59,13 +59,12 @@ public class CopyOnReadIndexDUnitTest extends CacheTestCase {
VM vm1;
VM vm2;
-
public CopyOnReadIndexDUnitTest(String name) {
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
+ @Override
+ public final void postSetUp() throws Exception {
getSystem();
Invoke.invokeInEveryVM(new SerializableRunnable("getSystem") {
public void run() {
@@ -79,11 +78,10 @@ public class CopyOnReadIndexDUnitTest extends CacheTestCase {
}
@Override
- protected final void preTearDownCacheTestCase() throws Exception {
+ public final void preTearDownCacheTestCase() throws Exception {
disconnectAllFromDS();
}
-
-
+
//test different queries against partitioned region
public void testPRQueryOnLocalNode() throws Exception {
QueryTestUtils utils = new QueryTestUtils();
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/MultiIndexCreationDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/MultiIndexCreationDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/MultiIndexCreationDUnitTest.java
index cea00c1..e18e720 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/MultiIndexCreationDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/MultiIndexCreationDUnitTest.java
@@ -172,14 +172,14 @@ public class MultiIndexCreationDUnitTest extends CacheTestCase {
}
@Override
- protected final void preTearDownCacheTestCase() throws Exception {
+ public final void preTearDownCacheTestCase() throws Exception {
hooked = false;
- Invoke.invokeInEveryVM(CacheTestCase.class, "disconnectFromDS");
+ Invoke.invokeInEveryVM(() -> disconnectFromDS());
}
@Override
- protected final void postTearDownCacheTestCase() throws Exception {
- Invoke.invokeInEveryVM(QueryObserverHolder.class, "reset");
+ public final void postTearDownCacheTestCase() throws Exception {
+ Invoke.invokeInEveryVM(() -> QueryObserverHolder.reset());
}
private static class MultiIndexCreationTestHook implements TestHook {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/PutAllWithIndexPerfDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/PutAllWithIndexPerfDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/PutAllWithIndexPerfDUnitTest.java
index 960bd4e..053f87a 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/PutAllWithIndexPerfDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/PutAllWithIndexPerfDUnitTest.java
@@ -63,13 +63,13 @@ public class PutAllWithIndexPerfDUnitTest extends CacheTestCase {
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
+ @Override
+ public final void postSetUp() throws Exception {
disconnectAllFromDS();
}
@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/cache/snapshot/ParallelSnapshotDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/snapshot/ParallelSnapshotDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/snapshot/ParallelSnapshotDUnitTest.java
index ea95558..5b123f2 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/snapshot/ParallelSnapshotDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/snapshot/ParallelSnapshotDUnitTest.java
@@ -155,14 +155,14 @@ public class ParallelSnapshotDUnitTest extends CacheTestCase {
}
return null;
}
-
- public void setUp() throws Exception {
- super.setUp();
+
+ @Override
+ public final void postSetUp() throws Exception {
loadCache();
}
@Override
- protected final void postTearDownCacheTestCase() throws Exception {
+ public final void postTearDownCacheTestCase() throws Exception {
File[] snaps = new File(".").listFiles(new FilenameFilter() {
@Override
public boolean accept(File dir, String name) {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/cache/snapshot/SnapshotByteArrayDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/snapshot/SnapshotByteArrayDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/snapshot/SnapshotByteArrayDUnitTest.java
index 43fc2e3..eae745a 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/snapshot/SnapshotByteArrayDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/snapshot/SnapshotByteArrayDUnitTest.java
@@ -105,13 +105,13 @@ public class SnapshotByteArrayDUnitTest extends CacheTestCase {
}
}
- public void setUp() throws Exception {
- super.setUp();
+ @Override
+ public final void postSetUp() throws Exception {
loadCache();
}
@Override
- protected final void preTearDownCacheTestCase() throws Exception {
+ public final void preTearDownCacheTestCase() throws Exception {
if (snap.exists()) {
snap.delete();
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/cache/snapshot/SnapshotDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/snapshot/SnapshotDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/snapshot/SnapshotDUnitTest.java
index 764f276..06bfecc 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/snapshot/SnapshotDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/snapshot/SnapshotDUnitTest.java
@@ -158,9 +158,9 @@ public class SnapshotDUnitTest extends CacheTestCase {
assertTrue(caughtException);
}
-
- public void setUp() throws Exception {
- super.setUp();
+
+ @Override
+ public final void postSetUp() throws Exception {
loadCache();
RegionGenerator rgen = new RegionGenerator();
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/cache/snapshot/SnapshotPerformanceDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/snapshot/SnapshotPerformanceDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/snapshot/SnapshotPerformanceDUnitTest.java
index 83fc231..c5b0e55 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/snapshot/SnapshotPerformanceDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/snapshot/SnapshotPerformanceDUnitTest.java
@@ -100,9 +100,9 @@ public class SnapshotPerformanceDUnitTest extends CacheTestCase {
LogWriterUtils.getLogWriter().info("SNP: Import entry rate: " + eps + " entries / sec");
LogWriterUtils.getLogWriter().info("SNP: Import data rate: " + mbps + " MB / sec");
}
-
- public void setUp() throws Exception {
- super.setUp();
+
+ @Override
+ public final void postSetUp() throws Exception {
createCache();
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheMapTxnDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheMapTxnDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheMapTxnDUnitTest.java
index f7e1739..0be86e2 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheMapTxnDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheMapTxnDUnitTest.java
@@ -57,17 +57,20 @@ public class CacheMapTxnDUnitTest extends DistributedTestCase{
}
@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);
vm0.invoke(() -> CacheMapTxnDUnitTest.createCache());
vm1.invoke(() -> CacheMapTxnDUnitTest.createCache());
+ postSetUpCacheMapTxnDUnitTest();
+ }
+
+ protected void postSetUpCacheMapTxnDUnitTest() throws Exception {
}
@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/cache30/CacheTestCase.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheTestCase.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheTestCase.java
index c228e5c..b326c58 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheTestCase.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheTestCase.java
@@ -16,53 +16,8 @@
*/
package com.gemstone.gemfire.cache30;
-import java.io.File;
-import java.io.FileWriter;
-import java.io.FilenameFilter;
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Properties;
-
-import org.apache.logging.log4j.Logger;
-
-import com.gemstone.gemfire.InternalGemFireError;
-import com.gemstone.gemfire.SystemFailure;
-import com.gemstone.gemfire.cache.AttributesFactory;
import com.gemstone.gemfire.cache.Cache;
-import com.gemstone.gemfire.cache.CacheException;
-import com.gemstone.gemfire.cache.CacheExistsException;
-import com.gemstone.gemfire.cache.CacheFactory;
-import com.gemstone.gemfire.cache.CacheTransactionManager;
-import com.gemstone.gemfire.cache.ExpirationAttributes;
-import com.gemstone.gemfire.cache.Region;
-import com.gemstone.gemfire.cache.RegionAttributes;
-import com.gemstone.gemfire.cache.RegionExistsException;
-import com.gemstone.gemfire.cache.TimeoutException;
-import com.gemstone.gemfire.cache.client.ClientCache;
-import com.gemstone.gemfire.cache.client.ClientCacheFactory;
-import com.gemstone.gemfire.cache.client.PoolManager;
-import com.gemstone.gemfire.distributed.internal.DistributionMessageObserver;
-import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem;
-import com.gemstone.gemfire.internal.FileUtil;
-import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
-import com.gemstone.gemfire.internal.cache.HARegion;
-import com.gemstone.gemfire.internal.cache.InternalRegionArguments;
-import com.gemstone.gemfire.internal.cache.LocalRegion;
-import com.gemstone.gemfire.internal.cache.PartitionedRegion;
-import com.gemstone.gemfire.internal.cache.xmlcache.CacheCreation;
-import com.gemstone.gemfire.internal.cache.xmlcache.CacheXmlGenerator;
-import com.gemstone.gemfire.internal.logging.LogService;
-import com.gemstone.gemfire.test.dunit.Assert;
-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.VM;
-import com.gemstone.gemfire.test.dunit.Wait;
-import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit3CacheTestCase;
/**
* The abstract superclass of tests that require the creation of a
@@ -71,583 +26,9 @@ import com.gemstone.gemfire.test.dunit.WaitCriterion;
* @author David Whitlock
* @since 3.0
*/
-public abstract class CacheTestCase extends DistributedTestCase {
- private static final Logger logger = LogService.getLogger();
-
- /** The Cache from which regions are obtained
- *
- * All references synchronized via <code>CacheTestCase.class</code>
- * */
- // static so it doesn't get serialized with SerializableRunnable inner classes
- protected static Cache cache;
-
- //////// Constructors
+public abstract class CacheTestCase extends JUnit3CacheTestCase {
public CacheTestCase(String name) {
super(name);
}
-
- //////// Helper methods
- /**
- * Creates the <code>Cache</code> for this test
- */
- private void createCache() {
- createCache(false);
- }
-
- private void createCache(boolean client) {
- createCache(client, null);
- }
-
- private void createCache(boolean client, CacheFactory cf) {
- synchronized(CacheTestCase.class) {
- try {
- System.setProperty("gemfire.DISABLE_DISCONNECT_DS_ON_CACHE_CLOSE", "true");
- Cache c;
- if (client) {
- c = (Cache)new ClientCacheFactory(getSystem().getProperties()).create();
- } else {
- if(cf == null) {
- c = CacheFactory.create(getSystem());
- } else {
- Properties props = getSystem().getProperties();
- for(Map.Entry entry : props.entrySet()) {
- cf.set((String) entry.getKey(), (String)entry.getValue());
- }
- c = cf.create();
- }
- }
- cache = c;
- } catch (CacheExistsException e) {
- Assert.fail("the cache already exists", e);
-
- } catch (RuntimeException ex) {
- throw ex;
-
- } catch (Exception ex) {
- Assert.fail("Checked exception while initializing cache??", ex);
- } finally {
- System.clearProperty("gemfire.DISABLE_DISCONNECT_DS_ON_CACHE_CLOSE");
- }
- }
- }
-
- /**
- * Creates the <code>Cache</code> for this test that is not connected
- * to other members
- */
- public Cache createLonerCache() {
- synchronized(CacheTestCase.class) {
- try {
- System.setProperty("gemfire.DISABLE_DISCONNECT_DS_ON_CACHE_CLOSE", "true");
- Cache c = CacheFactory.create(getLonerSystem());
- cache = c;
- } catch (CacheExistsException e) {
- Assert.fail("the cache already exists", e);
-
- } catch (RuntimeException ex) {
- throw ex;
-
- } catch (Exception ex) {
- Assert.fail("Checked exception while initializing cache??", ex);
- } finally {
- System.clearProperty("gemfire.DISABLE_DISCONNECT_DS_ON_CACHE_CLOSE");
- }
- return cache;
- }
- }
-
- /**
- * Creates the <code>Cache</code> for this test that is not connected
- * to other members.
- * Added specifically to test scenario of defect #47181.
- */
- public Cache createLonerCacheWithEnforceUniqueHost() {
- synchronized(CacheTestCase.class) {
- try {
- System.setProperty("gemfire.DISABLE_DISCONNECT_DS_ON_CACHE_CLOSE", "true");
- Cache c = CacheFactory.create(getLonerSystemWithEnforceUniqueHost());
- cache = c;
- } catch (CacheExistsException e) {
- Assert.fail("the cache already exists", e);
-
- } catch (RuntimeException ex) {
- throw ex;
-
- } catch (Exception ex) {
- Assert.fail("Checked exception while initializing cache??", ex);
- } finally {
- System.clearProperty("gemfire.DISABLE_DISCONNECT_DS_ON_CACHE_CLOSE");
- }
- return cache;
- }
- }
-
- /**
- * Sets this test up with a CacheCreation as its cache.
- * Any existing cache is closed. Whoever calls this must also call finishCacheXml
- */
- public static synchronized void beginCacheXml() {
-// getLogWriter().info("before closeCache");
- closeCache();
-// getLogWriter().info("before TestCacheCreation");
- cache = new TestCacheCreation();
-// getLogWriter().info("after TestCacheCreation");
- }
- /**
- * Finish what beginCacheXml started. It does this be generating a cache.xml
- * file and then creating a real cache using that cache.xml.
- */
- public void finishCacheXml(String name) {
- synchronized(CacheTestCase.class) {
- File file = new File(name + "-cache.xml");
- try {
- PrintWriter pw = new PrintWriter(new FileWriter(file), true);
- CacheXmlGenerator.generate(cache, pw);
- pw.close();
- } catch (IOException ex) {
- Assert.fail("IOException during cache.xml generation to " + file, ex);
- }
- cache = null;
- GemFireCacheImpl.testCacheXml = file;
- try {
- createCache();
- } finally {
- GemFireCacheImpl.testCacheXml = null;
- }
- }
- }
-
- /**
- * Finish what beginCacheXml started. It does this be generating a cache.xml
- * file and then creating a real cache using that cache.xml.
- */
- public void finishCacheXml(String name, boolean useSchema, String xmlVersion) {
- synchronized(CacheTestCase.class) {
- File dir = new File("XML_" + xmlVersion);
- dir.mkdirs();
- File file = new File(dir, name + ".xml");
- try {
- PrintWriter pw = new PrintWriter(new FileWriter(file), true);
- CacheXmlGenerator.generate(cache, pw, useSchema, xmlVersion);
- pw.close();
- } catch (IOException ex) {
- Assert.fail("IOException during cache.xml generation to " + file, ex);
- }
- cache = null;
- GemFireCacheImpl.testCacheXml = file;
- try {
- createCache();
- } finally {
- GemFireCacheImpl.testCacheXml = null;
- }
- }
- }
-
- /**
- * Return a cache for obtaining regions, created lazily.
- */
- public final Cache getCache() {
- return getCache(false);
- }
-
- public final Cache getCache(CacheFactory cf) {
- return getCache(false, cf);
- }
-
- public final Cache getCache(boolean client) {
- return getCache(client, null);
- }
-
- public final Cache getCache(boolean client, CacheFactory cf) {
- synchronized (CacheTestCase.class) {
- final GemFireCacheImpl gfCache = GemFireCacheImpl.getInstance();
- if (gfCache != null && !gfCache.isClosed()
- && gfCache.getCancelCriterion().cancelInProgress() != null) {
- Wait.waitForCriterion(new WaitCriterion() {
-
- public boolean done() {
- return gfCache.isClosed();
- }
-
- public String description() {
- return "waiting for cache to close";
- }
- }, 30 * 1000, 300, true);
- }
- if (cache == null || cache.isClosed()) {
- cache = null;
- createCache(client, cf);
- }
- if (client && cache != null) {
- IgnoredException.addIgnoredException("java.net.ConnectException");
- }
- return cache;
- }
- }
-
- /**
- * creates a client cache from the factory if one does not already exist
- * @since 6.5
- * @param factory
- * @return the client cache
- */
- public final ClientCache getClientCache(ClientCacheFactory factory) {
- synchronized (CacheTestCase.class) {
- final GemFireCacheImpl gfCache = GemFireCacheImpl.getInstance();
- if (gfCache != null && !gfCache.isClosed()
- && gfCache.getCancelCriterion().cancelInProgress() != null) {
- Wait.waitForCriterion(new WaitCriterion() {
-
- public boolean done() {
- return gfCache.isClosed();
- }
-
- public String description() {
- return "waiting for cache to close";
- }
- }, 30 * 1000, 300, true);
- }
- if (cache == null || cache.isClosed()) {
- cache = null;
- disconnectFromDS();
- cache = (Cache)factory.create();
- }
- if (cache != null) {
- IgnoredException.addIgnoredException("java.net.ConnectException");
- }
- return (ClientCache)cache;
- }
- }
-
- /**
- * same as {@link #getCache()} but with casting
- */
- public final GemFireCacheImpl getGemfireCache() {
- return (GemFireCacheImpl)getCache();
- }
- public static synchronized final boolean hasCache() {
- return cache != null;
- }
-
- /**
- * Return current cache without creating one.
- */
- public static synchronized final Cache basicGetCache() {
- return cache;
- }
-
- public static synchronized void disconnectFromDS() {
- closeCache();
- DistributedTestCase.disconnectFromDS();
- }
-
- /** Close the cache */
- public static synchronized void closeCache() {
- //Workaround for that fact that some classes are now extending
- //CacheTestCase but not using it properly.
- if(cache == null) {
- cache = GemFireCacheImpl.getInstance();
- }
- try {
- if (cache != null) {
- try {
- if (!cache.isClosed()) {
- if (cache instanceof GemFireCacheImpl) {
- CacheTransactionManager txMgr = ((GemFireCacheImpl)cache).getTxManager();
- if (txMgr != null) {
- if (txMgr.exists()) {
- try {
- // make sure we cleanup this threads txid stored in a thread local
- txMgr.rollback();
- }catch(Exception ignore) {
-
- }
- }
- }
- }
- cache.close();
- }
- }
- finally {
- cache = null;
- }
- } // cache != null
- } finally {
- //Make sure all pools are closed, even if we never
- //created a cache
- PoolManager.close(false);
- }
- }
-
- /** Closed the cache in all VMs. */
- protected void closeAllCache() {
- closeCache();
- Invoke.invokeInEveryVM(CacheTestCase.class, "closeCache");
- }
-
- @Override
- protected final void preTearDown() throws Exception {
- preTearDownCacheTestCase();
-
- // locally destroy all root regions and close the cache
- remoteTearDown();
- // Now invoke it in every VM
- for (int h = 0; h < Host.getHostCount(); h++) {
- Host host = Host.getHost(h);
- for (int v = 0; v < host.getVMCount(); v++) {
- VM vm = host.getVM(v);
- vm.invoke(()->remoteTearDown());
- }
- }
-
- postTearDownCacheTestCase();
- }
-
- protected void preTearDownCacheTestCase() throws Exception {
- }
-
- protected void postTearDownCacheTestCase() throws Exception {
- }
-
- /**
- * Local destroy all root regions and close the cache.
- */
- protected synchronized static void remoteTearDown() {
- try {
- DistributionMessageObserver.setInstance(null);
- destroyRegions(cache);
- }
- finally {
- try {
- closeCache();
- }
- finally {
- try {
- cleanDiskDirs();
- } catch(Exception e) {
- LogWriterUtils.getLogWriter().error("Error cleaning disk dirs", e);
- }
- }
- }
- }
-
- /**
- * Returns a region with the given name and attributes
- */
- public final Region createRegion(String name,
- RegionAttributes attrs)
- throws CacheException {
- return createRegion(name, "root", attrs);
- }
-
- /**
- * Provide any internal region arguments, typically required when
- * internal use (aka meta-data) regions are needed.
- * @return internal arguements, which may be null. If null, then default
- * InternalRegionArguments are used to construct the Region
- */
- public InternalRegionArguments getInternalRegionArguments()
- {
- return null;
- }
-
- final public Region createRegion(String name, String rootName,
- RegionAttributes attrs)
- throws CacheException {
- Region root = getRootRegion(rootName);
- if (root == null) {
- // don't put listeners on root region
- RegionAttributes rootAttrs = attrs;
- AttributesFactory fac = new AttributesFactory(attrs);
- ExpirationAttributes expiration = ExpirationAttributes.DEFAULT;
-
- // fac.setCacheListener(null);
- fac.setCacheLoader(null);
- fac.setCacheWriter(null);
- fac.setPoolName(null);
- fac.setPartitionAttributes(null);
- fac.setRegionTimeToLive(expiration);
- fac.setEntryTimeToLive(expiration);
- fac.setRegionIdleTimeout(expiration);
- fac.setEntryIdleTimeout(expiration);
- rootAttrs = fac.create();
- root = createRootRegion(rootName, rootAttrs);
- }
-
- InternalRegionArguments internalArgs = getInternalRegionArguments();
- if (internalArgs == null) {
- return root.createSubregion(name, attrs);
- } else {
- try {
- LocalRegion lr = (LocalRegion) root;
- return lr.createSubregion(name, attrs, internalArgs);
- } catch (IOException ioe) {
- AssertionError assErr = new AssertionError("unexpected exception");
- assErr.initCause(ioe);
- throw assErr;
- } catch (ClassNotFoundException cnfe) {
- AssertionError assErr = new AssertionError("unexpected exception");
- assErr.initCause(cnfe);
- throw assErr;
- }
- }
- }
-
- public final Region getRootRegion() {
- return getRootRegion("root");
- }
-
- public final Region getRootRegion(String rootName) {
- return getCache().getRegion(rootName);
- }
-
- protected final Region createRootRegion(RegionAttributes attrs)
- throws RegionExistsException, TimeoutException {
- return createRootRegion("root", attrs);
- }
-
- public final Region createRootRegion(String rootName, RegionAttributes attrs)
- throws RegionExistsException, TimeoutException {
- return getCache().createRegion(rootName, attrs);
- }
- public final Region createExpiryRootRegion(String rootName, RegionAttributes attrs)
- throws RegionExistsException, TimeoutException {
- System.setProperty(LocalRegion.EXPIRY_MS_PROPERTY, "true");
- try {
- return createRootRegion(rootName, attrs);
- } finally {
- System.getProperties().remove(LocalRegion.EXPIRY_MS_PROPERTY);
- }
- }
-
-
- /**
- * send an unordered message requiring an ack to all connected members
- * in order to flush the unordered communication channel
- */
- public void sendUnorderedMessageToAll() {
- //if (getCache() instanceof distcache.gemfire.GemFireCacheImpl) {
- try {
- com.gemstone.gemfire.distributed.internal.HighPriorityAckedMessage msg = new com.gemstone.gemfire.distributed.internal.HighPriorityAckedMessage();
- msg.send(InternalDistributedSystem.getConnectedInstance().getDM().getNormalDistributionManagerIds(), false);
- }
- catch (Exception e) {
- throw new RuntimeException("Unable to send unordered message due to exception", e);
- }
- //}
- }
-
- /**
- * send an unordered message requiring an ack to all connected admin members
- * in order to flush the unordered communication channel
- */
-// public void sendUnorderedMessageToAdminMembers() {
-// //if (getCache() instanceof distcache.gemfire.GemFireCacheImpl) {
-// try {
-// com.gemstone.gemfire.distributed.internal.HighPriorityAckedMessage msg = new com.gemstone.gemfire.distributed.internal.HighPriorityAckedMessage();
-// msg.send(DistributedSystemHelper.getAdminMembers(), false);
-// }
-// catch (Exception e) {
-// throw new RuntimeException("Unable to send unordered message due to exception", e);
-// }
-// //}
-// }
-
- /**
- * send an ordered message requiring an ack to all connected members
- * in order to flush the ordered communication channel
- */
- public void sendSerialMessageToAll() {
- if (getCache() instanceof GemFireCacheImpl) {
- try {
- com.gemstone.gemfire.distributed.internal.SerialAckedMessage msg = new com.gemstone.gemfire.distributed.internal.SerialAckedMessage();
- msg.send(InternalDistributedSystem.getConnectedInstance().getDM().getNormalDistributionManagerIds(), false);
- }
- catch (Exception e) {
- throw new RuntimeException("Unable to send serial message due to exception", e);
- }
- }
- }
-
- /**
- * @deprecated Use DistributedTestCase.addExpectedException
- */
- @Deprecated
- protected CacheSerializableRunnable addExceptionTag1(final String expectedException) {
- CacheSerializableRunnable addExceptionTag = new CacheSerializableRunnable(
- "addExceptionTag") {
- public void run2()
- {
- getCache().getLogger().info(
- "<ExpectedException action=add>" + expectedException
- + "</ExpectedException>");
- }
- };
-
- return addExceptionTag;
- }
-
- /**
- * @deprecated Use DistributedTestCase.addExpectedException
- */
- @Deprecated
- protected CacheSerializableRunnable removeExceptionTag1(final String expectedException) {
- CacheSerializableRunnable removeExceptionTag = new CacheSerializableRunnable(
- "removeExceptionTag") {
- public void run2() throws CacheException {
- getCache().getLogger().info(
- "<ExpectedException action=remove>" + expectedException
- + "</ExpectedException>");
- }
- };
- return removeExceptionTag;
- }
-
- /**
- * Used to generate a cache.xml. Basically just a CacheCreation
- * with a few more methods implemented.
- */
- static class TestCacheCreation extends CacheCreation {
- private boolean closed = false;
- @Override
- public void close() {
- this.closed = true;
- }
- @Override
- public boolean isClosed() {
- return this.closed;
- }
- }
-
- public static File getDiskDir() {
- int vmNum = VM.getCurrentVMNum();
- File dir = new File("diskDir", "disk" + String.valueOf(vmNum)).getAbsoluteFile();
- dir.mkdirs();
- return dir;
- }
-
- /**
- * Return a set of disk directories
- * for persistence tests. These directories
- * will be automatically cleaned up
- * on test case closure.
- */
- public static File[] getDiskDirs() {
- return new File[] {getDiskDir()};
- }
-
- public static void cleanDiskDirs() throws IOException {
- FileUtil.delete(getDiskDir());
- File[] defaultStoreFiles = new File(".").listFiles(new FilenameFilter() {
-
- public boolean accept(File dir, String name) {
- return name.startsWith("BACKUPDiskStore-" + System.getProperty("vmid"));
- }
- });
-
- for(File file: defaultStoreFiles) {
- FileUtil.delete(file);
- }
- }
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXmlTestCase.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXmlTestCase.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXmlTestCase.java
index dd127cb..8c9776e 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXmlTestCase.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/CacheXmlTestCase.java
@@ -44,18 +44,18 @@ public class CacheXmlTestCase extends CacheTestCase {
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
+ @Override
+ public final void postSetUp() throws Exception {
disconnectAllFromDS();
}
@Override
- protected final void preTearDownCacheTestCase() throws Exception {
+ public final void preTearDownCacheTestCase() throws Exception {
this.xmlFile = null;
}
@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/cache30/CachedAllEventsDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/CachedAllEventsDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/CachedAllEventsDUnitTest.java
index c3f97f7..6ffc53d 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/CachedAllEventsDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/CachedAllEventsDUnitTest.java
@@ -16,6 +16,8 @@
*/
package com.gemstone.gemfire.cache30;
+import static com.gemstone.gemfire.test.dunit.Assert.*;
+
import com.gemstone.gemfire.cache.AttributesFactory;
import com.gemstone.gemfire.cache.CacheException;
import com.gemstone.gemfire.cache.DataPolicy;
@@ -27,6 +29,10 @@ import com.gemstone.gemfire.distributed.DistributedMember;
import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem;
import com.gemstone.gemfire.test.dunit.Host;
import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
/**
* Make sure that create are distributed and done in
@@ -35,15 +41,8 @@ import com.gemstone.gemfire.test.dunit.VM;
* @author darrel
* @since 5.0
*/
-public class CachedAllEventsDUnitTest extends CacheTestCase {
-
-// private transient Region r;
-// private transient DistributedMember otherId;
-// private transient int invokeCount;
-
- public CachedAllEventsDUnitTest(String name) {
- super(name);
- }
+@Category(DistributedTest.class)
+public class CachedAllEventsDUnitTest extends JUnit4CacheTestCase {
private VM getOtherVm() {
Host host = Host.getHost(0);
@@ -75,8 +74,6 @@ public class CachedAllEventsDUnitTest extends CacheTestCase {
return InternalDistributedSystem.getAnyInstance().getDistributedMember();
}
- ////////////////////// Test Methods //////////////////////
-
/**
* make sure a remote create will be done in a NORMAL+ALL region
* @param rmtCreate is true if create should happen in remote region
@@ -98,13 +95,18 @@ public class CachedAllEventsDUnitTest extends CacheTestCase {
assertEquals(false, r1.containsKey("key"));
}
}
- // TODO these are never used
+
+ @Test
public void testRemoteCreate_CAE() throws CacheException {
remoteCreate(DataPolicy.NORMAL, InterestPolicy.ALL, true);
}
+
+ @Test
public void testRemoteCreate_CAER() throws CacheException {
remoteCreate(DataPolicy.REPLICATE, InterestPolicy.CACHE_CONTENT, true);
}
+
+ @Test
public void testRemoteCreate_C() throws CacheException {
remoteCreate(DataPolicy.NORMAL, InterestPolicy.CACHE_CONTENT, false);
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClearMultiVmCallBkDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClearMultiVmCallBkDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClearMultiVmCallBkDUnitTest.java
index e748a42..031fd76 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClearMultiVmCallBkDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClearMultiVmCallBkDUnitTest.java
@@ -60,10 +60,8 @@ public class ClearMultiVmCallBkDUnitTest extends DistributedTestCase{
static CacheTransactionManager cacheTxnMgr;
static boolean afterClear=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);
@@ -73,7 +71,7 @@ public class ClearMultiVmCallBkDUnitTest 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/cache30/ClearMultiVmDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClearMultiVmDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClearMultiVmDUnitTest.java
index 5f9450b..9aa4e95 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClearMultiVmDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClearMultiVmDUnitTest.java
@@ -66,8 +66,7 @@ public class ClearMultiVmDUnitTest extends DistributedTestCase{
static CacheTransactionManager cacheTxnMgr;
@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);
@@ -76,7 +75,7 @@ public class ClearMultiVmDUnitTest 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/cache30/ClientMembershipDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClientMembershipDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClientMembershipDUnitTest.java
index 19ce28d..02fa580 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClientMembershipDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClientMembershipDUnitTest.java
@@ -89,17 +89,13 @@ public class ClientMembershipDUnitTest extends ClientServerTestCase {
}
@Override
- public void setUp() throws Exception {
- super.setUp();
- }
-
- @Override
- protected void postTearDown() throws Exception {
+ public final void postTearDownCacheTestCase() throws Exception {
Invoke.invokeInEveryVM((() -> cleanup()));
}
public static void cleanup() {
properties = null;
+ InternalClientMembership.unregisterAllListeners();
}
private void waitForAcceptsInProgressToBe(final int target)
@@ -1082,7 +1078,7 @@ public class ClientMembershipDUnitTest extends ClientServerTestCase {
Pool pool = ClientServerTestCase.configureConnectionPool(factory, NetworkUtils.getServerHostName(host), ports, true, -1, 2, null);
createRegion(name, factory.create());
assertNotNull(getRootRegion().getSubregion(name));
- assertTrue(s == system); // see geode-1078
+ assertTrue(s == basicGetSystem()); // see geode-1078
return getMemberId();
}
};
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClientRegisterInterestDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClientRegisterInterestDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClientRegisterInterestDUnitTest.java
index f7e2277..ce8783b 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClientRegisterInterestDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClientRegisterInterestDUnitTest.java
@@ -46,7 +46,7 @@ public class ClientRegisterInterestDUnitTest extends ClientServerTestCase {
}
@Override
- protected final void postTearDownCacheTestCase() throws Exception {
+ public final void postTearDownCacheTestCase() throws Exception {
disconnectAllFromDS(); // cleans up bridge server and client and lonerDS
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClientServerCCEDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClientServerCCEDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClientServerCCEDUnitTest.java
index fb319b6..1355571 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClientServerCCEDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClientServerCCEDUnitTest.java
@@ -69,7 +69,7 @@ public class ClientServerCCEDUnitTest extends CacheTestCase {
}
@Override
- protected final void preTearDownCacheTestCase() {
+ public final void preTearDownCacheTestCase() {
disconnectAllFromDS();
HARegionQueue.setMessageSyncInterval(HARegionQueue.DEFAULT_MESSAGE_SYNC_INTERVAL);
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClientServerTestCase.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClientServerTestCase.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClientServerTestCase.java
index d9d8858..a3968ea 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClientServerTestCase.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/ClientServerTestCase.java
@@ -56,14 +56,17 @@ public class ClientServerTestCase extends CacheTestCase {
public static boolean AUTO_LOAD_BALANCE = false;
@Override
- public void setUp() throws Exception {
- super.setUp();
+ public final void postSetUp() throws Exception {
// this makes sure we don't have any connection left over from previous tests
disconnectAllFromDS();
+ postSetUpClientServerTestCase();
+ }
+
+ protected void postSetUpClientServerTestCase() throws Exception {
}
@Override
- protected final void preTearDownCacheTestCase() throws Exception {
+ public final void preTearDownCacheTestCase() throws Exception {
preTearDownClientServerTestCase();
// this makes sure we don't leave anything for the next tests
disconnectAllFromDS();
@@ -292,14 +295,14 @@ public class ClientServerTestCase extends CacheTestCase {
WaitCriterion w = new WaitCriterion() {
public String description() {
- return "client never finished connecting: " + system.getMemberId();
+ return "client never finished connecting: " + getSystemStatic().getMemberId();
}
public boolean done() {
// getLogWriter().warning("checking member id " + system.getMemberId() +
// " for member " + system.getDistributedMember() + " hash " +
// System.identityHashCode(system.getDistributedMember()));
- return system.getDistributedMember().getPort() > 0;
+ return getSystemStatic().getDistributedMember().getPort() > 0;
}
};
@@ -307,7 +310,7 @@ public class ClientServerTestCase extends CacheTestCase {
int interval = 100;
boolean throwException = true;
Wait.waitForCriterion(w, waitMillis, interval, throwException);
- return system.getDistributedMember();
+ return getSystemStatic().getDistributedMember();
}
protected static DistributedMember getDistributedMember() {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistAckMapMethodsDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistAckMapMethodsDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistAckMapMethodsDUnitTest.java
index cf6226d..9284e26 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistAckMapMethodsDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistAckMapMethodsDUnitTest.java
@@ -71,8 +71,7 @@ public class DistAckMapMethodsDUnitTest extends DistributedTestCase{
}
@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);
@@ -81,7 +80,7 @@ public class DistAckMapMethodsDUnitTest 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/cache30/DistributedAckOverflowRegionCCEOffHeapDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckOverflowRegionCCEOffHeapDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckOverflowRegionCCEOffHeapDUnitTest.java
index 2323b0e..2ab2446 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckOverflowRegionCCEOffHeapDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckOverflowRegionCCEOffHeapDUnitTest.java
@@ -39,7 +39,7 @@ public class DistributedAckOverflowRegionCCEOffHeapDUnitTest extends Distributed
}
@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/cache30/DistributedAckPersistentRegionCCEOffHeapDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckPersistentRegionCCEOffHeapDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckPersistentRegionCCEOffHeapDUnitTest.java
index 52a4313..718ca18 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckPersistentRegionCCEOffHeapDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckPersistentRegionCCEOffHeapDUnitTest.java
@@ -39,7 +39,7 @@ public class DistributedAckPersistentRegionCCEOffHeapDUnitTest extends Distribut
}
@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/cache30/DistributedAckRegionCCEOffHeapDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckRegionCCEOffHeapDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckRegionCCEOffHeapDUnitTest.java
index 1c1cbaf..c8fc191 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckRegionCCEOffHeapDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckRegionCCEOffHeapDUnitTest.java
@@ -39,7 +39,7 @@ public class DistributedAckRegionCCEOffHeapDUnitTest extends DistributedAckRegio
}
@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/cache30/DistributedAckRegionOffHeapDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckRegionOffHeapDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckRegionOffHeapDUnitTest.java
index cbf8367..f218f14 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckRegionOffHeapDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckRegionOffHeapDUnitTest.java
@@ -39,7 +39,7 @@ public class DistributedAckRegionOffHeapDUnitTest extends DistributedAckRegionDU
}
@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/cache30/DistributedMulticastRegionDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedMulticastRegionDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedMulticastRegionDUnitTest.java
index 01632a4..011b8f5 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedMulticastRegionDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedMulticastRegionDUnitTest.java
@@ -61,13 +61,12 @@ public class DistributedMulticastRegionDUnitTest extends CacheTestCase {
}
@Override
- public void setUp() throws Exception {
+ public final void preSetUp() throws Exception {
clean();
- super.setUp();
}
@Override
- protected final void preTearDownCacheTestCase() throws Exception {
+ public final void preTearDownCacheTestCase() throws Exception {
clean();
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedNoAckRegionCCEOffHeapDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedNoAckRegionCCEOffHeapDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedNoAckRegionCCEOffHeapDUnitTest.java
index c068876..b49d8f5 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedNoAckRegionCCEOffHeapDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedNoAckRegionCCEOffHeapDUnitTest.java
@@ -39,7 +39,7 @@ public class DistributedNoAckRegionCCEOffHeapDUnitTest extends DistributedNoAckR
}
@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/cache30/DistributedNoAckRegionOffHeapDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedNoAckRegionOffHeapDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedNoAckRegionOffHeapDUnitTest.java
index e668d3f..c2e22b4 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedNoAckRegionOffHeapDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/DistributedNoAckRegionOffHeapDUnitTest.java
@@ -39,7 +39,7 @@ public class DistributedNoAckRegionOffHeapDUnitTest extends DistributedNoAckRegi
}
@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/cache30/DynamicRegionDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/DynamicRegionDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/DynamicRegionDUnitTest.java
index 19d2bb7..eacb1d1 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/DynamicRegionDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/DynamicRegionDUnitTest.java
@@ -53,15 +53,15 @@ public class DynamicRegionDUnitTest extends CacheTestCase {
// the setUp and tearDown methods need to make sure we don't
// use the ds from previous test and that we don't leave ours around
// for the next test to use.
-
- public void setUp() throws Exception {
+
+ @Override
+ public final void preSetUp() throws Exception {
try {
disconnectAllFromDS();
} finally {
File d = new File("DynamicRegionData" + OSProcess.getId());
d.mkdirs();
DynamicRegionFactory.get().open(new DynamicRegionFactory.Config(d, null));
- super.setUp();
}
}
@@ -73,7 +73,7 @@ public class DynamicRegionDUnitTest extends CacheTestCase {
* </p>
*/
@Override
- protected final void preTearDownCacheTestCase() throws Exception {
+ public final void preTearDownCacheTestCase() throws Exception {
LogWriterUtils.getLogWriter().info("Running tearDown in " + this);
try {
//Asif destroy dynamic regions at the end of the test
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/cache30/GlobalRegionCCEOffHeapDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/GlobalRegionCCEOffHeapDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/GlobalRegionCCEOffHeapDUnitTest.java
index 653cab2..5362137 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/GlobalRegionCCEOffHeapDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/GlobalRegionCCEOffHeapDUnitTest.java
@@ -39,7 +39,7 @@ public class GlobalRegionCCEOffHeapDUnitTest extends GlobalRegionCCEDUnitTest {
}
@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/cache30/GlobalRegionOffHeapDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/GlobalRegionOffHeapDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/GlobalRegionOffHeapDUnitTest.java
index c652c55..2f774cc 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/GlobalRegionOffHeapDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/GlobalRegionOffHeapDUnitTest.java
@@ -39,7 +39,7 @@ public class GlobalRegionOffHeapDUnitTest extends GlobalRegionDUnitTest {
}
@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/cache30/MultiVMRegionTestCase.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/MultiVMRegionTestCase.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/MultiVMRegionTestCase.java
index 8127eea..8f4740c 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/MultiVMRegionTestCase.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/MultiVMRegionTestCase.java
@@ -171,7 +171,6 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
@Override
protected final void postTearDownRegionTestCase() throws Exception {
- DistributedTestCase.cleanupAllVms();
CCRegion = null;
}
@@ -5713,7 +5712,6 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
*/
private static void unregisterAllSerializers() {
DistributedTestUtils.unregisterAllDataSerializersFromAllVms();
- cleanupAllVms();
}
/**
@@ -9128,6 +9126,17 @@ public abstract class MultiVMRegionTestCase extends RegionTestCase {
return CCRegion.getDistributionManager().getDistributionManagerId();
}
+ public void sendSerialMessageToAll() {
+ if (getCache() instanceof GemFireCacheImpl) {
+ try {
+ com.gemstone.gemfire.distributed.internal.SerialAckedMessage msg = new com.gemstone.gemfire.distributed.internal.SerialAckedMessage();
+ msg.send(InternalDistributedSystem.getConnectedInstance().getDM().getNormalDistributionManagerIds(), false);
+ }
+ catch (Exception e) {
+ throw new RuntimeException("Unable to send serial message due to exception", e);
+ }
+ }
+ }
/** a class for testing handling of concurrent delta operations */
static class DeltaValue implements com.gemstone.gemfire.Delta, Serializable {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/cache30/OffHeapLRUEvictionControllerDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/OffHeapLRUEvictionControllerDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/OffHeapLRUEvictionControllerDUnitTest.java
index 0caa7bd..89a721e 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/OffHeapLRUEvictionControllerDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/OffHeapLRUEvictionControllerDUnitTest.java
@@ -41,7 +41,7 @@ public class OffHeapLRUEvictionControllerDUnitTest extends
}
@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/cache30/PartitionedRegionOffHeapDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/PartitionedRegionOffHeapDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/PartitionedRegionOffHeapDUnitTest.java
index efd42ad..ca4c192 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/PartitionedRegionOffHeapDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/PartitionedRegionOffHeapDUnitTest.java
@@ -38,7 +38,7 @@ public class PartitionedRegionOffHeapDUnitTest extends PartitionedRegionDUnitTes
}
@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/cache30/PutAllCallBkRemoteVMDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/PutAllCallBkRemoteVMDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/PutAllCallBkRemoteVMDUnitTest.java
index 01a1f42..781dc2d 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/PutAllCallBkRemoteVMDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/PutAllCallBkRemoteVMDUnitTest.java
@@ -77,8 +77,7 @@ public class PutAllCallBkRemoteVMDUnitTest extends DistributedTestCase {
static boolean notified = 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);
@@ -88,7 +87,7 @@ public class PutAllCallBkRemoteVMDUnitTest 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/cache30/PutAllCallBkSingleVMDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/PutAllCallBkSingleVMDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/PutAllCallBkSingleVMDUnitTest.java
index 12337cd..faeb8b3 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/PutAllCallBkSingleVMDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/PutAllCallBkSingleVMDUnitTest.java
@@ -67,8 +67,7 @@ public class PutAllCallBkSingleVMDUnitTest extends DistributedTestCase{
static int beforeUpdateputAllcounter = 0;
@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);
@@ -78,7 +77,7 @@ public class PutAllCallBkSingleVMDUnitTest 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/cache30/PutAllMultiVmDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/PutAllMultiVmDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/PutAllMultiVmDUnitTest.java
index 4ec8054..7ff73f9 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/PutAllMultiVmDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/PutAllMultiVmDUnitTest.java
@@ -64,8 +64,7 @@ public class PutAllMultiVmDUnitTest extends DistributedTestCase{
static CacheTransactionManager cacheTxnMgr;
@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);
@@ -74,7 +73,7 @@ public class PutAllMultiVmDUnitTest 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/cache30/ReconnectDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/ReconnectDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/ReconnectDUnitTest.java
index 70c7171..a4ba33d 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/ReconnectDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/ReconnectDUnitTest.java
@@ -85,8 +85,7 @@ public class ReconnectDUnitTest extends CacheTestCase
}
@Override
- public void setUp() throws Exception {
- super.setUp();
+ public final void postSetUp() throws Exception {
this.locatorPort = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
final int locPort = this.locatorPort;
Host.getHost(0).getVM(locatorVMNumber)
@@ -133,7 +132,7 @@ public class ReconnectDUnitTest extends CacheTestCase
}
@Override
- protected final void postTearDownCacheTestCase() throws Exception {
+ public final void postTearDownCacheTestCase() throws Exception {
try {
Host.getHost(0).getVM(locatorVMNumber).invoke(new SerializableRunnable("stop locator") {
public void run() {
@@ -680,8 +679,8 @@ public class ReconnectDUnitTest extends CacheTestCase
getSystem(props);
addReconnectListener();
-
- system.getLogWriter().info("<ExpectedException action=add>"
+
+ basicGetSystem().getLogWriter().info("<ExpectedException action=add>"
+ "CacheClosedException" + "</ExpectedException");
try{
getCache();
@@ -691,7 +690,7 @@ public class ReconnectDUnitTest extends CacheTestCase
LogWriterUtils.getLogWriter().info("Got Expected CancelException ");
}
finally {
- system.getLogWriter().info("<ExpectedException action=remove>"
+ basicGetSystem().getLogWriter().info("<ExpectedException action=remove>"
+ "CacheClosedException" + "</ExpectedException");
}
LogWriterUtils.getLogWriter().fine("roleLoss Sleeping SO call dumprun.sh");
@@ -901,7 +900,7 @@ public class ReconnectDUnitTest extends CacheTestCase
props.put(DistributionConfig.LOG_LEVEL_NAME, LogWriterUtils.getDUnitLogLevel());
getSystem(props);
- system.getLogWriter().info("<ExpectedException action=add>"
+ basicGetSystem().getLogWriter().info("<ExpectedException action=add>"
+ "CacheClosedException" + "</ExpectedException");
try {
@@ -1015,7 +1014,7 @@ public class ReconnectDUnitTest extends CacheTestCase
}
// greplogs won't care if you remove an exception that was never added,
// and this ensures that it gets removed.
- system.getLogWriter().info("<ExpectedException action=remove>"
+ basicGetSystem().getLogWriter().info("<ExpectedException action=remove>"
+ "CacheClosedException" + "</ExpectedException");
}
@@ -1139,7 +1138,7 @@ public class ReconnectDUnitTest extends CacheTestCase
// since the system will disconnect and attempt to reconnect
// a new system the old reference to DTC.system can cause
// trouble, so we first null it out.
- DistributedTestCase.system = null;
+ nullSystem();
final DistributedSystem msys = InternalDistributedSystem.getAnyInstance();
final Locator oldLocator = Locator.getLocator();
MembershipManagerHelper.crashDistributedSystem(msys);
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/cache30/ReconnectedCacheServerDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/ReconnectedCacheServerDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/ReconnectedCacheServerDUnitTest.java
index 6daf213..8da7dfb 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/ReconnectedCacheServerDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/ReconnectedCacheServerDUnitTest.java
@@ -16,6 +16,7 @@
*/
package com.gemstone.gemfire.cache30;
+import com.gemstone.gemfire.cache.Cache;
import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem;
import com.gemstone.gemfire.distributed.internal.membership.gms.MembershipManagerHelper;
import com.gemstone.gemfire.distributed.internal.membership.gms.mgr.GMSMembershipManager;
@@ -32,22 +33,24 @@ public class ReconnectedCacheServerDUnitTest extends CacheTestCase {
private static final long serialVersionUID = 1L;
private boolean addedCacheServer = false;
-
+
+ private Cache cache;
+
@Override
- public void setUp() {
- getCache();
- if (cache.getCacheServers().isEmpty()) {
- cache.addCacheServer();
+ public final void postSetUp() {
+ this.cache = getCache();
+ if (this.cache.getCacheServers().isEmpty()) {
+ this.cache.addCacheServer();
addedCacheServer = true;
}
}
@Override
- protected final void preTearDownCacheTestCase() throws Exception {
- if (addedCacheServer && cache != null && !cache.isClosed()) {
+ public final void preTearDownCacheTestCase() throws Exception {
+ if (addedCacheServer && this.cache != null && !this.cache.isClosed()) {
// since I polluted the cache I should shut it down in order
// to avoid affecting other tests
- cache.close();
+ this.cache.close();
}
}
@@ -55,7 +58,7 @@ public class ReconnectedCacheServerDUnitTest extends CacheTestCase {
// make sure the environment isn't polluted
assertFalse(Boolean.getBoolean("gemfire.autoReconnect-useCacheXMLFile"));
- GemFireCacheImpl gc = (GemFireCacheImpl)cache;
+ GemFireCacheImpl gc = (GemFireCacheImpl)this.cache;
// fool the system into thinking cluster-config is being used
GMSMembershipManager mgr = (GMSMembershipManager)MembershipManagerHelper
@@ -71,7 +74,7 @@ public class ReconnectedCacheServerDUnitTest extends CacheTestCase {
assertFalse(Boolean.getBoolean("gemfire.autoReconnect-useCacheXMLFile"));
- GemFireCacheImpl gc = (GemFireCacheImpl)cache;
+ GemFireCacheImpl gc = (GemFireCacheImpl)this.cache;
// fool the system into thinking cluster-config is being used
GMSMembershipManager mgr = (GMSMembershipManager)MembershipManagerHelper
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionMembershipListenerDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionMembershipListenerDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionMembershipListenerDUnitTest.java
index 0572c76..9a0554a 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionMembershipListenerDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionMembershipListenerDUnitTest.java
@@ -62,13 +62,12 @@ public class RegionMembershipListenerDUnitTest extends CacheTestCase {
}
@Override
- public void setUp() throws Exception {
- super.setUp();
+ public final void postSetUp() throws Exception {
DistributedRegion.TEST_HOOK_ADD_PROFILE = true;
}
@Override
- protected final void postTearDownCacheTestCase() throws Exception {
+ public final void postTearDownCacheTestCase() throws Exception {
DistributedRegion.TEST_HOOK_ADD_PROFILE = false;
}
@@ -295,7 +294,7 @@ public class RegionMembershipListenerDUnitTest extends CacheTestCase {
crashCacheOtherVm();
int to = getOpTimeout();
- MembershipManagerHelper.waitForMemberDeparture(system, this.otherId, to);
+ MembershipManagerHelper.waitForMemberDeparture(basicGetSystem(), this.otherId, to);
this.myListener.waitForCrashOp();
{
RegionEvent e = this.myListener.getLastEvent();
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionReliabilityTestCase.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionReliabilityTestCase.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionReliabilityTestCase.java
index 8cc65d3..b630eec 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionReliabilityTestCase.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionReliabilityTestCase.java
@@ -85,7 +85,7 @@ public abstract class RegionReliabilityTestCase extends ReliabilityTestCase {
}
@Override
- protected final void preTearDownCacheTestCase() throws Exception {
+ public final void preTearDownCacheTestCase() throws Exception {
DistributedCacheOperation.setBeforePutOutgoing(null);
}
[06/11] incubator-geode git commit: GEODE-1050: add JUnit 4 versions
of DistributedTestCase and CacheTestCase
Posted by kl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAExpiryDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAExpiryDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAExpiryDUnitTest.java
index 4ef9dc0..dd941b6 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAExpiryDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAExpiryDUnitTest.java
@@ -81,9 +81,8 @@ public class HAExpiryDUnitTest extends DistributedTestCase
/**
* This function creates regionqueue on 4 VMs
*/
- public void setUp() throws Exception
- {
- super.setUp();
+ @Override
+ public final void postSetUp() throws Exception {
final Host host = Host.getHost(0);
vm0 = host.getVM(0);
@@ -93,11 +92,10 @@ public class HAExpiryDUnitTest extends DistributedTestCase
vm2 = host.getVM(2);
vm3 = host.getVM(3);
-
}
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
vm0.invoke(() -> HAExpiryDUnitTest.closeCache());
vm1.invoke(() -> HAExpiryDUnitTest.closeCache());
vm2.invoke(() -> HAExpiryDUnitTest.closeCache());
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAGIIBugDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAGIIBugDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAGIIBugDUnitTest.java
index 4a24378..8e3d7af 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAGIIBugDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAGIIBugDUnitTest.java
@@ -99,9 +99,8 @@ public class HAGIIBugDUnitTest extends DistributedTestCase
/**
* This function creates regionqueue on 4 VMs
*/
- public void setUp() throws Exception
- {
- super.setUp();
+ @Override
+ public final void postSetUp() throws Exception {
final Host host = Host.getHost(0);
vm0 = host.getVM(0);
@@ -113,11 +112,10 @@ public class HAGIIBugDUnitTest extends DistributedTestCase
vm3 = host.getVM(3);
vm0.invoke(() -> HAGIIBugDUnitTest.createRegionQueue());
-
}
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
vm0.invoke(() -> HAGIIBugDUnitTest.closeCache());
vm1.invoke(() -> HAGIIBugDUnitTest.closeCache());
vm2.invoke(() -> HAGIIBugDUnitTest.closeCache());
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAGIIDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAGIIDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAGIIDUnitTest.java
index 4439e65..e23baa9 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAGIIDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAGIIDUnitTest.java
@@ -128,9 +128,8 @@ public class HAGIIDUnitTest extends DistributedTestCase
super(name);
}
- public void setUp() throws Exception
- {
- super.setUp();
+ @Override
+ public final void postSetUp() throws Exception {
final Host host = Host.getHost(0);
//server
@@ -450,7 +449,7 @@ public class HAGIIDUnitTest extends DistributedTestCase
}
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
ConflationDUnitTest.unsetIsSlowStart();
Invoke.invokeInEveryVM(ConflationDUnitTest.class, "unsetIsSlowStart");
// close the clients first
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARQueueNewImplDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARQueueNewImplDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARQueueNewImplDUnitTest.java
index 91aeb98..c2ff26b 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARQueueNewImplDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARQueueNewImplDUnitTest.java
@@ -110,9 +110,8 @@ public class HARQueueNewImplDUnitTest extends DistributedTestCase {
/**
* Sets up the test.
*/
- public void setUp() throws Exception {
- super.setUp();
-
+ @Override
+ public final void postSetUp() throws Exception {
final Host host = Host.getHost(0);
serverVM0 = host.getVM(0);
serverVM1 = host.getVM(1);
@@ -130,7 +129,7 @@ public class HARQueueNewImplDUnitTest extends DistributedTestCase {
* Tears down the test.
*/
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
closeCache();
clientVM1.invoke(() -> HARQueueNewImplDUnitTest.closeCache());
clientVM2.invoke(() -> HARQueueNewImplDUnitTest.closeCache());
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARegionDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARegionDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARegionDUnitTest.java
index 91f2ea5..64536d9 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARegionDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARegionDUnitTest.java
@@ -60,9 +60,8 @@ public class HARegionDUnitTest extends DistributedTestCase
/**
* get the VM's
*/
- 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);
@@ -72,7 +71,7 @@ public class HARegionDUnitTest extends DistributedTestCase
* close the cache in tearDown
*/
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
vm0.invoke(() -> HARegionDUnitTest.closeCache());
vm1.invoke(() -> HARegionDUnitTest.closeCache());
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARegionQueueDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARegionQueueDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARegionQueueDUnitTest.java
index cf31493..859c168 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARegionQueueDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARegionQueueDUnitTest.java
@@ -88,9 +88,8 @@ public class HARegionQueueDUnitTest extends DistributedTestCase
/**
* get the VM's
*/
- 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);
@@ -102,7 +101,7 @@ public class HARegionQueueDUnitTest extends DistributedTestCase
* close the cache in tearDown
*/
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
vm0.invoke(() -> HARegionQueueDUnitTest.closeCache());
vm1.invoke(() -> HARegionQueueDUnitTest.closeCache());
vm2.invoke(() -> HARegionQueueDUnitTest.closeCache());
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HASlowReceiverDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HASlowReceiverDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HASlowReceiverDUnitTest.java
index aa7964c..0f12155 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HASlowReceiverDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HASlowReceiverDUnitTest.java
@@ -74,9 +74,7 @@ public class HASlowReceiverDUnitTest extends DistributedTestCase {
}
@Override
- public void setUp() throws Exception {
- super.setUp();
-
+ public final void postSetUp() throws Exception {
final Host host = Host.getHost(0);
serverVM1 = host.getVM(1);
serverVM2 = host.getVM(2);
@@ -85,11 +83,10 @@ public class HASlowReceiverDUnitTest extends DistributedTestCase {
PORT0 = createServerCache().intValue();
PORT1 = ((Integer)serverVM1.invoke(() -> HASlowReceiverDUnitTest.createServerCache())).intValue();
PORT2 = ((Integer)serverVM2.invoke(() -> HASlowReceiverDUnitTest.createServerCache())).intValue();
-
}
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
clientVM.invoke(() -> HASlowReceiverDUnitTest.closeCache());
// then close the servers
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/OperationsPropagationDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/OperationsPropagationDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/OperationsPropagationDUnitTest.java
index ae85399..36ba2e9 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/OperationsPropagationDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/OperationsPropagationDUnitTest.java
@@ -100,9 +100,8 @@ public class OperationsPropagationDUnitTest extends DistributedTestCase
* Create the server1, server2 (in the same DS) and client1 (which is
* connected only to server2
*/
- public void setUp() throws Exception
- {
- super.setUp();
+ @Override
+ public final void postSetUp() throws Exception {
final Host host = Host.getHost(0);
// Server1 VM
server1 = host.getVM(0);
@@ -116,14 +115,13 @@ public class OperationsPropagationDUnitTest extends DistributedTestCase
PORT1 = ((Integer)server1.invoke(() -> OperationsPropagationDUnitTest.createServerCache())).intValue();
PORT2 = ((Integer)server2.invoke(() -> OperationsPropagationDUnitTest.createServerCache())).intValue();
client1.invoke(() -> OperationsPropagationDUnitTest.createClientCache( NetworkUtils.getServerHostName(host), new Integer(PORT2) ));
-
}
/**
* close the caches of the client and the servers
*/
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
client1.invoke(() -> OperationsPropagationDUnitTest.closeCache());
server1.invoke(() -> OperationsPropagationDUnitTest.closeCache());
server2.invoke(() -> OperationsPropagationDUnitTest.closeCache());
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/PutAllDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/PutAllDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/PutAllDUnitTest.java
index 7f9e79f..a8f6a00 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/PutAllDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/PutAllDUnitTest.java
@@ -91,9 +91,8 @@ public class PutAllDUnitTest extends DistributedTestCase
}
/** get the hosts and the VMs **/
- 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);
@@ -103,7 +102,7 @@ public class PutAllDUnitTest extends DistributedTestCase
/** close the caches**/
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
client1.invoke(() -> PutAllDUnitTest.closeCache());
client2.invoke(() -> PutAllDUnitTest.closeCache());
// close server
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/StatsBugDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/StatsBugDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/StatsBugDUnitTest.java
index f263113..74705fe 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/StatsBugDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/StatsBugDUnitTest.java
@@ -111,10 +111,9 @@ public class StatsBugDUnitTest extends DistributedTestCase
* @throws Exception -
* thrown if any problem occurs in initializing the test
*/
- public void setUp() throws Exception
- {
+ @Override
+ public final void postSetUp() throws Exception {
disconnectAllFromDS();
- super.setUp();
final Host host = Host.getHost(0);
primary = host.getVM(0);
secondary = host.getVM(1);
@@ -152,7 +151,7 @@ public class StatsBugDUnitTest extends DistributedTestCase
* thrown if any problem occurs in closing cache
*/
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
// close client
client1.invoke(() -> StatsBugDUnitTest.closeCache());
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/locks/TXLockServiceDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/locks/TXLockServiceDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/locks/TXLockServiceDUnitTest.java
index 8d150f9..867c214 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/locks/TXLockServiceDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/locks/TXLockServiceDUnitTest.java
@@ -67,9 +67,8 @@ public class TXLockServiceDUnitTest extends DistributedTestCase {
* time this method is called in this VM) distributed system
* which is somewhat configurable via hydra test parameters.
*/
- public void setUp() throws Exception {
- super.setUp();
-
+ @Override
+ public final void postSetUp() throws Exception {
// Create a DistributedSystem in every VM
connectDistributedSystem();
@@ -89,7 +88,7 @@ public class TXLockServiceDUnitTest extends DistributedTestCase {
}
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
// invokeInEveryVM(TXLockServiceDUnitTest.class,
// "remoteDumpAllDLockServices");
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/Bug43684DUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/Bug43684DUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/Bug43684DUnitTest.java
index d2a5cc3..0a14527 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/Bug43684DUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/Bug43684DUnitTest.java
@@ -71,8 +71,8 @@ public class Bug43684DUnitTest extends DistributedTestCase {
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
+ @Override
+ public final void postSetUp() throws Exception {
host = Host.getHost(0);
server1 = host.getVM(0);
server2 = host.getVM(1);
@@ -82,7 +82,7 @@ public class Bug43684DUnitTest extends DistributedTestCase {
}
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
closeCache();
client1.invoke(() -> Bug43684DUnitTest.closeCache());
server1.invoke(() -> Bug43684DUnitTest.closeCache());
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/Bug47388DUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/Bug47388DUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/Bug47388DUnitTest.java
index 193a7dd..8232bf7 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/Bug47388DUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/Bug47388DUnitTest.java
@@ -80,8 +80,8 @@ public class Bug47388DUnitTest extends DistributedTestCase {
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
+ @Override
+ public final void postSetUp() throws Exception {
disconnectFromDS();
Host host = Host.getHost(0);
vm0 = host.getVM(0); // datastore and server
@@ -102,7 +102,7 @@ public class Bug47388DUnitTest extends DistributedTestCase {
}
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
closeCache();
vm2.invoke(() -> Bug47388DUnitTest.closeCache());
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/Bug51400DUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/Bug51400DUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/Bug51400DUnitTest.java
index c7fffe4..a8f37d0 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/Bug51400DUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/Bug51400DUnitTest.java
@@ -65,18 +65,17 @@ public class Bug51400DUnitTest extends DistributedTestCase {
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
+ @Override
+ public final void postSetUp() throws Exception {
Host host = Host.getHost(0);
server0 = host.getVM(0);
server1 = host.getVM(1);
client0 = host.getVM(2);
client1 = host.getVM(3);
-
}
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
closeCache();
client0.invoke(() -> Bug51400DUnitTest.closeCache());
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/PartitionResolverDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/PartitionResolverDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/PartitionResolverDUnitTest.java
index 1ba824e..d371de1 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/PartitionResolverDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/PartitionResolverDUnitTest.java
@@ -69,9 +69,9 @@ public class PartitionResolverDUnitTest extends CacheTestCase {
public PartitionResolverDUnitTest(String name) {
super(name);
}
+
@Override
- public void setUp() throws Exception {
- super.setUp();
+ public final void postSetUp() throws Exception {
host = Host.getHost(0);
accessor = host.getVM(0);
datastore1 = host.getVM(1);
@@ -79,7 +79,7 @@ public class PartitionResolverDUnitTest extends CacheTestCase {
}
@Override
- protected final void postTearDownCacheTestCase() throws Exception {
+ public final void postTearDownCacheTestCase() throws Exception {
CountingResolver.resetResolverCount();
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/PartitionedRegionLoaderWriterDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/PartitionedRegionLoaderWriterDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/PartitionedRegionLoaderWriterDUnitTest.java
index faa6fb6..61b5c69 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/PartitionedRegionLoaderWriterDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/PartitionedRegionLoaderWriterDUnitTest.java
@@ -57,11 +57,6 @@ public class PartitionedRegionLoaderWriterDUnitTest extends CacheTestCase {
super(name);
}
- @Override
- public void setUp() throws Exception {
- super.setUp();
- }
-
public void testLoader_OnAccessor_NotOnDataStore(){
host = Host.getHost(0);
accessor = host.getVM(0);
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/PersistentColocatedPartitionedRegionDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/PersistentColocatedPartitionedRegionDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/PersistentColocatedPartitionedRegionDUnitTest.java
index 901d2d6..d0d9589 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/PersistentColocatedPartitionedRegionDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/PersistentColocatedPartitionedRegionDUnitTest.java
@@ -71,7 +71,7 @@ public class PersistentColocatedPartitionedRegionDUnitTest extends
}
@Override
- protected final void preTearDownCacheTestCase() throws Exception {
+ public final void preTearDownCacheTestCase() throws Exception {
FileUtil.delete(getBackupDir());
}
@@ -623,7 +623,7 @@ public class PersistentColocatedPartitionedRegionDUnitTest extends
//replying to the admin member.
vm1.invoke(new SerializableRunnable() {
public void run() {
- system.disconnect();
+ basicGetSystem().disconnect();
}
});
@@ -853,7 +853,7 @@ public class PersistentColocatedPartitionedRegionDUnitTest extends
//replying to the admin member.
vm1.invoke(new SerializableRunnable() {
public void run() {
- system.disconnect();
+ basicGetSystem().disconnect();
}
});
@@ -1000,7 +1000,7 @@ public class PersistentColocatedPartitionedRegionDUnitTest extends
public Object call() throws Exception {
Wait.waitForCriterion(new WaitCriterion() {
public boolean done() {
- InternalDistributedSystem ds = system;
+ InternalDistributedSystem ds = basicGetSystem();
return ds == null || !ds.isConnected();
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/PersistentPartitionedRegionTestBase.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/PersistentPartitionedRegionTestBase.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/PersistentPartitionedRegionTestBase.java
index 3b89271..c0fece6 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/PersistentPartitionedRegionTestBase.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/PersistentPartitionedRegionTestBase.java
@@ -86,11 +86,14 @@ public abstract class PersistentPartitionedRegionTestBase extends CacheTestCase
* @see dunit.DistributedTestCase#setUp()
*/
@Override
- public void setUp() throws Exception {
- super.setUp();
+ public final void postSetUp() throws Exception {
disconnectAllFromDS();
Invoke.invokeInEveryVM(PersistentPartitionedRegionTestBase.class,"setRegionName", new Object[]{getUniqueName()});
setRegionName(getUniqueName());
+ postSetUpPersistentPartitionedRegionTestBase();
+ }
+
+ protected void postSetUpPersistentPartitionedRegionTestBase() throws Exception {
}
public static void setRegionName(String testName) {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/PersistentPartitionedRegionWithTransactionDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/PersistentPartitionedRegionWithTransactionDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/PersistentPartitionedRegionWithTransactionDUnitTest.java
index 90118d1..901cecb 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/PersistentPartitionedRegionWithTransactionDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/PersistentPartitionedRegionWithTransactionDUnitTest.java
@@ -42,7 +42,7 @@ public class PersistentPartitionedRegionWithTransactionDUnitTest extends Persist
}
@Override
- protected final void postTearDownCacheTestCase() throws Exception {
+ public final void postTearDownCacheTestCase() throws Exception {
Invoke.invokeInEveryVM(new SerializableRunnable() {
public void run() {
TXManagerImpl.ALLOW_PERSISTENT_TRANSACTIONS = false;
@@ -52,8 +52,7 @@ public class PersistentPartitionedRegionWithTransactionDUnitTest extends Persist
}
@Override
- public void setUp() throws Exception {
- super.setUp();
+ protected final void postSetUpPersistentPartitionedRegionTestBase() throws Exception {
Invoke.invokeInEveryVM(new SerializableRunnable() {
public void run() {
@@ -63,7 +62,6 @@ public class PersistentPartitionedRegionWithTransactionDUnitTest extends Persist
});
}
-
public void testRollback() throws Throwable {
Host host = Host.getHost(0);
VM vm0 = host.getVM(0);
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/ShutdownAllDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/ShutdownAllDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/ShutdownAllDUnitTest.java
index cd68c35..3bd7600 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/ShutdownAllDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/ShutdownAllDUnitTest.java
@@ -85,10 +85,8 @@ public class ShutdownAllDUnitTest extends CacheTestCase {
*/
private static final int MAX_WAIT = 600 * 1000;
-
@Override
- public void setUp() throws Exception {
- super.setUp();
+ public final void postSetUp() throws Exception {
//Get rid of any existing distributed systems. We want
//to make assertions about the number of distributed systems
//we shut down, so we need to start with a clean slate.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/fixed/FixedPartitioningDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/fixed/FixedPartitioningDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/fixed/FixedPartitioningDUnitTest.java
index 100e444..6790566 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/fixed/FixedPartitioningDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/fixed/FixedPartitioningDUnitTest.java
@@ -45,14 +45,13 @@ public class FixedPartitioningDUnitTest extends FixedPartitioningTestBase {
private static final long serialVersionUID = 1L;
- public void setUp() throws Exception {
- super.setUp();
+ @Override
+ public final void postSetUp() throws Exception {
final Host host = Host.getHost(0);
member1 = host.getVM(0);
member2 = host.getVM(1);
member3 = host.getVM(2);
member4 = host.getVM(3);
-
}
/**
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/fixed/FixedPartitioningTestBase.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/fixed/FixedPartitioningTestBase.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/fixed/FixedPartitioningTestBase.java
index b1a2895..42428b8 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/fixed/FixedPartitioningTestBase.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/fixed/FixedPartitioningTestBase.java
@@ -1318,7 +1318,7 @@ public class FixedPartitioningTestBase extends DistributedTestCase {
}
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
try {
closeCache();
member1.invoke(() -> FixedPartitioningTestBase.closeCache());
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/fixed/FixedPartitioningWithColocationAndPersistenceDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/fixed/FixedPartitioningWithColocationAndPersistenceDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/fixed/FixedPartitioningWithColocationAndPersistenceDUnitTest.java
index 8d861b7..b508b56 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/fixed/FixedPartitioningWithColocationAndPersistenceDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/fixed/FixedPartitioningWithColocationAndPersistenceDUnitTest.java
@@ -34,14 +34,13 @@ public class FixedPartitioningWithColocationAndPersistenceDUnitTest extends
private static final long serialVersionUID = 1L;
- public void setUp() throws Exception {
- super.setUp();
+ @Override
+ public final void postSetUp() throws Exception {
final Host host = Host.getHost(0);
member1 = host.getVM(0);
member2 = host.getVM(1);
member3 = host.getVM(2);
member4 = host.getVM(3);
-
}
/**
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/persistence/PersistentReplicatedTestBase.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/persistence/PersistentReplicatedTestBase.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/persistence/PersistentReplicatedTestBase.java
index e07b145..1500269 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/persistence/PersistentReplicatedTestBase.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/persistence/PersistentReplicatedTestBase.java
@@ -55,8 +55,7 @@ public abstract class PersistentReplicatedTestBase extends CacheTestCase {
}
@Override
- public void setUp() throws Exception {
- super.setUp();
+ public final void postSetUp() throws Exception {
Invoke.invokeInEveryVM(PersistentReplicatedTestBase.class,"setRegionName", new Object[]{getUniqueName()});
setRegionName(getUniqueName());
diskDir = new File("diskDir-" + getName()).getAbsoluteFile();
@@ -70,7 +69,7 @@ public abstract class PersistentReplicatedTestBase extends CacheTestCase {
}
@Override
- protected final void postTearDownCacheTestCase() throws Exception {
+ public final void postTearDownCacheTestCase() throws Exception {
com.gemstone.gemfire.internal.FileUtil.delete(diskDir);
postTearDownPersistentReplicatedTestBase();
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/Bug40396DUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/Bug40396DUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/Bug40396DUnitTest.java
index b69c973..b9958c8 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/Bug40396DUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/Bug40396DUnitTest.java
@@ -59,8 +59,8 @@ public class Bug40396DUnitTest extends DistributedTestCase {
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
+ @Override
+ public final void postSetUp() throws Exception {
disconnectAllFromDS();
final Host host = Host.getHost(0);
server = host.getVM(0);
@@ -202,7 +202,7 @@ public class Bug40396DUnitTest extends DistributedTestCase {
}
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
// then close the servers
server.invoke(() -> Bug40396DUnitTest.removeExceptions());
server.invoke(() -> Bug40396DUnitTest.closeCache());
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/BackwardCompatibilityHigherVersionClientDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/BackwardCompatibilityHigherVersionClientDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/BackwardCompatibilityHigherVersionClientDUnitTest.java
index 8839f97..e35b49b 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/BackwardCompatibilityHigherVersionClientDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/BackwardCompatibilityHigherVersionClientDUnitTest.java
@@ -75,8 +75,7 @@ public class BackwardCompatibilityHigherVersionClientDUnitTest extends
}
@Override
- public void setUp() throws Exception {
- super.setUp();
+ public final void postSetUp() throws Exception {
final Host host = Host.getHost(0);
server1 = host.getVM(0);
client1 = host.getVM(1);
@@ -135,7 +134,7 @@ public class BackwardCompatibilityHigherVersionClientDUnitTest extends
}
@Override
- protected final void postTearDown() throws Exception {
+ public final void postTearDown() throws Exception {
client1.invoke(() -> BackwardCompatibilityHigherVersionClientDUnitTest.unsetHandshakeVersionForTesting());
client1.invoke(() -> BackwardCompatibilityHigherVersionClientDUnitTest.unsetConnectionToServerFailed());
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug36269DUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug36269DUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug36269DUnitTest.java
index 12cd163..80d238e 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug36269DUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug36269DUnitTest.java
@@ -71,8 +71,8 @@ public class Bug36269DUnitTest extends DistributedTestCase
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
+ @Override
+ public final void postSetUp() throws Exception {
disconnectAllFromDS();
final Host host = Host.getHost(0);
@@ -84,7 +84,6 @@ public class Bug36269DUnitTest extends DistributedTestCase
PORT1 = ((Integer)server1.invoke(() -> Bug36269DUnitTest.createServerCache())).intValue();
PORT2 = ((Integer)server2.invoke(() -> Bug36269DUnitTest.createServerCache())).intValue();
-
}
private void createCache(Properties props) throws Exception
@@ -217,7 +216,7 @@ public class Bug36269DUnitTest extends DistributedTestCase
}
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
closeCache();
// close server
server1.invoke(() -> Bug36269DUnitTest.closeCache());
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug36457DUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug36457DUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug36457DUnitTest.java
index 5667928..545b2a8 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug36457DUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug36457DUnitTest.java
@@ -73,15 +73,13 @@ public class Bug36457DUnitTest 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);
client1 = host.getVM(2);
client2 = host.getVM(3);
-
}
private void createCache(Properties props) throws Exception
@@ -140,7 +138,7 @@ public class Bug36457DUnitTest extends DistributedTestCase
}
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
// close the clients first
client1.invoke(() -> Bug36457DUnitTest.closeCache());
client2.invoke(() -> Bug36457DUnitTest.closeCache());
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug36805DUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug36805DUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug36805DUnitTest.java
index 16fab70..6ce5520 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug36805DUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug36805DUnitTest.java
@@ -77,15 +77,13 @@ public class Bug36805DUnitTest 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);
client1 = host.getVM(2);
client2 = host.getVM(3);
-
}
private void createCache(Properties props) throws Exception
@@ -134,7 +132,7 @@ public class Bug36805DUnitTest extends DistributedTestCase
}
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
// close the clients first
client1.invoke(() -> Bug36805DUnitTest.closeCache());
client2.invoke(() -> Bug36805DUnitTest.closeCache());
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug36829DUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug36829DUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug36829DUnitTest.java
index def774a..8eeec93 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug36829DUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug36829DUnitTest.java
@@ -46,8 +46,8 @@ public class Bug36829DUnitTest extends DistributedTestCase {
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
+ @Override
+ public final void postSetUp() throws Exception {
Host host = Host.getHost(0);
this.serverVM = host.getVM(0);
this.ClientVM = host.getVM(1);
@@ -164,7 +164,7 @@ public class Bug36829DUnitTest extends DistributedTestCase {
}
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
CacheServerTestUtil.resetDisableShufflingOfEndpointsFlag();
}
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug36995DUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug36995DUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug36995DUnitTest.java
index 30fb4c6..094635c 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug36995DUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug36995DUnitTest.java
@@ -56,14 +56,12 @@ public class Bug36995DUnitTest 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);
server3 = host.getVM(2);
-
}
private void createCache(Properties props) throws Exception
@@ -140,7 +138,7 @@ public class Bug36995DUnitTest extends DistributedTestCase
}
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
closeCache();
server1.invoke(() -> Bug36995DUnitTest.closeCache());
server2.invoke(() -> Bug36995DUnitTest.closeCache());
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug37210DUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug37210DUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug37210DUnitTest.java
index bd6d870..878a576 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug37210DUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug37210DUnitTest.java
@@ -82,10 +82,8 @@ public class Bug37210DUnitTest extends DistributedTestCase
* @throws Exception -
* thrown if any problem occurs in initializing the test
*/
- public void setUp() throws Exception
- {
- super.setUp();
-
+ @Override
+ public final void postSetUp() throws Exception {
IgnoredException.addIgnoredException("java.io.IOException");
final Host host = Host.getHost(0);
@@ -124,7 +122,7 @@ public class Bug37210DUnitTest extends DistributedTestCase
* thrown if any problem occurs in closing cache
*/
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
// close client
client.invoke(() -> Bug37210DUnitTest.closeCache());
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug37805DUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug37805DUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug37805DUnitTest.java
index 46e1679..4bfe1e1 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug37805DUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug37805DUnitTest.java
@@ -56,8 +56,8 @@ public class Bug37805DUnitTest extends DistributedTestCase{
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
+ @Override
+ public final void postSetUp() throws Exception {
Host host = Host.getHost(0);
this.server1VM = host.getVM(0);
this.durableClientVM = host.getVM(1);
@@ -66,7 +66,7 @@ public class Bug37805DUnitTest extends DistributedTestCase{
}
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
// Stop server 1
this.server1VM.invoke(() -> CacheServerTestUtil.closeCache());
CacheServerTestUtil.resetDisableShufflingOfEndpointsFlag();
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/CacheServerTransactionsDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/CacheServerTransactionsDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/CacheServerTransactionsDUnitTest.java
index beb1a9d..52f416a 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/CacheServerTransactionsDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/CacheServerTransactionsDUnitTest.java
@@ -95,9 +95,8 @@ public class CacheServerTransactionsDUnitTest extends DistributedTestCase
protected static boolean invalidated = false;
- public void setUp() throws Exception
- {
- super.setUp();
+ @Override
+ public final void postSetUp() throws Exception {
host = Host.getHost(0);
server1 = host.getVM(0);
server2 = host.getVM(1);
@@ -806,7 +805,7 @@ public class CacheServerTransactionsDUnitTest extends DistributedTestCase
}
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
// close the clients first
client1.invoke(() -> CacheServerTransactionsDUnitTest.closeCache());
client2.invoke(() -> CacheServerTransactionsDUnitTest.closeCache());
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ClearPropagationDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ClearPropagationDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ClearPropagationDUnitTest.java
index e71bebb..8f35ce2 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ClearPropagationDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ClearPropagationDUnitTest.java
@@ -83,8 +83,8 @@ public class ClearPropagationDUnitTest extends DistributedTestCase
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
+ @Override
+ public final void postSetUp() throws Exception {
disconnectAllFromDS();
final Host host = Host.getHost(0);
@@ -107,7 +107,6 @@ public class ClearPropagationDUnitTest extends DistributedTestCase
client2.invoke(() -> ClearPropagationDUnitTest.createClientCache( NetworkUtils.getServerHostName(server1.getHost()), new Integer(PORT1), new Integer(PORT2) ));
CacheObserverHolder.setInstance(new CacheObserverAdapter());
-
}
private void createCache(Properties props) throws Exception
@@ -469,7 +468,7 @@ public class ClearPropagationDUnitTest extends DistributedTestCase
}
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
//close client
client1.invoke(() -> ClearPropagationDUnitTest.closeCache());
client2.invoke(() -> ClearPropagationDUnitTest.closeCache());
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ClientConflationDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ClientConflationDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ClientConflationDUnitTest.java
index 8a7a769..f7e6085 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ClientConflationDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ClientConflationDUnitTest.java
@@ -73,8 +73,8 @@ public class ClientConflationDUnitTest extends DistributedTestCase
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
+ @Override
+ public final void postSetUp() throws Exception {
disconnectAllFromDS();
final Host host = Host.getHost(0);
@@ -529,7 +529,7 @@ public class ClientConflationDUnitTest extends DistributedTestCase
* close the cache in tearDown
*/
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
// close client
closeCacheFeeder();
vm1.invoke(() -> ClientConflationDUnitTest.closeCacheClient());
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ClientInterestNotifyDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ClientInterestNotifyDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ClientInterestNotifyDUnitTest.java
index 1559506..8a6cd35 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ClientInterestNotifyDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ClientInterestNotifyDUnitTest.java
@@ -139,17 +139,13 @@ public class ClientInterestNotifyDUnitTest extends DistributedTestCase
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
+ @Override
+ public final void postSetUp() throws Exception {
disconnectAllFromDS();
final Host host = Host.getHost(0);
vm0 = host.getVM(0);
vm1 = host.getVM(1);
- /*
- vm2 = host.getVM(2);
- vm3 = host.getVM(3);
- */
}
private Cache createCache(Properties props) throws Exception
@@ -626,7 +622,7 @@ public class ClientInterestNotifyDUnitTest extends DistributedTestCase
* close the caches in tearDown
*/
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
vm0.invoke(() -> ClientInterestNotifyDUnitTest.closeCache());
vm1.invoke(() -> ClientInterestNotifyDUnitTest.closeCache());
/*
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ClientServerMiscDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ClientServerMiscDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ClientServerMiscDUnitTest.java
index 8fb726a..98baa06 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ClientServerMiscDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ClientServerMiscDUnitTest.java
@@ -118,9 +118,8 @@ public class ClientServerMiscDUnitTest extends CacheTestCase
super(name);
}
- public void setUp() throws Exception
- {
- super.setUp();
+ @Override
+ public final void postSetUp() throws Exception {
host = Host.getHost(0);
server1 = host.getVM(0);
server2 = host.getVM(1);
@@ -1381,14 +1380,14 @@ public class ClientServerMiscDUnitTest extends CacheTestCase
}
@Override
- protected final void postTearDownCacheTestCase() throws Exception {
+ public final void postTearDownCacheTestCase() throws Exception {
// close the clients first
- closeCache();
+ closeCacheAndDisconnect();
// then close the servers
- server1.invoke(() -> ClientServerMiscDUnitTest.closeCache());
+ server1.invoke(() -> ClientServerMiscDUnitTest.closeCacheAndDisconnect());
}
- public static void closeCache()
+ public static void closeCacheAndDisconnect()
{
Cache cache = new ClientServerMiscDUnitTest("temp").getCache();
if (cache != null && !cache.isClosed()) {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ConflationDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ConflationDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ConflationDUnitTest.java
index 6839e32..363673c 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ConflationDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ConflationDUnitTest.java
@@ -83,8 +83,8 @@ public class ConflationDUnitTest extends DistributedTestCase
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
+ @Override
+ public final void postSetUp() throws Exception {
disconnectAllFromDS();
final Host host = Host.getHost(0);
@@ -899,7 +899,7 @@ public class ConflationDUnitTest extends DistributedTestCase
* close the cache in tearDown
*/
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
// close client
closeCache();
vm2.invoke(() -> ConflationDUnitTest.closeCache());
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DataSerializerPropogationDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DataSerializerPropogationDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DataSerializerPropogationDUnitTest.java
index 4c0c296..9d6ee1c 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DataSerializerPropogationDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DataSerializerPropogationDUnitTest.java
@@ -94,8 +94,7 @@ public class DataSerializerPropogationDUnitTest extends DistributedTestCase {
}
@Override
- public void setUp() throws Exception {
- super.setUp();
+ public final void postSetUp() throws Exception {
final Host host = Host.getHost(0);
client1 = host.getVM(0);
client2 = host.getVM(1);
@@ -156,7 +155,7 @@ public class DataSerializerPropogationDUnitTest extends DistributedTestCase {
}
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
try {
// close the clients first
client1.invoke(() -> DataSerializerPropogationDUnitTest.closeCache());
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DestroyEntryPropagationDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DestroyEntryPropagationDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DestroyEntryPropagationDUnitTest.java
index 6ca370f..6ce8409 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DestroyEntryPropagationDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DestroyEntryPropagationDUnitTest.java
@@ -83,10 +83,9 @@ public class DestroyEntryPropagationDUnitTest extends DistributedTestCase
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
+ @Override
+ public final void postSetUp() throws Exception {
disconnectAllFromDS();
- // pause(5000);
final Host host = Host.getHost(0);
//Server1 VM
@@ -106,7 +105,6 @@ public class DestroyEntryPropagationDUnitTest extends DistributedTestCase
vm2.invoke(() -> DestroyEntryPropagationDUnitTest.createClientCache( NetworkUtils.getServerHostName(host), new Integer(PORT1),new Integer(PORT2)));
vm3.invoke(() -> DestroyEntryPropagationDUnitTest.createClientCache( NetworkUtils.getServerHostName(host), new Integer(PORT1),new Integer(PORT2)));
-
}
private void createCache(Properties props) throws Exception
@@ -486,7 +484,7 @@ public class DestroyEntryPropagationDUnitTest extends DistributedTestCase
}
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
//close client
vm2.invoke(() -> DestroyEntryPropagationDUnitTest.closeCache());
vm3.invoke(() -> DestroyEntryPropagationDUnitTest.closeCache());
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientBug39997DUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientBug39997DUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientBug39997DUnitTest.java
index fb425c1..70db594 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientBug39997DUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientBug39997DUnitTest.java
@@ -50,7 +50,7 @@ public class DurableClientBug39997DUnitTest extends CacheTestCase {
public final void postTearDownCacheTestCase() {
Host.getHost(0) .getVM(0).invoke(() -> disconnectFromDS());
}
-
+
public void testNoServerAvailableOnStartup() {
Host host = Host.getHost(0);
VM vm0 = host.getVM(0);
@@ -62,10 +62,10 @@ public class DurableClientBug39997DUnitTest extends CacheTestCase {
public void run() {
getSystem(getClientProperties());
PoolImpl p = (PoolImpl)PoolManager.createFactory()
- .addServer(hostName, port)
- .setSubscriptionEnabled(true)
- .setSubscriptionRedundancy(0)
- .create("DurableClientReconnectDUnitTestPool");
+ .addServer(hostName, port)
+ .setSubscriptionEnabled(true)
+ .setSubscriptionRedundancy(0)
+ .create("DurableClientReconnectDUnitTestPool");
AttributesFactory factory = new AttributesFactory();
factory.setScope(Scope.LOCAL);
factory.setPoolName(p.getName());
@@ -81,7 +81,7 @@ public class DurableClientBug39997DUnitTest extends CacheTestCase {
}
}
});
-
+
vm1.invoke(new SerializableRunnable() {
public void run() {
Cache cache = getCache();
@@ -109,14 +109,14 @@ public class DurableClientBug39997DUnitTest extends CacheTestCase {
}
public boolean done() {
- try {
+ try {
region.registerInterest("ALL_KEYS");
} catch (NoSubscriptionServersAvailableException e) {
return false;
}
return true;
}
-
+
}, 30000, 1000, true);
}
});
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientQueueSizeDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientQueueSizeDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientQueueSizeDUnitTest.java
index 648718f..7994edf 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientQueueSizeDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientQueueSizeDUnitTest.java
@@ -76,8 +76,7 @@ public class DurableClientQueueSizeDUnitTest extends DistributedTestCase {
}
@Override
- public void setUp() throws Exception {
- super.setUp();
+ public final void postSetUp() throws Exception {
vm0 = Host.getHost(0).getVM(0);
vm1 = Host.getHost(0).getVM(1);
vm2 = Host.getHost(0).getVM(2);
@@ -90,7 +89,7 @@ public class DurableClientQueueSizeDUnitTest extends DistributedTestCase {
}
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
closeCache();
vm2.invoke(() -> DurableClientQueueSizeDUnitTest.closeCache());
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientReconnectDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientReconnectDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientReconnectDUnitTest.java
index 5f25c3a..ce2a1e0 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientReconnectDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientReconnectDUnitTest.java
@@ -96,9 +96,7 @@ public class DurableClientReconnectDUnitTest extends DistributedTestCase
}
@Override
- public void setUp() throws Exception
- {
- super.setUp();
+ public final void postSetUp() throws Exception {
final Host host = Host.getHost(0);
server1 = host.getVM(0);
server2 = host.getVM(1);
@@ -117,8 +115,8 @@ public class DurableClientReconnectDUnitTest extends DistributedTestCase
//CacheServerTestUtil.disableShufflingOfEndpoints();
System.setProperty("gemfire.bridge.disableShufflingOfEndpoints", "false");
-
}
+
public void testDurableReconnectSingleServer() throws Exception
{
createCacheClientAndConnectToSingleServer(NetworkUtils.getServerHostName(Host.getHost(0)), 0);
@@ -732,7 +730,7 @@ public class DurableClientReconnectDUnitTest extends DistributedTestCase
}
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
// close the clients first
closeCache();
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientStatsDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientStatsDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientStatsDUnitTest.java
index e3e38a4..125a8c7 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientStatsDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientStatsDUnitTest.java
@@ -70,8 +70,7 @@ public class DurableClientStatsDUnitTest extends DistributedTestCase {
}
@Override
- public void setUp() throws Exception {
- super.setUp();
+ public final void postSetUp() throws Exception {
Host host = Host.getHost(0);
this.server1VM = host.getVM(0);
this.durableClientVM = host.getVM(1);
@@ -80,7 +79,7 @@ public class DurableClientStatsDUnitTest extends DistributedTestCase {
}
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
// Stop server 1
this.server1VM.invoke(() -> CacheServerTestUtil.closeCache());
CacheServerTestUtil.resetDisableShufflingOfEndpointsFlag();
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableRegistrationDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableRegistrationDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableRegistrationDUnitTest.java
index 5d5e0a8..237fc91 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableRegistrationDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableRegistrationDUnitTest.java
@@ -100,8 +100,8 @@ public class DurableRegistrationDUnitTest extends DistributedTestCase {
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
+ @Override
+ public final void postSetUp() throws Exception {
Host host = Host.getHost(0);
this.server1VM = host.getVM(0);
this.server2VM = host.getVM(1);
@@ -771,7 +771,7 @@ public class DurableRegistrationDUnitTest extends DistributedTestCase {
}
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
CacheServerTestUtil.resetDisableShufflingOfEndpointsFlag();
}
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableResponseMatrixDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableResponseMatrixDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableResponseMatrixDUnitTest.java
index bc49f93..d0f64cf 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableResponseMatrixDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableResponseMatrixDUnitTest.java
@@ -63,9 +63,8 @@ public class DurableResponseMatrixDUnitTest 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);
// start servers first
@@ -481,7 +480,7 @@ public class DurableResponseMatrixDUnitTest extends DistributedTestCase
}
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
// close the clients first
closeCache();
// then close the servers
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/EventIDVerificationDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/EventIDVerificationDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/EventIDVerificationDUnitTest.java
index 0217361..6a12e54 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/EventIDVerificationDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/EventIDVerificationDUnitTest.java
@@ -84,9 +84,8 @@ public class EventIDVerificationDUnitTest 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);
@@ -99,7 +98,6 @@ public class EventIDVerificationDUnitTest extends DistributedTestCase
// Object[] { new Integer(PORT1),new Integer(PORT2)});
createClientCache(NetworkUtils.getServerHostName(host), new Integer(PORT1), new Integer(PORT2));
CacheObserverHolder.setInstance(new CacheObserverAdapter());
-
}
public void testEventIDOnServer()
@@ -472,7 +470,7 @@ public class EventIDVerificationDUnitTest extends DistributedTestCase
}
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
// close the clients first
closeCache();
// then close the servers
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/EventIDVerificationInP2PDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/EventIDVerificationInP2PDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/EventIDVerificationInP2PDUnitTest.java
index f33e6e1..94b7b05 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/EventIDVerificationInP2PDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/EventIDVerificationInP2PDUnitTest.java
@@ -71,9 +71,8 @@ public class EventIDVerificationInP2PDUnitTest 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);
receiver = false;
@@ -310,7 +309,7 @@ public class EventIDVerificationInP2PDUnitTest extends DistributedTestCase
}
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
closeCache();
vm0.invoke(() -> EventIDVerificationInP2PDUnitTest.closeCache());
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ForceInvalidateOffHeapEvictionDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ForceInvalidateOffHeapEvictionDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ForceInvalidateOffHeapEvictionDUnitTest.java
index b9c1893..3049551 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ForceInvalidateOffHeapEvictionDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ForceInvalidateOffHeapEvictionDUnitTest.java
@@ -36,7 +36,7 @@ public class ForceInvalidateOffHeapEvictionDUnitTest extends
}
@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/tier/sockets/HABug36738DUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/HABug36738DUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/HABug36738DUnitTest.java
index df81db8..a82061e 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/HABug36738DUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/HABug36738DUnitTest.java
@@ -16,8 +16,9 @@
*/
package com.gemstone.gemfire.internal.cache.tier.sockets;
-import java.util.Iterator;
-import java.util.Properties;
+import static com.gemstone.gemfire.test.dunit.Invoke.*;
+import static com.jayway.awaitility.Awaitility.*;
+import static com.jayway.awaitility.Duration.*;
import com.gemstone.gemfire.cache.AttributesFactory;
import com.gemstone.gemfire.cache.Cache;
@@ -25,23 +26,16 @@ import com.gemstone.gemfire.cache.CacheFactory;
import com.gemstone.gemfire.cache.DataPolicy;
import com.gemstone.gemfire.cache.MirrorType;
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.internal.cache.EnumListenerEvent;
import com.gemstone.gemfire.internal.cache.EventID;
import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
import com.gemstone.gemfire.internal.cache.HARegion;
import com.gemstone.gemfire.internal.cache.LocalRegion;
import com.gemstone.gemfire.internal.cache.ha.HAHelper;
-import com.gemstone.gemfire.internal.cache.ha.HARegionQueue;
-import com.gemstone.gemfire.internal.cache.tier.sockets.ClientProxyMembershipID;
-import com.gemstone.gemfire.internal.cache.tier.sockets.ClientUpdateMessage;
import com.gemstone.gemfire.test.dunit.DistributedTestCase;
import com.gemstone.gemfire.test.dunit.Host;
-import com.gemstone.gemfire.test.dunit.LogWriterUtils;
import com.gemstone.gemfire.test.dunit.VM;
-import com.gemstone.gemfire.test.dunit.Wait;
/**
* This is the bugtest for bug no. 36738. When Object of class
@@ -52,143 +46,89 @@ import com.gemstone.gemfire.test.dunit.Wait;
* 2. Perform put operations on HARegion with the value as ClientUpdateMessage.
* 3. Create server2 and HARegion in it so that GII will happen.
* 4. Perform get operations from server2.
- *
*/
-
-public class HABug36738DUnitTest extends DistributedTestCase
-{
-
- static VM server1 = null;
-
- static VM server2 = null;
-
- private static int NO_OF_PUTS = 10;
+public class HABug36738DUnitTest extends DistributedTestCase {
private static final String REGION_NAME = "HABug36738DUnitTest_Region";
+ private static final String HAREGION_NAME = "haRegion";
+ private static final int COUNT = 10;
- protected static Cache cache = null;
+ private static Cache cache;
- protected static HARegionQueue messageQueue = null;
-
- static Region haRegion = null;
-
- final static String HAREGION_NAME = "haRegion";
+ private Region haRegion;
public HABug36738DUnitTest(String name) {
super(name);
}
- public void setUp() throws Exception
- {
- super.setUp();
- final Host host = Host.getHost(0);
- server1 = host.getVM(0);
- server2 = host.getVM(1);
-
- }
-
@Override
- protected final void preTearDown() throws Exception {
- server1.invoke(() -> HABug36738DUnitTest.closeCache());
- server2.invoke(() -> HABug36738DUnitTest.closeCache());
- }
-
- public void testBug36768() throws Exception
- {
- createServer1();
- Wait.pause(10000);
- server1.invoke(() -> HABug36738DUnitTest.checkRegionQueueSize());
- createServer2();
- server1.invoke(() -> HABug36738DUnitTest.checkRegionQueueSize());
- server2.invoke(() -> HABug36738DUnitTest.checkRegionQueueSize());
- server2.invoke(() -> HABug36738DUnitTest.printRecs());
+ public final void preTearDown() throws Exception {
+ disconnectAllFromDS();
+ invokeInEveryVM( () -> cache = null );
}
- public static void printRecs()
- {
- HARegion region = (HARegion)cache.getRegion(Region.SEPARATOR
- + HAHelper.getRegionQueueName(HAREGION_NAME));
- assertNotNull(region);
- Iterator itr = region.keys().iterator();
- while (itr.hasNext()) {
- Object key = itr.next();
- ClientUpdateMessage value = (ClientUpdateMessage)region.get(key);
- LogWriterUtils.getLogWriter().info("key : " + key + "Value " + value.getValue());
-
- }
+ public void testBug36768() throws Exception {
+ final VM server1 = Host.getHost(0).getVM(0);
+ final VM server2 = Host.getHost(0).getVM(1);
- }
+ server1.invoke(() -> createServerCacheWithHAAndRegion());
+ await().atMost(TEN_SECONDS).until( () -> regionExists(server1, HAREGION_NAME) );
+ server1.invoke(() -> checkRegionQueueSize());
- // function to create server and region in it.
- private void createServer1() throws Exception
- {
- server1.invoke(() -> HABug36738DUnitTest.createServerCache( new Boolean(true) ));
- }
+ server2.invoke(() -> createServerCacheWithHA());
- // function to create server without region.
- private void createServer2() throws Exception
- {
- server2.invoke(() -> HABug36738DUnitTest.createServerCache( new Boolean(false) ));
+ server1.invoke(() -> checkRegionQueueSize());
+ server2.invoke(() -> checkRegionQueueSize());
}
- public static void createServerCache(Boolean isRegion) throws Exception
- {
- new HABug36738DUnitTest("temp").createCache(new Properties());
- if (isRegion.booleanValue()) {
- AttributesFactory factory = new AttributesFactory();
- factory.setScope(Scope.DISTRIBUTED_ACK);
- factory.setEnableConflation(true);
- factory.setDataPolicy(DataPolicy.REPLICATE);
- RegionAttributes attrs = factory.createRegionAttributes();
- cache.createVMRegion(REGION_NAME, attrs);
-
+ private void createServerCacheWithHAAndRegion() throws Exception {
+ createServerCacheWithHA();
+ assertNotNull(cache);
+ assertNotNull(this.haRegion);
+
+ final AttributesFactory factory = new AttributesFactory();
+ factory.setScope(Scope.DISTRIBUTED_ACK);
+ factory.setEnableConflation(true);
+ factory.setDataPolicy(DataPolicy.REPLICATE);
+
+ cache.createVMRegion(REGION_NAME, factory.createRegionAttributes());
+
+ for (int i = 0; i < COUNT; i++) {
+ ClientUpdateMessage clientMessage = new ClientUpdateMessageImpl(
+ EnumListenerEvent.AFTER_UPDATE,
+ (LocalRegion)this.haRegion,
+ null,
+ ("value" + i).getBytes(),
+ (byte)0x01,
+ null,
+ new ClientProxyMembershipID(),
+ new EventID(("memberID" + i).getBytes(), i, i));
+
+ this.haRegion.put(i, clientMessage);
}
+ }
- AttributesFactory factoryForHARegion = new AttributesFactory();
- factoryForHARegion.setMirrorType(MirrorType.KEYS_VALUES);
- factoryForHARegion.setScope(Scope.DISTRIBUTED_ACK);
- RegionAttributes ra = factoryForHARegion.createRegionAttributes();
- haRegion = HARegion.getInstance(HAREGION_NAME, (GemFireCacheImpl)cache, null,
- ra);
-
- if (isRegion.booleanValue()) {
- for (int i = 0; i < NO_OF_PUTS; i++) {
- ClientUpdateMessage clientMessage = new ClientUpdateMessageImpl(
- EnumListenerEvent.AFTER_UPDATE, (LocalRegion)haRegion, null, ("value" + i)
- .getBytes(), (byte)0x01, null, new ClientProxyMembershipID(),
- new EventID(("memberID" + i).getBytes(), i, i));
+ private void createServerCacheWithHA() throws Exception {
+ cache = CacheFactory.create(getSystem());
- haRegion.put(new Long(i), clientMessage);
- LogWriterUtils.getLogWriter().info("Putting in the message Queue");
+ final AttributesFactory factory = new AttributesFactory();
+ factory.setMirrorType(MirrorType.KEYS_VALUES);
+ factory.setScope(Scope.DISTRIBUTED_ACK);
- }
- }
+ haRegion = HARegion.getInstance(HAREGION_NAME, (GemFireCacheImpl) cache, null, factory.createRegionAttributes());
}
- private void createCache(Properties props) throws Exception
- {
- DistributedSystem ds = getSystem(props);
- assertNotNull(ds);
- ds.disconnect();
- ds = getSystem(props);
- cache = CacheFactory.create(ds);
- assertNotNull(cache);
+ private void checkRegionQueueSize() {
+ final HARegion region = (HARegion) cache.getRegion(Region.SEPARATOR + HAHelper.getRegionQueueName(HAREGION_NAME));
+ assertNotNull(region);
+ assertEquals(COUNT, region.size());
}
- public static void closeCache()
- {
- if (cache != null && !cache.isClosed()) {
- cache.close();
- cache.getDistributedSystem().disconnect();
- }
+ private boolean regionExists(final VM vm, final String name) {
+ return vm.invoke(() -> regionExists(name));
}
- public static void checkRegionQueueSize()
- {
- HARegion region = (HARegion)cache.getRegion(Region.SEPARATOR
- + HAHelper.getRegionQueueName(HAREGION_NAME));
- assertNotNull(region);
- LogWriterUtils.getLogWriter().info("Size of the Queue : " + region.size());
-
+ private boolean regionExists(final String name) {
+ return cache.getRegion(Region.SEPARATOR + HAHelper.getRegionQueueName(HAREGION_NAME)) != null;
}
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/HAInterestTestCase.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/HAInterestTestCase.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/HAInterestTestCase.java
index 85f3707..c86c473 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/HAInterestTestCase.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/HAInterestTestCase.java
@@ -100,8 +100,7 @@ public class HAInterestTestCase extends DistributedTestCase {
}
@Override
- public void setUp() throws Exception {
- super.setUp();
+ public final void postSetUp() throws Exception {
host = Host.getHost(0);
server1 = host.getVM(0);
server2 = host.getVM(1);
@@ -116,7 +115,7 @@ public class HAInterestTestCase extends DistributedTestCase {
}
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
// close the clients first
closeCache();
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/HAStartupAndFailoverDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/HAStartupAndFailoverDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/HAStartupAndFailoverDUnitTest.java
index 7395a84..d92d6e9 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/HAStartupAndFailoverDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/HAStartupAndFailoverDUnitTest.java
@@ -78,9 +78,8 @@ public class HAStartupAndFailoverDUnitTest 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);
@@ -94,8 +93,8 @@ public class HAStartupAndFailoverDUnitTest extends DistributedTestCase
PORT2 = ((Integer) server2.invoke(() -> HAStartupAndFailoverDUnitTest.createServerCache()));
PORT3 = ((Integer) server3.invoke(() -> HAStartupAndFailoverDUnitTest.createServerCache()));
CacheServerTestUtil.disableShufflingOfEndpoints();
-
}
+
/**
* Stops primary server one by one to ensure new primary is selected
*
@@ -718,7 +717,7 @@ public class HAStartupAndFailoverDUnitTest extends DistributedTestCase
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
// close the clients first
closeCache();
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InstantiatorPropagationDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InstantiatorPropagationDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InstantiatorPropagationDUnitTest.java
index 9438af7..36ba531 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InstantiatorPropagationDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InstantiatorPropagationDUnitTest.java
@@ -91,8 +91,8 @@ public class InstantiatorPropagationDUnitTest extends DistributedTestCase {
// TODO Auto-generated constructor stub
}
- public void setUp() throws Exception {
- super.setUp();
+ @Override
+ public final void postSetUp() throws Exception {
final Host host = Host.getHost(0);
client1 = host.getVM(0);
client2 = host.getVM(1);
@@ -151,7 +151,7 @@ public class InstantiatorPropagationDUnitTest extends DistributedTestCase {
}
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
// close the clients first
closeCache();
client1.invoke(() -> InstantiatorPropagationDUnitTest.closeCache());
[05/11] incubator-geode git commit: GEODE-1050: add JUnit 4 versions
of DistributedTestCase and CacheTestCase
Posted by kl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestListDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestListDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestListDUnitTest.java
index 50ceda7..b841609 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestListDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestListDUnitTest.java
@@ -134,8 +134,8 @@ public class InterestListDUnitTest extends DistributedTestCase
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
+ @Override
+ public final void postSetUp() throws Exception {
disconnectAllFromDS();
Wait.pause(10000);
final Host host = Host.getHost(0);
@@ -144,8 +144,8 @@ public class InterestListDUnitTest extends DistributedTestCase
vm2 = host.getVM(2);
// start servers first
PORT1 = ((Integer) vm0.invoke(() -> InterestListDUnitTest.createServerCache())).intValue();
-
}
+
/**
* one server two clients
* create Entries in all the vms
@@ -1028,7 +1028,7 @@ public class InterestListDUnitTest extends DistributedTestCase
}
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
// close the clients first
vm1.invoke(() -> InterestListDUnitTest.closeCache());
vm2.invoke(() -> InterestListDUnitTest.closeCache());
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestListEndpointDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestListEndpointDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestListEndpointDUnitTest.java
index 392bdd3..c001124 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestListEndpointDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestListEndpointDUnitTest.java
@@ -90,8 +90,8 @@ public class InterestListEndpointDUnitTest extends DistributedTestCase
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
+ @Override
+ public final void postSetUp() throws Exception {
disconnectAllFromDS();
Wait.pause(5000);
final Host host = Host.getHost(0);
@@ -112,7 +112,6 @@ public class InterestListEndpointDUnitTest extends DistributedTestCase
Wait.pause(5000); // [bruce] avoid ConnectException
client1.invoke(() -> impl.createClientCache(
NetworkUtils.getServerHostName(server1.getHost()), new Integer(PORT1),new Integer(PORT2)));
-
}
/** subclass support */
@@ -491,7 +490,7 @@ public class InterestListEndpointDUnitTest extends DistributedTestCase
}
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
// Close client cache first, then server caches
client1.invoke(() -> impl.closeCache());
server2.invoke(() -> impl.closeCache());
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestListFailoverDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestListFailoverDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestListFailoverDUnitTest.java
index 1e98cc5..8cd3c12 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestListFailoverDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestListFailoverDUnitTest.java
@@ -72,8 +72,8 @@ public class InterestListFailoverDUnitTest extends DistributedTestCase
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
+ @Override
+ public final void postSetUp() throws Exception {
disconnectAllFromDS();
final Host host = Host.getHost(0);
vm0 = host.getVM(0);
@@ -299,7 +299,7 @@ public class InterestListFailoverDUnitTest extends DistributedTestCase
}
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
closeAll();
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestListRecoveryDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestListRecoveryDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestListRecoveryDUnitTest.java
index 0f25d01..d83e61a 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestListRecoveryDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestListRecoveryDUnitTest.java
@@ -89,10 +89,9 @@ public class InterestListRecoveryDUnitTest extends DistributedTestCase
}
@Override
- public void setUp() throws Exception {
+ public final void postSetUp() throws Exception {
disconnectAllFromDS();
Wait.pause(2000);
- super.setUp();
final Host host = Host.getHost(0);
server1 = host.getVM(0);
server2 = host.getVM(1);
@@ -129,7 +128,7 @@ public class InterestListRecoveryDUnitTest extends DistributedTestCase
VM serverFirstRegistered = null;
VM serverSecondRegistered = null;
- LogWriter logger = system.getLogWriter();
+ LogWriter logger = basicGetSystem().getLogWriter();
createEntries();
server2.invoke(() -> InterestListRecoveryDUnitTest.createEntries());
server1.invoke(() -> InterestListRecoveryDUnitTest.createEntries());
@@ -484,7 +483,7 @@ public class InterestListRecoveryDUnitTest extends DistributedTestCase
}
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
// close the clients first
server2.invoke(() -> InterestListRecoveryDUnitTest.closeCache());
closeCache();
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestRegrListenerDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestRegrListenerDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestRegrListenerDUnitTest.java
index 66b33fa..6b48cef 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestRegrListenerDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestRegrListenerDUnitTest.java
@@ -72,10 +72,10 @@ public class InterestRegrListenerDUnitTest extends DistributedTestCase {
}
private static final long serialVersionUID = 1L;
-
- public void setUp() throws Exception {
+
+ @Override
+ public final void preSetUp() throws Exception {
disconnectAllFromDS();
- super.setUp();
}
public Cache createCache(Properties props) throws Exception
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestResultPolicyDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestResultPolicyDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestResultPolicyDUnitTest.java
index d163e29..5b400e7 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestResultPolicyDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestResultPolicyDUnitTest.java
@@ -79,8 +79,7 @@ public class InterestResultPolicyDUnitTest extends DistributedTestCase
* Creates the server cache and populates it with some entries
*/
@Override
- public void setUp() throws Exception {
- super.setUp();
+ public final void postSetUp() throws Exception {
disconnectAllFromDS();
Wait.pause(5000);
final Host host = Host.getHost(0);
@@ -94,7 +93,7 @@ public class InterestResultPolicyDUnitTest extends DistributedTestCase
* Closes the cache on server and client
*/
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
// might get ServerConnectivityExceptions during shutdown
this.expectedEx = IgnoredException.addIgnoredException(ServerConnectivityException.class
.getName());
@@ -105,7 +104,7 @@ public class InterestResultPolicyDUnitTest extends DistributedTestCase
}
@Override
- protected void postTearDown() throws Exception {
+ public final void postTearDown() throws Exception {
if (this.expectedEx != null) {
this.expectedEx.remove();
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/NewRegionAttributesDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/NewRegionAttributesDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/NewRegionAttributesDUnitTest.java
index 1a952c8..7a74627 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/NewRegionAttributesDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/NewRegionAttributesDUnitTest.java
@@ -71,8 +71,8 @@ public class NewRegionAttributesDUnitTest extends DistributedTestCase
* @throws Exception
* thrown if any problem occurs in set-up
*/
- public void setUp() throws Exception {
- super.setUp();
+ @Override
+ public final void postSetUp() throws Exception {
disconnectAllFromDS();
Wait.pause(5000);
final Host host = Host.getHost(0);
@@ -100,7 +100,7 @@ public class NewRegionAttributesDUnitTest extends DistributedTestCase
* thrown if any problem occurs while closing the cache
*/
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
vm0.invoke(() -> NewRegionAttributesDUnitTest.closeCache());
vm1.invoke(() -> NewRegionAttributesDUnitTest.closeCache());
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/RedundancyLevelTestBase.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/RedundancyLevelTestBase.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/RedundancyLevelTestBase.java
index eaba8d9..e65d2cd 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/RedundancyLevelTestBase.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/RedundancyLevelTestBase.java
@@ -102,9 +102,8 @@ public class RedundancyLevelTestBase extends DistributedTestCase
DistributedTestCase.disconnectAllFromDS();
}
- public void setUp() throws Exception
- {
- super.setUp();
+ @Override
+ public final void postSetUp() throws Exception {
final Host host = Host.getHost(0);
server0 = host.getVM(0);
@@ -127,7 +126,6 @@ public class RedundancyLevelTestBase extends DistributedTestCase
SERVER4 = hostName + PORT4;
CacheServerTestUtil.disableShufflingOfEndpoints();
-
}
protected static volatile boolean registerInterestCalled = false;
@@ -621,7 +619,7 @@ public class RedundancyLevelTestBase extends DistributedTestCase
}
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
try {
if(!FailOverDetectionByCCU)
ClientServerObserverHolder.setInstance(oldBo);
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/RegionCloseDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/RegionCloseDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/RegionCloseDUnitTest.java
index b925bf7..4fb4278 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/RegionCloseDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/RegionCloseDUnitTest.java
@@ -68,9 +68,8 @@ public class RegionCloseDUnitTest 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 VM
server1 = host.getVM(0);
@@ -80,7 +79,6 @@ public class RegionCloseDUnitTest extends DistributedTestCase
PORT1 = ((Integer)server1.invoke(() -> RegionCloseDUnitTest.createServerCache())).intValue();
client1.invoke(() -> RegionCloseDUnitTest.createClientCache(
NetworkUtils.getServerHostName(host), new Integer(PORT1)));
-
}
private void createCache(Properties props) throws Exception
@@ -237,7 +235,7 @@ public class RegionCloseDUnitTest extends DistributedTestCase
}
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
//close client
client1.invoke(() -> RegionCloseDUnitTest.closeCache());
//close server
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/RegisterInterestBeforeRegionCreationDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/RegisterInterestBeforeRegionCreationDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/RegisterInterestBeforeRegionCreationDUnitTest.java
index 097da6a..7f4d365 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/RegisterInterestBeforeRegionCreationDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/RegisterInterestBeforeRegionCreationDUnitTest.java
@@ -86,13 +86,8 @@ public class RegisterInterestBeforeRegionCreationDUnitTest extends DistributedTe
super(name);
}
- /**
- * get the hosts
- * @throws Exception
- */
- 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);
@@ -106,7 +101,7 @@ public class RegisterInterestBeforeRegionCreationDUnitTest extends DistributedTe
* @throws Exception
*/
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
client1.invoke(() -> RegisterInterestBeforeRegionCreationDUnitTest.closeCache());
client2.invoke(() -> RegisterInterestBeforeRegionCreationDUnitTest.closeCache());
server1.invoke(() -> RegisterInterestBeforeRegionCreationDUnitTest.closeCache());
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/RegisterInterestKeysDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/RegisterInterestKeysDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/RegisterInterestKeysDUnitTest.java
index df131a9..91a068f 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/RegisterInterestKeysDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/RegisterInterestKeysDUnitTest.java
@@ -66,8 +66,8 @@ public class RegisterInterestKeysDUnitTest extends DistributedTestCase
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
+ @Override
+ public final void postSetUp() throws Exception {
disconnectAllFromDS();
Wait.pause(5000);
@@ -98,7 +98,6 @@ public class RegisterInterestKeysDUnitTest extends DistributedTestCase
NetworkUtils.getServerHostName(server1.getHost()), new Integer(PORT1),new Integer(PORT2)));
client2.invoke(() -> impl.createClientCache(
NetworkUtils.getServerHostName(server1.getHost()), new Integer(PORT1),new Integer(PORT2)));
-
}
/** subclass support */
@@ -237,7 +236,7 @@ public class RegisterInterestKeysDUnitTest extends DistributedTestCase
}
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
//close client
client1.invoke(() -> impl.closeCache());
client2.invoke(() -> impl.closeCache());
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ReliableMessagingDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ReliableMessagingDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ReliableMessagingDUnitTest.java
index f02fef5..7da68f7 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ReliableMessagingDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ReliableMessagingDUnitTest.java
@@ -326,10 +326,9 @@ public class ReliableMessagingDUnitTest extends DistributedTestCase
sleep(2000);
}
}
-
- 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);
@@ -339,7 +338,6 @@ public class ReliableMessagingDUnitTest extends DistributedTestCase
CacheServerTestUtil.disableShufflingOfEndpoints();
createClientCache(PORT1, PORT2);
-
}
private Cache createCache(Properties props) throws Exception
@@ -413,7 +411,7 @@ public class ReliableMessagingDUnitTest extends DistributedTestCase
}
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
creationTime = 0;
closeCache();
server1.invoke(() -> ReliableMessagingDUnitTest.closeCache());
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/UnregisterInterestDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/UnregisterInterestDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/UnregisterInterestDUnitTest.java
index 4056483..3690e57 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/UnregisterInterestDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/UnregisterInterestDUnitTest.java
@@ -70,8 +70,8 @@ public class UnregisterInterestDUnitTest extends DistributedTestCase {
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
+ @Override
+ public final void postSetUp() throws Exception {
Host host = Host.getHost(0);
server0 = host.getVM(0);
client1 = host.getVM(1);
@@ -83,7 +83,7 @@ public class UnregisterInterestDUnitTest extends DistributedTestCase {
}
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
closeCache();
server0.invoke(() -> UnregisterInterestDUnitTest.closeCache());
client1.invoke(() -> UnregisterInterestDUnitTest.closeCache());
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/UpdatePropagationDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/UpdatePropagationDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/UpdatePropagationDUnitTest.java
index f544e74..3c5e9e0 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/UpdatePropagationDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/UpdatePropagationDUnitTest.java
@@ -100,8 +100,8 @@ public class UpdatePropagationDUnitTest extends DistributedTestCase
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
+ @Override
+ public final void postSetUp() throws Exception {
disconnectAllFromDS();
final Host host = Host.getHost(0);
@@ -127,7 +127,6 @@ public class UpdatePropagationDUnitTest extends DistributedTestCase
IgnoredException.addIgnoredException("java.net.SocketException");
IgnoredException.addIgnoredException("Unexpected IOException");
-
}
private void createCache(Properties props) throws Exception
@@ -572,7 +571,7 @@ public class UpdatePropagationDUnitTest extends DistributedTestCase
}
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
//close client
client1.invoke(() -> closeCache());
client2.invoke(() -> closeCache());
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/VerifyEventIDGenerationInP2PDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/VerifyEventIDGenerationInP2PDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/VerifyEventIDGenerationInP2PDUnitTest.java
index 5287c9f..c329beb 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/VerifyEventIDGenerationInP2PDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/VerifyEventIDGenerationInP2PDUnitTest.java
@@ -67,9 +67,8 @@ public class VerifyEventIDGenerationInP2PDUnitTest 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);
createServerCache();
@@ -170,7 +169,7 @@ public class VerifyEventIDGenerationInP2PDUnitTest extends DistributedTestCase
}
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
closeCache();
vm0.invoke(() -> VerifyEventIDGenerationInP2PDUnitTest.closeCache());
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/VerifyUpdatesFromNonInterestEndPointDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/VerifyUpdatesFromNonInterestEndPointDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/VerifyUpdatesFromNonInterestEndPointDUnitTest.java
index 238a094..0587313 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/VerifyUpdatesFromNonInterestEndPointDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/VerifyUpdatesFromNonInterestEndPointDUnitTest.java
@@ -73,8 +73,8 @@ public class VerifyUpdatesFromNonInterestEndPointDUnitTest extends DistributedTe
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
+ @Override
+ public final void postSetUp() throws Exception {
disconnectAllFromDS();
Wait.pause(5000);
final Host host = Host.getHost(0);
@@ -82,13 +82,10 @@ public class VerifyUpdatesFromNonInterestEndPointDUnitTest extends DistributedTe
vm1 = host.getVM(1);
vm2 = host.getVM(2);
-
PORT1 = ((Integer)vm0.invoke(() -> VerifyUpdatesFromNonInterestEndPointDUnitTest.createServerCache())).intValue();
PORT2 = ((Integer)vm1.invoke(() -> VerifyUpdatesFromNonInterestEndPointDUnitTest.createServerCache())).intValue();
vm2.invoke(() -> VerifyUpdatesFromNonInterestEndPointDUnitTest.createClientCache( NetworkUtils.getServerHostName(vm0.getHost()), new Integer(PORT1),new Integer(PORT2)));
-
-
}
private Cache createCache(Properties props) throws Exception
@@ -246,7 +243,7 @@ public class VerifyUpdatesFromNonInterestEndPointDUnitTest extends DistributedTe
}
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
//close client
vm2.invoke(() -> VerifyUpdatesFromNonInterestEndPointDUnitTest.closeCache());
//close server
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/AsyncEventQueueTestBase.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/AsyncEventQueueTestBase.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/AsyncEventQueueTestBase.java
index d834017..a5b6125 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/AsyncEventQueueTestBase.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/AsyncEventQueueTestBase.java
@@ -126,8 +126,8 @@ public class AsyncEventQueueTestBase extends DistributedTestCase {
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
+ @Override
+ public final void preSetUp() throws Exception {
final Host host = Host.getHost(0);
vm0 = host.getVM(0);
vm1 = host.getVM(1);
@@ -137,12 +137,14 @@ public class AsyncEventQueueTestBase extends DistributedTestCase {
vm5 = host.getVM(5);
vm6 = host.getVM(6);
vm7 = host.getVM(7);
+ }
+
+ @Override
+ public final void postSetUp() throws Exception {
// this is done to vary the number of dispatchers for sender
// during every test method run
shuffleNumDispatcherThreads();
- Invoke.invokeInEveryVM(AsyncEventQueueTestBase.class,
- "setNumDispatcherThreadsForTheRun",
- new Object[] { dispatcherThreads.get(0) });
+ Invoke.invokeInEveryVM(() -> setNumDispatcherThreadsForTheRun(dispatcherThreads.get(0)));
}
public static void shuffleNumDispatcherThreads() {
@@ -159,7 +161,7 @@ public class AsyncEventQueueTestBase extends DistributedTestCase {
}
AsyncEventQueueTestBase test = new AsyncEventQueueTestBase(getTestMethodName());
int port = AvailablePortHelper.getRandomAvailablePortForDUnitSite();
- Properties props = new Properties();
+ Properties props = test.getDistributedSystemProperties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
//props.setProperty(DistributionConfig.DISTRIBUTED_SYSTEM_ID_NAME, "" + dsId);
props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + port
@@ -173,7 +175,7 @@ public class AsyncEventQueueTestBase extends DistributedTestCase {
public static Integer createFirstRemoteLocator(int dsId, int remoteLocPort) {
AsyncEventQueueTestBase test = new AsyncEventQueueTestBase(getTestMethodName());
int port = AvailablePortHelper.getRandomAvailablePortForDUnitSite();
- Properties props = new Properties();
+ Properties props = test.getDistributedSystemProperties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
props.setProperty(DistributionConfig.DISTRIBUTED_SYSTEM_ID_NAME, "" + dsId);
props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + port
@@ -692,7 +694,7 @@ public class AsyncEventQueueTestBase extends DistributedTestCase {
protected static void createCache(Integer locPort) {
AsyncEventQueueTestBase test = new AsyncEventQueueTestBase(getTestMethodName());
- Properties props = new Properties();
+ Properties props = test.getDistributedSystemProperties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + locPort
+ "]");
@@ -702,7 +704,7 @@ public class AsyncEventQueueTestBase extends DistributedTestCase {
public static void createCacheWithoutLocator(Integer mCastPort) {
AsyncEventQueueTestBase test = new AsyncEventQueueTestBase(getTestMethodName());
- Properties props = new Properties();
+ Properties props = test.getDistributedSystemProperties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME, "" + mCastPort);
InternalDistributedSystem ds = test.getSystem(props);
cache = CacheFactory.create(ds);
@@ -941,7 +943,7 @@ public class AsyncEventQueueTestBase extends DistributedTestCase {
public static int createReceiver(int locPort) {
AsyncEventQueueTestBase test = new AsyncEventQueueTestBase(getTestMethodName());
- Properties props = new Properties();
+ Properties props = test.getDistributedSystemProperties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + locPort
+ "]");
@@ -1568,7 +1570,7 @@ public class AsyncEventQueueTestBase extends DistributedTestCase {
}
@Override
- protected final void postTearDown() throws Exception {
+ public final void postTearDown() throws Exception {
cleanupVM();
vm0.invoke(() -> AsyncEventQueueTestBase.cleanupVM());
vm1.invoke(() -> AsyncEventQueueTestBase.cleanupVM());
@@ -1607,16 +1609,16 @@ public class AsyncEventQueueTestBase extends DistributedTestCase {
((MyGatewaySenderEventListener)eventListener1).printMap();
}
-
@Override
- public InternalDistributedSystem getSystem(Properties props) {
- // For now all WANTestBase tests allocate off-heap memory even though
+ public final Properties getDistributedSystemProperties() {
+ // For now all WANTestBase tests allocate off-heap memory even though
// many of them never use it.
// The problem is that WANTestBase has static methods that create instances
// of WANTestBase (instead of instances of the subclass). So we can't override
// this method so that only the off-heap subclasses allocate off heap memory.
+ Properties props = new Properties();
props.setProperty(DistributionConfig.OFF_HEAP_MEMORY_SIZE_NAME, "300m");
- return super.getSystem(props);
+ return props;
}
/**
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/asyncqueue/AsyncEventListenerDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/asyncqueue/AsyncEventListenerDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/asyncqueue/AsyncEventListenerDUnitTest.java
index 779fc75..fbe97bc 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/asyncqueue/AsyncEventListenerDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/asyncqueue/AsyncEventListenerDUnitTest.java
@@ -48,10 +48,6 @@ public class AsyncEventListenerDUnitTest extends AsyncEventQueueTestBase {
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
- }
-
/**
* Test to verify that AsyncEventQueue can not be created when null listener
* is passed.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/asyncqueue/AsyncEventQueueStatsDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/asyncqueue/AsyncEventQueueStatsDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/asyncqueue/AsyncEventQueueStatsDUnitTest.java
index 71a3227..cd11ae9 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/asyncqueue/AsyncEventQueueStatsDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/asyncqueue/AsyncEventQueueStatsDUnitTest.java
@@ -31,10 +31,6 @@ public class AsyncEventQueueStatsDUnitTest extends AsyncEventQueueTestBase {
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
- }
-
/**
* Normal replication scenario
*/
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/concurrent/ConcurrentAsyncEventQueueDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/concurrent/ConcurrentAsyncEventQueueDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/concurrent/ConcurrentAsyncEventQueueDUnitTest.java
index 41accac..5440a08 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/concurrent/ConcurrentAsyncEventQueueDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/concurrent/ConcurrentAsyncEventQueueDUnitTest.java
@@ -34,10 +34,6 @@ public class ConcurrentAsyncEventQueueDUnitTest extends AsyncEventQueueTestBase
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
- }
-
public void testConcurrentSerialAsyncEventQueueAttributes() {
Integer lnPort = (Integer)vm0.invoke(() -> AsyncEventQueueTestBase.createFirstLocatorWithDSId( 1 ));
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/CommonParallelAsyncEventQueueDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/CommonParallelAsyncEventQueueDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/CommonParallelAsyncEventQueueDUnitTest.java
index a21e2ab..7c31949 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/CommonParallelAsyncEventQueueDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/CommonParallelAsyncEventQueueDUnitTest.java
@@ -32,10 +32,6 @@ public class CommonParallelAsyncEventQueueDUnitTest extends AsyncEventQueueTestB
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
- }
-
public void testSameSenderWithNonColocatedRegions() throws Exception {
IgnoredException.addIgnoredException("cannot have the same parallel async");
Integer lnPort = (Integer)vm0.invoke(() -> AsyncEventQueueTestBase.createFirstLocatorWithDSId( 1 ));
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/compression/CompressionCacheConfigDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/compression/CompressionCacheConfigDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/compression/CompressionCacheConfigDUnitTest.java
index 653a376..c2d1814 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/compression/CompressionCacheConfigDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/compression/CompressionCacheConfigDUnitTest.java
@@ -62,11 +62,6 @@ public class CompressionCacheConfigDUnitTest extends CacheTestCase {
super(name);
}
- @Override
- public void setUp() throws Exception {
- super.setUp();
- }
-
/**
* Asserts that a member is successfully initialized with a compressed region when
* a compressor is included in the region attributes.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/compression/CompressionCacheListenerDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/compression/CompressionCacheListenerDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/compression/CompressionCacheListenerDUnitTest.java
index 84a9faf..48facca 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/compression/CompressionCacheListenerDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/compression/CompressionCacheListenerDUnitTest.java
@@ -162,8 +162,7 @@ public class CompressionCacheListenerDUnitTest extends CacheTestCase {
}
@Override
- public void setUp() throws Exception {
- super.setUp();
+ public final void postSetUp() throws Exception {
disconnectAllFromDS();
createRegion();
}
@@ -179,7 +178,7 @@ public class CompressionCacheListenerDUnitTest extends CacheTestCase {
}
@Override
- protected final void preTearDownCacheTestCase() throws Exception {
+ public final void preTearDownCacheTestCase() throws Exception {
preTearDownCompressionCacheListenerDUnitTest();
try {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/compression/CompressionRegionConfigDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/compression/CompressionRegionConfigDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/compression/CompressionRegionConfigDUnitTest.java
index cd71a2c..083e5c0 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/compression/CompressionRegionConfigDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/compression/CompressionRegionConfigDUnitTest.java
@@ -71,11 +71,6 @@ public class CompressionRegionConfigDUnitTest extends CacheTestCase {
super(name);
}
- @Override
- public void setUp() throws Exception {
- super.setUp();
- }
-
/**
* Sanity check using two peers sharing a replicated region.
* @throws Exception
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/compression/CompressionRegionFactoryDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/compression/CompressionRegionFactoryDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/compression/CompressionRegionFactoryDUnitTest.java
index 7a0793b..cf7cd04 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/compression/CompressionRegionFactoryDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/compression/CompressionRegionFactoryDUnitTest.java
@@ -54,11 +54,6 @@ public class CompressionRegionFactoryDUnitTest extends CacheTestCase {
super(name);
}
- @Override
- public void setUp() throws Exception {
- super.setUp();
- }
-
/**
* Asserts that a region is created when a valid compressor is used.
* Asserts that the region attributes contain the correct compressor value.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/compression/CompressionRegionOperationsDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/compression/CompressionRegionOperationsDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/compression/CompressionRegionOperationsDUnitTest.java
index 32164bd..34b037c 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/compression/CompressionRegionOperationsDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/compression/CompressionRegionOperationsDUnitTest.java
@@ -129,9 +129,7 @@ public class CompressionRegionOperationsDUnitTest extends CacheTestCase {
}
@Override
- public void setUp() throws Exception {
- super.setUp();
-
+ public final void postSetUp() throws Exception {
createRegion();
}
@@ -147,7 +145,7 @@ public class CompressionRegionOperationsDUnitTest extends CacheTestCase {
}
@Override
- protected final void preTearDownCacheTestCase() throws Exception {
+ public final void preTearDownCacheTestCase() throws Exception {
Error error = null;
Exception exception = null;
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/ExceptionsDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/ExceptionsDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/ExceptionsDUnitTest.java
index e9c725d..e94ddf6 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/ExceptionsDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/ExceptionsDUnitTest.java
@@ -178,15 +178,15 @@ public class ExceptionsDUnitTest extends DistributedTestCase {
}
}
- public void setUp() throws Exception {
- super.setUp();
+ @Override
+ public final void postSetUp() throws Exception {
Host host = Host.getHost(0);
VM vm0 = host.getVM(0);
vm0.invoke(() -> ExceptionsDUnitTest.init());
}
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
Host host = Host.getHost(0);
VM vm0 = host.getVM(0);
vm0.invoke(() -> ExceptionsDUnitTest.closeCache());
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/IdleTimeOutDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/IdleTimeOutDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/IdleTimeOutDUnitTest.java
index 68153eb..c66f57a 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/IdleTimeOutDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/IdleTimeOutDUnitTest.java
@@ -244,8 +244,8 @@ public class IdleTimeOutDUnitTest extends DistributedTestCase {
}
}
- public void setUp() throws Exception {
- super.setUp();
+ @Override
+ public final void postSetUp() throws Exception {
Host host = Host.getHost(0);
VM vm0 = host.getVM(0);
Object o[] = new Object[1];
@@ -254,7 +254,7 @@ public class IdleTimeOutDUnitTest extends DistributedTestCase {
}
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
VM vm0 = Host.getHost(0).getVM(0);
vm0.invoke(() -> IdleTimeOutDUnitTest.closeCache());
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/MaxPoolSizeDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/MaxPoolSizeDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/MaxPoolSizeDUnitTest.java
index 9ee5922..3845587 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/MaxPoolSizeDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/MaxPoolSizeDUnitTest.java
@@ -245,8 +245,8 @@ public class MaxPoolSizeDUnitTest extends DistributedTestCase {
}
}
- public void setUp() throws Exception {
- super.setUp();
+ @Override
+ public final void postSetUp() throws Exception {
disconnectAllFromDS();
Host host = Host.getHost(0);
VM vm0 = host.getVM(0);
@@ -256,7 +256,7 @@ public class MaxPoolSizeDUnitTest 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);
try {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/TransactionTimeOutDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/TransactionTimeOutDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/TransactionTimeOutDUnitTest.java
index 1a19b0b..7993e75 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/TransactionTimeOutDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/TransactionTimeOutDUnitTest.java
@@ -119,15 +119,15 @@ public class TransactionTimeOutDUnitTest extends DistributedTestCase {
}
}
- public void setUp() throws Exception {
- super.setUp();
+ @Override
+ public final void postSetUp() throws Exception {
Host host = Host.getHost(0);
VM vm0 = host.getVM(0);
vm0.invoke(() -> TransactionTimeOutDUnitTest.init());
}
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
Host host = Host.getHost(0);
VM vm0 = host.getVM(0);
vm0.invoke(() -> TransactionTimeOutDUnitTest.closeCache());
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/TxnManagerMultiThreadDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/TxnManagerMultiThreadDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/TxnManagerMultiThreadDUnitTest.java
index 8096dc0..72a6723 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/TxnManagerMultiThreadDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/TxnManagerMultiThreadDUnitTest.java
@@ -315,9 +315,8 @@ public class TxnManagerMultiThreadDUnitTest extends DistributedTestCase {
}
}//end of closeCache
- /////setUp and tearDown methods/////
- public void setUp() throws java.lang.Exception {
- super.setUp();
+ @Override
+ public final void postSetUp() throws java.lang.Exception {
VM vm0 = Host.getHost(0).getVM(0);
Object o[] = new Object[1];
o[0] = "TxnManagerMultiThreadDUnitTest";
@@ -356,7 +355,7 @@ public class TxnManagerMultiThreadDUnitTest extends DistributedTestCase {
}//end of delRows
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
VM vm0 = Host.getHost(0).getVM(0);
//get tableName to pass to destroyTable
String tableName = CacheUtils.getTableName();
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/TxnTimeOutDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/TxnTimeOutDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/TxnTimeOutDUnitTest.java
index 746972a..44c21cd 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/TxnTimeOutDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/jta/dunit/TxnTimeOutDUnitTest.java
@@ -115,15 +115,15 @@ public class TxnTimeOutDUnitTest extends DistributedTestCase {
}
}
- public void setUp() throws Exception {
- super.setUp();
+ @Override
+ public final void postSetUp() throws Exception {
Host host = Host.getHost(0);
VM vm0 = host.getVM(0);
vm0.invoke(() -> TxnTimeOutDUnitTest.init());
}
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
Host host = Host.getHost(0);
VM vm0 = host.getVM(0);
vm0.invoke(() -> TxnTimeOutDUnitTest.closeCache());
@@ -211,7 +211,7 @@ public class TxnTimeOutDUnitTest extends DistributedTestCase {
public static void runTest1() throws Exception {
boolean exceptionOccured = false;
try {
- system.getLogWriter().fine("<ExpectedException action=add> +" +
+ getSystemStatic().getLogWriter().fine("<ExpectedException action=add> +" +
"DistributedSystemDisconnectedException" +
"</ExpectedException>");
Context ctx = cache.getJNDIContext();
@@ -234,7 +234,7 @@ public class TxnTimeOutDUnitTest extends DistributedTestCase {
fail("failed in naming lookup: " + e);
}
finally {
- system.getLogWriter().fine("<ExpectedException action=remove> +" +
+ getSystemStatic().getLogWriter().fine("<ExpectedException action=remove> +" +
"DistributedSystemDisconnectedException" +
"</ExpectedException>");
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/offheap/OutOfOffHeapMemoryDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/offheap/OutOfOffHeapMemoryDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/offheap/OutOfOffHeapMemoryDUnitTest.java
index 9c2e5e8..4f07f41 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/offheap/OutOfOffHeapMemoryDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/offheap/OutOfOffHeapMemoryDUnitTest.java
@@ -68,14 +68,17 @@ public class OutOfOffHeapMemoryDUnitTest extends CacheTestCase {
}
@Override
- public void setUp() throws Exception {
+ public final void preSetUp() throws Exception {
disconnectAllFromDS();
- super.setUp();
+ }
+
+ @Override
+ public final void postSetUp() throws Exception {
IgnoredException.addIgnoredException(OutOfOffHeapMemoryException.class.getSimpleName());
}
@Override
- protected final void preTearDownCacheTestCase() throws Exception {
+ public final void preTearDownCacheTestCase() throws Exception {
final SerializableRunnable checkOrphans = 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/process/LocalProcessLauncherDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/process/LocalProcessLauncherDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/process/LocalProcessLauncherDUnitTest.java
index cb05740..fc9c614 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/process/LocalProcessLauncherDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/process/LocalProcessLauncherDUnitTest.java
@@ -44,8 +44,7 @@ public class LocalProcessLauncherDUnitTest extends DistributedTestCase {
}
@Override
- public void setUp() throws Exception {
- super.setUp();
+ public final void postSetUp() throws Exception {
new File(getClass().getSimpleName()).mkdir();
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/internal/statistics/StatisticsDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/statistics/StatisticsDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/statistics/StatisticsDUnitTest.java
index 9fd18e6..11a9bb7 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/statistics/StatisticsDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/statistics/StatisticsDUnitTest.java
@@ -126,12 +126,7 @@ public class StatisticsDUnitTest extends CacheTestCase {
}
@Override
- public void setUp() throws Exception {
- super.setUp();
- }
-
- @Override
- protected final void preTearDownCacheTestCase() throws Exception {
+ public final void preTearDownCacheTestCase() throws Exception {
Invoke.invokeInEveryVM(getClass(), "cleanup");
disconnectAllFromDS(); // because this test enabled stat sampling!
}
@@ -272,7 +267,7 @@ public class StatisticsDUnitTest extends CacheTestCase {
publishers[pubThread] = pubs[pubVM].invokeAsync(
new CacheSerializableRunnable("pub-connect-and-put-data-" + pubVM + "-thread-" + pubThread) {
public void run2() throws CacheException {
- final PubSubStats statistics = new PubSubStats(system, "pub-" + pubThread, pubVM);
+ final PubSubStats statistics = new PubSubStats(basicGetSystem(), "pub-" + pubThread, pubVM);
pubStatsRef.set(pubThread, statistics);
final RegionMembershipListener rml = rmlRef.get();
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/management/CacheManagementDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/management/CacheManagementDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/management/CacheManagementDUnitTest.java
index 6ef2180..b9025e5 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/management/CacheManagementDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/management/CacheManagementDUnitTest.java
@@ -96,11 +96,6 @@ public class CacheManagementDUnitTest extends ManagementTestBase {
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
-
- }
-
public void testGemFireConfigData() throws Exception {
initManagement(false);
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/management/ClientHealthStatsDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/management/ClientHealthStatsDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/management/ClientHealthStatsDUnitTest.java
index de5c07f..6751aea 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/management/ClientHealthStatsDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/management/ClientHealthStatsDUnitTest.java
@@ -96,10 +96,11 @@ public class ClientHealthStatsDUnitTest extends DistributedTestCase {
super(name);
}
- public void setUp() throws Exception {
+ @Override
+ public final void postSetUp() throws Exception {
disconnectAllFromDS();
- super.setUp();
- final Host host = Host.getHost(0);
+
+ final Host host = Host.getHost(0);
managingNode = host.getVM(0);
server = host.getVM(1);
client = host.getVM(2);
@@ -108,7 +109,7 @@ public class ClientHealthStatsDUnitTest extends DistributedTestCase {
}
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
reset();
helper.closeCache(managingNode);
helper.closeCache(client);
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/management/CompositeTypeTestDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/management/CompositeTypeTestDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/management/CompositeTypeTestDUnitTest.java
index 49db7d5..565de1b 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/management/CompositeTypeTestDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/management/CompositeTypeTestDUnitTest.java
@@ -43,11 +43,6 @@ public class CompositeTypeTestDUnitTest extends ManagementTestBase {
private static ObjectName objectName;
- public void setUp() throws Exception {
- super.setUp();
-
- }
-
public void testCompositeTypeGetters() throws Exception{
initManagement(false);
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/management/DLockManagementDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/management/DLockManagementDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/management/DLockManagementDUnitTest.java
index 2e08d58..5da954f 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/management/DLockManagementDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/management/DLockManagementDUnitTest.java
@@ -53,11 +53,6 @@ public class DLockManagementDUnitTest extends ManagementTestBase {
}
- public void setUp() throws Exception {
- super.setUp();
-
- }
-
/**
* Distributed Lock Service test
*
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/management/DiskManagementDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/management/DiskManagementDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/management/DiskManagementDUnitTest.java
index b850b54..d90fbe2 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/management/DiskManagementDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/management/DiskManagementDUnitTest.java
@@ -85,11 +85,10 @@ public class DiskManagementDUnitTest extends ManagementTestBase {
diskDir.deleteOnExit();
}
- public void setUp() throws Exception {
- super.setUp();
+ @Override
+ protected final void postSetUpManagementTestBase() throws Exception {
failureCause = "";
testFailed = false;
-
}
@Override
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/management/DistributedSystemDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/management/DistributedSystemDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/management/DistributedSystemDUnitTest.java
index 10f628d..cd73ec0 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/management/DistributedSystemDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/management/DistributedSystemDUnitTest.java
@@ -110,12 +110,6 @@ public class DistributedSystemDUnitTest extends ManagementTestBase {
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
-
-
- }
-
/**
* Tests each and every operations that is defined on the MemberMXBean
*
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/management/LocatorManagementDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/management/LocatorManagementDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/management/LocatorManagementDUnitTest.java
index 0d2fdbc..fcc3081 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/management/LocatorManagementDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/management/LocatorManagementDUnitTest.java
@@ -68,8 +68,8 @@ public class LocatorManagementDUnitTest extends ManagementTestBase {
private static final long serialVersionUID = 1L;
- public void setUp() throws Exception {
- super.setUp();
+ @Override
+ protected final void postSetUpManagementTestBase() throws Exception {
locator = managedNode1;
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/management/ManagementTestBase.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/management/ManagementTestBase.java b/geode-core/src/test/java/com/gemstone/gemfire/management/ManagementTestBase.java
index 663abee..6064297 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/management/ManagementTestBase.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/management/ManagementTestBase.java
@@ -104,28 +104,30 @@ public class ManagementTestBase extends DistributedTestCase {
private static Cache cache;
- public void setUp() throws Exception {
+ @Override
+ public final void postSetUp() throws Exception {
disconnectAllFromDS();
- super.setUp();
+
Host host = Host.getHost(0);
managingNode = host.getVM(0);
managedNode1 = host.getVM(1);
managedNode2 = host.getVM(2);
managedNode3 = host.getVM(3);
-
-
managedNodeList = new ArrayList<VM>();
managedNodeList.add(managedNode1);
managedNodeList.add(managedNode2);
managedNodeList.add(managedNode3);
locatorVM = host.getLocator();
+ postSetUpManagementTestBase();
+ }
+ protected void postSetUpManagementTestBase() throws Exception {
}
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
preTearDownManagementTestBase();
closeAllCache();
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/management/MemberMBeanAttributesDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/management/MemberMBeanAttributesDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/management/MemberMBeanAttributesDUnitTest.java
index c3c1c2f..bb5d50a 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/management/MemberMBeanAttributesDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/management/MemberMBeanAttributesDUnitTest.java
@@ -58,11 +58,6 @@ public class MemberMBeanAttributesDUnitTest extends ManagementTestBase {
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
-
- }
-
protected void sample(VM vm1) {
vm1.invoke(new SerializableRunnable("Create Cache") {
public void run() {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/management/OffHeapManagementDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/management/OffHeapManagementDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/management/OffHeapManagementDUnitTest.java
index 9ded958..0938b70 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/management/OffHeapManagementDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/management/OffHeapManagementDUnitTest.java
@@ -143,8 +143,7 @@ public class OffHeapManagementDUnitTest extends CacheTestCase {
}
@Override
- public void setUp() throws Exception {
- super.setUp();
+ public final void postSetUp() throws Exception {
Host.getHost(0).getVM(0).invoke(new SerializableRunnable() {
@Override
public void run() {
@@ -154,7 +153,7 @@ public class OffHeapManagementDUnitTest extends CacheTestCase {
}
@Override
- protected final void preTearDownCacheTestCase() throws Exception {
+ public final void preTearDownCacheTestCase() throws Exception {
Host.getHost(0).getVM(0).invoke(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/management/QueryDataDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/management/QueryDataDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/management/QueryDataDUnitTest.java
index e06fd3e..7fa222c 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/management/QueryDataDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/management/QueryDataDUnitTest.java
@@ -142,11 +142,9 @@ public class QueryDataDUnitTest extends ManagementTestBase {
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
+ @Override
+ protected final void postSetUpManagementTestBase() throws Exception {
initManagement(false);
-
-
}
private void initCommonRegions(){
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/management/RegionManagementDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/management/RegionManagementDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/management/RegionManagementDUnitTest.java
index 303188a..55cd4ec 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/management/RegionManagementDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/management/RegionManagementDUnitTest.java
@@ -103,11 +103,6 @@ public class RegionManagementDUnitTest extends ManagementTestBase {
public RegionManagementDUnitTest(String name) {
super(name);
-
- }
-
- public void setUp() throws Exception {
- super.setUp();
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/management/UniversalMembershipListenerAdapterDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/management/UniversalMembershipListenerAdapterDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/management/UniversalMembershipListenerAdapterDUnitTest.java
index d84415a..60ef7ba 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/management/UniversalMembershipListenerAdapterDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/management/UniversalMembershipListenerAdapterDUnitTest.java
@@ -89,7 +89,7 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
}
@Override
- protected final void postTearDownCacheTestCase() throws Exception {
+ public final void postTearDownCacheTestCase() throws Exception {
InternalClientMembership.unregisterAllListeners();
}
@@ -1565,7 +1565,7 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
Region region = createRegion(name, factory.create());
assertNotNull(region);
assertNotNull(getRootRegion().getSubregion(name));
- return system.getDistributedMember();
+ return basicGetSystem().getDistributedMember();
}
};
@@ -1849,7 +1849,7 @@ public class UniversalMembershipListenerAdapterDUnitTest extends ClientServerTes
com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().error(e);
fail(e.getMessage());
}
- return system.getDistributedMember();
+ return basicGetSystem().getDistributedMember();
}
};
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/management/bean/stats/DistributedSystemStatsDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/management/bean/stats/DistributedSystemStatsDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/management/bean/stats/DistributedSystemStatsDUnitTest.java
index 1de93ee..24cd2bc 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/management/bean/stats/DistributedSystemStatsDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/management/bean/stats/DistributedSystemStatsDUnitTest.java
@@ -44,10 +44,6 @@ public class DistributedSystemStatsDUnitTest extends ManagementTestBase{
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
- }
-
public void testDistributedSystemStats() throws Exception {
initManagement(true);
@@ -63,7 +59,7 @@ public class DistributedSystemStatsDUnitTest extends ManagementTestBase{
public void run() {
MemberMBean bean = (MemberMBean) managementService.getMemberMXBean();
MemberMBeanBridge bridge = bean.getBridge();
- DiskStoreStats diskStoreStats = new DiskStoreStats(system, "test");
+ DiskStoreStats diskStoreStats = new DiskStoreStats(basicGetSystem(), "test");
bridge.addDiskStoreStats(diskStoreStats);
diskStoreStats.startRead();
diskStoreStats.startWrite();
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/CliUtilDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/CliUtilDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/CliUtilDUnitTest.java
index 192b458..383711e 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/CliUtilDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/CliUtilDUnitTest.java
@@ -77,7 +77,7 @@ public class CliUtilDUnitTest extends CacheTestCase {
private static final long serialVersionUID = 1L;
@Override
- protected final void preTearDownCacheTestCase() throws Exception {
+ public final void preTearDownCacheTestCase() throws Exception {
destroySetup();
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/CliCommandTestBase.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/CliCommandTestBase.java b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/CliCommandTestBase.java
index 664e7a6..2b79128 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/CliCommandTestBase.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/CliCommandTestBase.java
@@ -76,12 +76,8 @@ public class CliCommandTestBase extends CacheTestCase {
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
- }
-
@Override
- protected final void preTearDownCacheTestCase() throws Exception {
+ public final void preTearDownCacheTestCase() throws Exception {
preTearDownCliCommandTestBase();
destroyDefaultSetup();
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/ConfigCommandsDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/ConfigCommandsDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/ConfigCommandsDUnitTest.java
index dca0f78..b65259d 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/ConfigCommandsDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/ConfigCommandsDUnitTest.java
@@ -459,7 +459,7 @@ public class ConfigCommandsDUnitTest extends CliCommandTestBase {
getSystem(localProps);
assertNotNull(getCache());
- assertEquals("error", system.getConfig().getAttribute(DistributionConfig.LOG_LEVEL_NAME));
+ assertEquals("error", basicGetSystem().getConfig().getAttribute(DistributionConfig.LOG_LEVEL_NAME));
return null;
}
});
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/DeployCommandsDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/DeployCommandsDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/DeployCommandsDUnitTest.java
index 9373d0f..b8e9780 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/DeployCommandsDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/DeployCommandsDUnitTest.java
@@ -62,9 +62,7 @@ public class DeployCommandsDUnitTest extends CliCommandTestBase {
@SuppressWarnings("serial")
@Override
- public void setUp() throws Exception {
- super.setUp();
-
+ public final void postSetUp() throws Exception {
this.commandProcessor = new CommandProcessor();
assertFalse(this.commandProcessor.isStopped());
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/GetCommandOnRegionWithCacheLoaderDuringCacheMissDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/GetCommandOnRegionWithCacheLoaderDuringCacheMissDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/GetCommandOnRegionWithCacheLoaderDuringCacheMissDUnitTest.java
index dc580cd..82bd92e 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/GetCommandOnRegionWithCacheLoaderDuringCacheMissDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/GetCommandOnRegionWithCacheLoaderDuringCacheMissDUnitTest.java
@@ -88,9 +88,7 @@ public class GetCommandOnRegionWithCacheLoaderDuringCacheMissDUnitTest extends C
}
@Override
- public void setUp() throws Exception {
- super.setUp();
-
+ public final void postSetUp() throws Exception {
Properties managerDistributedSystemProperties = createDistributedSystemProperties(GEMFIRE_MANAGER_NAME);
HeadlessGfsh gfsh = createDefaultSetup(managerDistributedSystemProperties);
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/ListAndDescribeDiskStoreCommandsDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/ListAndDescribeDiskStoreCommandsDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/ListAndDescribeDiskStoreCommandsDUnitTest.java
index 4f86a55..2fac594 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/ListAndDescribeDiskStoreCommandsDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/ListAndDescribeDiskStoreCommandsDUnitTest.java
@@ -63,8 +63,7 @@ public class ListAndDescribeDiskStoreCommandsDUnitTest extends CliCommandTestBas
}
@Override
- public void setUp() throws Exception {
- super.setUp();
+ public final void postSetUp() throws Exception {
createDefaultSetup(null);
setupGemFire();
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/ListIndexCommandDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/ListIndexCommandDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/ListIndexCommandDUnitTest.java
index c60f33e..1df8d00 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/ListIndexCommandDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/ListIndexCommandDUnitTest.java
@@ -85,8 +85,7 @@ public class ListIndexCommandDUnitTest extends CliCommandTestBase {
}
@Override
- public void setUp() throws Exception {
- super.setUp();
+ public final void postSetUp() throws Exception {
createDefaultSetup(null);
setupGemFire();
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/MemberCommandsDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/MemberCommandsDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/MemberCommandsDUnitTest.java
index 7d6efc5..e7b8442 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/MemberCommandsDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/MemberCommandsDUnitTest.java
@@ -73,15 +73,14 @@ public class MemberCommandsDUnitTest extends CacheTestCase {
}
@Override
- public void setUp() throws Exception {
- super.setUp();
+ public final void postSetUp() throws Exception {
// This test does not require an actual Gfsh connection to work, however when run as part of a suite, prior tests
// may mess up the environment causing this test to fail. Setting this prevents false failures.
CliUtil.isGfshVM = false;
}
@Override
- protected final void postTearDownCacheTestCase() throws Exception {
+ public final void postTearDownCacheTestCase() throws Exception {
disconnectFromDS();
CliUtil.isGfshVM = true;
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/QueueCommandsDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/QueueCommandsDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/QueueCommandsDUnitTest.java
index e6c1e47..343d5eb 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/QueueCommandsDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/QueueCommandsDUnitTest.java
@@ -60,9 +60,9 @@ public class QueueCommandsDUnitTest extends CliCommandTestBase {
super(testName);
}
- public void setUp() throws Exception {
+ @Override
+ public final void preSetUp() throws Exception {
disconnectAllFromDS();
- super.setUp();
}
public void testAsyncEventQueue() throws IOException {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/SharedConfigurationCommandsDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/SharedConfigurationCommandsDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/SharedConfigurationCommandsDUnitTest.java
index 9dc9506..319a21f 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/SharedConfigurationCommandsDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/SharedConfigurationCommandsDUnitTest.java
@@ -333,7 +333,7 @@ public class SharedConfigurationCommandsDUnitTest extends CliCommandTestBase {
}
@Override
- protected final void postTearDownCacheTestCase() throws Exception {
+ public final void postTearDownCacheTestCase() throws Exception {
for (int i = 0; i < 4; i++) {
Host.getHost(0).getVM(i).invoke(SharedConfigurationDUnitTest.locatorCleanup);
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/ShellCommandsDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/ShellCommandsDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/ShellCommandsDUnitTest.java
index 2ff86ba..ee6fcac 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/ShellCommandsDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/ShellCommandsDUnitTest.java
@@ -43,10 +43,8 @@ public class ShellCommandsDUnitTest extends CliCommandTestBase {
super(name);
}
- @Before
@Override
- public void setUp() throws Exception {
- super.setUp();
+ public final void postSetUp() throws Exception {
getDefaultShell();
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/ShowDeadlockDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/ShowDeadlockDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/ShowDeadlockDUnitTest.java
index ba942c6..6bf05b3 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/ShowDeadlockDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/ShowDeadlockDUnitTest.java
@@ -65,15 +65,14 @@ public class ShowDeadlockDUnitTest extends CacheTestCase {
private static final Map<String, String> EMPTY_ENV = Collections.emptyMap();
@Override
- public void setUp() throws Exception {
- super.setUp();
+ public final void postSetUp() throws Exception {
// This test does not require an actual Gfsh connection to work, however when run as part of a suite, prior tests
// may mess up the environment causing this test to fail. Setting this prevents false failures.
CliUtil.isGfshVM = false;
}
@Override
- protected final void preTearDownCacheTestCase() throws Exception {
+ public final void preTearDownCacheTestCase() throws Exception {
Invoke.invokeInEveryVM(new SerializableRunnable() {
private static final long serialVersionUID = 1L;
@@ -188,7 +187,7 @@ public class ShowDeadlockDUnitTest extends CacheTestCase {
} catch (InterruptedException e) {
Assert.fail("interrupted", e);
}
- ResultCollector collector = FunctionService.onMember(system, member).execute(new TestFunction());
+ ResultCollector collector = FunctionService.onMember(basicGetSystem(), member).execute(new TestFunction());
//wait the function to lock the lock on member.
collector.getResult();
lock.unlock();
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/UserCommandsDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/UserCommandsDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/UserCommandsDUnitTest.java
index c7a8f5d..e9d01db 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/UserCommandsDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/UserCommandsDUnitTest.java
@@ -52,13 +52,12 @@ public class UserCommandsDUnitTest extends CliCommandTestBase {
}
@Override
- public void setUp() throws Exception {
- super.setUp();
+ public final void postSetUp() throws Exception {
createUserCommandJarFile();
}
@Override
- protected final void postTearDownCacheTestCase() throws Exception {
+ public final void postTearDownCacheTestCase() throws Exception {
if (this.deleteJarDirectory) {
FileUtil.delete(this.jarDirectory);
} else {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/configuration/SharedConfigurationDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/management/internal/configuration/SharedConfigurationDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/configuration/SharedConfigurationDUnitTest.java
index d583e51..2298e1f 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/management/internal/configuration/SharedConfigurationDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/configuration/SharedConfigurationDUnitTest.java
@@ -435,7 +435,7 @@ public class SharedConfigurationDUnitTest extends CacheTestCase {
}
@Override
- protected final void postTearDownCacheTestCase() throws Exception {
+ public final void postTearDownCacheTestCase() throws Exception {
for (int i=0; i<4; i++) {
Host.getHost(0).getVM(i).invoke(SharedConfigurationDUnitTest.locatorCleanup);
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/pulse/TestClientIdsDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/management/internal/pulse/TestClientIdsDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/pulse/TestClientIdsDUnitTest.java
index 696de8e..a84f477 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/management/internal/pulse/TestClientIdsDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/pulse/TestClientIdsDUnitTest.java
@@ -81,8 +81,8 @@ public class TestClientIdsDUnitTest extends DistributedTestCase {
this.helper = new ManagementTestBase(name);
}
- public void setUp() throws Exception {
- super.setUp();
+ @Override
+ public final void postSetUp() throws Exception {
final Host host = Host.getHost(0);
managingNode = host.getVM(0);
server = host.getVM(1);
@@ -91,7 +91,7 @@ public class TestClientIdsDUnitTest extends DistributedTestCase {
}
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
helper.closeCache(managingNode);
helper.closeCache(server);
helper.closeCache(client);
[03/11] incubator-geode git commit: GEODE-1050: add JUnit 4 versions
of DistributedTestCase and CacheTestCase
Posted by kl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/internal/JUnit4DistributedTestCase.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/internal/JUnit4DistributedTestCase.java b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/internal/JUnit4DistributedTestCase.java
new file mode 100755
index 0000000..809fbd3
--- /dev/null
+++ b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/internal/JUnit4DistributedTestCase.java
@@ -0,0 +1,610 @@
+/*
+ * 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.test.dunit.internal;
+
+import static org.junit.Assert.*;
+
+import java.io.Serializable;
+import java.text.DecimalFormat;
+import java.util.Iterator;
+import java.util.LinkedHashSet;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
+
+import com.gemstone.gemfire.admin.internal.AdminDistributedSystemImpl;
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.hdfs.internal.hoplog.HoplogConfig;
+import com.gemstone.gemfire.cache.query.QueryTestUtils;
+import com.gemstone.gemfire.cache.query.internal.QueryObserverHolder;
+import com.gemstone.gemfire.cache30.ClientServerTestCase;
+import com.gemstone.gemfire.cache30.GlobalLockingDUnitTest;
+import com.gemstone.gemfire.cache30.MultiVMRegionTestCase;
+import com.gemstone.gemfire.cache30.RegionTestCase;
+import com.gemstone.gemfire.distributed.DistributedSystem;
+import com.gemstone.gemfire.distributed.internal.DistributionConfig;
+import com.gemstone.gemfire.distributed.internal.DistributionMessageObserver;
+import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem;
+import com.gemstone.gemfire.internal.SocketCreator;
+import com.gemstone.gemfire.internal.admin.ClientStatsManager;
+import com.gemstone.gemfire.internal.cache.DiskStoreObserver;
+import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
+import com.gemstone.gemfire.internal.cache.HARegion;
+import com.gemstone.gemfire.internal.cache.InitialImageOperation;
+import com.gemstone.gemfire.internal.cache.PartitionedRegion;
+import com.gemstone.gemfire.internal.cache.tier.InternalClientMembership;
+import com.gemstone.gemfire.internal.cache.tier.sockets.CacheServerTestUtil;
+import com.gemstone.gemfire.internal.cache.tier.sockets.ClientProxyMembershipID;
+import com.gemstone.gemfire.internal.cache.xmlcache.CacheCreation;
+import com.gemstone.gemfire.internal.logging.LogService;
+import com.gemstone.gemfire.management.internal.cli.LogWrapper;
+import com.gemstone.gemfire.test.dunit.DistributedTestUtils;
+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.standalone.DUnitLauncher;
+import com.gemstone.gemfire.test.junit.rules.serializable.SerializableTestName;
+import org.apache.logging.log4j.Logger;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Rule;
+
+/**
+ * This class is the base class for all distributed tests using JUnit 4.
+ *
+ * TODO: make this class abstract when JUnit3DistributedTestCase is deleted
+ */
+public class JUnit4DistributedTestCase implements DistributedTestFixture, Serializable {
+
+ private static final Logger logger = LogService.getLogger();
+
+ private static final Set<String> testHistory = new LinkedHashSet<String>();
+
+ /** This VM's connection to the distributed system */
+ private static InternalDistributedSystem system;
+ private static Class lastSystemCreatedInTest;
+ private static Properties lastSystemProperties;
+ private static volatile String testMethodName;
+
+ /** For formatting timing info */
+ private static final DecimalFormat format = new DecimalFormat("###.###");
+
+ private static boolean reconnect = false;
+
+ private static final boolean logPerTest = Boolean.getBoolean("dunitLogPerTest");
+
+ private final DistributedTestFixture distributedTestFixture;
+
+ /**
+ * Constructs a new distributed test. All JUnit 4 test classes need to have a
+ * no-arg constructor.
+ */
+ public JUnit4DistributedTestCase() {
+ this((DistributedTestFixture)null);
+ }
+
+ /**
+ * This constructor should only be used by {@link JUnit3DistributedTestCase}.
+ */
+ protected JUnit4DistributedTestCase(final DistributedTestFixture distributedTestFixture) {
+ if (distributedTestFixture == null) {
+ this.distributedTestFixture = this;
+ } else {
+ this.distributedTestFixture = distributedTestFixture;
+ }
+ }
+
+ @Rule
+ public SerializableTestName testName = new SerializableTestName();
+
+ @BeforeClass
+ public static final void initializeDistributedTestCase() {
+ DUnitLauncher.launchIfNeeded();
+ }
+
+ public final String getName() {
+ if (this.distributedTestFixture != this) {
+ return this.distributedTestFixture.getName();
+ }
+ return this.testName.getMethodName();
+ }
+
+ public final Class<? extends DistributedTestFixture> getTestClass() {
+ return this.distributedTestFixture.getClass();
+ }
+
+ //---------------------------------------------------------------------------
+ // methods for tests
+ //---------------------------------------------------------------------------
+
+ /**
+ * @deprecated Please override {@link #getDistributedSystemProperties()} instead.
+ */
+ @Deprecated
+ public final void setSystem(final Properties props, final DistributedSystem ds) { // TODO: override getDistributedSystemProperties and then delete
+ system = (InternalDistributedSystem)ds;
+ lastSystemProperties = props;
+ lastSystemCreatedInTest = getTestClass(); // used to be getDeclaringClass()
+ }
+
+ /**
+ * Returns this VM's connection to the distributed system. If necessary, the
+ * connection will be lazily created using the given {@code Properties}.
+ *
+ * <p>Do not override this method. Override {@link #getDistributedSystemProperties()}
+ * instead.
+ *
+ * <p>Note: "final" was removed so that WANTestBase can override this method.
+ * This was part of the xd offheap merge.
+ *
+ * @since 3.0
+ */
+ public final InternalDistributedSystem getSystem(final Properties props) {
+ // Setting the default disk store name is now done in setUp
+ if (system == null) {
+ system = InternalDistributedSystem.getAnyInstance();
+ }
+ if (system == null || !system.isConnected()) {
+ // Figure out our distributed system properties
+ Properties p = DistributedTestUtils.getAllDistributedSystemProperties(props);
+ lastSystemCreatedInTest = getTestClass(); // used to be getDeclaringClass()
+ if (logPerTest) {
+ String testMethod = getTestMethodName();
+ String testName = lastSystemCreatedInTest.getName() + '-' + testMethod;
+ String oldLogFile = p.getProperty(DistributionConfig.LOG_FILE_NAME);
+ p.put(DistributionConfig.LOG_FILE_NAME,
+ oldLogFile.replace("system.log", testName+".log"));
+ String oldStatFile = p.getProperty(DistributionConfig.STATISTIC_ARCHIVE_FILE_NAME);
+ p.put(DistributionConfig.STATISTIC_ARCHIVE_FILE_NAME,
+ oldStatFile.replace("statArchive.gfs", testName+".gfs"));
+ }
+ system = (InternalDistributedSystem)DistributedSystem.connect(p);
+ lastSystemProperties = p;
+ } else {
+ boolean needNewSystem = false;
+ if(!getTestClass().equals(lastSystemCreatedInTest)) { // used to be getDeclaringClass()
+ Properties newProps = DistributedTestUtils.getAllDistributedSystemProperties(props);
+ needNewSystem = !newProps.equals(lastSystemProperties);
+ if(needNewSystem) {
+ LogWriterUtils.getLogWriter().info(
+ "Test class has changed and the new DS properties are not an exact match. "
+ + "Forcing DS disconnect. Old props = "
+ + lastSystemProperties + "new props=" + newProps);
+ }
+ } else {
+ Properties activeProps = system.getProperties();
+ for (Iterator iter = props.entrySet().iterator();
+ iter.hasNext(); ) {
+ Map.Entry entry = (Map.Entry) iter.next();
+ String key = (String) entry.getKey();
+ String value = (String) entry.getValue();
+ if (!value.equals(activeProps.getProperty(key))) {
+ needNewSystem = true;
+ LogWriterUtils.getLogWriter().info("Forcing DS disconnect. For property " + key
+ + " old value = " + activeProps.getProperty(key)
+ + " new value = " + value);
+ break;
+ }
+ }
+ }
+ if(needNewSystem) {
+ // the current system does not meet our needs to disconnect and
+ // call recursively to get a new system.
+ LogWriterUtils.getLogWriter().info("Disconnecting from current DS in order to make a new one");
+ disconnectFromDS();
+ getSystem(props);
+ }
+ }
+ return system;
+ }
+
+ /**
+ * Returns this VM's connection to the distributed system. If necessary, the
+ * connection will be lazily created using the {@code Properties} returned by
+ * {@link #getDistributedSystemProperties()}.
+ *
+ * <p>Do not override this method. Override {@link #getDistributedSystemProperties()}
+ * instead.
+ *
+ * @see #getSystem(Properties)
+ *
+ * @since 3.0
+ */
+ public final InternalDistributedSystem getSystem() {
+ return getSystem(getDistributedSystemProperties());
+ }
+
+ public final InternalDistributedSystem basicGetSystem() {
+ return system;
+ }
+
+ public final void nullSystem() { // TODO: delete
+ system = null;
+ }
+
+ public static final InternalDistributedSystem getSystemStatic() {
+ return system;
+ }
+
+ /**
+ * Returns a loner distributed system that isn't connected to other vms.
+ *
+ * @since 6.5
+ */
+ public final InternalDistributedSystem getLonerSystem() {
+ Properties props = getDistributedSystemProperties();
+ props.put(DistributionConfig.MCAST_PORT_NAME, "0");
+ props.put(DistributionConfig.LOCATORS_NAME, "");
+ return getSystem(props);
+ }
+
+ /**
+ * Returns whether or this VM is connected to a {@link DistributedSystem}.
+ */
+ public final boolean isConnectedToDS() {
+ return system != null && system.isConnected();
+ }
+
+ /**
+ * Returns a {@code Properties} object used to configure a connection to a
+ * {@link DistributedSystem}. Unless overridden, this method will return an
+ * empty {@code Properties} object.
+ *
+ * <p>Override this as needed. Default implementation returns empty {@code Properties}.
+ *
+ * @since 3.0
+ */
+ @Override
+ public Properties getDistributedSystemProperties() {
+ if (this.distributedTestFixture != this) {
+ return this.distributedTestFixture.getDistributedSystemProperties();
+ }
+ return defaultGetDistributedSystemProperties();
+ }
+
+ final Properties defaultGetDistributedSystemProperties() {
+ return new Properties();
+ }
+
+ public static final void disconnectAllFromDS() {
+ disconnectFromDS();
+ Invoke.invokeInEveryVM(()->disconnectFromDS());
+ }
+
+ /**
+ * Disconnects this VM from the distributed system
+ */
+ public static final void disconnectFromDS() {
+ //setTestMethodName(null);
+ GemFireCacheImpl.testCacheXml = null;
+ if (system != null) {
+ system.disconnect();
+ system = null;
+ }
+
+ for (;;) {
+ DistributedSystem ds = InternalDistributedSystem.getConnectedInstance();
+ if (ds == null) {
+ break;
+ }
+ try {
+ ds.disconnect();
+ } catch (Exception e) {
+ // ignore
+ }
+ }
+
+ AdminDistributedSystemImpl ads = AdminDistributedSystemImpl.getConnectedInstance();
+ if (ads != null) {// && ads.isConnected()) {
+ ads.disconnect();
+ }
+ }
+
+ //---------------------------------------------------------------------------
+ // name methods
+ //---------------------------------------------------------------------------
+
+ public static final String getTestMethodName() {
+ return testMethodName;
+ }
+
+ private static final void setTestMethodName(final String testMethodName) {
+ JUnit4DistributedTestCase.testMethodName = testMethodName;
+ }
+
+ /**
+ * Returns a unique name for this test method. It is based on the
+ * name of the class as well as the name of the method.
+ */
+ public final String getUniqueName() {
+ return getTestClass().getSimpleName() + "_" + getName();
+ }
+
+ //---------------------------------------------------------------------------
+ // setup methods
+ //---------------------------------------------------------------------------
+
+ /**
+ * Sets up the DistributedTestCase.
+ *
+ * <p>Do not override this method. Override {@link #preSetUp()} with work that
+ * needs to occur before setUp() or override {@link #postSetUp()} with work
+ * that needs to occur after setUp().
+ */
+ @Before
+ public final void setUp() throws Exception {
+ preSetUp();
+ setUpDistributedTestCase();
+ postSetUp();
+ }
+
+ /**
+ * Sets up DistributedTest in controller and remote VMs. This includes the
+ * defining the test name, setting the default disk store name, logging the
+ * test history, and capturing a creation stack for detecting the source of
+ * incompatible DistributedSystem connections.
+ *
+ * <p>Do not override this method.
+ */
+ private final void setUpDistributedTestCase() {
+ final String className = getTestClass().getCanonicalName();
+ final String methodName = getName();
+
+ logTestHistory();
+
+ setUpVM(methodName, getDefaultDiskStoreName(0, -1, className, methodName));
+
+ for (int hostIndex = 0; hostIndex < Host.getHostCount(); hostIndex++) {
+ Host host = Host.getHost(hostIndex);
+ for (int vmIndex = 0; vmIndex < host.getVMCount(); vmIndex++) {
+ final String vmDefaultDiskStoreName = getDefaultDiskStoreName(hostIndex, vmIndex, className, methodName);
+ host.getVM(vmIndex).invoke(()->setUpVM(methodName, vmDefaultDiskStoreName));
+ }
+ }
+
+ logTestStart();
+ }
+
+ /**
+ * {@code preSetUp()} is invoked before {@link #setUpDistributedTestCase()}.
+ *
+ * <p>Override this as needed. Default implementation is empty.
+ */
+ @Override
+ public void preSetUp() throws Exception {
+ if (this.distributedTestFixture != this) {
+ this.distributedTestFixture.preSetUp();
+ }
+ }
+
+ /**
+ * {@code postSetUp()} is invoked after {@link #setUpDistributedTestCase()}.
+ *
+ * <p>Override this as needed. Default implementation is empty.
+ */
+ @Override
+ public void postSetUp() throws Exception {
+ if (this.distributedTestFixture != this) {
+ this.distributedTestFixture.postSetUp();
+ }
+ }
+
+ private static final String getDefaultDiskStoreName(final int hostIndex, final int vmIndex, final String className, final String methodName) {
+ return "DiskStore-" + String.valueOf(hostIndex) + "-" + String.valueOf(vmIndex) + "-" + className + "." + methodName; // used to be getDeclaringClass()
+ }
+
+ private static final void setUpVM(final String methodName, final String defaultDiskStoreName) {
+ assertNotNull("methodName must not be null", methodName);
+ assertNotNull("defaultDiskStoreName must not be null", defaultDiskStoreName);
+ setTestMethodName(methodName);
+ GemFireCacheImpl.setDefaultDiskStoreName(defaultDiskStoreName);
+ System.setProperty(HoplogConfig.ALLOW_LOCAL_HDFS_PROP, "true");
+ setUpCreationStackGenerator();
+ }
+
+ private final void logTestStart() {
+ System.out.println("\n\n[setup] START TEST " + getTestClass().getSimpleName()+"."+testMethodName+"\n\n");
+ }
+
+ private static final void setUpCreationStackGenerator() {
+ // the following is moved from InternalDistributedSystem to fix #51058
+ InternalDistributedSystem.TEST_CREATION_STACK_GENERATOR.set(
+ new InternalDistributedSystem.CreationStackGenerator() {
+ @Override
+ public Throwable generateCreationStack(final DistributionConfig config) {
+ final StringBuilder sb = new StringBuilder();
+ final String[] validAttributeNames = config.getAttributeNames();
+ for (int i = 0; i < validAttributeNames.length; i++) {
+ final String attName = validAttributeNames[i];
+ final Object actualAtt = config.getAttributeObject(attName);
+ String actualAttStr = actualAtt.toString();
+ sb.append(" ");
+ sb.append(attName);
+ sb.append("=\"");
+ if (actualAtt.getClass().isArray()) {
+ actualAttStr = InternalDistributedSystem.arrayToString(actualAtt);
+ }
+ sb.append(actualAttStr);
+ sb.append("\"");
+ sb.append("\n");
+ }
+ return new Throwable("Creating distributed system with the following configuration:\n" + sb.toString());
+ }
+ });
+ }
+
+ /**
+ * Write a message to the log about what tests have ran previously. This
+ * makes it easier to figure out if a previous test may have caused problems
+ */
+ private final void logTestHistory() {
+ String classname = getTestClass().getSimpleName();
+ testHistory.add(classname);
+ System.out.println("Previously run tests: " + testHistory);
+ }
+
+ //---------------------------------------------------------------------------
+ // teardown methods
+ //---------------------------------------------------------------------------
+
+ /**
+ * Tears down the DistributedTestCase.
+ *
+ * <p>Do not override this method. Override {@link #preTearDown()} with work that
+ * needs to occur before tearDown() or override {@link #postTearDown()} with work
+ * that needs to occur after tearDown().
+ */
+ @After
+ public final void tearDown() throws Exception {
+ try {
+ preTearDownAssertions();
+ } finally {
+ preTearDown();
+ tearDownDistributedTestCase();
+ postTearDown();
+ }
+ postTearDownAssertions();
+ }
+
+ private final void tearDownDistributedTestCase() throws Exception {
+ Invoke.invokeInEveryVM(()->tearDownCreationStackGenerator());
+ if (logPerTest) {
+ disconnectAllFromDS();
+ }
+ cleanupAllVms();
+ if (!getDistributedSystemProperties().isEmpty()) {
+ disconnectAllFromDS();
+ }
+ }
+
+ /**
+ * {@code preTearDown()} is invoked before {@link #tearDownDistributedTestCase()}.
+ *
+ * <p>Override this as needed. Default implementation is empty.
+ */
+ @Override
+ public void preTearDown() throws Exception {
+ if (this.distributedTestFixture != this) {
+ this.distributedTestFixture.preTearDown();
+ }
+ }
+
+ /**
+ * {@code postTearDown()} is invoked after {@link #tearDownDistributedTestCase()}.
+ *
+ * <p>Override this as needed. Default implementation is empty.
+ */
+ @Override
+ public void postTearDown() throws Exception {
+ if (this.distributedTestFixture != this) {
+ this.distributedTestFixture.postTearDown();
+ }
+ }
+
+ @Override
+ public void preTearDownAssertions() throws Exception {
+ if (this.distributedTestFixture != this) {
+ this.distributedTestFixture.preTearDownAssertions();
+ }
+ }
+
+ @Override
+ public void postTearDownAssertions() throws Exception {
+ if (this.distributedTestFixture != this) {
+ this.distributedTestFixture.postTearDownAssertions();
+ }
+ }
+
+ private static final void cleanupAllVms() {
+ tearDownVM();
+ Invoke.invokeInEveryVM(()->tearDownVM());
+ Invoke.invokeInLocator(()->{
+ DistributionMessageObserver.setInstance(null);
+ DistributedTestUtils.unregisterInstantiatorsInThisVM();
+ });
+ DUnitLauncher.closeAndCheckForSuspects();
+ }
+
+ private static final void tearDownVM() {
+ closeCache();
+
+ // keep alphabetized to detect duplicate lines
+ CacheCreation.clearThreadLocals();
+ CacheServerTestUtil.clearCacheReference();
+ ClientProxyMembershipID.system = null;
+ ClientServerTestCase.AUTO_LOAD_BALANCE = false;
+ ClientStatsManager.cleanupForTests();
+ DiskStoreObserver.setInstance(null);
+ DistributedTestUtils.unregisterInstantiatorsInThisVM();
+ DistributionMessageObserver.setInstance(null);
+ GlobalLockingDUnitTest.region_testBug32356 = null;
+ InitialImageOperation.slowImageProcessing = 0;
+ InternalClientMembership.unregisterAllListeners();
+ LogWrapper.close();
+ MultiVMRegionTestCase.CCRegion = null;
+ QueryObserverHolder.reset();
+ QueryTestUtils.setCache(null);
+ RegionTestCase.preSnapshotRegion = null;
+ SocketCreator.resetHostNameCache();
+ SocketCreator.resolve_dns = true;
+
+ // clear system properties -- keep alphabetized
+ System.clearProperty("gemfire.log-level");
+ System.clearProperty(HoplogConfig.ALLOW_LOCAL_HDFS_PROP);
+ System.clearProperty("jgroups.resolve_dns");
+
+ if (InternalDistributedSystem.systemAttemptingReconnect != null) {
+ InternalDistributedSystem.systemAttemptingReconnect.stopReconnecting();
+ }
+
+ IgnoredException.removeAllExpectedExceptions();
+ }
+
+ private static final void closeCache() { // TODO: this should move to CacheTestCase
+ GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
+ if (cache != null && !cache.isClosed()) {
+ destroyRegions(cache);
+ cache.close();
+ }
+ }
+
+ protected static final void destroyRegions(final Cache cache) { // TODO: this should move to CacheTestCase
+ if (cache != null && !cache.isClosed()) {
+ // try to destroy the root regions first so that we clean up any persistent files.
+ for (Iterator itr = cache.rootRegions().iterator(); itr.hasNext();) {
+ Region root = (Region)itr.next();
+ String regionFullPath = root == null ? null : root.getFullPath();
+ // for colocated regions you can't locally destroy a partitioned region.
+ if(root.isDestroyed() || root instanceof HARegion || root instanceof PartitionedRegion) {
+ continue;
+ }
+ try {
+ root.localDestroyRegion("teardown");
+ } catch (Throwable t) {
+ logger.error("Failure during tearDown destroyRegions for " + regionFullPath, t);
+ }
+ }
+ }
+ }
+
+ private static final void tearDownCreationStackGenerator() {
+ InternalDistributedSystem.TEST_CREATION_STACK_GENERATOR.set(InternalDistributedSystem.DEFAULT_CREATION_STACK_GENERATOR);
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/internal/tests/JUnit3BasicDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/internal/tests/JUnit3BasicDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/internal/tests/JUnit3BasicDUnitTest.java
new file mode 100644
index 0000000..5130b5c
--- /dev/null
+++ b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/internal/tests/JUnit3BasicDUnitTest.java
@@ -0,0 +1,189 @@
+/*
+ * 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.test.dunit.internal.tests;
+
+import static com.gemstone.gemfire.test.dunit.Invoke.*;
+
+import java.util.Properties;
+
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.AsyncInvocation;
+import com.gemstone.gemfire.test.dunit.DUnitEnv;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.RMIException;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.internal.JUnit3DistributedTestCase;
+
+/**
+ * This class tests the basic functionality of the distributed unit
+ * test framework.
+ */
+public class JUnit3BasicDUnitTest extends JUnit3DistributedTestCase {
+
+ private static Properties bindings;
+
+ public JUnit3BasicDUnitTest(String name) {
+ super(name);
+ }
+
+ @Override
+ public void postSetUp() throws Exception {
+ bindings = new Properties();
+ invokeInEveryVM(() -> bindings = new Properties());
+ }
+
+ @Override
+ public void postTearDown() throws Exception {
+ bindings = null;
+ invokeInEveryVM(() -> bindings = null);
+ }
+
+ public void testPreconditions() {
+ invokeInEveryVM(() -> assertNotNull("getUniqueName() must not return null", getUniqueName()));
+ invokeInEveryVM(() -> assertNotNull("bindings must not be null", bindings));
+ }
+
+ /**
+ * Tests how the Hydra framework handles an error
+ */
+ public void ignore_testDontCatchRemoteException() throws Exception {
+ Host host = Host.getHost(0);
+ VM vm = host.getVM(0);
+ vm.invoke(() -> remoteThrowException());
+ }
+
+ public void testRemoteInvocationWithException() throws Exception {
+ Host host = Host.getHost(0);
+ VM vm = host.getVM(0);
+ try {
+ vm.invoke(() -> remoteThrowException());
+ fail("Should have thrown a BasicTestException");
+
+ } catch (RMIException ex) {
+ assertTrue(ex.getCause() instanceof BasicTestException);
+ }
+ }
+
+ public void testInvokeWithLambda() throws Exception {
+ Host host = Host.getHost(0);
+ VM vm0 = host.getVM(0);
+ VM vm1 = host.getVM(1);
+
+ int vm0Num = vm0.invoke(() -> DUnitEnv.get().getVMID());
+ int vm1Num = vm1.invoke(() -> DUnitEnv.get().getVMID());
+
+ assertEquals(0, vm0Num);
+ assertEquals(1, vm1Num);
+ }
+
+ public void testInvokeLambdaAsync() throws Throwable {
+ Host host = Host.getHost(0);
+ VM vm0 = host.getVM(0);
+
+ AsyncInvocation<Integer> async0 = vm0.invokeAsync(() -> DUnitEnv.get().getVMID());
+ int vm0num = async0.getResult();
+
+ assertEquals(0, vm0num);
+ }
+
+ public void testInvokeWithNamedLambda() {
+ Host host = Host.getHost(0);
+ VM vm0 = host.getVM(0);
+ VM vm1 = host.getVM(1);
+
+ int vm0Num = vm0.invoke("getVMID", () -> DUnitEnv.get().getVMID());
+ int vm1Num = vm1.invoke("getVMID", () -> DUnitEnv.get().getVMID());
+
+ assertEquals(0, vm0Num);
+ assertEquals(1, vm1Num);
+ }
+
+ public void testInvokeNamedLambdaAsync() throws Throwable {
+ Host host = Host.getHost(0);
+ VM vm0 = host.getVM(0);
+
+ AsyncInvocation<Integer> async0 = vm0.invokeAsync("getVMID", () -> DUnitEnv.get().getVMID());
+ int vm0num = async0.getResult();
+
+ assertEquals(0, vm0num);
+ }
+
+ // Test was never implemented
+ public void ignore_testRemoteInvocationBoolean() {
+ }
+
+ public void testRemoteInvokeAsync() throws Exception {
+ Host host = Host.getHost(0);
+ VM vm = host.getVM(0);
+ String name = getUniqueName();
+ String value = "Hello";
+
+ AsyncInvocation ai = vm.invokeAsync(() -> remoteBind(name, value));
+ ai.join();
+ // TODO shouldn't we call fail() here?
+ if (ai.exceptionOccurred()) {
+ Assert.fail("remoteBind failed", ai.getException());
+ }
+
+ ai = vm.invokeAsync(() -> remoteValidateBind(name, value ));
+ ai.join();
+ if (ai.exceptionOccurred()) {
+ Assert.fail("remoteValidateBind failed", ai.getException());
+ }
+ }
+
+ public void testRemoteInvokeAsyncWithException() throws Exception {
+ Host host = Host.getHost(0);
+ VM vm = host.getVM(0);
+
+ AsyncInvocation ai = vm.invokeAsync(() -> remoteThrowException());
+ ai.join();
+ assertTrue(ai.exceptionOccurred());
+ Throwable ex = ai.getException();
+ assertTrue(ex instanceof BasicTestException);
+ }
+
+ /**
+ * Accessed via reflection. DO NOT REMOVE
+ */
+ private static void remoteThrowException() {
+ String s = "Test exception. Please ignore.";
+ throw new BasicTestException(s);
+ }
+
+ private static void remoteBind(String name, String value) {
+ assertNotNull("name must not be null", name);
+ assertNotNull("value must not be null", value);
+ assertNotNull("bindings must not be null", bindings);
+
+ new JUnit3BasicDUnitTest("").getSystem(); // forces connection
+ bindings.setProperty(name, value);
+ }
+
+ private static void remoteValidateBind(String name, String expected) {
+ assertEquals(expected, bindings.getProperty(name));
+ }
+
+ private static class BasicTestException extends RuntimeException {
+ BasicTestException() {
+ this("Test exception. Please ignore.");
+ }
+ BasicTestException(String s) {
+ super(s);
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/internal/tests/JUnit3GetDefaultDiskStoreNameDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/internal/tests/JUnit3GetDefaultDiskStoreNameDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/internal/tests/JUnit3GetDefaultDiskStoreNameDUnitTest.java
new file mode 100644
index 0000000..e89f66b
--- /dev/null
+++ b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/internal/tests/JUnit3GetDefaultDiskStoreNameDUnitTest.java
@@ -0,0 +1,66 @@
+/*
+ * 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.test.dunit.internal.tests;
+
+import static org.assertj.core.api.Assertions.*;
+
+import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.internal.JUnit3DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
+import org.junit.experimental.categories.Category;
+
+@SuppressWarnings("serial")
+@Category(DistributedTest.class)
+public class JUnit3GetDefaultDiskStoreNameDUnitTest extends JUnit3DistributedTestCase {
+
+ public JUnit3GetDefaultDiskStoreNameDUnitTest(final String name) {
+ super(name);
+ }
+
+ public void testGetTestMethodName() {
+ String expected = createDefaultDiskStoreName(0, -1, "testGetTestMethodName");
+ assertGetDefaultDiskStoreName(expected);
+ }
+
+ public void testGetTestMethodNameChanges() {
+ String expected = createDefaultDiskStoreName(0, -1, "testGetTestMethodNameChanges");
+ assertGetDefaultDiskStoreName(expected);
+ }
+
+ public void testGetTestMethodNameInAllVMs() {
+ String expected = createDefaultDiskStoreName(0, -1, "testGetTestMethodNameInAllVMs");
+ assertGetDefaultDiskStoreName(expected);
+
+ for (int vmIndex = 0; vmIndex < Host.getHost(0).getVMCount(); vmIndex++) {
+ String expectedInVM = createDefaultDiskStoreName(0, vmIndex, "testGetTestMethodNameInAllVMs");
+ Host.getHost(0).getVM(vmIndex).invoke(()->assertGetDefaultDiskStoreName(expectedInVM));
+ }
+ }
+
+ private void assertGetDefaultDiskStoreName(final String expected) {
+ assertThat(getDefaultDiskStoreName()).isEqualTo(expected);
+ }
+
+ private String createDefaultDiskStoreName(final int hostIndex, final int vmIndex, final String methodName) {
+ return "DiskStore-" + hostIndex + "-" + vmIndex + "-" + getClass().getCanonicalName() + "." + methodName;
+ }
+
+ private String getDefaultDiskStoreName() {
+ return GemFireCacheImpl.DEFAULT_DS_NAME; // TODO: not thread safe
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/internal/tests/JUnit3GetTestMethodNameDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/internal/tests/JUnit3GetTestMethodNameDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/internal/tests/JUnit3GetTestMethodNameDUnitTest.java
new file mode 100644
index 0000000..c77843d
--- /dev/null
+++ b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/internal/tests/JUnit3GetTestMethodNameDUnitTest.java
@@ -0,0 +1,53 @@
+/*
+ * 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.test.dunit.internal.tests;
+
+import static org.assertj.core.api.Assertions.*;
+
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.internal.JUnit3DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
+import org.junit.experimental.categories.Category;
+
+@SuppressWarnings("serial")
+@Category(DistributedTest.class)
+public class JUnit3GetTestMethodNameDUnitTest extends JUnit3DistributedTestCase {
+
+ public JUnit3GetTestMethodNameDUnitTest(final String name) {
+ super(name);
+ }
+
+ public void testGetTestMethodName() {
+ assertGetTestMethodName("testGetTestMethodName");
+ }
+
+ public void testGetTestMethodNameChanges() {
+ assertGetTestMethodName("testGetTestMethodNameChanges");
+ }
+
+ public void testGetTestMethodNameInAllVMs() {
+ assertGetTestMethodName("testGetTestMethodNameInAllVMs");
+
+ for (int vmIndex = 0; vmIndex < Host.getHost(0).getVMCount(); vmIndex++) {
+ Host.getHost(0).getVM(vmIndex).invoke(()->assertGetTestMethodName("testGetTestMethodNameInAllVMs"));
+ }
+ }
+
+ private void assertGetTestMethodName(final String expected) {
+ assertThat(getTestMethodName()).isEqualTo(expected);
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/internal/tests/JUnit3VMDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/internal/tests/JUnit3VMDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/internal/tests/JUnit3VMDUnitTest.java
new file mode 100644
index 0000000..ac2ed7e
--- /dev/null
+++ b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/internal/tests/JUnit3VMDUnitTest.java
@@ -0,0 +1,192 @@
+/*
+ * 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.test.dunit.internal.tests;
+
+import java.io.Serializable;
+import java.util.concurrent.atomic.AtomicInteger;
+
+import com.gemstone.gemfire.test.dunit.AsyncInvocation;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.RMIException;
+import com.gemstone.gemfire.test.dunit.SerializableRunnableIF;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.internal.JUnit3DistributedTestCase;
+
+/**
+ * This class tests the functionality of the {@link VM} class.
+ */
+public class JUnit3VMDUnitTest extends JUnit3DistributedTestCase {
+
+ private static final AtomicInteger COUNTER = new AtomicInteger();
+ private static final boolean BOOLEAN_VALUE = true;
+ private static final byte BYTE_VALUE = (byte) 40;
+ private static final long LONG_VALUE = 42L;
+ private static final String STRING_VALUE = "BLAH BLAH BLAH";
+
+ public JUnit3VMDUnitTest(String name) {
+ super(name);
+ }
+
+ public void testInvokeStaticBoolean() {
+ Host host = Host.getHost(0);
+ VM vm = host.getVM(0);
+ assertEquals(BOOLEAN_VALUE, (boolean) vm.invoke(() -> remoteBooleanMethod()));
+ }
+
+ public void testInvokeStaticByte() {
+ Host host = Host.getHost(0);
+ VM vm = host.getVM(0);
+ assertEquals(BYTE_VALUE, (byte) vm.invoke(() -> remoteByteMethod()));
+ }
+
+ public void testInvokeStaticLong() {
+ Host host = Host.getHost(0);
+ VM vm = host.getVM(0);
+ assertEquals(LONG_VALUE, (long) vm.invoke(() -> remoteLongMethod()));
+ }
+
+ public void testInvokeInstance() {
+ Host host = Host.getHost(0);
+ VM vm = host.getVM(0);
+ assertEquals(STRING_VALUE, vm.invoke(new ClassWithString(), "getString"));
+ }
+
+ public void testInvokeRunnableWithException() {
+ Host host = Host.getHost(0);
+ VM vm = host.getVM(0);
+ try {
+ vm.invoke(new InvokeRunnable());
+ fail("Should have thrown a BasicTestException");
+ } catch (RMIException ex) {
+ assertTrue(ex.getCause() instanceof BasicTestException);
+ }
+ }
+
+ public void testReturnValue() throws Exception {
+ final Host host = Host.getHost(0);
+ final VM vm = host.getVM(0);
+ // Assert class static invocation works
+ AsyncInvocation a1 = vm.invokeAsync(() -> getAndIncStaticCount());
+ a1.join();
+ assertEquals(new Integer(0), a1.getReturnValue());
+ // Assert class static invocation with args works
+ a1 = vm.invokeAsync(() -> incrementStaticCount(new Integer(2)));
+ a1.join();
+ assertEquals(new Integer(3), a1.getReturnValue());
+ // Assert that previous values are not returned when invoking method w/ no return val
+ a1 = vm.invokeAsync(() -> incStaticCount());
+ a1.join();
+ assertNull(a1.getReturnValue());
+ // Assert that previous null returns are over-written
+ a1 = vm.invokeAsync(() -> getAndIncStaticCount());
+ a1.join();
+ assertEquals(new Integer(4), a1.getReturnValue());
+
+ // Assert object method invocation works with zero arg method
+ final VMTestObject o = new VMTestObject(0);
+ a1 = vm.invokeAsync(o, "incrementAndGet", new Object[] {});
+ a1.join();
+ assertEquals(new Integer(1), a1.getReturnValue());
+ // Assert object method invocation works with no return
+ a1 = vm.invokeAsync(o, "set", new Object[] {new Integer(3)});
+ a1.join();
+ assertNull(a1.getReturnValue());
+ }
+
+ private static Integer getAndIncStaticCount() {
+ return new Integer(COUNTER.getAndIncrement());
+ }
+
+ private static Integer incrementStaticCount(Integer inc) {
+ return new Integer(COUNTER.addAndGet(inc.intValue()));
+ }
+
+ private static void incStaticCount() {
+ COUNTER.incrementAndGet();
+ }
+
+ /**
+ * Accessed via reflection. DO NOT REMOVE
+ */
+ private static byte remoteByteMethod() {
+ return BYTE_VALUE;
+ }
+
+ /**
+ * Accessed via reflection. DO NOT REMOVE
+ */
+ private static boolean remoteBooleanMethod() {
+ return BOOLEAN_VALUE;
+ }
+
+ /**
+ * Accessed via reflection. DO NOT REMOVE
+ */
+ private static long remoteLongMethod() {
+ return LONG_VALUE;
+ }
+
+ private static class ClassWithLong implements Serializable {
+ public long getLong() {
+ return LONG_VALUE;
+ }
+ }
+
+ private static class ClassWithByte implements Serializable {
+ public byte getByte() {
+ return BYTE_VALUE;
+ }
+ }
+
+ private static class InvokeRunnable implements SerializableRunnableIF {
+ public void run() {
+ throw new BasicTestException();
+ }
+ }
+
+ private static class ClassWithString implements Serializable {
+ public String getString() {
+ return STRING_VALUE;
+ }
+ }
+
+ private static class BasicTestException extends RuntimeException {
+ BasicTestException() {
+ this("Test exception. Please ignore.");
+ }
+ BasicTestException(String s) {
+ super(s);
+ }
+ }
+
+ private static class VMTestObject implements Serializable {
+ private static final long serialVersionUID = 1L;
+ private final AtomicInteger val;
+ public VMTestObject(int init) {
+ this.val = new AtomicInteger(init);
+ }
+ public Integer get() {
+ return new Integer(this.val.get());
+ }
+ public Integer incrementAndGet() {
+ return new Integer(this.val.incrementAndGet());
+ }
+ public void set(Integer newVal) {
+ this.val.set(newVal.intValue());
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/internal/tests/JUnit4BasicDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/internal/tests/JUnit4BasicDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/internal/tests/JUnit4BasicDUnitTest.java
new file mode 100644
index 0000000..5cac3ba
--- /dev/null
+++ b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/internal/tests/JUnit4BasicDUnitTest.java
@@ -0,0 +1,202 @@
+/*
+ * 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.test.dunit.internal.tests;
+
+import static com.gemstone.gemfire.test.dunit.Assert.*;
+import static com.gemstone.gemfire.test.dunit.Invoke.*;
+
+import java.util.Properties;
+
+import com.gemstone.gemfire.test.dunit.AsyncInvocation;
+import com.gemstone.gemfire.test.dunit.DUnitEnv;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.RMIException;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+/**
+ * This class tests the basic functionality of the distributed unit
+ * test framework.
+ */
+@Category(DistributedTest.class)
+public class JUnit4BasicDUnitTest extends JUnit4DistributedTestCase {
+
+ private static Properties bindings;
+
+ @BeforeClass
+ public static void setUpJUnit4BasicDUnitTest() throws Exception {
+ invokeInEveryVM(() -> bindings = new Properties());
+ }
+
+ @AfterClass
+ public static void tearDownJUnit4BasicDUnitTest() {
+ invokeInEveryVM(() -> bindings = null);
+ }
+
+ @Test
+ public void testPreconditions() {
+ invokeInEveryVM(() -> assertNotNull("getUniqueName() must not return null", getUniqueName()));
+ invokeInEveryVM(() -> assertNotNull("bindings must not be null", bindings));
+ }
+
+ /**
+ * Tests how the Hydra framework handles an error
+ */
+ @Ignore
+ @Test
+ public void testDontCatchRemoteException() throws Exception {
+ Host host = Host.getHost(0);
+ VM vm = host.getVM(0);
+ vm.invoke(() -> remoteThrowException());
+ }
+
+ @Test
+ public void testRemoteInvocationWithException() throws Exception {
+ Host host = Host.getHost(0);
+ VM vm = host.getVM(0);
+ try {
+ vm.invoke(() -> remoteThrowException());
+ fail("Should have thrown a BasicTestException");
+
+ } catch (RMIException ex) {
+ assertTrue(ex.getCause() instanceof BasicTestException);
+ }
+ }
+
+ @Test
+ public void testInvokeWithLambda() throws Exception {
+ Host host = Host.getHost(0);
+ VM vm0 = host.getVM(0);
+ VM vm1 = host.getVM(1);
+
+ int vm0Num = vm0.invoke(() -> DUnitEnv.get().getVMID());
+ int vm1Num = vm1.invoke(() -> DUnitEnv.get().getVMID());
+
+ assertEquals(0, vm0Num);
+ assertEquals(1, vm1Num);
+ }
+
+ @Test
+ public void testInvokeLambdaAsync() throws Throwable {
+ Host host = Host.getHost(0);
+ VM vm0 = host.getVM(0);
+
+ AsyncInvocation<Integer> async0 = vm0.invokeAsync(() -> DUnitEnv.get().getVMID());
+ int vm0num = async0.getResult();
+
+ assertEquals(0, vm0num);
+ }
+
+ @Test
+ public void testInvokeWithNamedLambda() {
+ Host host = Host.getHost(0);
+ VM vm0 = host.getVM(0);
+ VM vm1 = host.getVM(1);
+
+ int vm0Num = vm0.invoke("getVMID", () -> DUnitEnv.get().getVMID());
+ int vm1Num = vm1.invoke("getVMID", () -> DUnitEnv.get().getVMID());
+
+ assertEquals(0, vm0Num);
+ assertEquals(1, vm1Num);
+ }
+
+ @Test
+ public void testInvokeNamedLambdaAsync() throws Throwable {
+ Host host = Host.getHost(0);
+ VM vm0 = host.getVM(0);
+
+ AsyncInvocation<Integer> async0 = vm0.invokeAsync("getVMID", () -> DUnitEnv.get().getVMID());
+ int vm0num = async0.getResult();
+
+ assertEquals(0, vm0num);
+ }
+
+ @Ignore("Test was never implemented")
+ @Test
+ public void testRemoteInvocationBoolean() {
+ }
+
+ @Test
+ public void testRemoteInvokeAsync() throws Exception {
+ Host host = Host.getHost(0);
+ VM vm = host.getVM(0);
+ String name = this.getUniqueName();
+ String value = "Hello";
+
+ AsyncInvocation ai =
+ vm.invokeAsync(() -> this.remoteBind( name, value ));
+ ai.join();
+ // TODO shouldn't we call fail() here?
+ if (ai.exceptionOccurred()) {
+ fail("remoteBind failed", ai.getException());
+ }
+
+ ai = vm.invokeAsync(() -> this.remoteValidateBind(name, value ));
+ ai.join();
+ if (ai.exceptionOccurred()) {
+ fail("remoteValidateBind failed", ai.getException());
+ }
+ }
+
+ @Test
+ public void testRemoteInvokeAsyncWithException() throws Exception {
+ Host host = Host.getHost(0);
+ VM vm = host.getVM(0);
+
+ AsyncInvocation ai = vm.invokeAsync(() -> this.remoteThrowException());
+ ai.join();
+ assertTrue(ai.exceptionOccurred());
+ Throwable ex = ai.getException();
+ assertTrue(ex instanceof BasicTestException);
+ }
+
+ /**
+ * Accessed via reflection. DO NOT REMOVE
+ */
+ private static void remoteThrowException() {
+ String s = "Test exception. Please ignore.";
+ throw new BasicTestException(s);
+ }
+
+ private static void remoteBind(String name, String value) {
+ assertNotNull("name must not be null", name);
+ assertNotNull("value must not be null", value);
+ assertNotNull("bindings must not be null", bindings);
+
+ new JUnit4BasicDUnitTest().getSystem(); // forces connection
+ bindings.setProperty(name, value);
+ }
+
+ private static void remoteValidateBind(String name, String expected) {
+ assertEquals(expected, bindings.getProperty(name));
+ }
+
+ private static class BasicTestException extends RuntimeException {
+ BasicTestException() {
+ this("Test exception. Please ignore.");
+ }
+ BasicTestException(String s) {
+ super(s);
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/internal/tests/JUnit4GetDefaultDiskStoreNameDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/internal/tests/JUnit4GetDefaultDiskStoreNameDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/internal/tests/JUnit4GetDefaultDiskStoreNameDUnitTest.java
new file mode 100644
index 0000000..7f99bc1
--- /dev/null
+++ b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/internal/tests/JUnit4GetDefaultDiskStoreNameDUnitTest.java
@@ -0,0 +1,65 @@
+/*
+ * 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.test.dunit.internal.tests;
+
+import static org.assertj.core.api.Assertions.*;
+
+import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+@Category(DistributedTest.class)
+public class JUnit4GetDefaultDiskStoreNameDUnitTest extends JUnit4DistributedTestCase {
+
+ @Test
+ public void testGetTestMethodName() {
+ String expected = createDefaultDiskStoreName(0, -1, "testGetTestMethodName");
+ assertGetDefaultDiskStoreName(expected);
+ }
+
+ @Test
+ public void testGetTestMethodNameChanges() {
+ String expected = createDefaultDiskStoreName(0, -1, "testGetTestMethodNameChanges");
+ assertGetDefaultDiskStoreName(expected);
+ }
+
+ @Test
+ public void testGetTestMethodNameInAllVMs() {
+ String expected = createDefaultDiskStoreName(0, -1, "testGetTestMethodNameInAllVMs");
+ assertGetDefaultDiskStoreName(expected);
+
+ for (int vmIndex = 0; vmIndex < Host.getHost(0).getVMCount(); vmIndex++) {
+ String expectedInVM = createDefaultDiskStoreName(0, vmIndex, "testGetTestMethodNameInAllVMs");
+ Host.getHost(0).getVM(vmIndex).invoke(()->assertGetDefaultDiskStoreName(expectedInVM));
+ }
+ }
+
+ private void assertGetDefaultDiskStoreName(final String expected) {
+ assertThat(getDefaultDiskStoreName()).isEqualTo(expected);
+ }
+
+ private String createDefaultDiskStoreName(final int hostIndex, final int vmIndex, final String methodName) {
+ return "DiskStore-" + hostIndex + "-" + vmIndex + "-" + getClass().getCanonicalName() + "." + methodName;
+ }
+
+ private String getDefaultDiskStoreName() {
+ return GemFireCacheImpl.DEFAULT_DS_NAME; // TODO: not thread safe
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/internal/tests/JUnit4GetTestMethodNameDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/internal/tests/JUnit4GetTestMethodNameDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/internal/tests/JUnit4GetTestMethodNameDUnitTest.java
new file mode 100644
index 0000000..93b2e86
--- /dev/null
+++ b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/internal/tests/JUnit4GetTestMethodNameDUnitTest.java
@@ -0,0 +1,52 @@
+/*
+ * 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.test.dunit.internal.tests;
+
+import static org.assertj.core.api.Assertions.*;
+
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+@Category(DistributedTest.class)
+public class JUnit4GetTestMethodNameDUnitTest extends JUnit4DistributedTestCase {
+
+ @Test
+ public void testGetTestMethodName() {
+ assertGetTestMethodName("testGetTestMethodName");
+ }
+
+ @Test
+ public void testGetTestMethodNameChanges() {
+ assertGetTestMethodName("testGetTestMethodNameChanges");
+ }
+
+ @Test
+ public void testGetTestMethodNameInAllVMs() {
+ assertGetTestMethodName("testGetTestMethodNameInAllVMs");
+
+ for (int vmIndex = 0; vmIndex < Host.getHost(0).getVMCount(); vmIndex++) {
+ Host.getHost(0).getVM(vmIndex).invoke(()->assertGetTestMethodName("testGetTestMethodNameInAllVMs"));
+ }
+ }
+
+ private void assertGetTestMethodName(final String expected) {
+ assertThat(getTestMethodName()).isEqualTo(expected);
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/internal/tests/JUnit4VMDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/internal/tests/JUnit4VMDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/internal/tests/JUnit4VMDUnitTest.java
new file mode 100644
index 0000000..c9d9d3c
--- /dev/null
+++ b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/internal/tests/JUnit4VMDUnitTest.java
@@ -0,0 +1,200 @@
+/*
+ * 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.test.dunit.internal.tests;
+
+import static com.gemstone.gemfire.test.dunit.Assert.*;
+
+import java.io.Serializable;
+import java.util.concurrent.atomic.AtomicInteger;
+
+import com.gemstone.gemfire.test.dunit.AsyncInvocation;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.RMIException;
+import com.gemstone.gemfire.test.dunit.SerializableRunnableIF;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+/**
+ * This class tests the functionality of the {@link VM} class.
+ */
+@Category(DistributedTest.class)
+public class JUnit4VMDUnitTest extends JUnit4DistributedTestCase {
+
+ private static final AtomicInteger COUNTER = new AtomicInteger();
+ private static final boolean BOOLEAN_VALUE = true;
+ private static final byte BYTE_VALUE = (byte) 40;
+ private static final long LONG_VALUE = 42L;
+ private static final String STRING_VALUE = "BLAH BLAH BLAH";
+
+ @Test
+ public void testInvokeStaticBoolean() {
+ Host host = Host.getHost(0);
+ VM vm = host.getVM(0);
+ assertEquals(BOOLEAN_VALUE, (boolean) vm.invoke(() -> remoteBooleanMethod()));
+ }
+
+ @Test
+ public void testInvokeStaticByte() {
+ Host host = Host.getHost(0);
+ VM vm = host.getVM(0);
+ assertEquals(BYTE_VALUE, (byte) vm.invoke(() -> remoteByteMethod()));
+ }
+
+ @Test
+ public void testInvokeStaticLong() {
+ Host host = Host.getHost(0);
+ VM vm = host.getVM(0);
+ assertEquals(LONG_VALUE, (long) vm.invoke(() -> remoteLongMethod()));
+ }
+
+ @Test
+ public void testInvokeInstance() {
+ Host host = Host.getHost(0);
+ VM vm = host.getVM(0);
+ assertEquals(STRING_VALUE, vm.invoke(new ClassWithString(), "getString"));
+ }
+
+ @Test
+ public void testInvokeRunnableWithException() {
+ Host host = Host.getHost(0);
+ VM vm = host.getVM(0);
+ try {
+ vm.invoke(new InvokeRunnable());
+ fail("Should have thrown a BasicTestException");
+ } catch (RMIException ex) {
+ assertTrue(ex.getCause() instanceof BasicTestException);
+ }
+ }
+
+ @Test
+ public void testReturnValue() throws Exception {
+ final Host host = Host.getHost(0);
+ final VM vm = host.getVM(0);
+ // Assert class static invocation works
+ AsyncInvocation a1 = vm.invokeAsync(() -> getAndIncStaticCount());
+ a1.join();
+ assertEquals(new Integer(0), a1.getReturnValue());
+ // Assert class static invocation with args works
+ a1 = vm.invokeAsync(() -> incrementStaticCount(new Integer(2)));
+ a1.join();
+ assertEquals(new Integer(3), a1.getReturnValue());
+ // Assert that previous values are not returned when invoking method w/ no return val
+ a1 = vm.invokeAsync(() -> incStaticCount());
+ a1.join();
+ assertNull(a1.getReturnValue());
+ // Assert that previous null returns are over-written
+ a1 = vm.invokeAsync(() -> getAndIncStaticCount());
+ a1.join();
+ assertEquals(new Integer(4), a1.getReturnValue());
+
+ // Assert object method invocation works with zero arg method
+ final VMTestObject o = new VMTestObject(0);
+ a1 = vm.invokeAsync(o, "incrementAndGet", new Object[] {});
+ a1.join();
+ assertEquals(new Integer(1), a1.getReturnValue());
+ // Assert object method invocation works with no return
+ a1 = vm.invokeAsync(o, "set", new Object[] {new Integer(3)});
+ a1.join();
+ assertNull(a1.getReturnValue());
+ }
+
+ private static Integer getAndIncStaticCount() {
+ return new Integer(COUNTER.getAndIncrement());
+ }
+
+ private static Integer incrementStaticCount(Integer inc) {
+ return new Integer(COUNTER.addAndGet(inc.intValue()));
+ }
+
+ private static void incStaticCount() {
+ COUNTER.incrementAndGet();
+ }
+
+ /**
+ * Accessed via reflection. DO NOT REMOVE
+ */
+ private static byte remoteByteMethod() {
+ return BYTE_VALUE;
+ }
+
+ /**
+ * Accessed via reflection. DO NOT REMOVE
+ */
+ private static boolean remoteBooleanMethod() {
+ return BOOLEAN_VALUE;
+ }
+
+ /**
+ * Accessed via reflection. DO NOT REMOVE
+ */
+ private static long remoteLongMethod() {
+ return LONG_VALUE;
+ }
+
+ private static class ClassWithLong implements Serializable {
+ public long getLong() {
+ return LONG_VALUE;
+ }
+ }
+
+ private static class ClassWithByte implements Serializable {
+ public byte getByte() {
+ return BYTE_VALUE;
+ }
+ }
+
+ private static class InvokeRunnable implements SerializableRunnableIF {
+ public void run() {
+ throw new BasicTestException();
+ }
+ }
+
+ private static class ClassWithString implements Serializable {
+ public String getString() {
+ return STRING_VALUE;
+ }
+ }
+
+ private static class BasicTestException extends RuntimeException {
+ BasicTestException() {
+ this("Test exception. Please ignore.");
+ }
+ BasicTestException(String s) {
+ super(s);
+ }
+ }
+
+ private static class VMTestObject implements Serializable {
+ private static final long serialVersionUID = 1L;
+ private final AtomicInteger val;
+ public VMTestObject(int init) {
+ this.val = new AtomicInteger(init);
+ }
+ public Integer get() {
+ return new Integer(this.val.get());
+ }
+ public Integer incrementAndGet() {
+ return new Integer(this.val.incrementAndGet());
+ }
+ public void set(Integer newVal) {
+ this.val.set(newVal.intValue());
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/tests/BasicDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/tests/BasicDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/tests/BasicDUnitTest.java
index 3a98188..b10f610 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/tests/BasicDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/tests/BasicDUnitTest.java
@@ -16,6 +16,8 @@
*/
package com.gemstone.gemfire.test.dunit.tests;
+import static com.gemstone.gemfire.test.dunit.Invoke.invokeInEveryVM;
+
import java.util.Properties;
import com.gemstone.gemfire.test.dunit.Assert;
@@ -32,86 +34,164 @@ import com.gemstone.gemfire.test.dunit.VM;
*/
public class BasicDUnitTest extends DistributedTestCase {
+ private static Properties bindings;
+
public BasicDUnitTest(String name) {
super(name);
}
- //////// Test Methods
+ @Override
+ public final void postSetUp() throws Exception {
+ bindings = new Properties();
+ invokeInEveryVM(() -> bindings = new Properties());
+ }
+
+ @Override
+ public final void postTearDown() throws Exception {
+ bindings = null;
+ invokeInEveryVM(() -> bindings = null);
+ }
+
+ public void testPreconditions() {
+ invokeInEveryVM(() -> assertNotNull("getUniqueName() must not return null", getUniqueName()));
+ invokeInEveryVM(() -> assertNotNull("bindings must not be null", bindings));
+ }
/**
* Tests how the Hydra framework handles an error
*/
- public void _testDontCatchRemoteException() {
+ public void ignore_testDontCatchRemoteException() throws Exception {
Host host = Host.getHost(0);
VM vm = host.getVM(0);
- vm.invoke(() -> this.remoteThrowException());
+ vm.invoke(() -> remoteThrowException());
}
- public void testRemoteInvocationWithException() {
+ public void testRemoteInvocationWithException() throws Exception {
Host host = Host.getHost(0);
VM vm = host.getVM(0);
try {
- vm.invoke(() -> this.remoteThrowException());
+ vm.invoke(() -> remoteThrowException());
fail("Should have thrown a BasicTestException");
} catch (RMIException ex) {
assertTrue(ex.getCause() instanceof BasicTestException);
}
}
-
- public void testInvokeWithLambda() {
+
+ public void testInvokeWithLambda() throws Exception {
Host host = Host.getHost(0);
VM vm0 = host.getVM(0);
VM vm1 = host.getVM(1);
-
+
int vm0Num = vm0.invoke(() -> DUnitEnv.get().getVMID());
int vm1Num = vm1.invoke(() -> DUnitEnv.get().getVMID());
-
+
assertEquals(0, vm0Num);
assertEquals(1, vm1Num);
-
}
-
+
public void testInvokeLambdaAsync() throws Throwable {
Host host = Host.getHost(0);
VM vm0 = host.getVM(0);
-
+
AsyncInvocation<Integer> async0 = vm0.invokeAsync(() -> DUnitEnv.get().getVMID());
int vm0num = async0.getResult();
-
+
assertEquals(0, vm0num);
-
}
public void testInvokeWithNamedLambda() {
Host host = Host.getHost(0);
VM vm0 = host.getVM(0);
VM vm1 = host.getVM(1);
-
+
int vm0Num = vm0.invoke("getVMID", () -> DUnitEnv.get().getVMID());
int vm1Num = vm1.invoke("getVMID", () -> DUnitEnv.get().getVMID());
-
+
assertEquals(0, vm0Num);
assertEquals(1, vm1Num);
-
}
-
+
public void testInvokeNamedLambdaAsync() throws Throwable {
Host host = Host.getHost(0);
VM vm0 = host.getVM(0);
-
+
AsyncInvocation<Integer> async0 = vm0.invokeAsync("getVMID", () -> DUnitEnv.get().getVMID());
int vm0num = async0.getResult();
-
+
assertEquals(0, vm0num);
-
}
-
+
+ // Test was never implemented
+ public void ignore_testRemoteInvocationBoolean() {
+ }
+
+ public void testRemoteInvokeAsync() throws Exception {
+ Host host = Host.getHost(0);
+ VM vm = host.getVM(0);
+ String name = getUniqueName();
+ String value = "Hello";
+
+ AsyncInvocation ai = vm.invokeAsync(() -> remoteBind(name, value));
+ ai.join();
+ // TODO shouldn't we call fail() here?
+ if (ai.exceptionOccurred()) {
+ Assert.fail("remoteBind failed", ai.getException());
+ }
+
+ ai = vm.invokeAsync(() -> remoteValidateBind(name, value ));
+ ai.join();
+ if (ai.exceptionOccurred()) {
+ Assert.fail("remoteValidateBind failed", ai.getException());
+ }
+ }
+
+ public void testRemoteInvokeAsyncWithException() throws Exception {
+ Host host = Host.getHost(0);
+ VM vm = host.getVM(0);
+
+ AsyncInvocation ai = vm.invokeAsync(() -> remoteThrowException());
+ ai.join();
+ assertTrue(ai.exceptionOccurred());
+ Throwable ex = ai.getException();
+ assertTrue(ex instanceof BasicTestException);
+ }
+
+ /**
+ * Accessed via reflection. DO NOT REMOVE
+ */
+ private static void remoteThrowException() {
+ String s = "Test exception. Please ignore.";
+ throw new BasicTestException(s);
+ }
+
+ private static void remoteBind(String name, String value) {
+ assertNotNull("name must not be null", name);
+ assertNotNull("value must not be null", value);
+ assertNotNull("bindings must not be null", bindings);
+
+ new BasicDUnitTest("").getSystem(); // forces connection
+ bindings.setProperty(name, value);
+ }
+
+ private static void remoteValidateBind(String name, String expected) {
+ assertEquals(expected, bindings.getProperty(name));
+ }
+
+ private static class BasicTestException extends RuntimeException {
+ BasicTestException() {
+ this("Test exception. Please ignore.");
+ }
+ BasicTestException(String s) {
+ super(s);
+ }
+ }
+
static class BasicDUnitException extends RuntimeException {
public BasicDUnitException() {
}
}
-
+
public static void throwException() throws BasicDUnitException {
throw new BasicDUnitException();
}
@@ -119,7 +199,7 @@ public class BasicDUnitTest extends DistributedTestCase {
public void testInvokeNamedRunnableLambdaAsync() throws Throwable {
Host host = Host.getHost(0);
VM vm0 = host.getVM(0);
-
+
AsyncInvocation<Integer> async0 = vm0.invokeAsync("throwSomething", () -> BasicDUnitTest.throwException());
try {
async0.getResult();
@@ -138,7 +218,7 @@ public class BasicDUnitTest extends DistributedTestCase {
public void testInvokeNamedRunnableLambda() throws Throwable {
Host host = Host.getHost(0);
VM vm0 = host.getVM(0);
-
+
try {
vm0.invoke("throwSomething", () -> BasicDUnitTest.throwException());
throw new Error("expected an exception to be thrown");
@@ -148,75 +228,4 @@ public class BasicDUnitTest extends DistributedTestCase {
}
}
}
-
- static class BasicTestException extends RuntimeException {
- BasicTestException() {
- this("Test exception. Please ignore.");
- }
-
- BasicTestException(String s) {
- super(s);
- }
- }
-
- /**
- * Accessed via reflection. DO NOT REMOVE
- *
- */
- protected static void remoteThrowException() {
- String s = "Test exception. Please ignore.";
- throw new BasicTestException(s);
- }
-
- public void _testRemoteInvocationBoolean() {
-
- }
-
- public void testRemoteInvokeAsync() throws InterruptedException {
- Host host = Host.getHost(0);
- VM vm = host.getVM(0);
- String name = this.getUniqueName();
- String value = "Hello";
-
- AsyncInvocation ai =
- vm.invokeAsync(() -> this.remoteBind( name, value ));
- ai.join();
- // TODO shouldn't we call fail() here?
- if (ai.exceptionOccurred()) {
- Assert.fail("remoteBind failed", ai.getException());
- }
-
- ai = vm.invokeAsync(() -> this.remoteValidateBind(name, value ));
- ai.join();
- if (ai.exceptionOccurred()) {
- Assert.fail("remoteValidateBind failed", ai.getException());
- }
- }
-
- private static Properties bindings = new Properties();
- private static void remoteBind(String name, String s) {
- new BasicDUnitTest("bogus").getSystem(); // forces connection
- bindings.setProperty(name, s);
- }
-
- private static void remoteValidateBind(String name, String expected)
- {
- assertEquals(expected, bindings.getProperty(name));
- }
-
- public void testRemoteInvokeAsyncWithException()
- throws InterruptedException {
-
- Host host = Host.getHost(0);
- VM vm = host.getVM(0);
-// String name = this.getUniqueName();
-// String value = "Hello";
-
- AsyncInvocation ai =
- vm.invokeAsync(() -> this.remoteThrowException());
- ai.join();
- assertTrue(ai.exceptionOccurred());
- Throwable ex = ai.getException();
- assertTrue(ex instanceof BasicTestException);
- }
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/tests/GetDefaultDiskStoreNameDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/tests/GetDefaultDiskStoreNameDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/tests/GetDefaultDiskStoreNameDUnitTest.java
index 99dcc29..c92ab3d 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/tests/GetDefaultDiskStoreNameDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/tests/GetDefaultDiskStoreNameDUnitTest.java
@@ -37,30 +37,30 @@ public class GetDefaultDiskStoreNameDUnitTest extends DistributedTestCase {
String expected = createDefaultDiskStoreName(0, -1, "testGetTestMethodName");
assertGetDefaultDiskStoreName(expected);
}
-
+
public void testGetTestMethodNameChanges() {
String expected = createDefaultDiskStoreName(0, -1, "testGetTestMethodNameChanges");
assertGetDefaultDiskStoreName(expected);
}
-
+
public void testGetTestMethodNameInAllVMs() {
String expected = createDefaultDiskStoreName(0, -1, "testGetTestMethodNameInAllVMs");
assertGetDefaultDiskStoreName(expected);
-
+
for (int vmIndex = 0; vmIndex < Host.getHost(0).getVMCount(); vmIndex++) {
String expectedInVM = createDefaultDiskStoreName(0, vmIndex, "testGetTestMethodNameInAllVMs");
Host.getHost(0).getVM(vmIndex).invoke(()->assertGetDefaultDiskStoreName(expectedInVM));
}
}
-
+
private void assertGetDefaultDiskStoreName(final String expected) {
assertThat(getDefaultDiskStoreName()).isEqualTo(expected);
}
-
+
private String createDefaultDiskStoreName(final int hostIndex, final int vmIndex, final String methodName) {
return "DiskStore-" + hostIndex + "-" + vmIndex + "-" + getClass().getCanonicalName() + "." + methodName;
}
-
+
private String getDefaultDiskStoreName() {
return GemFireCacheImpl.DEFAULT_DS_NAME; // TODO: not thread safe
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/tests/GetTestMethodNameDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/tests/GetTestMethodNameDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/tests/GetTestMethodNameDUnitTest.java
index 9bad472..13550f6 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/tests/GetTestMethodNameDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/tests/GetTestMethodNameDUnitTest.java
@@ -35,19 +35,19 @@ public class GetTestMethodNameDUnitTest extends DistributedTestCase {
public void testGetTestMethodName() {
assertGetTestMethodName("testGetTestMethodName");
}
-
+
public void testGetTestMethodNameChanges() {
assertGetTestMethodName("testGetTestMethodNameChanges");
}
-
+
public void testGetTestMethodNameInAllVMs() {
assertGetTestMethodName("testGetTestMethodNameInAllVMs");
-
+
for (int vmIndex = 0; vmIndex < Host.getHost(0).getVMCount(); vmIndex++) {
Host.getHost(0).getVM(vmIndex).invoke(()->assertGetTestMethodName("testGetTestMethodNameInAllVMs"));
}
}
-
+
private void assertGetTestMethodName(final String expected) {
assertThat(getTestMethodName()).isEqualTo(expected);
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/tests/OverridingGetPropertiesDisconnectsAllDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/tests/OverridingGetPropertiesDisconnectsAllDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/tests/OverridingGetPropertiesDisconnectsAllDUnitTest.java
new file mode 100644
index 0000000..776fb3d
--- /dev/null
+++ b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/tests/OverridingGetPropertiesDisconnectsAllDUnitTest.java
@@ -0,0 +1,57 @@
+/*
+ * 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.test.dunit.tests;
+
+import static com.gemstone.gemfire.test.dunit.Invoke.*;
+
+import java.util.Properties;
+
+import com.gemstone.gemfire.distributed.internal.DistributionConfig;
+import com.gemstone.gemfire.test.dunit.DistributedTestCase;
+
+/**
+ * Verifies that overriding {@code getDistributedSystemProperties} results
+ * in {@code disconnectAllFromDS} during tear down.
+ */
+public class OverridingGetPropertiesDisconnectsAllDUnitTest extends DistributedTestCase {
+
+ public OverridingGetPropertiesDisconnectsAllDUnitTest(final String name) {
+ super(name);
+ }
+
+ @Override
+ public final void preTearDownAssertions() throws Exception {
+ invokeInEveryVM(() -> assertNotNull(basicGetSystem()));
+ }
+
+ @Override
+ public final void postTearDownAssertions() throws Exception {
+ invokeInEveryVM(() -> assertNull(basicGetSystem()));
+ }
+
+ @Override
+ public final Properties getDistributedSystemProperties() {
+ Properties props = new Properties();
+ props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
+ return props;
+ }
+
+ public void testDisconnects() throws Exception {
+ invokeInEveryVM(() -> assertFalse(getDistributedSystemProperties().isEmpty()));
+ invokeInEveryVM(() -> assertNotNull(getSystem()));
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/tests/VMDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/tests/VMDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/tests/VMDUnitTest.java
index ce6cb36..c0275d2 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/tests/VMDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/tests/VMDUnitTest.java
@@ -31,6 +31,7 @@ import com.gemstone.gemfire.test.dunit.VM;
*/
public class VMDUnitTest extends DistributedTestCase {
+ private static final AtomicInteger COUNTER = new AtomicInteger();
private static final boolean BOOLEAN_VALUE = true;
private static final byte BYTE_VALUE = (byte) 40;
private static final long LONG_VALUE = 42L;
@@ -40,124 +41,139 @@ public class VMDUnitTest extends DistributedTestCase {
super(name);
}
- /**
- * Accessed via reflection. DO NOT REMOVE
- * @return
- */
- protected static byte remoteByteMethod() {
- return BYTE_VALUE;
+ public void testInvokeStaticBoolean() {
+ Host host = Host.getHost(0);
+ VM vm = host.getVM(0);
+ assertEquals(BOOLEAN_VALUE, (boolean) vm.invoke(() -> remoteBooleanMethod()));
}
- public void notestInvokeStaticBoolean() {
+ public void testInvokeStaticByte() {
Host host = Host.getHost(0);
VM vm = host.getVM(0);
- assertEquals(BOOLEAN_VALUE,
- (boolean) vm.invoke(() -> VMDUnitTest.remoteBooleanMethod()));
+ assertEquals(BYTE_VALUE, (byte) vm.invoke(() -> remoteByteMethod()));
}
- /**
- * Accessed via reflection. DO NOT REMOVE
- * @return
- */
- protected static boolean remoteBooleanMethod() {
- return BOOLEAN_VALUE;
+ public void testInvokeStaticLong() {
+ Host host = Host.getHost(0);
+ VM vm = host.getVM(0);
+ assertEquals(LONG_VALUE, (long) vm.invoke(() -> remoteLongMethod()));
}
- public void notestInvokeStaticBooleanNotBoolean() {
+ public void testInvokeInstance() {
Host host = Host.getHost(0);
VM vm = host.getVM(0);
- try {
- vm.invoke(() -> VMDUnitTest.remoteByteMethod());
- fail("Should have thrown an IllegalArgumentException");
-
- } catch (IllegalArgumentException ex) {
-
- }
+ assertEquals(STRING_VALUE, vm.invoke(new ClassWithString(), "getString"));
}
- public void notestInvokeStaticLong() {
+ public void testInvokeRunnableWithException() {
Host host = Host.getHost(0);
VM vm = host.getVM(0);
- assertEquals(LONG_VALUE,
- (long) vm.invoke(() -> VMDUnitTest.remoteLongMethod()));
+ try {
+ vm.invoke(new InvokeRunnable());
+ fail("Should have thrown a BasicTestException");
+ } catch (RMIException ex) {
+ assertTrue(ex.getCause() instanceof BasicTestException);
+ }
+ }
+
+ public void testReturnValue() throws Exception {
+ final Host host = Host.getHost(0);
+ final VM vm = host.getVM(0);
+ // Assert class static invocation works
+ AsyncInvocation a1 = vm.invokeAsync(() -> getAndIncStaticCount());
+ a1.join();
+ assertEquals(new Integer(0), a1.getReturnValue());
+ // Assert class static invocation with args works
+ a1 = vm.invokeAsync(() -> incrementStaticCount(new Integer(2)));
+ a1.join();
+ assertEquals(new Integer(3), a1.getReturnValue());
+ // Assert that previous values are not returned when invoking method w/ no return val
+ a1 = vm.invokeAsync(() -> incStaticCount());
+ a1.join();
+ assertNull(a1.getReturnValue());
+ // Assert that previous null returns are over-written
+ a1 = vm.invokeAsync(() -> getAndIncStaticCount());
+ a1.join();
+ assertEquals(new Integer(4), a1.getReturnValue());
+
+ // Assert object method invocation works with zero arg method
+ final VMTestObject o = new VMTestObject(0);
+ a1 = vm.invokeAsync(o, "incrementAndGet", new Object[] {});
+ a1.join();
+ assertEquals(new Integer(1), a1.getReturnValue());
+ // Assert object method invocation works with no return
+ a1 = vm.invokeAsync(o, "set", new Object[] {new Integer(3)});
+ a1.join();
+ assertNull(a1.getReturnValue());
+ }
+
+ private static Integer getAndIncStaticCount() {
+ return new Integer(COUNTER.getAndIncrement());
+ }
+
+ private static Integer incrementStaticCount(Integer inc) {
+ return new Integer(COUNTER.addAndGet(inc.intValue()));
+ }
+
+ private static void incStaticCount() {
+ COUNTER.incrementAndGet();
}
/**
* Accessed via reflection. DO NOT REMOVE
- * @return
*/
- protected static long remoteLongMethod() {
- return LONG_VALUE;
+ private static byte remoteByteMethod() {
+ return BYTE_VALUE;
}
- public void notestInvokeStaticLongNotLong() {
- Host host = Host.getHost(0);
- VM vm = host.getVM(0);
- try {
- vm.invoke(() -> VMDUnitTest.remoteByteMethod());
- fail("Should have thrown an IllegalArgumentException");
+ /**
+ * Accessed via reflection. DO NOT REMOVE
+ */
+ private static boolean remoteBooleanMethod() {
+ return BOOLEAN_VALUE;
+ }
- } catch (IllegalArgumentException ex) {
-
- }
+ /**
+ * Accessed via reflection. DO NOT REMOVE
+ */
+ private static long remoteLongMethod() {
+ return LONG_VALUE;
}
- protected static class ClassWithLong implements Serializable {
+ private static class ClassWithLong implements Serializable {
public long getLong() {
return LONG_VALUE;
}
}
- protected static class ClassWithByte implements Serializable {
+ private static class ClassWithByte implements Serializable {
public byte getByte() {
return BYTE_VALUE;
}
}
- protected static class InvokeRunnable
- implements SerializableRunnableIF {
-
+ private static class InvokeRunnable implements SerializableRunnableIF {
public void run() {
- throw new BasicDUnitTest.BasicTestException();
+ throw new BasicTestException();
}
}
- protected static class ClassWithString implements Serializable {
+ private static class ClassWithString implements Serializable {
public String getString() {
return STRING_VALUE;
}
}
- public void notestInvokeInstance() {
- Host host = Host.getHost(0);
- VM vm = host.getVM(0);
- assertEquals(STRING_VALUE,
- vm.invoke(new ClassWithString(), "getString"));
- }
-
- public void notestInvokeRunnable() {
- Host host = Host.getHost(0);
- VM vm = host.getVM(0);
- try {
- vm.invoke(new InvokeRunnable());
- fail("Should have thrown a BasicTestException");
-
- } catch (RMIException ex) {
- assertTrue(ex.getCause() instanceof BasicDUnitTest.BasicTestException);
+ private static class BasicTestException extends RuntimeException {
+ BasicTestException() {
+ this("Test exception. Please ignore.");
+ }
+ BasicTestException(String s) {
+ super(s);
}
}
-
- private static final AtomicInteger COUNTER = new AtomicInteger();
- public static Integer getAndIncStaticCount() {
- return new Integer(COUNTER.getAndIncrement());
- }
- public static Integer incrementStaticCount(Integer inc) {
- return new Integer(COUNTER.addAndGet(inc.intValue()));
- }
- public static void incStaticCount() {
- COUNTER.incrementAndGet();
- }
- public static class VMTestObject implements Serializable {
+
+ private static class VMTestObject implements Serializable {
private static final long serialVersionUID = 1L;
private final AtomicInteger val;
public VMTestObject(int init) {
@@ -173,34 +189,4 @@ public class VMDUnitTest extends DistributedTestCase {
this.val.set(newVal.intValue());
}
}
- public void testReturnValue() throws Exception {
- final Host host = Host.getHost(0);
- final VM vm = host.getVM(0);
- // Assert class static invocation works
- AsyncInvocation a1 = vm.invokeAsync(() -> getAndIncStaticCount());
- a1.join();
- assertEquals(new Integer(0), a1.getReturnValue());
- // Assert class static invocation with args works
- a1 = vm.invokeAsync(() -> incrementStaticCount(new Integer(2)));
- a1.join();
- assertEquals(new Integer(3), a1.getReturnValue());
- // Assert that previous values are not returned when invoking method w/ no return val
- a1 = vm.invokeAsync(() -> incStaticCount());
- a1.join();
- assertNull(a1.getReturnValue());
- // Assert that previous null returns are over-written
- a1 = vm.invokeAsync(() -> getAndIncStaticCount());
- a1.join();
- assertEquals(new Integer(4), a1.getReturnValue());
-
- // Assert object method invocation works with zero arg method
- final VMTestObject o = new VMTestObject(0);
- a1 = vm.invokeAsync(o, "incrementAndGet", new Object[] {});
- a1.join();
- assertEquals(new Integer(1), a1.getReturnValue());
- // Assert object method invocation works with no return
- a1 = vm.invokeAsync(o, "set", new Object[] {new Integer(3)});
- a1.join();
- assertNull(a1.getReturnValue());
- }
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqDataDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqDataDUnitTest.java b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqDataDUnitTest.java
index ebc6f53..bd473b3 100644
--- a/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqDataDUnitTest.java
+++ b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqDataDUnitTest.java
@@ -63,10 +63,9 @@ public class CqDataDUnitTest extends CacheTestCase {
public CqDataDUnitTest(String name) {
super(name);
}
-
- public void setUp() throws Exception {
- super.setUp();
-
+
+ @Override
+ public final void postSetUp() throws Exception {
// avoid IllegalStateException from HandShake by connecting all vms tor
// system before creating ConnectionPools
getSystem();
@@ -75,7 +74,10 @@ public class CqDataDUnitTest extends CacheTestCase {
getSystem();
}
});
-
+ postSetUpCqDataDUnitTest();
+ }
+
+ protected void postSetUpCqDataDUnitTest() throws Exception {
}
/**
[04/11] incubator-geode git commit: GEODE-1050: add JUnit 4 versions
of DistributedTestCase and CacheTestCase
Posted by kl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/pulse/TestFunctionsDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/management/internal/pulse/TestFunctionsDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/pulse/TestFunctionsDUnitTest.java
index b410a82..2666b0c 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/management/internal/pulse/TestFunctionsDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/pulse/TestFunctionsDUnitTest.java
@@ -44,11 +44,6 @@ public class TestFunctionsDUnitTest extends ManagementTestBase {
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
-
- }
-
public static Integer getNumOfRunningFunction() {
final WaitCriterion waitCriteria = new WaitCriterion() {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/pulse/TestHeapDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/management/internal/pulse/TestHeapDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/pulse/TestHeapDUnitTest.java
index 78e91b0..4eefdca 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/management/internal/pulse/TestHeapDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/pulse/TestHeapDUnitTest.java
@@ -38,12 +38,7 @@ public class TestHeapDUnitTest extends ManagementTestBase {
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
-
- }
-
- public static long getHeapSizeOfClient() {
+ public static long getHeapSizeOfClient() {
return (Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory());
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/pulse/TestLocatorsDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/management/internal/pulse/TestLocatorsDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/pulse/TestLocatorsDUnitTest.java
index 926c2ff..69f8bc9 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/management/internal/pulse/TestLocatorsDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/pulse/TestLocatorsDUnitTest.java
@@ -37,11 +37,6 @@ public class TestLocatorsDUnitTest extends ManagementTestBase {
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
-
- }
-
public static int getNumOfLocatorFromMBean() {
final WaitCriterion waitCriteria = new WaitCriterion() {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/pulse/TestSubscriptionsDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/management/internal/pulse/TestSubscriptionsDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/pulse/TestSubscriptionsDUnitTest.java
index ef491b0..95ef63b 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/management/internal/pulse/TestSubscriptionsDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/pulse/TestSubscriptionsDUnitTest.java
@@ -74,8 +74,8 @@ public class TestSubscriptionsDUnitTest extends DistributedTestCase {
this.helper = new ManagementTestBase(name);
}
- public void setUp() throws Exception {
- super.setUp();
+ @Override
+ public final void postSetUp() throws Exception {
final Host host = Host.getHost(0);
managingNode = host.getVM(0);
server = host.getVM(1);
@@ -84,7 +84,7 @@ public class TestSubscriptionsDUnitTest extends DistributedTestCase {
}
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
helper.closeCache(managingNode);
helper.closeCache(server);
helper.closeCache(client);
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/pdx/ClientsWithVersioningRetryDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/pdx/ClientsWithVersioningRetryDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/pdx/ClientsWithVersioningRetryDUnitTest.java
index 40592ff..0f747db 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/pdx/ClientsWithVersioningRetryDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/pdx/ClientsWithVersioningRetryDUnitTest.java
@@ -79,8 +79,7 @@ public class ClientsWithVersioningRetryDUnitTest extends CacheTestCase {
}
@Override
- public void setUp() throws Exception {
- super.setUp();
+ public final void postSetUp() throws Exception {
Invoke.invokeInEveryVM(new SerializableRunnable() {
@Override
public void run() {
@@ -93,7 +92,7 @@ public class ClientsWithVersioningRetryDUnitTest extends CacheTestCase {
}
@Override
- protected final void postTearDownCacheTestCase() throws Exception {
+ public final void postTearDownCacheTestCase() throws Exception {
Invoke.invokeInEveryVM(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/pdx/JSONPdxClientServerDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/pdx/JSONPdxClientServerDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/pdx/JSONPdxClientServerDUnitTest.java
index 937ff31..4949b43 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/pdx/JSONPdxClientServerDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/pdx/JSONPdxClientServerDUnitTest.java
@@ -60,7 +60,7 @@ public class JSONPdxClientServerDUnitTest extends CacheTestCase {
}
@Override
- protected final void preTearDownCacheTestCase() {
+ public final void preTearDownCacheTestCase() {
// this test creates client caches in some VMs and so
// breaks the contract of CacheTestCase to hold caches in
// that class's "cache" instance variable
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/pdx/PdxSerializableDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/pdx/PdxSerializableDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/pdx/PdxSerializableDUnitTest.java
index 51635f3..1e901bc 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/pdx/PdxSerializableDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/pdx/PdxSerializableDUnitTest.java
@@ -35,12 +35,6 @@ public class PdxSerializableDUnitTest extends CacheTestCase {
super(name);
}
-
- @Override
- public void setUp() throws Exception {
- super.setUp();
- }
-
public void testSimplePut() {
Host host = Host.getHost(0);
VM vm1 = host.getVM(0);
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/pdx/PdxTypeExportDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/pdx/PdxTypeExportDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/pdx/PdxTypeExportDUnitTest.java
index c820e72..58f2128 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/pdx/PdxTypeExportDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/pdx/PdxTypeExportDUnitTest.java
@@ -68,9 +68,9 @@ public class PdxTypeExportDUnitTest extends CacheTestCase {
Host.getHost(0).getVM(3).invoke(test);
}
-
- public void setUp() throws Exception {
- super.setUp();
+
+ @Override
+ public final void postSetUp() throws Exception {
loadCache();
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/redis/RedisDistDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/redis/RedisDistDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/redis/RedisDistDUnitTest.java
index f787909..825f532 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/redis/RedisDistDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/redis/RedisDistDUnitTest.java
@@ -64,8 +64,7 @@ public class RedisDistDUnitTest extends DistributedTestCase {
}
@Override
- public void setUp() throws Exception {
- super.setUp();
+ public final void postSetUp() throws Exception {
disconnectAllFromDS();
host = Host.getHost(0);
server1 = host.getVM(0);
@@ -102,7 +101,7 @@ public class RedisDistDUnitTest extends DistributedTestCase {
}
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
disconnectAllFromDS();
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/security/ClientAuthenticationDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/security/ClientAuthenticationDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/security/ClientAuthenticationDUnitTest.java
index 739dd42..456a6ed 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/security/ClientAuthenticationDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/security/ClientAuthenticationDUnitTest.java
@@ -74,9 +74,7 @@ public class ClientAuthenticationDUnitTest extends DistributedTestCase {
SSLHandshakeException.class.getName() };
@Override
- public void setUp() throws Exception {
-
- super.setUp();
+ public final void postSetUp() throws Exception {
final Host host = Host.getHost(0);
server1 = host.getVM(0);
server2 = host.getVM(1);
@@ -893,7 +891,7 @@ public class ClientAuthenticationDUnitTest extends DistributedTestCase {
//////////////////////////////////////////////////////////////////////////////
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
// close the clients first
client1.invoke(() -> SecurityTestUtil.closeCache());
client2.invoke(() -> SecurityTestUtil.closeCache());
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/security/ClientAuthorizationDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/security/ClientAuthorizationDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/security/ClientAuthorizationDUnitTest.java
index e3d8ccf..9271cd1 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/security/ClientAuthorizationDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/security/ClientAuthorizationDUnitTest.java
@@ -56,9 +56,7 @@ public class ClientAuthorizationDUnitTest extends ClientAuthorizationTestBase {
}
@Override
- public void setUp() throws Exception {
-
- super.setUp();
+ public final void postSetUp() throws Exception {
final Host host = Host.getHost(0);
server1 = host.getVM(0);
server2 = host.getVM(1);
@@ -801,7 +799,7 @@ public class ClientAuthorizationDUnitTest extends ClientAuthorizationTestBase {
// End Region: Tests
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
// close the clients first
client1.invoke(() -> SecurityTestUtil.closeCache());
client2.invoke(() -> SecurityTestUtil.closeCache());
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/security/ClientMultiUserAuthzDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/security/ClientMultiUserAuthzDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/security/ClientMultiUserAuthzDUnitTest.java
index 325f0bb..496c3a2 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/security/ClientMultiUserAuthzDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/security/ClientMultiUserAuthzDUnitTest.java
@@ -44,9 +44,8 @@ public class ClientMultiUserAuthzDUnitTest extends ClientAuthorizationTestBase {
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);
@@ -510,7 +509,7 @@ public class ClientMultiUserAuthzDUnitTest extends ClientAuthorizationTestBase {
// End Region: Tests
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
// close the clients first
client1.invoke(() -> SecurityTestUtil.closeCache());
client2.invoke(() -> SecurityTestUtil.closeCache());
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/security/DeltaClientAuthorizationDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/security/DeltaClientAuthorizationDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/security/DeltaClientAuthorizationDUnitTest.java
index a7d6131..8a78378 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/security/DeltaClientAuthorizationDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/security/DeltaClientAuthorizationDUnitTest.java
@@ -97,8 +97,8 @@ public class DeltaClientAuthorizationDUnitTest extends
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);
@@ -112,7 +112,7 @@ public class DeltaClientAuthorizationDUnitTest extends
}
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
// close the clients first
client1.invoke(() -> SecurityTestUtil.closeCache());
client2.invoke(() -> SecurityTestUtil.closeCache());
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/security/DeltaClientPostAuthorizationDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/security/DeltaClientPostAuthorizationDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/security/DeltaClientPostAuthorizationDUnitTest.java
index 090b96a..e0502a2 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/security/DeltaClientPostAuthorizationDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/security/DeltaClientPostAuthorizationDUnitTest.java
@@ -58,9 +58,8 @@ public class DeltaClientPostAuthorizationDUnitTest extends
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);
@@ -74,7 +73,7 @@ public class DeltaClientPostAuthorizationDUnitTest extends
}
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
// close the clients first
client1.invoke(() -> SecurityTestUtil.closeCache());
client2.invoke(() -> SecurityTestUtil.closeCache());
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/security/P2PAuthenticationDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/security/P2PAuthenticationDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/security/P2PAuthenticationDUnitTest.java
index 560b9e4..b31f15c 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/security/P2PAuthenticationDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/security/P2PAuthenticationDUnitTest.java
@@ -72,9 +72,8 @@ public class P2PAuthenticationDUnitTest extends DistributedTestCase {
super(name);
}
- public void setUp() throws Exception {
-
- super.setUp();
+ @Override
+ public final void postSetUp() throws Exception {
final Host host = Host.getHost(0);
locatorVM = host.getVM(0);
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/security/SecurityTestUtil.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/security/SecurityTestUtil.java b/geode-core/src/test/java/com/gemstone/gemfire/security/SecurityTestUtil.java
index d3c379f..af8c0fe 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/security/SecurityTestUtil.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/security/SecurityTestUtil.java
@@ -187,16 +187,16 @@ public class SecurityTestUtil extends DistributedTestCase {
DistributedSystem dsys = getSystem(sysProps);
assertNotNull(dsys);
- addExpectedExceptions(SecurityTestUtil.expectedExceptions, system
+ addExpectedExceptions(SecurityTestUtil.expectedExceptions, dsys
.getLogWriter());
return dsys;
}
void openCache() {
- assertNotNull(system);
- assertTrue(system.isConnected());
- cache = CacheFactory.create(system);
+ assertNotNull(basicGetSystem());
+ assertTrue(basicGetSystem().isConnected());
+ cache = CacheFactory.create(basicGetSystem());
assertNotNull(cache);
}
@@ -1875,7 +1875,7 @@ public class SecurityTestUtil extends DistributedTestCase {
private static LogWriter getLogger() {
LogWriter logger = null;
- DistributedSystem dsys = system;
+ DistributedSystem dsys = getSystemStatic();
if (dsys == null || !dsys.isConnected()) {
while ((dsys = InternalDistributedSystem.getAnyInstance()) != null
&& !dsys.isConnected()) {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/DistributedTestCase.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/DistributedTestCase.java b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/DistributedTestCase.java
index 4f656fd..6a6227c 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/DistributedTestCase.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/DistributedTestCase.java
@@ -16,520 +16,25 @@
*/
package com.gemstone.gemfire.test.dunit;
-import java.text.DecimalFormat;
-import java.util.Iterator;
-import java.util.LinkedHashSet;
-import java.util.Map;
-import java.util.Properties;
-import java.util.Set;
-
-import org.apache.logging.log4j.Logger;
-import org.junit.experimental.categories.Category;
-
-import com.gemstone.gemfire.SystemFailure;
-import com.gemstone.gemfire.admin.internal.AdminDistributedSystemImpl;
-import com.gemstone.gemfire.cache.Cache;
-import com.gemstone.gemfire.cache.Region;
-import com.gemstone.gemfire.cache.hdfs.internal.hoplog.HoplogConfig;
-import com.gemstone.gemfire.cache.query.QueryTestUtils;
-import com.gemstone.gemfire.cache.query.internal.QueryObserverHolder;
-import com.gemstone.gemfire.cache30.ClientServerTestCase;
-import com.gemstone.gemfire.cache30.GlobalLockingDUnitTest;
-import com.gemstone.gemfire.cache30.MultiVMRegionTestCase;
-import com.gemstone.gemfire.cache30.RegionTestCase;
-import com.gemstone.gemfire.distributed.DistributedSystem;
-import com.gemstone.gemfire.distributed.internal.DistributionConfig;
-import com.gemstone.gemfire.distributed.internal.DistributionMessageObserver;
-import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem;
-import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem.CreationStackGenerator;
-import com.gemstone.gemfire.distributed.internal.tcpserver.TcpClient;
-import com.gemstone.gemfire.internal.SocketCreator;
-import com.gemstone.gemfire.internal.admin.ClientStatsManager;
-import com.gemstone.gemfire.internal.cache.DiskStoreObserver;
-import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
-import com.gemstone.gemfire.internal.cache.HARegion;
-import com.gemstone.gemfire.internal.cache.InitialImageOperation;
-import com.gemstone.gemfire.internal.cache.PartitionedRegion;
-import com.gemstone.gemfire.internal.cache.tier.InternalClientMembership;
-import com.gemstone.gemfire.internal.cache.tier.sockets.CacheServerTestUtil;
-import com.gemstone.gemfire.internal.cache.tier.sockets.ClientProxyMembershipID;
-import com.gemstone.gemfire.internal.cache.xmlcache.CacheCreation;
-import com.gemstone.gemfire.internal.logging.LogService;
-import com.gemstone.gemfire.management.internal.cli.LogWrapper;
+import com.gemstone.gemfire.test.dunit.internal.JUnit3DistributedTestCase;
import com.gemstone.gemfire.test.dunit.standalone.DUnitLauncher;
import com.gemstone.gemfire.test.junit.categories.DistributedTest;
-
-import junit.framework.TestCase;
+import org.junit.experimental.categories.Category;
/**
* This class is the superclass of all distributed unit tests.
- *
- * tests/hydra/JUnitTestTask is the main DUnit driver. It supports two
- * additional public static methods if they are defined in the test case:
- *
- * public static void caseSetUp() -- comparable to JUnit's BeforeClass annotation
- *
- * public static void caseTearDown() -- comparable to JUnit's AfterClass annotation
*
* @author David Whitlock
*/
@Category(DistributedTest.class)
@SuppressWarnings("serial")
-public abstract class DistributedTestCase extends TestCase implements java.io.Serializable {
-
- private static final Logger logger = LogService.getLogger();
-
- private static final Set<String> testHistory = new LinkedHashSet<String>();
-
- /** This VM's connection to the distributed system */
- public static InternalDistributedSystem system;
- private static Class lastSystemCreatedInTest;
- private static Properties lastSystemProperties;
- private static volatile String testMethodName;
+public abstract class DistributedTestCase extends JUnit3DistributedTestCase {
- /** For formatting timing info */
- private static final DecimalFormat format = new DecimalFormat("###.###");
-
- public static boolean reconnect = false;
-
- public static final boolean logPerTest = Boolean.getBoolean("dunitLogPerTest");
-
/**
- * Creates a new <code>DistributedTestCase</code> test with the
- * given name.
+ * Creates a new <code>DistributedTestCase</code> test with the given name.
*/
public DistributedTestCase(final String name) {
super(name);
DUnitLauncher.launchIfNeeded();
}
-
- //---------------------------------------------------------------------------
- // methods for tests
- //---------------------------------------------------------------------------
-
- public final void setSystem(final Properties props, final DistributedSystem ds) { // TODO: override getDistributedSystemProperties and then delete
- system = (InternalDistributedSystem)ds;
- lastSystemProperties = props;
- lastSystemCreatedInTest = getClass(); // used to be getDeclaringClass()
- }
-
- /**
- * Returns this VM's connection to the distributed system. If
- * necessary, the connection will be lazily created using the given
- * <code>Properties</code>. Note that this method uses hydra's
- * configuration to determine the location of log files, etc.
- * Note: "final" was removed so that WANTestBase can override this method.
- * This was part of the xd offheap merge.
- *
- * see hydra.DistributedConnectionMgr#connect
- * @since 3.0
- */
- public /*final*/ InternalDistributedSystem getSystem(final Properties props) { // TODO: make final
- // Setting the default disk store name is now done in setUp
- if (system == null) {
- system = InternalDistributedSystem.getAnyInstance();
- }
- if (system == null || !system.isConnected()) {
- // Figure out our distributed system properties
- Properties p = DistributedTestUtils.getAllDistributedSystemProperties(props);
- lastSystemCreatedInTest = getClass(); // used to be getDeclaringClass()
- if (logPerTest) {
- String testMethod = getTestMethodName();
- String testName = lastSystemCreatedInTest.getName() + '-' + testMethod;
- String oldLogFile = p.getProperty(DistributionConfig.LOG_FILE_NAME);
- p.put(DistributionConfig.LOG_FILE_NAME,
- oldLogFile.replace("system.log", testName+".log"));
- String oldStatFile = p.getProperty(DistributionConfig.STATISTIC_ARCHIVE_FILE_NAME);
- p.put(DistributionConfig.STATISTIC_ARCHIVE_FILE_NAME,
- oldStatFile.replace("statArchive.gfs", testName+".gfs"));
- }
- system = (InternalDistributedSystem)DistributedSystem.connect(p);
- lastSystemProperties = p;
- } else {
- boolean needNewSystem = false;
- if(!getClass().equals(lastSystemCreatedInTest)) { // used to be getDeclaringClass()
- Properties newProps = DistributedTestUtils.getAllDistributedSystemProperties(props);
- needNewSystem = !newProps.equals(lastSystemProperties);
- if(needNewSystem) {
- LogWriterUtils.getLogWriter().info(
- "Test class has changed and the new DS properties are not an exact match. "
- + "Forcing DS disconnect. Old props = "
- + lastSystemProperties + "new props=" + newProps);
- }
- } else {
- Properties activeProps = system.getProperties();
- for (Iterator iter = props.entrySet().iterator();
- iter.hasNext(); ) {
- Map.Entry entry = (Map.Entry) iter.next();
- String key = (String) entry.getKey();
- String value = (String) entry.getValue();
- if (!value.equals(activeProps.getProperty(key))) {
- needNewSystem = true;
- LogWriterUtils.getLogWriter().info("Forcing DS disconnect. For property " + key
- + " old value = " + activeProps.getProperty(key)
- + " new value = " + value);
- break;
- }
- }
- }
- if(needNewSystem) {
- // the current system does not meet our needs to disconnect and
- // call recursively to get a new system.
- LogWriterUtils.getLogWriter().info("Disconnecting from current DS in order to make a new one");
- disconnectFromDS();
- getSystem(props);
- }
- }
- return system;
- }
-
- /**
- * Returns this VM's connection to the distributed system. If
- * necessary, the connection will be lazily created using the
- * <code>Properties</code> returned by {@link
- * #getDistributedSystemProperties}.
- *
- * @see #getSystem(Properties)
- *
- * @since 3.0
- */
- public final InternalDistributedSystem getSystem() {
- return getSystem(getDistributedSystemProperties());
- }
-
- /**
- * Returns a loner distributed system that isn't connected to other
- * vms
- *
- * @since 6.5
- */
- public final InternalDistributedSystem getLonerSystem() {
- Properties props = getDistributedSystemProperties();
- props.put(DistributionConfig.MCAST_PORT_NAME, "0");
- props.put(DistributionConfig.LOCATORS_NAME, "");
- return getSystem(props);
- }
-
- /**
- * Returns a loner distributed system in combination with enforceUniqueHost
- * and redundancyZone properties.
- * Added specifically to test scenario of defect #47181.
- */
- public final InternalDistributedSystem getLonerSystemWithEnforceUniqueHost() {
- Properties props = getDistributedSystemProperties();
- props.put(DistributionConfig.MCAST_PORT_NAME, "0");
- props.put(DistributionConfig.LOCATORS_NAME, "");
- props.put(DistributionConfig.ENFORCE_UNIQUE_HOST_NAME, "true");
- props.put(DistributionConfig.REDUNDANCY_ZONE_NAME, "zone1");
- return getSystem(props);
- }
-
- /**
- * Returns whether or this VM is connected to a {@link
- * DistributedSystem}.
- */
- public final boolean isConnectedToDS() {
- return system != null && system.isConnected();
- }
-
- /**
- * Returns a <code>Properties</code> object used to configure a
- * connection to a {@link
- * com.gemstone.gemfire.distributed.DistributedSystem}.
- * Unless overridden, this method will return an empty
- * <code>Properties</code> object.
- *
- * @since 3.0
- */
- public Properties getDistributedSystemProperties() {
- Properties props = new Properties();
- return props;
- }
-
- public static void disconnectAllFromDS() {
- disconnectFromDS();
- Invoke.invokeInEveryVM(()->disconnectFromDS());
- }
-
- /**
- * Disconnects this VM from the distributed system
- */
- public static void disconnectFromDS() {
- setTestMethodName(null);
- GemFireCacheImpl.testCacheXml = null;
- if (system != null) {
- system.disconnect();
- system = null;
- }
-
- for (;;) {
- DistributedSystem ds = InternalDistributedSystem.getConnectedInstance();
- if (ds == null) {
- break;
- }
- try {
- ds.disconnect();
- } catch (Exception e) {
- // ignore
- }
- }
-
- AdminDistributedSystemImpl ads = AdminDistributedSystemImpl.getConnectedInstance();
- if (ads != null) {// && ads.isConnected()) {
- ads.disconnect();
- }
- }
-
- //---------------------------------------------------------------------------
- // name methods
- //---------------------------------------------------------------------------
-
- public static String getTestMethodName() {
- return testMethodName;
- }
-
- public static void setTestMethodName(final String testMethodName) { // TODO: delete
- DistributedTestCase.testMethodName = testMethodName;
- }
-
- /**
- * Returns a unique name for this test method. It is based on the
- * name of the class as well as the name of the method.
- */
- public String getUniqueName() {
- return getClass().getSimpleName() + "_" + getName();
- }
-
- //---------------------------------------------------------------------------
- // setup methods
- //---------------------------------------------------------------------------
-
- /**
- * Sets up the DistributedTestCase.
- * <p>
- * Do not override this method. Override {@link #preSetUp()} with work that
- * needs to occur before setUp() or override {@link #postSetUp()} with work
- * that needs to occur after setUp().
- */
- @Override
- public void setUp() throws Exception {
- preSetUp();
- setUpDistributedTestCase();
- postSetUp();
- }
-
- /**
- * Sets up DistributedTest in controller and remote VMs. This includes the
- * defining the test name, setting the default disk store name, logging the
- * test history, and capturing a creation stack for detecting the source of
- * incompatible DistributedSystem connections.
- * <p>
- * Do not override this method.
- */
- private final void setUpDistributedTestCase() {
- final String className = getClass().getCanonicalName();
- final String methodName = getName();
-
- logTestHistory();
-
- setUpVM(methodName, getDefaultDiskStoreName(0, -1, className, methodName));
-
- for (int hostIndex = 0; hostIndex < Host.getHostCount(); hostIndex++) {
- Host host = Host.getHost(hostIndex);
- for (int vmIndex = 0; vmIndex < host.getVMCount(); vmIndex++) {
- final String vmDefaultDiskStoreName = getDefaultDiskStoreName(hostIndex, vmIndex, className, methodName);
- host.getVM(vmIndex).invoke(()->setUpVM(methodName, vmDefaultDiskStoreName));
- }
- }
-
- logTestStart();
- }
-
- /**
- * <code>preSetUp()</code> is invoked before {@link #setUpDistributedTestCase()}.
- * <p>
- * Override this as needed. Default implementation is empty.
- */
- protected void preSetUp() throws Exception {
- }
-
- /**
- * <code>postSetUp()</code> is invoked after {@link #setUpDistributedTestCase()}.
- * <p>
- * Override this as needed. Default implementation is empty.
- */
- protected void postSetUp() throws Exception {
- }
-
- private static String getDefaultDiskStoreName(final int hostIndex, final int vmIndex, final String className, final String methodName) {
- return "DiskStore-" + String.valueOf(hostIndex) + "-" + String.valueOf(vmIndex) + "-" + className + "." + methodName; // used to be getDeclaringClass()
- }
-
- private static void setUpVM(final String methodName, final String defaultDiskStoreName) {
- setTestMethodName(methodName);
- GemFireCacheImpl.setDefaultDiskStoreName(defaultDiskStoreName);
- System.setProperty(HoplogConfig.ALLOW_LOCAL_HDFS_PROP, "true");
- setUpCreationStackGenerator();
- }
-
- private void logTestStart() {
- System.out.println("\n\n[setup] START TEST " + getClass().getSimpleName()+"."+testMethodName+"\n\n");
- }
-
- private static void setUpCreationStackGenerator() {
- // the following is moved from InternalDistributedSystem to fix #51058
- InternalDistributedSystem.TEST_CREATION_STACK_GENERATOR.set(
- new CreationStackGenerator() {
- @Override
- public Throwable generateCreationStack(final DistributionConfig config) {
- final StringBuilder sb = new StringBuilder();
- final String[] validAttributeNames = config.getAttributeNames();
- for (int i = 0; i < validAttributeNames.length; i++) {
- final String attName = validAttributeNames[i];
- final Object actualAtt = config.getAttributeObject(attName);
- String actualAttStr = actualAtt.toString();
- sb.append(" ");
- sb.append(attName);
- sb.append("=\"");
- if (actualAtt.getClass().isArray()) {
- actualAttStr = InternalDistributedSystem.arrayToString(actualAtt);
- }
- sb.append(actualAttStr);
- sb.append("\"");
- sb.append("\n");
- }
- return new Throwable("Creating distributed system with the following configuration:\n" + sb.toString());
- }
- });
- }
-
- /**
- * Write a message to the log about what tests have ran previously. This
- * makes it easier to figure out if a previous test may have caused problems
- */
- private void logTestHistory() {
- String classname = getClass().getSimpleName();
- testHistory.add(classname);
- System.out.println("Previously run tests: " + testHistory);
- }
-
- //---------------------------------------------------------------------------
- // teardown methods
- //---------------------------------------------------------------------------
-
- /**
- * Tears down the DistributedTestCase.
- * <p>
- * Do not override this method. Override {@link #preTearDown()} with work that
- * needs to occur before tearDown() or override {@link #postTearDown()} with work
- * that needs to occur after tearDown().
- */
- @Override
- public final void tearDown() throws Exception {
- preTearDown();
- tearDownDistributedTestCase();
- postTearDown();
- }
-
- private final void tearDownDistributedTestCase() throws Exception {
- Invoke.invokeInEveryVM(()->tearDownCreationStackGenerator());
- if (logPerTest) {
- disconnectFromDS();
- Invoke.invokeInEveryVM(()->disconnectFromDS());
- }
- cleanupAllVms();
- }
-
- /**
- * <code>preTearDown()</code> is invoked before {@link #tearDownDistributedTestCase()}.
- * <p>
- * Override this as needed. Default implementation is empty.
- */
- protected void preTearDown() throws Exception {
- }
-
- /**
- * <code>postTearDown()</code> is invoked after {@link #tearDownDistributedTestCase()}.
- * <p>
- * Override this as needed. Default implementation is empty.
- */
- protected void postTearDown() throws Exception {
- }
-
- public static void cleanupAllVms() { // TODO: make private
- tearDownVM();
- Invoke.invokeInEveryVM(()->tearDownVM());
- Invoke.invokeInLocator(()->{
- DistributionMessageObserver.setInstance(null);
- DistributedTestUtils.unregisterInstantiatorsInThisVM();
- });
- DUnitLauncher.closeAndCheckForSuspects();
- }
-
- private static void tearDownVM() {
- closeCache();
-
- // keep alphabetized to detect duplicate lines
- CacheCreation.clearThreadLocals();
- CacheServerTestUtil.clearCacheReference();
- ClientProxyMembershipID.system = null;
- ClientServerTestCase.AUTO_LOAD_BALANCE = false;
- ClientStatsManager.cleanupForTests();
- DiskStoreObserver.setInstance(null);
- DistributedTestUtils.unregisterInstantiatorsInThisVM();
- DistributionMessageObserver.setInstance(null);
- GlobalLockingDUnitTest.region_testBug32356 = null;
- InitialImageOperation.slowImageProcessing = 0;
- InternalClientMembership.unregisterAllListeners();
- LogWrapper.close();
- MultiVMRegionTestCase.CCRegion = null;
- QueryObserverHolder.reset();
- QueryTestUtils.setCache(null);
- RegionTestCase.preSnapshotRegion = null;
- SocketCreator.resetHostNameCache();
- SocketCreator.resolve_dns = true;
- TcpClient.clearStaticData();
-
- // clear system properties -- keep alphabetized
- System.clearProperty("gemfire.log-level");
- System.clearProperty(HoplogConfig.ALLOW_LOCAL_HDFS_PROP);
- System.clearProperty("jgroups.resolve_dns");
-
- if (InternalDistributedSystem.systemAttemptingReconnect != null) {
- InternalDistributedSystem.systemAttemptingReconnect.stopReconnecting();
- }
-
- IgnoredException.removeAllExpectedExceptions();
- }
-
- private static void closeCache() {
- GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
- if (cache != null && !cache.isClosed()) {
- destroyRegions(cache);
- cache.close();
- }
- }
-
- protected static final void destroyRegions(final Cache cache) { // TODO: make private
- if (cache != null && !cache.isClosed()) {
- // try to destroy the root regions first so that we clean up any persistent files.
- for (Iterator itr = cache.rootRegions().iterator(); itr.hasNext();) {
- Region root = (Region)itr.next();
- String regionFullPath = root == null ? null : root.getFullPath();
- // for colocated regions you can't locally destroy a partitioned region.
- if(root.isDestroyed() || root instanceof HARegion || root instanceof PartitionedRegion) {
- continue;
- }
- try {
- root.localDestroyRegion("teardown");
- } catch (Throwable t) {
- logger.error("Failure during tearDown destroyRegions for " + regionFullPath, t);
- }
- }
- }
- }
-
- private static void tearDownCreationStackGenerator() {
- InternalDistributedSystem.TEST_CREATION_STACK_GENERATOR.set(InternalDistributedSystem.DEFAULT_CREATION_STACK_GENERATOR);
- }
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/cache/internal/CacheTestFixture.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/cache/internal/CacheTestFixture.java b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/cache/internal/CacheTestFixture.java
new file mode 100644
index 0000000..f0f64d4
--- /dev/null
+++ b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/cache/internal/CacheTestFixture.java
@@ -0,0 +1,40 @@
+/*
+ * 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.test.dunit.cache.internal;
+
+import com.gemstone.gemfire.test.dunit.internal.DistributedTestFixture;
+
+/**
+ * Defines the {@code CacheTestCase} methods that can be overridden by its subclasses.
+ */
+public interface CacheTestFixture extends DistributedTestFixture {
+
+ /**
+ * {@code preTearDownCacheTestCase()} is invoked before {@code CacheTestCase#tearDownCacheTestCase()}.
+ *
+ * <p>Override this as needed. Default implementation is empty.
+ */
+ public void preTearDownCacheTestCase() throws Exception;
+
+ /**
+ * {@code postTearDownCacheTestCase()} is invoked after {@code CacheTestCase#tearDownCacheTestCase()}.
+ *
+ * <p>Override this as needed. Default implementation is empty.
+ */
+ public void postTearDownCacheTestCase() throws Exception;
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/cache/internal/JUnit3CacheTestCase.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/cache/internal/JUnit3CacheTestCase.java b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/cache/internal/JUnit3CacheTestCase.java
new file mode 100644
index 0000000..afbb29d
--- /dev/null
+++ b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/cache/internal/JUnit3CacheTestCase.java
@@ -0,0 +1,223 @@
+/*
+ * 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.test.dunit.cache.internal;
+
+import java.io.File;
+import java.io.IOException;
+
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.CacheException;
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.RegionExistsException;
+import com.gemstone.gemfire.cache.TimeoutException;
+import com.gemstone.gemfire.cache.client.ClientCache;
+import com.gemstone.gemfire.cache.client.ClientCacheFactory;
+import com.gemstone.gemfire.cache30.CacheSerializableRunnable;
+import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
+import com.gemstone.gemfire.test.dunit.IgnoredException;
+import com.gemstone.gemfire.test.dunit.internal.JUnit3DistributedTestCase;
+
+/**
+ * The abstract superclass of tests that require the creation of a
+ * {@link Cache}.
+ */
+public abstract class JUnit3CacheTestCase extends JUnit3DistributedTestCase implements CacheTestFixture {
+
+ private final JUnit4CacheTestCase delegate = new JUnit4CacheTestCase(this);
+
+ public JUnit3CacheTestCase(final String name) {
+ super(name);
+ }
+
+ /**
+ * Creates the {@code Cache} for this test that is not connected to other
+ * members.
+ */
+ public final Cache createLonerCache() {
+ return delegate.createLonerCache();
+ }
+
+ /**
+ * Sets this test up with a {@code CacheCreation} as its cache. Any existing
+ * cache is closed. Whoever calls this must also call {@code finishCacheXml}.
+ */
+ public static final void beginCacheXml() {
+ JUnit4CacheTestCase.beginCacheXml();
+ }
+
+ /**
+ * Finish what {@code beginCacheXml} started. It does this be generating a
+ * cache.xml file and then creating a real cache using that cache.xml.
+ */
+ public final void finishCacheXml(final String name) {
+ delegate.finishCacheXml(name);
+ }
+
+ /**
+ * Finish what {@code beginCacheXml} started. It does this be generating a
+ * cache.xml file and then creating a real cache using that cache.xml.
+ */
+ public final void finishCacheXml(final String name, final boolean useSchema, final String xmlVersion) {
+ delegate.finishCacheXml(name, useSchema, xmlVersion);
+ }
+
+ /**
+ * Return a cache for obtaining regions, created lazily.
+ */
+ public final Cache getCache() {
+ return delegate.getCache();
+ }
+
+ public final Cache getCache(final CacheFactory factory) {
+ return delegate.getCache(factory);
+ }
+
+ public final Cache getCache(final boolean client) {
+ return delegate.getCache(client);
+ }
+
+ public final Cache getCache(final boolean client, final CacheFactory factory) {
+ return delegate.getCache(client, factory);
+ }
+
+ /**
+ * Creates a client cache from the factory if one does not already exist.
+ *
+ * @since 6.5
+ */
+ public final ClientCache getClientCache(final ClientCacheFactory factory) {
+ return delegate.getClientCache(factory);
+ }
+
+ /**
+ * Invokes {@link #getCache()} and casts the return to
+ * {@code GemFireCacheImpl}.
+ */
+ public final GemFireCacheImpl getGemfireCache() { // TODO: remove?
+ return delegate.getGemfireCache();
+ }
+
+ public static final boolean hasCache() {
+ return JUnit4CacheTestCase.hasCache();
+ }
+
+ /**
+ * Return current cache without creating one.
+ */
+ public static final Cache basicGetCache() {
+ return JUnit4CacheTestCase.basicGetCache();
+ }
+
+ /**
+ * Close the cache.
+ */
+ public static final void closeCache() {
+ JUnit4CacheTestCase.closeCache();
+ }
+
+ /**
+ * Closed the cache in all VMs.
+ */
+ protected final void closeAllCache() {
+ delegate.closeAllCache();
+ }
+
+ @Override
+ public final void preTearDown() throws Exception {
+ delegate.preTearDown();
+ }
+
+ @Override
+ public void preTearDownCacheTestCase() throws Exception {
+ }
+
+ @Override
+ public void postTearDownCacheTestCase() throws Exception {
+ }
+
+ /**
+ * Local destroy all root regions and close the cache.
+ */
+ protected static final void remoteTearDown() {
+ JUnit4CacheTestCase.remoteTearDown();
+ }
+
+ /**
+ * Returns a region with the given name and attributes
+ */
+ public final Region createRegion(final String name, final RegionAttributes attributes) throws CacheException {
+ return delegate.createRegion(name, attributes);
+ }
+
+ public final Region createRegion(final String name, final String rootName, final RegionAttributes attributes) throws CacheException {
+ return delegate.createRegion(name, rootName, attributes);
+ }
+
+ public final Region getRootRegion() {
+ return delegate.getRootRegion();
+ }
+
+ public final Region getRootRegion(final String rootName) {
+ return delegate.getRootRegion(rootName);
+ }
+
+ protected final Region createRootRegion(final RegionAttributes attributes) throws RegionExistsException, TimeoutException {
+ return delegate.createRootRegion(attributes);
+ }
+
+ public final Region createRootRegion(final String rootName, final RegionAttributes attributes) throws RegionExistsException, TimeoutException {
+ return delegate.createRootRegion(rootName, attributes);
+ }
+
+ public final Region createExpiryRootRegion(final String rootName, final RegionAttributes attributes) throws RegionExistsException, TimeoutException {
+ return delegate.createExpiryRootRegion(rootName, attributes);
+ }
+
+ /**
+ * @deprecated Please use {@link IgnoredException#addIgnoredException(String)} instead.
+ */
+ @Deprecated
+ public final CacheSerializableRunnable addExceptionTag1(final String exceptionStringToIgnore) {
+ return delegate.addExceptionTag1(exceptionStringToIgnore);
+ }
+
+ /**
+ * @deprecated Please use {@link IgnoredException#remove()} instead.
+ */
+ @Deprecated
+ public final CacheSerializableRunnable removeExceptionTag1(final String exceptionStringToIgnore) {
+ return delegate.removeExceptionTag1(exceptionStringToIgnore);
+ }
+
+ public static final File getDiskDir() {
+ return JUnit4CacheTestCase.getDiskDir();
+ }
+
+ /**
+ * Return a set of disk directories for persistence tests. These directories
+ * will be automatically cleaned up during tear down.
+ */
+ public static final File[] getDiskDirs() {
+ return JUnit4CacheTestCase.getDiskDirs();
+ }
+
+ public static final void cleanDiskDirs() throws IOException {
+ JUnit4CacheTestCase.cleanDiskDirs();
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/cache/internal/JUnit4CacheTestCase.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/cache/internal/JUnit4CacheTestCase.java b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/cache/internal/JUnit4CacheTestCase.java
new file mode 100644
index 0000000..d3988ef
--- /dev/null
+++ b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/cache/internal/JUnit4CacheTestCase.java
@@ -0,0 +1,567 @@
+/*
+ * 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.test.dunit.cache.internal;
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.FilenameFilter;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.util.Map;
+import java.util.Properties;
+
+import com.gemstone.gemfire.cache.AttributesFactory;
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.CacheException;
+import com.gemstone.gemfire.cache.CacheExistsException;
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.CacheTransactionManager;
+import com.gemstone.gemfire.cache.ExpirationAttributes;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.RegionExistsException;
+import com.gemstone.gemfire.cache.TimeoutException;
+import com.gemstone.gemfire.cache.client.ClientCache;
+import com.gemstone.gemfire.cache.client.ClientCacheFactory;
+import com.gemstone.gemfire.cache.client.PoolManager;
+import com.gemstone.gemfire.cache30.CacheSerializableRunnable;
+import com.gemstone.gemfire.distributed.internal.DistributionMessageObserver;
+import com.gemstone.gemfire.internal.FileUtil;
+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.xmlcache.CacheCreation;
+import com.gemstone.gemfire.internal.cache.xmlcache.CacheXmlGenerator;
+import com.gemstone.gemfire.internal.logging.LogService;
+import com.gemstone.gemfire.test.dunit.Assert;
+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.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import org.apache.logging.log4j.Logger;
+
+/**
+ * This class is the base class for all distributed tests using JUnit 4 that
+ * require the creation of a {@link Cache}.
+ *
+ * TODO: make this class abstract when JUnit3CacheTestCase is deleted
+ */
+public class JUnit4CacheTestCase extends JUnit4DistributedTestCase implements CacheTestFixture {
+
+ private static final Logger logger = LogService.getLogger();
+
+ /**
+ * The Cache from which regions are obtained.
+ *
+ * <p>All references synchronized via {@code JUnit4CacheTestCase.class}.
+ *
+ * <p>Field is static so it doesn't get serialized with SerializableRunnable inner classes.
+ */
+ private static Cache cache;
+
+ private final CacheTestFixture cacheTestFixture;
+
+ public JUnit4CacheTestCase() {
+ this((CacheTestFixture)null);
+ }
+
+ JUnit4CacheTestCase(final CacheTestFixture cacheTestFixture) {
+ super(cacheTestFixture);
+ if (cacheTestFixture == null) {
+ this.cacheTestFixture = this;
+ } else {
+ this.cacheTestFixture = cacheTestFixture;
+ }
+ }
+
+ /**
+ * Creates the {@code Cache} for this test
+ */
+ private final void createCache() {
+ createCache(false);
+ }
+
+ private final void createCache(final boolean client) {
+ createCache(client, null);
+ }
+
+ private final void createCache(final boolean client, final CacheFactory factory) {
+ synchronized(JUnit4CacheTestCase.class) {
+ try {
+ System.setProperty("gemfire.DISABLE_DISCONNECT_DS_ON_CACHE_CLOSE", "true");
+ Cache newCache;
+ if (client) {
+ newCache = (Cache)new ClientCacheFactory(getSystem().getProperties()).create();
+ } else {
+ if(factory == null) {
+ newCache = CacheFactory.create(getSystem());
+ } else {
+ Properties props = getSystem().getProperties();
+ for(Map.Entry entry : props.entrySet()) {
+ factory.set((String) entry.getKey(), (String)entry.getValue());
+ }
+ newCache = factory.create();
+ }
+ }
+ cache = newCache;
+ } catch (CacheExistsException e) {
+ Assert.fail("the cache already exists", e); // TODO: remove error handling
+
+ } catch (RuntimeException ex) {
+ throw ex;
+
+ } catch (Exception ex) {
+ Assert.fail("Checked exception while initializing cache??", ex);
+ } finally {
+ System.clearProperty("gemfire.DISABLE_DISCONNECT_DS_ON_CACHE_CLOSE");
+ }
+ }
+ }
+
+ /**
+ * Creates the {@code Cache} for this test that is not connected to other
+ * members.
+ */
+ public final Cache createLonerCache() {
+ synchronized(JUnit4CacheTestCase.class) {
+ try {
+ System.setProperty("gemfire.DISABLE_DISCONNECT_DS_ON_CACHE_CLOSE", "true");
+ Cache newCache = CacheFactory.create(getLonerSystem());
+ cache = newCache;
+ } catch (CacheExistsException e) {
+ Assert.fail("the cache already exists", e); // TODO: remove error handling
+
+ } catch (RuntimeException ex) {
+ throw ex;
+
+ } catch (Exception ex) {
+ Assert.fail("Checked exception while initializing cache??", ex);
+ } finally {
+ System.clearProperty("gemfire.DISABLE_DISCONNECT_DS_ON_CACHE_CLOSE");
+ }
+ return cache;
+ }
+ }
+
+ /**
+ * Sets this test up with a {@code CacheCreation} as its cache. Any existing
+ * cache is closed. Whoever calls this must also call {@code finishCacheXml}.
+ */
+ public static final synchronized void beginCacheXml() {
+ closeCache();
+ cache = new TestCacheCreation();
+ }
+
+ /**
+ * Finish what {@code beginCacheXml} started. It does this be generating a
+ * cache.xml file and then creating a real cache using that cache.xml.
+ */
+ public final void finishCacheXml(final String name) {
+ synchronized(JUnit4CacheTestCase.class) {
+ File file = new File(name + "-cache.xml");
+ try {
+ PrintWriter pw = new PrintWriter(new FileWriter(file), true);
+ CacheXmlGenerator.generate(cache, pw);
+ pw.close();
+ } catch (IOException ex) {
+ Assert.fail("IOException during cache.xml generation to " + file, ex); // TODO: remove error handling
+ }
+ cache = null;
+ GemFireCacheImpl.testCacheXml = file;
+ try {
+ createCache();
+ } finally {
+ GemFireCacheImpl.testCacheXml = null;
+ }
+ }
+ }
+
+ /**
+ * Finish what {@code beginCacheXml} started. It does this be generating a
+ * cache.xml file and then creating a real cache using that cache.xml.
+ */
+ public final void finishCacheXml(final String name, final boolean useSchema, final String xmlVersion) {
+ synchronized(JUnit4CacheTestCase.class) {
+ File dir = new File("XML_" + xmlVersion);
+ dir.mkdirs();
+ File file = new File(dir, name + ".xml");
+ try {
+ PrintWriter pw = new PrintWriter(new FileWriter(file), true);
+ CacheXmlGenerator.generate(cache, pw, useSchema, xmlVersion);
+ pw.close();
+ } catch (IOException ex) {
+ Assert.fail("IOException during cache.xml generation to " + file, ex); // TODO: remove error handling
+ }
+ cache = null;
+ GemFireCacheImpl.testCacheXml = file;
+ try {
+ createCache();
+ } finally {
+ GemFireCacheImpl.testCacheXml = null;
+ }
+ }
+ }
+
+ /**
+ * Return a cache for obtaining regions, created lazily.
+ */
+ public final Cache getCache() {
+ return getCache(false);
+ }
+
+ public final Cache getCache(final CacheFactory factory) {
+ return getCache(false, factory);
+ }
+
+ public final Cache getCache(final boolean client) {
+ return getCache(client, null);
+ }
+
+ public final Cache getCache(final boolean client, final CacheFactory factory) {
+ synchronized (JUnit4CacheTestCase.class) {
+ final GemFireCacheImpl gemFireCache = GemFireCacheImpl.getInstance();
+ if (gemFireCache != null && !gemFireCache.isClosed()
+ && gemFireCache.getCancelCriterion().cancelInProgress() != null) {
+ Wait.waitForCriterion(new WaitCriterion() { // TODO: replace with Awaitility
+ @Override
+ public boolean done() {
+ return gemFireCache.isClosed();
+ }
+ @Override
+ public String description() {
+ return "waiting for cache to close";
+ }
+ }, 30 * 1000, 300, true);
+ }
+ if (cache == null || cache.isClosed()) {
+ cache = null;
+ createCache(client, factory);
+ }
+ if (client && cache != null) {
+ IgnoredException.addIgnoredException("java.net.ConnectException");
+ }
+ return cache;
+ }
+ }
+
+ /**
+ * Creates a client cache from the factory if one does not already exist.
+ *
+ * @since 6.5
+ */
+ public final ClientCache getClientCache(final ClientCacheFactory factory) {
+ synchronized (JUnit4CacheTestCase.class) {
+ final GemFireCacheImpl gemFireCache = GemFireCacheImpl.getInstance();
+ if (gemFireCache != null && !gemFireCache.isClosed()
+ && gemFireCache.getCancelCriterion().cancelInProgress() != null) {
+ Wait.waitForCriterion(new WaitCriterion() { // TODO: replace with Awaitility
+ @Override
+ public boolean done() {
+ return gemFireCache.isClosed();
+ }
+ @Override
+ public String description() {
+ return "waiting for cache to close";
+ }
+ }, 30 * 1000, 300, true);
+ }
+ if (cache == null || cache.isClosed()) {
+ cache = null;
+ disconnectFromDS();
+ cache = (Cache)factory.create();
+ }
+ if (cache != null) {
+ IgnoredException.addIgnoredException("java.net.ConnectException");
+ }
+ return (ClientCache)cache;
+ }
+ }
+
+ /**
+ * Invokes {@link #getCache()} and casts the return to
+ * {@code GemFireCacheImpl}.
+ */
+ public final GemFireCacheImpl getGemfireCache() { // TODO: remove?
+ return (GemFireCacheImpl)getCache();
+ }
+
+ public static final synchronized boolean hasCache() {
+ return cache != null;
+ }
+
+ /**
+ * Return current cache without creating one.
+ */
+ public static final synchronized Cache basicGetCache() {
+ return cache;
+ }
+
+ /**
+ * Close the cache.
+ */
+ public static final synchronized void closeCache() {
+ // Workaround for that fact that some classes are now extending
+ // CacheTestCase but not using it properly.
+ if(cache == null) {
+ cache = GemFireCacheImpl.getInstance();
+ }
+ try {
+ if (cache != null) {
+ try {
+ if (!cache.isClosed()) {
+ if (cache instanceof GemFireCacheImpl) {
+ CacheTransactionManager txMgr = ((GemFireCacheImpl)cache).getTxManager();
+ if (txMgr != null) {
+ if (txMgr.exists()) {
+ try {
+ // make sure we cleanup this threads txid stored in a thread local
+ txMgr.rollback();
+ }catch(Exception ignore) {
+
+ }
+ }
+ }
+ }
+ cache.close();
+ }
+ }
+ finally {
+ cache = null;
+ }
+ } // cache != null
+ } finally {
+ //Make sure all pools are closed, even if we never
+ //created a cache
+ PoolManager.close(false);
+ }
+ }
+
+ /**
+ * Close the cache in all VMs.
+ */
+ protected final void closeAllCache() {
+ closeCache();
+ Invoke.invokeInEveryVM(()->closeCache());
+ }
+
+ @Override
+ public final void preTearDown() throws Exception {
+ preTearDownCacheTestCase();
+ tearDownCacheTestCase();
+ postTearDownCacheTestCase();
+ }
+
+ private final void tearDownCacheTestCase() {
+ remoteTearDown();
+ Invoke.invokeInEveryVM(()->remoteTearDown());
+ }
+
+ @Override
+ public void preTearDownCacheTestCase() throws Exception {
+ if (this.cacheTestFixture != this) {
+ this.cacheTestFixture.preTearDownCacheTestCase();
+ }
+ }
+
+ @Override
+ public void postTearDownCacheTestCase() throws Exception {
+ if (this.cacheTestFixture != this) {
+ this.cacheTestFixture.postTearDownCacheTestCase();
+ }
+ }
+
+ /**
+ * Local destroy all root regions and close the cache.
+ */
+ protected static final synchronized void remoteTearDown() {
+ try {
+ DistributionMessageObserver.setInstance(null);
+ destroyRegions(cache);
+ }
+ finally {
+ try {
+ closeCache();
+ }
+ finally {
+ try {
+ cleanDiskDirs();
+ } catch(Exception e) {
+ LogWriterUtils.getLogWriter().error("Error cleaning disk dirs", e);
+ }
+ }
+ }
+ }
+
+ /**
+ * Returns a region with the given name and attributes.
+ */
+ public final Region createRegion(final String name, final RegionAttributes attributes) throws CacheException {
+ return createRegion(name, "root", attributes);
+ }
+
+ /**
+ * Provide any internal region arguments, typically required when internal
+ * use (aka meta-data) regions are needed.
+ *
+ * @return internal arguments, which may be null. If null, then default
+ * InternalRegionArguments are used to construct the Region
+ */
+ private final InternalRegionArguments getInternalRegionArguments() { // TODO: delete?
+ return null;
+ }
+
+ public final Region createRegion(final String name, final String rootName, final RegionAttributes attributes) throws CacheException {
+ Region root = getRootRegion(rootName);
+ if (root == null) {
+ // don't put listeners on root region
+ RegionAttributes rootAttrs = attributes;
+ AttributesFactory fac = new AttributesFactory(attributes);
+ ExpirationAttributes expiration = ExpirationAttributes.DEFAULT;
+
+ // fac.setCacheListener(null);
+ fac.setCacheLoader(null);
+ fac.setCacheWriter(null);
+ fac.setPoolName(null);
+ fac.setPartitionAttributes(null);
+ fac.setRegionTimeToLive(expiration);
+ fac.setEntryTimeToLive(expiration);
+ fac.setRegionIdleTimeout(expiration);
+ fac.setEntryIdleTimeout(expiration);
+ rootAttrs = fac.create();
+ root = createRootRegion(rootName, rootAttrs);
+ }
+
+ InternalRegionArguments internalArgs = getInternalRegionArguments();
+ if (internalArgs == null) {
+ return root.createSubregion(name, attributes);
+ } else {
+ try {
+ LocalRegion lr = (LocalRegion) root;
+ return lr.createSubregion(name, attributes, internalArgs);
+ } catch (IOException ioe) {
+ AssertionError assErr = new AssertionError("unexpected exception");
+ assErr.initCause(ioe);
+ throw assErr;
+ } catch (ClassNotFoundException cnfe) {
+ AssertionError assErr = new AssertionError("unexpected exception");
+ assErr.initCause(cnfe);
+ throw assErr;
+ }
+ }
+ }
+
+ public final Region getRootRegion() {
+ return getRootRegion("root");
+ }
+
+ public final Region getRootRegion(final String rootName) {
+ return getCache().getRegion(rootName);
+ }
+
+ protected final Region createRootRegion(final RegionAttributes attributes) throws RegionExistsException, TimeoutException {
+ return createRootRegion("root", attributes);
+ }
+
+ public final Region createRootRegion(final String rootName, final RegionAttributes attributes) throws RegionExistsException, TimeoutException {
+ return getCache().createRegion(rootName, attributes);
+ }
+
+ public final Region createExpiryRootRegion(final String rootName, final RegionAttributes attributes) throws RegionExistsException, TimeoutException {
+ System.setProperty(LocalRegion.EXPIRY_MS_PROPERTY, "true");
+ try {
+ return createRootRegion(rootName, attributes);
+ } finally {
+ System.clearProperty(LocalRegion.EXPIRY_MS_PROPERTY);
+ }
+ }
+
+ /**
+ * @deprecated Please use {@link IgnoredException#addIgnoredException(String)} instead.
+ */
+ @Deprecated
+ public final CacheSerializableRunnable addExceptionTag1(final String exceptionStringToIgnore) { // TODO: delete this method
+ CacheSerializableRunnable addExceptionTag = new CacheSerializableRunnable("addExceptionTag") {
+ @Override
+ public void run2() {
+ getCache().getLogger().info("<ExpectedException action=add>" + exceptionStringToIgnore + "</ExpectedException>");
+ }
+ };
+ return addExceptionTag;
+ }
+
+ /**
+ * @deprecated Please use {@link IgnoredException#addIgnoredException(String)} instead.
+ */
+ @Deprecated
+ public final CacheSerializableRunnable removeExceptionTag1(final String exceptionStringToIgnore) { // TODO: delete this method
+ CacheSerializableRunnable removeExceptionTag = new CacheSerializableRunnable("removeExceptionTag") {
+ @Override
+ public void run2() throws CacheException {
+ getCache().getLogger().info("<ExpectedException action=remove>" + exceptionStringToIgnore + "</ExpectedException>");
+ }
+ };
+ return removeExceptionTag;
+ }
+
+ public static final File getDiskDir() {
+ int vmNum = VM.getCurrentVMNum();
+ File dir = new File("diskDir", "disk" + String.valueOf(vmNum)).getAbsoluteFile();
+ dir.mkdirs();
+ return dir;
+ }
+
+ /**
+ * Return a set of disk directories for persistence tests. These directories
+ * will be automatically cleaned up on test case closure.
+ */
+ public static final File[] getDiskDirs() {
+ return new File[] {getDiskDir()};
+ }
+
+ public static final void cleanDiskDirs() throws IOException {
+ FileUtil.delete(getDiskDir());
+ File[] defaultStoreFiles = new File(".").listFiles(new FilenameFilter() {
+ @Override
+ public boolean accept(File dir, String name) {
+ return name.startsWith("BACKUPDiskStore-" + System.getProperty("vmid"));
+ }
+ });
+
+ for(File file: defaultStoreFiles) {
+ FileUtil.delete(file);
+ }
+ }
+
+ /**
+ * Used to generate a cache.xml. Basically just a {@code CacheCreation} with
+ * a few more methods implemented.
+ */
+ private static final class TestCacheCreation extends CacheCreation {
+ private boolean closed = false;
+ @Override
+ public void close() {
+ this.closed = true;
+ }
+ @Override
+ public boolean isClosed() {
+ return this.closed;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/internal/DistributedTestFixture.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/internal/DistributedTestFixture.java b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/internal/DistributedTestFixture.java
new file mode 100755
index 0000000..46c24b2
--- /dev/null
+++ b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/internal/DistributedTestFixture.java
@@ -0,0 +1,87 @@
+/*
+ * 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.test.dunit.internal;
+
+import java.util.Properties;
+
+/**
+ * Defines the {@code DistributedTestCase} methods that can be overridden by its subclasses.
+ */
+public interface DistributedTestFixture {
+
+ /**
+ * {@code preSetUp()} is invoked before {@code DistributedTestCase#setUp()}.
+ *
+ * <p>Override this as needed. Default implementation is empty.
+ */
+ public void preSetUp() throws Exception;
+
+ /**
+ * {@code postSetUp()} is invoked after {@code DistributedTestCase#setUp()}.
+ *
+ * <p>Override this as needed. Default implementation is empty.
+ */
+ public void postSetUp() throws Exception;
+
+ /**
+ * {@code preTearDown()} is invoked before {@code DistributedTestCase#tearDown()}.
+ *
+ * <p>Override this as needed. Default implementation is empty.
+ */
+ public void preTearDown() throws Exception;
+
+ /**
+ * {@code postTearDown()} is invoked after {@code DistributedTestCase#tearDown()}.
+ *
+ * <p>Override this as needed. Default implementation is empty.
+ */
+ public void postTearDown() throws Exception;
+
+ /**
+ * {@code preTearDownAssertions()} is invoked before any tear down methods
+ * have been invoked. If this method throws anything, tear down methods will
+ * still be invoked.
+ *
+ * <p>Override this as needed. Default implementation is empty.
+ */
+ public void preTearDownAssertions() throws Exception;
+
+ /**
+ * {@code postTearDownAssertions()} is invoked after all tear down methods
+ * have completed. This method will not be invoked if
+ * {@code preTearDownAssertions()} throws.
+ *
+ * <p>Override this as needed. Default implementation is empty.
+ */
+ public void postTearDownAssertions() throws Exception;
+
+ /**
+ * Returns the {@code Properties} used to define the {@code DistributedSystem}.
+ *
+ * <p>Override this as needed. This method is called by various
+ * {@code getSystem} methods in {@code DistributedTestCase}.
+ */
+ public Properties getDistributedSystemProperties();
+
+ /**
+ * Returns the {@code name} of the test method being executed.
+ */
+ public String getName();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/internal/JUnit3DistributedTestCase.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/internal/JUnit3DistributedTestCase.java b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/internal/JUnit3DistributedTestCase.java
new file mode 100755
index 0000000..f453e7e
--- /dev/null
+++ b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/internal/JUnit3DistributedTestCase.java
@@ -0,0 +1,247 @@
+/*
+ * 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.test.dunit.internal;
+
+import java.io.Serializable;
+import java.util.Properties;
+
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.distributed.DistributedSystem;
+import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem;
+import com.gemstone.gemfire.internal.logging.LogService;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
+import junit.framework.TestCase;
+import org.apache.logging.log4j.Logger;
+import org.junit.experimental.categories.Category;
+
+/**
+ * This class is the superclass of all distributed tests using JUnit 3.
+ */
+@Category(DistributedTest.class)
+public abstract class JUnit3DistributedTestCase extends TestCase implements DistributedTestFixture, Serializable {
+
+ private static final Logger logger = LogService.getLogger();
+
+ private final JUnit4DistributedTestCase delegate = new JUnit4DistributedTestCase(this);
+
+ /**
+ * Constructs a new distributed test. All JUnit 3 test classes need to have a
+ * String-arg constructor.
+ */
+ public JUnit3DistributedTestCase(final String name) {
+ super(name);
+ JUnit4DistributedTestCase.initializeDistributedTestCase();
+ }
+
+ //---------------------------------------------------------------------------
+ // methods for tests
+ //---------------------------------------------------------------------------
+
+ /**
+ * @deprecated Please override {@link #getDistributedSystemProperties()} instead.
+ */
+ @Deprecated
+ public final void setSystem(final Properties props, final DistributedSystem ds) { // TODO: override getDistributedSystemProperties and then delete
+ delegate.setSystem(props, ds);
+ }
+
+ /**
+ * Returns this VM's connection to the distributed system. If necessary, the
+ * connection will be lazily created using the given {@code Properties}.
+ *
+ * <p>Do not override this method. Override {@link #getDistributedSystemProperties()}
+ * instead.
+ *
+ * <p>Note: "final" was removed so that WANTestBase can override this method.
+ * This was part of the xd offheap merge.
+ *
+ * @since 3.0
+ */
+ public final InternalDistributedSystem getSystem(final Properties props) {
+ return delegate.getSystem(props);
+ }
+
+ /**
+ * Returns this VM's connection to the distributed system. If necessary, the
+ * connection will be lazily created using the {@code Properties} returned by
+ * {@link #getDistributedSystemProperties()}.
+ *
+ * <p>Do not override this method. Override {@link #getDistributedSystemProperties()}
+ * instead.
+ *
+ * @see #getSystem(Properties)
+ *
+ * @since 3.0
+ */
+ public final InternalDistributedSystem getSystem() {
+ return delegate.getSystem();
+ }
+
+ public final InternalDistributedSystem basicGetSystem() {
+ return delegate.basicGetSystem();
+ }
+
+ public final void nullSystem() { // TODO: delete
+ delegate.nullSystem();
+ }
+
+ public static final InternalDistributedSystem getSystemStatic() {
+ return JUnit4DistributedTestCase.getSystemStatic();
+ }
+
+ /**
+ * Returns a loner distributed system that isn't connected to other vms.
+ *
+ * @since 6.5
+ */
+ public final InternalDistributedSystem getLonerSystem() {
+ return delegate.getLonerSystem();
+ }
+
+ /**
+ * Returns whether or this VM is connected to a {@link DistributedSystem}.
+ */
+ public final boolean isConnectedToDS() {
+ return delegate.isConnectedToDS();
+ }
+
+ /**
+ * Returns a {@code Properties} object used to configure a connection to a
+ * {@link DistributedSystem}. Unless overridden, this method will return an
+ * empty {@code Properties} object.
+ *
+ * @since 3.0
+ */
+ public Properties getDistributedSystemProperties() {
+ return delegate.defaultGetDistributedSystemProperties();
+ }
+
+ public static final void disconnectAllFromDS() {
+ JUnit4DistributedTestCase.disconnectAllFromDS();
+ }
+
+ /**
+ * Disconnects this VM from the distributed system
+ */
+ public static final void disconnectFromDS() {
+ JUnit4DistributedTestCase.disconnectFromDS();
+ }
+
+ //---------------------------------------------------------------------------
+ // name methods
+ //---------------------------------------------------------------------------
+
+ public static final String getTestMethodName() {
+ return JUnit4DistributedTestCase.getTestMethodName();
+ }
+
+ /**
+ * Returns a unique name for this test method. It is based on the
+ * name of the class as well as the name of the method.
+ */
+ public final String getUniqueName() {
+ return delegate.getUniqueName();
+ }
+
+ //---------------------------------------------------------------------------
+ // setup methods
+ //---------------------------------------------------------------------------
+
+ /**
+ * Sets up the DistributedTestCase.
+ * <p>
+ * Do not override this method. Override {@link #preSetUp()} with work that
+ * needs to occur before setUp() or override {@link #postSetUp()} with work
+ * that needs to occur after setUp().
+ */
+ @Override
+ public final void setUp() throws Exception {
+ delegate.setUp();
+ }
+
+ /**
+ * {@code preSetUp()} is invoked before {@link JUnit4DistributedTestCase#setUpDistributedTestCase()}.
+ *
+ * <p>Override this as needed. Default implementation is empty.
+ */
+ public void preSetUp() throws Exception {
+ }
+
+ /**
+ * {@code postSetUp()} is invoked after {@link JUnit4DistributedTestCase#setUpDistributedTestCase()}.
+ *
+ * <p>Override this as needed. Default implementation is empty.
+ */
+ public void postSetUp() throws Exception {
+ }
+
+ //---------------------------------------------------------------------------
+ // teardown methods
+ //---------------------------------------------------------------------------
+
+ /**
+ * Tears down the DistributedTestCase.
+ *
+ * <p>Do not override this method. Override {@link #preTearDown()} with work that
+ * needs to occur before tearDown() or override {@link #postTearDown()} with work
+ * that needs to occur after tearDown().
+ */
+ @Override
+ public final void tearDown() throws Exception {
+ delegate.tearDown();
+ }
+
+ /**
+ * {@code preTearDown()} is invoked before {@link JUnit4DistributedTestCase#tearDownDistributedTestCase()}.
+ *
+ * <p>Override this as needed. Default implementation is empty.
+ */
+ public void preTearDown() throws Exception {
+ }
+
+ /**
+ * {@code postTearDown()} is invoked after {@link JUnit4DistributedTestCase#tearDownDistributedTestCase()}.
+ *
+ * <p>Override this as needed. Default implementation is empty.
+ */
+ public void postTearDown() throws Exception {
+ }
+
+ /**
+ * {@code preTearDownAssertions()} is invoked before any tear down methods
+ * have been invoked. If this method throws anything, tear down methods will
+ * still be invoked.
+ *
+ * <p>Override this as needed. Default implementation is empty.
+ */
+ public void preTearDownAssertions() throws Exception {
+ }
+
+ /**
+ * {@code postTearDownAssertions()} is invoked after all tear down methods
+ * have completed. This method will not be invoked if
+ * {@code preTearDownAssertions()} throws.
+ *
+ * <p>Override this as needed. Default implementation is empty.
+ */
+ public void postTearDownAssertions() throws Exception {
+ }
+
+ protected static final void destroyRegions(final Cache cache) { // TODO: this should move to CacheTestCase
+ JUnit4DistributedTestCase.destroyRegions(cache);
+ }
+}
[09/11] incubator-geode git commit: GEODE-1050: add JUnit 4 versions
of DistributedTestCase and CacheTestCase
Posted by kl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/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 ed89a13..ce705ea 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
@@ -111,7 +111,7 @@ public abstract class RegionTestCase extends CacheTestCase {
}
@Override
- protected final void postTearDownCacheTestCase() throws Exception {
+ public final void postTearDownCacheTestCase() throws Exception {
cleanup();
Invoke.invokeInEveryVM(getClass(), "cleanup");
postTearDownRegionTestCase();
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/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 cfd1ce8..f219539 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
@@ -62,8 +62,7 @@ public class RemoveAllMultiVmDUnitTest extends DistributedTestCase {
static CacheTransactionManager cacheTxnMgr;
@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 RemoveAllMultiVmDUnitTest 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/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 f26f94a..d564fca 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
@@ -77,7 +77,7 @@ public class SearchAndLoadDUnitTest extends CacheTestCase {
}
@Override
- protected final void preTearDownCacheTestCase() throws Exception {
+ public final void preTearDownCacheTestCase() throws Exception {
for (int h = 0; h < Host.getHostCount(); h++) {
Host host = Host.getHost(h);
for (int v = 0; v < host.getVMCount(); v++) {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/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 899fbb1..b08fb73 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
@@ -66,17 +66,14 @@ public class SlowRecDUnitTest extends CacheTestCase {
// the setUp and tearDown methods need to make sure we don't
// use the ds from previous test and that we don't leave ours around
// for the next test to use.
-
- public void setUp() throws Exception {
- try {
- disconnectAllFromDS();
- } finally {
- super.setUp();
- }
+
+ @Override
+ public final void preSetUp() throws Exception {
+ disconnectAllFromDS();
}
@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/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 720da56..604ca8a 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
@@ -1077,8 +1077,8 @@ public class TXDistributedDUnitTest extends CacheTestCase {
*/
public static Serializable getSystemId() {
Serializable ret = null;
- if (DistributedTestCase.system != null) {
- ret = DistributedTestCase.system.getDistributionManager().getId();
+ if (getSystemStatic() != null) {
+ ret = getSystemStatic().getDistributionManager().getId();
}
return ret;
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/distributed/DistributedMemberDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/distributed/DistributedMemberDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/distributed/DistributedMemberDUnitTest.java
index 3dc6d75..d66fded 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/distributed/DistributedMemberDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/distributed/DistributedMemberDUnitTest.java
@@ -16,6 +16,8 @@
*/
package com.gemstone.gemfire.distributed;
+import static com.gemstone.gemfire.test.dunit.Assert.*;
+
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.Arrays;
@@ -31,14 +33,14 @@ import com.gemstone.gemfire.distributed.internal.DM;
import com.gemstone.gemfire.distributed.internal.DistributionConfig;
import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem;
import com.gemstone.gemfire.distributed.internal.membership.InternalDistributedMember;
-import com.gemstone.gemfire.test.dunit.Assert;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
import com.gemstone.gemfire.test.dunit.Host;
import com.gemstone.gemfire.test.dunit.SerializableCallable;
import com.gemstone.gemfire.test.dunit.SerializableRunnable;
import com.gemstone.gemfire.test.dunit.VM;
-
-import junit.framework.AssertionFailedError;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
/**
* Tests the functionality of the {@link DistributedMember} class.
@@ -46,13 +48,10 @@ import junit.framework.AssertionFailedError;
* @author Kirk Lund
* @since 5.0
*/
-public class DistributedMemberDUnitTest extends DistributedTestCase {
+@Category(DistributedTest.class)
+public class DistributedMemberDUnitTest extends JUnit4DistributedTestCase {
- public DistributedMemberDUnitTest(String name) {
- super(name);
- }
-
- protected void sleep(long millis) {
+ protected void sleep(long millis) { // TODO: replace with Awaitility
try {
Thread.sleep(millis);
}
@@ -64,6 +63,7 @@ public class DistributedMemberDUnitTest extends DistributedTestCase {
/**
* Tests default settings.
*/
+ @Test
public void testDefaults() {
Properties config = new Properties();
config.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
@@ -94,6 +94,7 @@ public class DistributedMemberDUnitTest extends DistributedTestCase {
}
}
+ @Test
public void testNonDefaultName() {
Properties config = new Properties();
config.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
@@ -118,6 +119,7 @@ public class DistributedMemberDUnitTest extends DistributedTestCase {
* Tests the configuration of many Roles and groups in one vm.
* Confirms no runtime distinction between roles and groups.
*/
+ @Test
public void testRolesInOneVM() {
final String rolesProp = "A,B,C";
final String groupsProp = "D,E,F,G";
@@ -152,6 +154,7 @@ public class DistributedMemberDUnitTest extends DistributedTestCase {
}
}
+ @Test
public void testTwoMembersSameName() {
disconnectFromDS(); // or assertion on # members fails when run-dunit-tests
Host.getHost(0).getVM(0).invoke(new SerializableRunnable() {
@@ -185,7 +188,8 @@ public class DistributedMemberDUnitTest extends DistributedTestCase {
* Tests the configuration of one unique Role in each of four vms. Verifies
* that each vm is aware of the other vms' Roles.
*/
- public void testRolesInAllVMs() {
+ @Test
+ public void testRolesInAllVMs() {
disconnectAllFromDS(); // or assertion on # members fails when run-dunit-tests
// connect all four vms...
@@ -227,7 +231,7 @@ public class DistributedMemberDUnitTest extends DistributedTestCase {
assertEquals(3, members.size());
break;
}
- catch (AssertionFailedError e) {
+ catch (AssertionError e) { // TODO: delete this
if (i < 3) {
sleep(200);
} else {
@@ -268,7 +272,8 @@ public class DistributedMemberDUnitTest extends DistributedTestCase {
* Tests the configuration of one unique group in each of four vms. Verifies
* that each vm is aware of the other vms' groups.
*/
- public void testGroupsInAllVMs() {
+ @Test
+ public void testGroupsInAllVMs() {
disconnectFromDS(); // or assertion on # members fails when run-dunit-tests
// connect all four vms...
@@ -307,7 +312,7 @@ public class DistributedMemberDUnitTest extends DistributedTestCase {
assertEquals(3, members.size());
break;
}
- catch (AssertionFailedError e) {
+ catch (AssertionError e) { // TODO: delete this
if (i < 3) {
sleep(200);
} else {
@@ -359,6 +364,7 @@ public class DistributedMemberDUnitTest extends DistributedTestCase {
* Changing the id can result in bad keys in JMX and can result in numerous
* errors in Admin/JMX tests.
*/
+ @Test
public void testGetId() {
Properties config = new Properties();
config.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
@@ -378,7 +384,8 @@ public class DistributedMemberDUnitTest extends DistributedTestCase {
system.disconnect();
}
}
-
+
+ @Test
public void testFindMemberByName() {
disconnectAllFromDS(); // or assertion on # members fails when run-dunit-tests
VM vm0 = Host.getHost(0).getVM(0);
@@ -408,7 +415,7 @@ public class DistributedMemberDUnitTest extends DistributedTestCase {
assertTrue("Expected" + expected + " got " + members, members.containsAll(expected));
assertEquals(4, members.size());
} catch (UnknownHostException e) {
- Assert.fail("Unable to get IpAddress", e);
+ fail("Unable to get IpAddress", e);
}
}
});
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/distributed/DistributedSystemDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/distributed/DistributedSystemDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/distributed/DistributedSystemDUnitTest.java
index 610be11..f34fd7e 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/distributed/DistributedSystemDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/distributed/DistributedSystemDUnitTest.java
@@ -16,6 +16,8 @@
*/
package com.gemstone.gemfire.distributed;
+import static com.gemstone.gemfire.test.dunit.Assert.*;
+
import java.net.Inet4Address;
import java.net.Inet6Address;
import java.net.InetAddress;
@@ -26,7 +28,6 @@ import java.util.concurrent.TimeoutException;
import com.gemstone.gemfire.CancelException;
import com.gemstone.gemfire.GemFireConfigException;
-import com.gemstone.gemfire.SystemConnectException;
import com.gemstone.gemfire.cache.AttributesFactory;
import com.gemstone.gemfire.cache.Cache;
import com.gemstone.gemfire.cache.CacheFactory;
@@ -44,11 +45,14 @@ import com.gemstone.gemfire.distributed.internal.membership.gms.mgr.GMSMembershi
import com.gemstone.gemfire.internal.AvailablePort;
import com.gemstone.gemfire.internal.AvailablePortHelper;
import com.gemstone.gemfire.internal.SocketCreator;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
import com.gemstone.gemfire.test.dunit.DistributedTestUtils;
import com.gemstone.gemfire.test.dunit.Host;
import com.gemstone.gemfire.test.dunit.LogWriterUtils;
import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
/**
* Tests the functionality of the {@link DistributedSystem} class.
@@ -57,23 +61,18 @@ import com.gemstone.gemfire.test.dunit.VM;
*
* @author David Whitlock
*/
-public class DistributedSystemDUnitTest extends DistributedTestCase {
+@Category(DistributedTest.class)
+public class DistributedSystemDUnitTest extends JUnit4DistributedTestCase {
- public DistributedSystemDUnitTest(String name) {
- super(name);
- }
-
- public void setUp() throws Exception {
- super.setUp();
+ public void postSetUp() throws Exception {
disconnectAllFromDS();
}
- //////// Test methods
-
/**
* ensure that waitForMemberDeparture correctly flushes the serial message queue for
* the given member
*/
+ @Test
public void testWaitForDeparture() throws Exception {
disconnectAllFromDS();
int locatorPort = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
@@ -109,7 +108,7 @@ public class DistributedSystemDUnitTest extends DistributedTestCase {
}
}
- static class FakeMessage extends SerialDistributionMessage {
+ private static class FakeMessage extends SerialDistributionMessage {
volatile boolean[] blocked;
volatile boolean processed;
@@ -143,12 +142,9 @@ public class DistributedSystemDUnitTest extends DistributedTestCase {
* Tests that we can get a DistributedSystem with the same
* configuration twice.
*/
+ @Test
public void testGetSameSystemTwice() {
Properties config = new Properties();
-
-// int unusedPort = AvailablePort.getRandomAvailablePort(AvailablePort.JGROUPS);
-// config.setProperty("mcast-port", String.valueOf(unusedPort));
- // a loner is all this test needs
config.setProperty("mcast-port", "0");
config.setProperty("locators", "");
// set a flow-control property for the test (bug 37562)
@@ -165,12 +161,9 @@ public class DistributedSystemDUnitTest extends DistributedTestCase {
* different configuration after one has already been obtained
* throws an exception.
*/
+ @Test
public void testGetDifferentSystem() {
Properties config = new Properties();
-
-// int unusedPort = AvailablePort.getRandomAvailablePort(AvailablePort.JGROUPS);
-// config.setProperty("mcast-port", String.valueOf(unusedPort));
- // a loner is all this test needs
config.setProperty("mcast-port", "0");
config.setProperty("locators", "");
config.setProperty("mcast-flow-control", "3000000,0.20,3000");
@@ -196,12 +189,9 @@ public class DistributedSystemDUnitTest extends DistributedTestCase {
* Tests getting a system with a different configuration after
* another system has been closed.
*/
+ @Test
public void testGetDifferentSystemAfterClose() {
Properties config = new Properties();
-
-// int unusedPort = AvailablePort.getRandomAvailablePort(AvailablePort.JGROUPS);
-// config.setProperty("mcast-port", String.valueOf(unusedPort));
- // a loner is all this test needs
config.setProperty("mcast-port", "0");
config.setProperty("locators", "");
@@ -213,13 +203,11 @@ public class DistributedSystemDUnitTest extends DistributedTestCase {
DistributedSystem system2 = DistributedSystem.connect(config);
system2.disconnect();
}
-
-
+
+
+ @Test
public void testGetProperties() {
Properties config = new Properties();
-
-// int unusedPort = AvailablePort.getRandomAvailablePort(AvailablePort.JGROUPS);
-// config.setProperty("mcast-port", String.valueOf(unusedPort));
// a loner is all this test needs
int unusedPort = 0;
config.setProperty("mcast-port", "0");
@@ -235,13 +223,14 @@ public class DistributedSystemDUnitTest extends DistributedTestCase {
assertTrue(config != system1.getProperties());
assertEquals(unusedPort, Integer.parseInt(system1.getProperties().getProperty("mcast-port")));
}
-
-
+
+
+ @Test
public void testIsolatedDistributedSystem() throws Exception {
Properties config = new Properties();
config.setProperty("mcast-port", "0");
config.setProperty("locators", "");
- system = (InternalDistributedSystem)DistributedSystem.connect(config);
+ getSystem(config);
try {
// make sure isolated distributed system can still create a cache and region
Cache cache = CacheFactory.create(getSystem());
@@ -255,12 +244,13 @@ public class DistributedSystemDUnitTest extends DistributedTestCase {
/** test the ability to set the port used to listen for tcp/ip connections */
+ @Test
public void testSpecificTcpPort() throws Exception {
Properties config = new Properties();
int tcpPort = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
config.put("locators", "localhost["+DistributedTestUtils.getDUnitLocatorPort()+"]");
config.setProperty("tcp-port", String.valueOf(tcpPort));
- system = (InternalDistributedSystem)DistributedSystem.connect(config);
+ InternalDistributedSystem system = getSystem(config);
DistributionManager dm = (DistributionManager)system.getDistributionManager();
GMSMembershipManager mgr = (GMSMembershipManager)dm.getMembershipManager();
int actualPort = mgr.getDirectChannelPort();
@@ -269,6 +259,7 @@ public class DistributedSystemDUnitTest extends DistributedTestCase {
}
/** test that loopback cannot be used as a bind address when a locator w/o a bind address is being used */
+ @Test
public void testLoopbackNotAllowed() throws Exception {
// DISABLED for bug #49926
InetAddress loopback = null;
@@ -291,7 +282,7 @@ public class DistributedSystemDUnitTest extends DistributedTestCase {
config.setProperty(DistributionConfig.BIND_ADDRESS_NAME, loopback.getHostAddress());
LogWriterUtils.getLogWriter().info("attempting to connect with " + loopback +" and locators=" + locators);
try {
- system = (InternalDistributedSystem)DistributedSystem.connect(config);
+ InternalDistributedSystem system = getSystem(config);
system.disconnect();
fail("expected a configuration exception disallowing use of loopback address");
} catch (GemFireConfigException e) {
@@ -302,14 +293,15 @@ public class DistributedSystemDUnitTest extends DistributedTestCase {
}
}
+ @Test
public void testUDPPortRange() throws Exception {
Properties config = new Properties();
int unicastPort = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
config.put("locators", "localhost["+DistributedTestUtils.getDUnitLocatorPort()+"]");
// Minimum 3 ports required in range for UDP, FD_SOCK and TcpConduit.
config.setProperty(DistributionConfig.MEMBERSHIP_PORT_RANGE_NAME,
- ""+unicastPort+"-"+(unicastPort+2));
- system = (InternalDistributedSystem)DistributedSystem.connect(config);
+ ""+unicastPort+"-"+(unicastPort+2));
+ InternalDistributedSystem system = getSystem(config);
DistributionManager dm = (DistributionManager)system.getDistributionManager();
InternalDistributedMember idm = dm.getDistributionManagerId();
system.disconnect();
@@ -345,6 +337,7 @@ public class DistributedSystemDUnitTest extends DistributedTestCase {
return startPort;
}
+ @Test
public void testMembershipPortRangeWithExactThreeValues() throws Exception {
Properties config = new Properties();
config.setProperty("locators", "localhost[" + DistributedTestUtils.getDUnitLocatorPort() + "]");
@@ -352,7 +345,7 @@ public class DistributedSystemDUnitTest extends DistributedTestCase {
int portStartRange = getPortRange(portRange);
int portEndRange = portStartRange + portRange - 1;
config.setProperty(DistributionConfig.MEMBERSHIP_PORT_RANGE_NAME, "" + (portStartRange) + "-" + (portEndRange));
- system = (InternalDistributedSystem) DistributedSystem.connect(config);
+ InternalDistributedSystem system = getSystem(config);
Cache cache = CacheFactory.create(system);
cache.addCacheServer();
DistributionManager dm = (DistributionManager) system.getDistributionManager();
@@ -364,6 +357,7 @@ public class DistributedSystemDUnitTest extends DistributedTestCase {
assertTrue(idm.getDirectChannelPort() >= portStartRange);
}
+ @Test
public void testConflictingUDPPort() throws Exception {
final Properties config = new Properties();
final int mcastPort = AvailablePort.getRandomAvailablePort(AvailablePort.MULTICAST);
@@ -373,7 +367,7 @@ public class DistributedSystemDUnitTest extends DistributedTestCase {
config.setProperty("start-locator", "localhost["+socketPorts[1]+"]");
config.setProperty(DistributionConfig.MEMBERSHIP_PORT_RANGE_NAME,
""+unicastPort+"-"+(unicastPort+2));
- system = (InternalDistributedSystem)DistributedSystem.connect(config);
+ InternalDistributedSystem system = (InternalDistributedSystem)DistributedSystem.connect(config);
try {
DistributionManager dm = (DistributionManager)system.getDistributionManager();
InternalDistributedMember idm = dm.getDistributionManagerId();
@@ -402,13 +396,9 @@ public class DistributedSystemDUnitTest extends DistributedTestCase {
*
* @since 4.0
*/
+ @Test
public void testEmptyCacheXmlFile() throws Exception {
Properties config = new Properties();
-
-// int unusedPort =
-// AvailablePort.getRandomAvailablePort(AvailablePort.JGROUPS);
-// config.setProperty("mcast-port", String.valueOf(unusedPort));
- // a loner is all this test needs
config.setProperty("mcast-port", "0");
config.setProperty("locators", "");
config.setProperty(DistributionConfig.CACHE_XML_FILE_NAME, "");
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/distributed/HostedLocatorsDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/distributed/HostedLocatorsDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/distributed/HostedLocatorsDUnitTest.java
index fe2202f..f874417 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/distributed/HostedLocatorsDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/distributed/HostedLocatorsDUnitTest.java
@@ -50,13 +50,14 @@ public class HostedLocatorsDUnitTest extends DistributedTestCase {
protected transient volatile int locatorPort;
protected transient volatile LocatorLauncher launcher;
-
- public void setUp() throws Exception {
+
+ @Override
+ public final void postSetUp() throws Exception {
disconnectAllFromDS();
}
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
disconnectAllFromDS();
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/distributed/LocatorDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/distributed/LocatorDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/distributed/LocatorDUnitTest.java
index 5969c51..f6dfde4 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/distributed/LocatorDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/distributed/LocatorDUnitTest.java
@@ -75,6 +75,8 @@ import com.gemstone.gemfire.test.dunit.WaitCriterion;
*/
public class LocatorDUnitTest extends DistributedTestCase {
+ private static volatile InternalDistributedSystem system = null;
+
static TestHook hook;
/**
@@ -93,15 +95,14 @@ public class LocatorDUnitTest extends DistributedTestCase {
private int port2;
@Override
- public void setUp() throws Exception {
- super.setUp();
+ public final void postSetUp() throws Exception {
port1 = -1;
port2 = -1;
IgnoredException.addIgnoredException("Removing shunned member");
}
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
if (Locator.hasLocator()) {
Locator.getLocator().stop();
}
@@ -115,6 +116,14 @@ public class LocatorDUnitTest extends DistributedTestCase {
}
}
+ @Override
+ public final void postTearDown() throws Exception {
+ if (system != null) {
+ system.disconnect();
+ system = null;
+ }
+ }
+
//////// Test Methods
/**
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/distributed/SystemAdminDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/distributed/SystemAdminDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/distributed/SystemAdminDUnitTest.java
index 64014de..73c9c8c 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/distributed/SystemAdminDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/distributed/SystemAdminDUnitTest.java
@@ -1,19 +1,19 @@
-/*
- * 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.distributed;
import java.io.BufferedReader;
@@ -28,9 +28,9 @@ import java.util.Properties;
import com.gemstone.gemfire.distributed.internal.DistributionManager;
import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem;
-import com.gemstone.gemfire.internal.SystemAdmin;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
-import com.gemstone.gemfire.test.dunit.DistributedTestUtils;
+import com.gemstone.gemfire.internal.SystemAdmin;
+import com.gemstone.gemfire.test.dunit.DistributedTestCase;
+import com.gemstone.gemfire.test.dunit.DistributedTestUtils;
import com.gemstone.gemfire.test.dunit.LogWriterUtils;
public class SystemAdminDUnitTest extends DistributedTestCase {
@@ -40,19 +40,18 @@ public class SystemAdminDUnitTest extends DistributedTestCase {
}
@Override
- public void setUp() throws Exception {
- super.setUp();
+ public final void postSetUp() throws Exception {
disconnect();
}
- @Override
- protected final void preTearDown() throws Exception {
+ @Override
+ public final void preTearDown() throws Exception {
disconnect();
}
public void disconnect() {
// get rid of the command-line distributed system created by SystemAdmin
- system = null;
+ nullSystem();
InternalDistributedSystem sys = InternalDistributedSystem.getAnyInstance();
if (sys != null && sys.isConnected()) {
LogWriterUtils.getLogWriter().info("disconnecting(3)");
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/Bug40751DUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/Bug40751DUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/Bug40751DUnitTest.java
index e98c608..d906c09 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/Bug40751DUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/Bug40751DUnitTest.java
@@ -48,7 +48,7 @@ public class Bug40751DUnitTest 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/distributed/internal/ConsoleDistributionManagerDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/ConsoleDistributionManagerDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/ConsoleDistributionManagerDUnitTest.java
index 847edb5..2aa9d27 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/ConsoleDistributionManagerDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/ConsoleDistributionManagerDUnitTest.java
@@ -71,7 +71,8 @@ public class ConsoleDistributionManagerDUnitTest
// this.lastAlert = alert;
}
- public void setUp() throws Exception {
+ @Override
+ public final void postSetUp() throws Exception {
boolean finishedSetup = false;
IgnoredException.addIgnoredException("Error occurred while reading system log");
try {
@@ -83,7 +84,6 @@ public class ConsoleDistributionManagerDUnitTest
DistributionManager.isDedicatedAdminVM = true;
- super.setUp();
populateCache();
RemoteTransportConfig transport = null;
@@ -145,12 +145,12 @@ public class ConsoleDistributionManagerDUnitTest
}
@Override
- protected final void preTearDownCacheTestCase() throws Exception {
+ public final void preTearDownCacheTestCase() throws Exception {
this.agent.disconnect();
}
@Override
- protected final void postTearDownCacheTestCase() throws Exception {
+ public final void postTearDownCacheTestCase() throws Exception {
try {
disconnectFromDS(); //make sure there's no ldm lying around
} finally {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/DistributionAdvisorDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/DistributionAdvisorDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/DistributionAdvisorDUnitTest.java
index d11d22b..391cec9 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/DistributionAdvisorDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/DistributionAdvisorDUnitTest.java
@@ -41,9 +41,9 @@ public class DistributionAdvisorDUnitTest extends DistributedTestCase {
public DistributionAdvisorDUnitTest(String name) {
super(name);
}
-
- public void setUp() throws Exception {
- super.setUp();
+
+ @Override
+ public final void postSetUp() throws Exception {
// connect to distributed system in every VM
Invoke.invokeInEveryVM(new SerializableRunnable("DistributionAdvisorDUnitTest: SetUp") {
public void run() {
@@ -84,7 +84,7 @@ public class DistributionAdvisorDUnitTest extends DistributedTestCase {
}
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
this.advisor.close();
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/DistributionManagerDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/DistributionManagerDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/DistributionManagerDUnitTest.java
index 25eec69..81d35d4 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/DistributionManagerDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/DistributionManagerDUnitTest.java
@@ -46,6 +46,7 @@ import com.gemstone.gemfire.distributed.internal.membership.gms.MembershipManage
import com.gemstone.gemfire.distributed.internal.membership.gms.interfaces.Manager;
import com.gemstone.gemfire.distributed.internal.membership.gms.mgr.GMSMembershipManager;
import com.gemstone.gemfire.internal.logging.LogService;
+import com.gemstone.gemfire.test.dunit.internal.JUnit3DistributedTestCase;
import com.gemstone.gemfire.test.dunit.DistributedTestCase;
import com.gemstone.gemfire.test.dunit.Host;
import com.gemstone.gemfire.test.dunit.IgnoredException;
@@ -75,9 +76,8 @@ public class DistributionManagerDUnitTest extends DistributedTestCase {
}
@Override
- public void setUp() throws Exception {
+ public void preSetUp() throws Exception {
disconnectAllFromDS();
- super.setUp();
}
//////// Test Methods
@@ -310,18 +310,18 @@ public class DistributionManagerDUnitTest extends DistributedTestCase {
rgn.put("bomb", "pow!"); // this will hang until vm1 responds
rgn.getCache().close();
- system.disconnect();
+ basicGetSystem().disconnect();
vm1.invoke(new SerializableRunnable("disconnect from ds") {
public void run() {
if (!myCache.isClosed()) {
- if (system.isConnected()) {
- system.disconnect();
+ if (basicGetSystem().isConnected()) {
+ basicGetSystem().disconnect();
}
myCache = null;
}
- if (system.isConnected()) {
- system.disconnect();
+ if (basicGetSystem().isConnected()) {
+ basicGetSystem().disconnect();
}
synchronized(alertGuard) {
assertTrue(alertReceived);
@@ -347,8 +347,8 @@ public class DistributionManagerDUnitTest extends DistributedTestCase {
public void afterCreate(EntryEvent event) {
try {
if (playDead) {
- MembershipManagerHelper.beSickMember(system);
- MembershipManagerHelper.playDead(system);
+ MembershipManagerHelper.beSickMember(getSystemStatic());
+ MembershipManagerHelper.playDead(getSystemStatic());
}
Thread.sleep(15000);
}
@@ -373,7 +373,7 @@ public class DistributionManagerDUnitTest extends DistributedTestCase {
static void createAlertListener() throws Exception {
DistributedSystemConfig config =
- AdminDistributedSystemFactory.defineDistributedSystem(system, null);
+ AdminDistributedSystemFactory.defineDistributedSystem(getSystemStatic(), null);
adminSystem =
AdminDistributedSystemFactory.getDistributedSystem(config);
adminSystem.setAlertLevel(AlertLevel.SEVERE);
@@ -423,13 +423,13 @@ public class DistributionManagerDUnitTest extends DistributedTestCase {
.setScope(Scope.DISTRIBUTED_ACK)
.setDataPolicy(DataPolicy.REPLICATE)
.create("testRegion");
- system.getLogWriter().info("<ExpectedException action=add>sec have elapsed while waiting for replies</ExpectedException>");
+ basicGetSystem().getLogWriter().info("<ExpectedException action=add>sec have elapsed while waiting for replies</ExpectedException>");
vm1.invoke(new SerializableRunnable("Connect to distributed system") {
public void run() {
props.setProperty(DistributionConfig.NAME_NAME, "sleeper");
getSystem(props);
- LogWriter log = system.getLogWriter();
+ LogWriter log = basicGetSystem().getLogWriter();
log.info("<ExpectedException action=add>service failure</ExpectedException>");
log.info("<ExpectedException action=add>com.gemstone.gemfire.ForcedDisconnectException</ExpectedException>");
RegionFactory rf = new RegionFactory();
@@ -449,15 +449,15 @@ public class DistributionManagerDUnitTest extends DistributedTestCase {
rgn.getCache().close();
- system.getLogWriter().info("<ExpectedException action=remove>sec have elapsed while waiting for replies</ExpectedException>");
- system.disconnect();
+ basicGetSystem().getLogWriter().info("<ExpectedException action=remove>sec have elapsed while waiting for replies</ExpectedException>");
+ basicGetSystem().disconnect();
vm1.invoke(new SerializableRunnable("wait for forced disconnect") {
public void run() {
// wait a while for the DS to finish disconnecting
WaitCriterion ev = new WaitCriterion() {
public boolean done() {
- return !system.isConnected();
+ return !basicGetSystem().isConnected();
}
public String description() {
return null;
@@ -477,14 +477,14 @@ public class DistributionManagerDUnitTest extends DistributedTestCase {
Wait.waitForCriterion(ev, 20 * 1000, 200, false);
if (!myCache.isClosed()) {
- if (system.isConnected()) {
- system.disconnect();
+ if (basicGetSystem().isConnected()) {
+ basicGetSystem().disconnect();
}
myCache = null;
throw new RuntimeException("Test Failed - vm1's cache is not closed");
}
- if (system.isConnected()) {
- system.disconnect();
+ if (basicGetSystem().isConnected()) {
+ basicGetSystem().disconnect();
throw new RuntimeException("Test Failed - vm1's system should have been disconnected");
}
@@ -545,7 +545,7 @@ public class DistributionManagerDUnitTest extends DistributedTestCase {
public void testWaitForViewInstallation() {
getSystem(new Properties());
- MembershipManager mgr = system.getDM().getMembershipManager();
+ MembershipManager mgr = basicGetSystem().getDM().getMembershipManager();
final NetView v = mgr.getView();
@@ -553,7 +553,7 @@ public class DistributionManagerDUnitTest extends DistributedTestCase {
Thread t = new Thread("wait for view installation") {
public void run() {
try {
- ((DistributionManager)system.getDM()).waitForViewInstallation(v.getViewId()+1);
+ ((DistributionManager)basicGetSystem().getDM()).waitForViewInstallation(v.getViewId()+1);
synchronized(passed) {
passed[0] = true;
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/ProductUseLogDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/ProductUseLogDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/ProductUseLogDUnitTest.java
index 149d6d8..e2217b5 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/ProductUseLogDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/ProductUseLogDUnitTest.java
@@ -1,19 +1,19 @@
-/*
- * 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.distributed.internal;
import java.io.BufferedReader;
@@ -27,24 +27,24 @@ import com.gemstone.gemfire.cache.CacheFactory;
import com.gemstone.gemfire.cache.server.CacheServer;
import com.gemstone.gemfire.distributed.Locator;
import com.gemstone.gemfire.internal.AvailablePort;
-import com.gemstone.gemfire.internal.cache.CacheServerImpl;
-import com.gemstone.gemfire.test.dunit.Assert;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
-import com.gemstone.gemfire.test.dunit.Host;
-import com.gemstone.gemfire.test.dunit.SerializableRunnable;
+import com.gemstone.gemfire.internal.cache.CacheServerImpl;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.DistributedTestCase;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.SerializableRunnable;
import com.gemstone.gemfire.test.dunit.VM;
public class ProductUseLogDUnitTest extends DistributedTestCase {
public ProductUseLogDUnitTest(String name) {
super(name);
- }
-
- @Override
- public Properties getDistributedSystemProperties() {
- Properties p = super.getDistributedSystemProperties();
- p.put(DistributionConfig.USE_CLUSTER_CONFIGURATION_NAME, "false");
- return p;
+ }
+
+ @Override
+ public Properties getDistributedSystemProperties() {
+ Properties p = super.getDistributedSystemProperties();
+ p.put(DistributionConfig.USE_CLUSTER_CONFIGURATION_NAME, "false");
+ return p;
}
public void testMembershipMonitoring() throws Exception {
@@ -54,8 +54,8 @@ public class ProductUseLogDUnitTest extends DistributedTestCase {
// use a locator so we will monitor server load and record member->server mappings
int locatorPort = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
Properties p = new Properties();
- p.put(DistributionConfig.START_LOCATOR_NAME, "localhost["+locatorPort+"],peer=false");
- p.put(DistributionConfig.USE_CLUSTER_CONFIGURATION_NAME, "false");
+ p.put(DistributionConfig.START_LOCATOR_NAME, "localhost["+locatorPort+"],peer=false");
+ p.put(DistributionConfig.USE_CLUSTER_CONFIGURATION_NAME, "false");
InternalDistributedSystem system = getSystem(p);
InternalLocator locator = (InternalLocator)Locator.getLocator();
@@ -71,7 +71,7 @@ public class ProductUseLogDUnitTest extends DistributedTestCase {
public void run() {
InternalDistributedSystem system = getSystem();
Cache cache = CacheFactory.create(system);
- CacheServer server = cache.addCacheServer();
+ CacheServer server = cache.addCacheServer();
server.setPort(0);
try {
server.start();
@@ -101,8 +101,8 @@ public class ProductUseLogDUnitTest extends DistributedTestCase {
return sb.toString();
}
- @Override
- protected final void preTearDown() throws Exception {
+ @Override
+ public final void preTearDown() throws Exception {
disconnectAllFromDS();
}
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/deadlock/GemFireDeadlockDetectorDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/deadlock/GemFireDeadlockDetectorDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/deadlock/GemFireDeadlockDetectorDUnitTest.java
index bc3bee6..9120366 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/deadlock/GemFireDeadlockDetectorDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/deadlock/GemFireDeadlockDetectorDUnitTest.java
@@ -53,7 +53,7 @@ public class GemFireDeadlockDetectorDUnitTest 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/distributed/internal/tcpserver/TcpServerBackwardCompatDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/tcpserver/TcpServerBackwardCompatDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/tcpserver/TcpServerBackwardCompatDUnitTest.java
index 3685ac4..3ca83fb 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/tcpserver/TcpServerBackwardCompatDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/tcpserver/TcpServerBackwardCompatDUnitTest.java
@@ -67,8 +67,7 @@ public class TcpServerBackwardCompatDUnitTest extends DistributedTestCase {
}
@Override
- public void setUp() throws Exception {
- super.setUp();
+ public final void postSetUp() throws Exception {
disconnectAllFromDS();
Invoke.invokeInEveryVM(new CacheSerializableRunnable("Set TcpServer.isTesting true") {
@@ -80,7 +79,7 @@ public class TcpServerBackwardCompatDUnitTest extends DistributedTestCase {
}
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
Invoke.invokeInEveryVM(new CacheSerializableRunnable("Set TcpServer.isTesting true") {
@Override
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/disttx/CacheMapDistTXDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/disttx/CacheMapDistTXDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/disttx/CacheMapDistTXDUnitTest.java
index c0e8268..f0ea16d 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/disttx/CacheMapDistTXDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/disttx/CacheMapDistTXDUnitTest.java
@@ -32,21 +32,32 @@ public class CacheMapDistTXDUnitTest extends CacheMapTxnDUnitTest {
super(name);
}
- public void setUp() throws Exception {
+ @Override
+ public final void preSetUp() throws Exception {
Host host = Host.getHost(0);
VM vm0 = host.getVM(0);
VM vm1 = host.getVM(1);
vm0.invoke(() -> CacheMapDistTXDUnitTest.setDistributedTX());
vm1.invoke(() -> CacheMapDistTXDUnitTest.setDistributedTX());
+ }
- super.setUp(); // creates cache
+ @Override
+ public final void postSetUpCacheMapTxnDUnitTest() throws Exception {
+ Host host = Host.getHost(0);
+ VM vm0 = host.getVM(0);
+ VM vm1 = host.getVM(1);
- // make sure that "distributed-transactions" is true
+ // make sure that "distributed-transactions" is true
vm0.invoke(() -> CacheMapDistTXDUnitTest.checkIsDistributedTX());
vm1.invoke(() -> CacheMapDistTXDUnitTest.checkIsDistributedTX());
}
+ @Override
+ public final void postTearDown() throws Exception {
+ props.clear();
+ }
+
public static void setDistributedTX() {
props.setProperty(DistributionConfig.DISTRIBUTED_TRANSACTIONS_NAME, "true");
// props.setProperty(DistributionConfig.LOG_LEVEL_NAME, "fine");
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/disttx/DistTXDebugDUnitDisabledTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/disttx/DistTXDebugDUnitDisabledTest.java b/geode-core/src/test/java/com/gemstone/gemfire/disttx/DistTXDebugDUnitDisabledTest.java
new file mode 100644
index 0000000..dbd5d3c
--- /dev/null
+++ b/geode-core/src/test/java/com/gemstone/gemfire/disttx/DistTXDebugDUnitDisabledTest.java
@@ -0,0 +1,1016 @@
+/*
+ * 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 com.gemstone.gemfire.DataSerializable;
+import com.gemstone.gemfire.DataSerializer;
+import com.gemstone.gemfire.cache.AttributesFactory;
+import com.gemstone.gemfire.cache.CacheException;
+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.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;
+
+/**
+ * TODO: reenable this test and fix it when work on Dist TX resumes -- it fails with no members to host buckets
+ */
+public class DistTXDebugDUnitDisabledTest extends CacheTestCase {
+ VM accessor = null;
+ VM dataStore1 = null;
+ VM dataStore2 = null;
+ VM dataStore3 = null;
+
+ public DistTXDebugDUnitDisabledTest(String name) {
+ super(name);
+ }
+
+ @Override
+ public final void postSetUp() throws Exception {
+ Host host = Host.getHost(0);
+ dataStore1 = host.getVM(0);
+ dataStore2 = host.getVM(1);
+ dataStore3 = host.getVM(2);
+ accessor = host.getVM(3);
+ postSetUpDistTXDebugDUnitTest();
+ }
+
+ protected void postSetUpDistTXDebugDUnitTest() throws Exception {
+ }
+
+ @Override
+ public final void postTearDownCacheTestCase() throws Exception {
+ Invoke.invokeInEveryVM(new SerializableRunnable() {
+ public void run() {
+ InternalResourceManager.setResourceObserver(null);
+ }
+ });
+ InternalResourceManager.setResourceObserver(null);
+ }
+
+ public static void createCacheInVm() {
+ new DistTXDebugDUnitDisabledTest("temp").getCache();
+ }
+
+ protected void createCacheInAllVms() {
+ dataStore1.invoke(() -> DistTXDebugDUnitDisabledTest.createCacheInVm());
+ dataStore2.invoke(() -> DistTXDebugDUnitDisabledTest.createCacheInVm());
+ dataStore3.invoke(() -> DistTXDebugDUnitDisabledTest.createCacheInVm());
+ accessor.invoke(() -> DistTXDebugDUnitDisabledTest.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(basicGetCache());
+ Region pr = basicGetCache().createRegion(partitionedRegionName, attr.create());
+ assertNotNull(pr);
+ LogWriterUtils.getLogWriter().info(
+ "Partitioned Region " + partitionedRegionName
+ + " created Successfully :" + pr.toString());
+ }
+
+ protected void createPartitionedRegion(Object[] attributes) {
+ dataStore1.invoke(DistTXDebugDUnitDisabledTest.class, "createPR", attributes);
+ dataStore2.invoke(DistTXDebugDUnitDisabledTest.class, "createPR", attributes);
+ dataStore3.invoke(DistTXDebugDUnitDisabledTest.class, "createPR", attributes);
+ // make Local max memory = o for accessor
+ attributes[2] = new Integer(0);
+ accessor.invoke(DistTXDebugDUnitDisabledTest.class, "createPR", attributes);
+ }
+
+ public static void destroyPR(String partitionedRegionName) {
+ // assertNotNull(basicGetCache());
+ // Region pr = basicGetCache().getRegion(partitionedRegionName);
+
+ assertNotNull(basicGetCache());
+ Region pr = basicGetCache().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 = basicGetCache().createRegion(replicatedRegionName, af.create());
+ assertNotNull(rr);
+ LogWriterUtils.getLogWriter().info(
+ "Replicated Region " + replicatedRegionName + " created Successfully :"
+ + rr.toString());
+ }
+
+ protected void createReplicatedRegion(Object[] attributes) {
+ dataStore1.invoke(DistTXDebugDUnitDisabledTest.class, "createRR", attributes);
+ dataStore2.invoke(DistTXDebugDUnitDisabledTest.class, "createRR", attributes);
+ dataStore3.invoke(DistTXDebugDUnitDisabledTest.class, "createRR", attributes);
+ // DataPolicy.EMPTY for accessor
+ attributes[1] = Boolean.TRUE;
+ accessor.invoke(DistTXDebugDUnitDisabledTest.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) basicGetCache().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 = basicGetCache().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) basicGetCache()
+ .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(() -> DistTXDebugDUnitDisabledTest.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) basicGetCache().getRegion("pregion1");
+ Region rr1 = basicGetCache().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 = basicGetCache().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) basicGetCache().getRegion("pregion1");
+ Region rr1 = basicGetCache().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(() -> DistTXDebugDUnitDisabledTest.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) basicGetCache().getRegion("pregion1");
+ // Region rr1 = basicGetCache().getRegion("rregion1");
+ Region rr1 = basicGetCache().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 = basicGetCache().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) basicGetCache().getRegion("pregion1");
+ LogWriterUtils.getLogWriter().info(
+ " calling pr.getLocalSize " + pr1.getLocalSize());
+ assertEquals(2, pr1.getLocalSize());
+
+ Region rr1 = basicGetCache().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(() -> DistTXDebugDUnitDisabledTest.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) basicGetCache().getRegion("pregion1");
+
+ // put in tx and commit
+ // CacheTransactionManager ctx = basicGetCache()
+ // .getCacheTransactionManager();
+ CacheTransactionManager ctx = basicGetCache().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) basicGetCache().getRegion("pregion1");
+ CacheTransactionManager ctx = basicGetCache().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) basicGetCache().getRegion("pregion1");
+
+ // put in tx and commit
+ // CacheTransactionManager ctx = basicGetCache()
+ // .getCacheTransactionManager();
+ CacheTransactionManager ctx = basicGetCache().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(() -> DistTXDebugDUnitDisabledTest.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) basicGetCache().getRegion("pregion1");
+ Region rr1 = basicGetCache().getRegion("rregion1");
+ CacheTransactionManager ctx = basicGetCache().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 = basicGetCache().getRegion("rregion1");
+ LogWriterUtils.getLogWriter()
+ .info(" calling rr.getLocalSize " + rr1.size());
+ assertEquals(3, rr1.size());
+
+ PartitionedRegion pr1 = (PartitionedRegion) basicGetCache().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) basicGetCache().getRegion("pregion1");
+ Region rr1 = basicGetCache().getRegion("rregion1");
+
+ CacheTransactionManager ctx = basicGetCache().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 = basicGetCache().getRegion("rregion1");
+ LogWriterUtils.getLogWriter()
+ .info(" calling rr.getLocalSize " + rr1.size());
+ assertEquals(3, rr1.size());
+
+ PartitionedRegion pr1 = (PartitionedRegion) basicGetCache().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) basicGetCache().getRegion("pregion1");
+
+ CacheTransactionManager ctx = basicGetCache().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) basicGetCache().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 = basicGetCache().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 = basicGetCache().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 = basicGetCache().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) basicGetCache().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 = basicGetCache().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) basicGetCache().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 = basicGetCache().getRegion("rregion1");
+ CacheTransactionManager ctx = basicGetCache().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 = basicGetCache().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 = basicGetCache().getRegion("rregion1");
+ CacheTransactionManager ctx = basicGetCache().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));
+
+ }
+}
[02/11] incubator-geode git commit: GEODE-1050: add JUnit 4 versions
of DistributedTestCase and CacheTestCase
Posted by kl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqDataOptimizedExecuteDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqDataOptimizedExecuteDUnitTest.java b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqDataOptimizedExecuteDUnitTest.java
index e185af1..89e1554 100644
--- a/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqDataOptimizedExecuteDUnitTest.java
+++ b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqDataOptimizedExecuteDUnitTest.java
@@ -26,14 +26,14 @@ import com.gemstone.gemfire.test.dunit.SerializableRunnable;
* Test class for testing {@link CqServiceImpl#EXECUTE_QUERY_DURING_INIT} flag
*
*/
-public class CqDataOptimizedExecuteDUnitTest extends CqDataDUnitTest{
+public class CqDataOptimizedExecuteDUnitTest extends CqDataDUnitTest {
public CqDataOptimizedExecuteDUnitTest(String name) {
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
+ @Override
+ protected final void postSetUpCqDataDUnitTest() throws Exception {
//We're seeing this on the server when the client
//disconnects.
IgnoredException.addIgnoredException("Connection reset");
@@ -45,7 +45,7 @@ public class CqDataOptimizedExecuteDUnitTest extends CqDataDUnitTest{
}
@Override
- protected final void preTearDownCacheTestCase() throws Exception {
+ public final void preTearDownCacheTestCase() throws Exception {
Invoke.invokeInEveryVM(new SerializableRunnable("getSystem") {
public void run() {
CqServiceImpl.EXECUTE_QUERY_DURING_INIT = true;
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqDataUsingPoolDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqDataUsingPoolDUnitTest.java b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqDataUsingPoolDUnitTest.java
index a329a2b..5d77d62 100644
--- a/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqDataUsingPoolDUnitTest.java
+++ b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqDataUsingPoolDUnitTest.java
@@ -82,9 +82,9 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase {
public CqDataUsingPoolDUnitTest(String name) {
super(name);
}
-
- public void setUp() throws Exception {
- super.setUp();
+
+ @Override
+ public final void postSetUp() throws Exception {
// avoid IllegalStateException from HandShake by connecting all vms tor
// system before creating ConnectionPools
getSystem();
@@ -93,7 +93,10 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase {
getSystem();
}
});
-
+ postSetUpCqDataUsingPoolDUnitTest();
+ }
+
+ protected void postSetUpCqDataUsingPoolDUnitTest() throws Exception {
}
/**
@@ -856,7 +859,8 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase {
}
public void testCqStatInitializationTimingIssue() {
-
+ disconnectAllFromDS();
+
//The async close can cause this exception on the server
IgnoredException.addIgnoredException("java.net.SocketException: Broken pipe");
final String regionName = "testCqStatInitializationTimingIssue";
@@ -1112,6 +1116,8 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase {
}
public void testGetDurableCqsFromServer() {
+ disconnectAllFromDS();
+
final String regionName = "testGetAllDurableCqsFromServer";
final String cq1Name = "testCq1";
final Host host = Host.getHost(0);
@@ -1172,6 +1178,8 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase {
}
public void testGetDurableCqsFromServerCycleClients() {
+ disconnectAllFromDS();
+
final String regionName = "testGetAllDurableCqsFromServerCycleClients";
final Host host = Host.getHost(0);
VM server = host.getVM(0);
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqDataUsingPoolOptimizedExecuteDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqDataUsingPoolOptimizedExecuteDUnitTest.java b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqDataUsingPoolOptimizedExecuteDUnitTest.java
index 47b9a89..03bc48b 100644
--- a/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqDataUsingPoolOptimizedExecuteDUnitTest.java
+++ b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqDataUsingPoolOptimizedExecuteDUnitTest.java
@@ -26,16 +26,20 @@ import com.gemstone.gemfire.test.dunit.SerializableRunnable;
* Test class for testing {@link CqServiceImpl#EXECUTE_QUERY_DURING_INIT} flag
*
*/
-public class CqDataUsingPoolOptimizedExecuteDUnitTest extends CqDataUsingPoolDUnitTest{
+public class CqDataUsingPoolOptimizedExecuteDUnitTest extends CqDataUsingPoolDUnitTest {
public CqDataUsingPoolOptimizedExecuteDUnitTest(String name) {
super(name);
}
- public void setUp() throws Exception {
+ @Override
+ public final void preSetUp() throws Exception {
IgnoredException.addIgnoredException("Read timed out");
IgnoredException.addIgnoredException("java.net.SocketException");
- super.setUp();
+ }
+
+ @Override
+ protected final void postSetUpCqDataUsingPoolDUnitTest() throws Exception {
Invoke.invokeInEveryVM(new SerializableRunnable("set test hook") {
public void run() {
CqServiceImpl.EXECUTE_QUERY_DURING_INIT = false;
@@ -44,7 +48,7 @@ public class CqDataUsingPoolOptimizedExecuteDUnitTest extends CqDataUsingPoolDUn
}
@Override
- protected final void preTearDownCacheTestCase() throws Exception {
+ public final void preTearDownCacheTestCase() throws Exception {
Invoke.invokeInEveryVM(new SerializableRunnable("getSystem") {
public void run() {
CqServiceImpl.EXECUTE_QUERY_DURING_INIT = true;
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqPerfDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqPerfDUnitTest.java b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqPerfDUnitTest.java
index 97035f0..fc5b09a 100644
--- a/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqPerfDUnitTest.java
+++ b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqPerfDUnitTest.java
@@ -57,10 +57,9 @@ public class CqPerfDUnitTest extends CacheTestCase {
public CqPerfDUnitTest(String name) {
super(name);
}
-
- public void setUp() throws Exception {
- super.setUp();
-
+
+ @Override
+ public final void postSetUp() throws Exception {
// avoid IllegalStateException from HandShake by connecting all vms tor
// system before creating connection pools
getSystem();
@@ -69,9 +68,7 @@ public class CqPerfDUnitTest extends CacheTestCase {
getSystem();
}
});
-
}
-
/**
* Tests the cq performance.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqPerfUsingPoolDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqPerfUsingPoolDUnitTest.java b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqPerfUsingPoolDUnitTest.java
index e631886..4b8e321 100644
--- a/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqPerfUsingPoolDUnitTest.java
+++ b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqPerfUsingPoolDUnitTest.java
@@ -57,10 +57,9 @@ public class CqPerfUsingPoolDUnitTest extends CacheTestCase {
public CqPerfUsingPoolDUnitTest(String name) {
super(name);
}
-
- public void setUp() throws Exception {
- super.setUp();
-
+
+ @Override
+ public final void postSetUp() throws Exception {
// avoid IllegalStateException from HandShake by connecting all vms tor
// system before creating connection pools
getSystem();
@@ -69,9 +68,7 @@ public class CqPerfUsingPoolDUnitTest extends CacheTestCase {
getSystem();
}
});
-
}
-
/**
* Tests the cq performance.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqQueryDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqQueryDUnitTest.java b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqQueryDUnitTest.java
index 9730395..ff14a7d 100644
--- a/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqQueryDUnitTest.java
+++ b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqQueryDUnitTest.java
@@ -171,10 +171,9 @@ public class CqQueryDUnitTest extends CacheTestCase {
public CqQueryDUnitTest(String name) {
super(name);
}
-
- public void setUp() throws Exception {
- super.setUp();
-
+
+ @Override
+ public final void postSetUp() throws Exception {
// avoid IllegalStateException from HandShake by connecting all vms tor
// system before creating connection pools
getSystem();
@@ -183,7 +182,10 @@ public class CqQueryDUnitTest extends CacheTestCase {
getSystem();
}
});
-
+ postSetUpCqQueryDUnitTest();
+ }
+
+ protected void postSetUpCqQueryDUnitTest() throws Exception {
}
/* Returns Cache Server Port */
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqQueryOptimizedExecuteDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqQueryOptimizedExecuteDUnitTest.java b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqQueryOptimizedExecuteDUnitTest.java
index a3ccf36..eda4d1d 100644
--- a/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqQueryOptimizedExecuteDUnitTest.java
+++ b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqQueryOptimizedExecuteDUnitTest.java
@@ -36,14 +36,14 @@ import com.gemstone.gemfire.test.dunit.Wait;
* Test class for testing {@link CqServiceImpl#EXECUTE_QUERY_DURING_INIT} flag
*
*/
-public class CqQueryOptimizedExecuteDUnitTest extends CqQueryDUnitTest{
+public class CqQueryOptimizedExecuteDUnitTest extends CqQueryDUnitTest {
public CqQueryOptimizedExecuteDUnitTest(String name) {
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
+ @Override
+ protected final void postSetUpCqQueryDUnitTest() throws Exception {
Invoke.invokeInEveryVM(new SerializableRunnable("getSystem") {
public void run() {
CqServiceImpl.EXECUTE_QUERY_DURING_INIT = false;
@@ -52,7 +52,7 @@ public class CqQueryOptimizedExecuteDUnitTest extends CqQueryDUnitTest{
}
@Override
- protected final void preTearDownCacheTestCase() throws Exception {
+ public final void preTearDownCacheTestCase() throws Exception {
Invoke.invokeInEveryVM(new SerializableRunnable("getSystem") {
public void run() {
CqServiceImpl.EXECUTE_QUERY_DURING_INIT = true;
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqQueryUsingPoolDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqQueryUsingPoolDUnitTest.java b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqQueryUsingPoolDUnitTest.java
index f333b77..be91665 100644
--- a/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqQueryUsingPoolDUnitTest.java
+++ b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqQueryUsingPoolDUnitTest.java
@@ -159,10 +159,9 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
public CqQueryUsingPoolDUnitTest(String name) {
super(name);
}
-
- public void setUp() throws Exception {
- super.setUp();
-
+
+ @Override
+ public final void postSetUp() throws Exception {
//We're seeing this on the server when the client
//disconnects.
IgnoredException.addIgnoredException("Connection reset");
@@ -178,7 +177,10 @@ public class CqQueryUsingPoolDUnitTest extends CacheTestCase {
getSystem();
}
});
-
+ postSetUpCqQueryUsingPoolDUnitTest();
+ }
+
+ protected void postSetUpCqQueryUsingPoolDUnitTest() throws Exception {
}
/* Returns Cache Server Port */
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqQueryUsingPoolOptimizedExecuteDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqQueryUsingPoolOptimizedExecuteDUnitTest.java b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqQueryUsingPoolOptimizedExecuteDUnitTest.java
index cf3dc95..993dd42 100644
--- a/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqQueryUsingPoolOptimizedExecuteDUnitTest.java
+++ b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqQueryUsingPoolOptimizedExecuteDUnitTest.java
@@ -30,8 +30,8 @@ public class CqQueryUsingPoolOptimizedExecuteDUnitTest extends CqQueryUsingPoolD
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
+ @Override
+ public final void postSetUpCqQueryUsingPoolDUnitTest() throws Exception {
Invoke.invokeInEveryVM(new SerializableRunnable("getSystem") {
public void run() {
CqServiceImpl.EXECUTE_QUERY_DURING_INIT = false;
@@ -40,7 +40,7 @@ public class CqQueryUsingPoolOptimizedExecuteDUnitTest extends CqQueryUsingPoolD
}
@Override
- protected final void preTearDownCacheTestCase() throws Exception {
+ public final void preTearDownCacheTestCase() throws Exception {
Invoke.invokeInEveryVM(new SerializableRunnable("getSystem") {
public void run() {
CqServiceImpl.EXECUTE_QUERY_DURING_INIT = true;
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqResultSetUsingPoolDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqResultSetUsingPoolDUnitTest.java b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqResultSetUsingPoolDUnitTest.java
index 35cef9d..4591ea6 100644
--- a/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqResultSetUsingPoolDUnitTest.java
+++ b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqResultSetUsingPoolDUnitTest.java
@@ -22,12 +22,11 @@ import java.util.Set;
import com.gemstone.gemfire.cache.CacheException;
import com.gemstone.gemfire.cache.Region;
-import com.gemstone.gemfire.cache.query.CqQuery;
import com.gemstone.gemfire.cache.query.data.Portfolio;
import com.gemstone.gemfire.cache.query.internal.DefaultQueryService;
+import com.gemstone.gemfire.cache.query.internal.cq.CqService;
import com.gemstone.gemfire.cache.query.internal.cq.InternalCqQuery;
import com.gemstone.gemfire.cache.query.internal.cq.ServerCQImpl;
-import com.gemstone.gemfire.cache.query.internal.cq.CqService;
import com.gemstone.gemfire.cache.query.internal.index.IndexManager;
import com.gemstone.gemfire.cache30.CacheSerializableRunnable;
import com.gemstone.gemfire.cache30.CacheTestCase;
@@ -42,7 +41,7 @@ import com.gemstone.gemfire.test.dunit.VM;
import com.gemstone.gemfire.test.dunit.Wait;
/**
- * This class tests the ContiunousQuery mechanism in GemFire.
+ * This class tests the ContinuousQuery mechanism in GemFire.
*
* @author anil
*/
@@ -130,10 +129,9 @@ public class CqResultSetUsingPoolDUnitTest extends CacheTestCase {
public CqResultSetUsingPoolDUnitTest(String name) {
super(name);
}
-
- public void setUp() throws Exception {
- super.setUp();
-
+
+ @Override
+ public final void postSetUp() throws Exception {
// avoid IllegalStateException from HandShake by connecting all vms tor
// system before creating ConnectionPools
getSystem();
@@ -142,10 +140,12 @@ public class CqResultSetUsingPoolDUnitTest extends CacheTestCase {
getSystem();
}
});
-
+ postSetUpCqResultSetUsingPoolDUnitTest();
}
-
-
+
+ protected void postSetUpCqResultSetUsingPoolDUnitTest() throws Exception {
+ }
+
/**
* Tests CQ Result Set.
*
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqResultSetUsingPoolOptimizedExecuteDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqResultSetUsingPoolOptimizedExecuteDUnitTest.java b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqResultSetUsingPoolOptimizedExecuteDUnitTest.java
index 2363d2d..d4e40fa 100644
--- a/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqResultSetUsingPoolOptimizedExecuteDUnitTest.java
+++ b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqResultSetUsingPoolOptimizedExecuteDUnitTest.java
@@ -39,14 +39,14 @@ import com.gemstone.gemfire.test.dunit.SerializableRunnable;
import com.gemstone.gemfire.test.dunit.VM;
import com.gemstone.gemfire.test.dunit.Wait;
-public class CqResultSetUsingPoolOptimizedExecuteDUnitTest extends CqResultSetUsingPoolDUnitTest{
+public class CqResultSetUsingPoolOptimizedExecuteDUnitTest extends CqResultSetUsingPoolDUnitTest {
public CqResultSetUsingPoolOptimizedExecuteDUnitTest(String name) {
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
+ @Override
+ protected final void postSetUpCqResultSetUsingPoolDUnitTest() throws Exception {
Invoke.invokeInEveryVM(new SerializableRunnable("getSystem") {
public void run() {
CqServiceImpl.EXECUTE_QUERY_DURING_INIT = false;
@@ -55,7 +55,7 @@ public class CqResultSetUsingPoolOptimizedExecuteDUnitTest extends CqResultSetUs
}
@Override
- protected final void preTearDownCacheTestCase() throws Exception {
+ public final void preTearDownCacheTestCase() throws Exception {
Invoke.invokeInEveryVM(new SerializableRunnable("getSystem") {
public void run() {
CqServiceImpl.EXECUTE_QUERY_DURING_INIT = true;
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqStatsDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqStatsDUnitTest.java b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqStatsDUnitTest.java
index 6afdaec..094fcda 100644
--- a/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqStatsDUnitTest.java
+++ b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqStatsDUnitTest.java
@@ -55,10 +55,9 @@ public class CqStatsDUnitTest extends CacheTestCase {
public CqStatsDUnitTest(String name) {
super(name);
}
-
- public void setUp() throws Exception {
- super.setUp();
-
+
+ @Override
+ public final void postSetUp() throws Exception {
// avoid IllegalStateException from HandShake by connecting all vms to
// system before creating pool
getSystem();
@@ -67,7 +66,10 @@ public class CqStatsDUnitTest extends CacheTestCase {
getSystem();
}
});
-
+ postSetUpCqStatsDUnitTest();
+ }
+
+ protected void postSetUpCqStatsDUnitTest() throws Exception {
}
public void validateCQStats(VM vm, final String cqName,
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqStatsOptimizedExecuteDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqStatsOptimizedExecuteDUnitTest.java b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqStatsOptimizedExecuteDUnitTest.java
index df0b950..7d4a74e 100644
--- a/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqStatsOptimizedExecuteDUnitTest.java
+++ b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqStatsOptimizedExecuteDUnitTest.java
@@ -24,14 +24,14 @@ import com.gemstone.gemfire.test.dunit.SerializableRunnable;
/**
* Test class for testing {@link CqServiceImpl#EXECUTE_QUERY_DURING_INIT} flag
*/
-public class CqStatsOptimizedExecuteDUnitTest extends CqStatsDUnitTest{
+public class CqStatsOptimizedExecuteDUnitTest extends CqStatsDUnitTest {
public CqStatsOptimizedExecuteDUnitTest(String name) {
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
+ @Override
+ protected final void postSetUpCqStatsDUnitTest() throws Exception {
Invoke.invokeInEveryVM(new SerializableRunnable("getSystem") {
public void run() {
CqServiceImpl.EXECUTE_QUERY_DURING_INIT = false;
@@ -40,7 +40,7 @@ public class CqStatsOptimizedExecuteDUnitTest extends CqStatsDUnitTest{
}
@Override
- protected final void preTearDownCacheTestCase() throws Exception {
+ public final void preTearDownCacheTestCase() throws Exception {
Invoke.invokeInEveryVM(new SerializableRunnable("getSystem") {
public void run() {
CqServiceImpl.EXECUTE_QUERY_DURING_INIT = true;
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqStatsUsingPoolDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqStatsUsingPoolDUnitTest.java b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqStatsUsingPoolDUnitTest.java
index 04e9b42..5a75cfb 100644
--- a/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqStatsUsingPoolDUnitTest.java
+++ b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqStatsUsingPoolDUnitTest.java
@@ -55,10 +55,9 @@ public class CqStatsUsingPoolDUnitTest extends CacheTestCase {
public CqStatsUsingPoolDUnitTest(String name) {
super(name);
}
-
- public void setUp() throws Exception {
- super.setUp();
-
+
+ @Override
+ public final void postSetUp() throws Exception {
// avoid IllegalStateException from HandShake by connecting all vms to
// system before creating pool
getSystem();
@@ -67,7 +66,10 @@ public class CqStatsUsingPoolDUnitTest extends CacheTestCase {
getSystem();
}
});
-
+ postSetUpCqStatsUsingPoolDUnitTest();
+ }
+
+ protected void postSetUpCqStatsUsingPoolDUnitTest() throws Exception {
}
private void validateCQStats(VM vm, final String cqName,
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqStatsUsingPoolOptimizedExecuteDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqStatsUsingPoolOptimizedExecuteDUnitTest.java b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqStatsUsingPoolOptimizedExecuteDUnitTest.java
index a959024..5ccb735 100644
--- a/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqStatsUsingPoolOptimizedExecuteDUnitTest.java
+++ b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqStatsUsingPoolOptimizedExecuteDUnitTest.java
@@ -24,14 +24,14 @@ import com.gemstone.gemfire.test.dunit.SerializableRunnable;
/**
* Test class for testing {@link CqServiceImpl#EXECUTE_QUERY_DURING_INIT} flag
*/
-public class CqStatsUsingPoolOptimizedExecuteDUnitTest extends CqStatsUsingPoolDUnitTest{
+public class CqStatsUsingPoolOptimizedExecuteDUnitTest extends CqStatsUsingPoolDUnitTest {
public CqStatsUsingPoolOptimizedExecuteDUnitTest(String name) {
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
+ @Override
+ public final void postSetUpCqStatsUsingPoolDUnitTest() throws Exception {
Invoke.invokeInEveryVM(new SerializableRunnable("getSystem") {
public void run() {
CqServiceImpl.EXECUTE_QUERY_DURING_INIT = false;
@@ -40,7 +40,7 @@ public class CqStatsUsingPoolOptimizedExecuteDUnitTest extends CqStatsUsingPoolD
}
@Override
- protected final void preTearDownCacheTestCase() throws Exception {
+ public final void preTearDownCacheTestCase() throws Exception {
Invoke.invokeInEveryVM(new SerializableRunnable("getSystem") {
public void run() {
CqServiceImpl.EXECUTE_QUERY_DURING_INIT = true;
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/PartitionedRegionCqQueryOptimizedExecuteDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/PartitionedRegionCqQueryOptimizedExecuteDUnitTest.java b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/PartitionedRegionCqQueryOptimizedExecuteDUnitTest.java
index 7989bc0..1913b4d 100644
--- a/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/PartitionedRegionCqQueryOptimizedExecuteDUnitTest.java
+++ b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/PartitionedRegionCqQueryOptimizedExecuteDUnitTest.java
@@ -36,8 +36,8 @@ public class PartitionedRegionCqQueryOptimizedExecuteDUnitTest extends Partition
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
+ @Override
+ public final void postSetUp() throws Exception {
Invoke.invokeInEveryVM(new SerializableRunnable("getSystem") {
public void run() {
CqServiceImpl.EXECUTE_QUERY_DURING_INIT = false;
@@ -46,7 +46,7 @@ public class PartitionedRegionCqQueryOptimizedExecuteDUnitTest extends Partition
}
@Override
- protected final void preTearDownCacheTestCase() throws Exception {
+ public final void preTearDownCacheTestCase() throws Exception {
Invoke.invokeInEveryVM(new SerializableRunnable("getSystem") {
public void run() {
CqServiceImpl.EXECUTE_QUERY_DURING_INIT = true;
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/PrCqUsingPoolOptimizedExecuteDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/PrCqUsingPoolOptimizedExecuteDUnitTest.java b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/PrCqUsingPoolOptimizedExecuteDUnitTest.java
index d71a7be..bc552aa 100644
--- a/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/PrCqUsingPoolOptimizedExecuteDUnitTest.java
+++ b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/PrCqUsingPoolOptimizedExecuteDUnitTest.java
@@ -24,14 +24,14 @@ import com.gemstone.gemfire.test.dunit.SerializableRunnable;
* Test class for testing {@link CqServiceImpl#EXECUTE_QUERY_DURING_INIT} flag
*
*/
-public class PrCqUsingPoolOptimizedExecuteDUnitTest extends PrCqUsingPoolDUnitTest{
+public class PrCqUsingPoolOptimizedExecuteDUnitTest extends PrCqUsingPoolDUnitTest {
public PrCqUsingPoolOptimizedExecuteDUnitTest(String name) {
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
+ @Override
+ public final void postSetUp() throws Exception {
Invoke.invokeInEveryVM(new SerializableRunnable("getSystem") {
public void run() {
CqServiceImpl.EXECUTE_QUERY_DURING_INIT = false;
@@ -40,7 +40,7 @@ public class PrCqUsingPoolOptimizedExecuteDUnitTest extends PrCqUsingPoolDUnitTe
}
@Override
- protected final void preTearDownCacheTestCase() throws Exception {
+ public final void preTearDownCacheTestCase() throws Exception {
Invoke.invokeInEveryVM(new SerializableRunnable("getSystem") {
public void run() {
CqServiceImpl.EXECUTE_QUERY_DURING_INIT = true;
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/dunit/PdxQueryCQTestBase.java
----------------------------------------------------------------------
diff --git a/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/dunit/PdxQueryCQTestBase.java b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/dunit/PdxQueryCQTestBase.java
index 7fa5077..9bcb341 100755
--- a/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/dunit/PdxQueryCQTestBase.java
+++ b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/dunit/PdxQueryCQTestBase.java
@@ -79,7 +79,7 @@ public abstract class PdxQueryCQTestBase extends CacheTestCase {
}
@Override
- protected final void preTearDownCacheTestCase() throws Exception {
+ public final void preTearDownCacheTestCase() throws Exception {
disconnectAllFromDS(); // tests all expect to create a new ds
// Reset the testObject numinstance for the next test.
TestObject.numInstance = 0;
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryMonitorDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryMonitorDUnitTest.java b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryMonitorDUnitTest.java
index 8008c3a..49a0360 100644
--- a/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryMonitorDUnitTest.java
+++ b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryMonitorDUnitTest.java
@@ -172,7 +172,7 @@ public class QueryMonitorDUnitTest extends CacheTestCase {
}
@Override
- protected final void preTearDownCacheTestCase() throws Exception {
+ public final void preTearDownCacheTestCase() throws Exception {
Host host = Host.getHost(0);
disconnectFromDS();
// shut down clients before servers
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-cq/src/test/java/com/gemstone/gemfire/cache/snapshot/ClientSnapshotDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-cq/src/test/java/com/gemstone/gemfire/cache/snapshot/ClientSnapshotDUnitTest.java b/geode-cq/src/test/java/com/gemstone/gemfire/cache/snapshot/ClientSnapshotDUnitTest.java
index 540b37b..08ad752 100644
--- a/geode-cq/src/test/java/com/gemstone/gemfire/cache/snapshot/ClientSnapshotDUnitTest.java
+++ b/geode-cq/src/test/java/com/gemstone/gemfire/cache/snapshot/ClientSnapshotDUnitTest.java
@@ -232,9 +232,9 @@ public class ClientSnapshotDUnitTest extends CacheTestCase {
assertFalse(region.containsValueForKey(1));
assertNull(region.get(1));
}
-
- public void setUp() throws Exception {
- super.setUp();
+
+ @Override
+ public final void postSetUp() throws Exception {
loadCache();
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-cq/src/test/java/com/gemstone/gemfire/internal/cache/PRDeltaPropagationDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-cq/src/test/java/com/gemstone/gemfire/internal/cache/PRDeltaPropagationDUnitTest.java b/geode-cq/src/test/java/com/gemstone/gemfire/internal/cache/PRDeltaPropagationDUnitTest.java
index 12fd791..e8816f9 100755
--- a/geode-cq/src/test/java/com/gemstone/gemfire/internal/cache/PRDeltaPropagationDUnitTest.java
+++ b/geode-cq/src/test/java/com/gemstone/gemfire/internal/cache/PRDeltaPropagationDUnitTest.java
@@ -126,8 +126,8 @@ public class PRDeltaPropagationDUnitTest extends DistributedTestCase {
super(name);
}
- 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);
@@ -1111,7 +1111,7 @@ public class PRDeltaPropagationDUnitTest extends DistributedTestCase {
}
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
closeCache();
client1.invoke(() -> PRDeltaPropagationDUnitTest.closeCache());
dataStore1.invoke(() -> PRDeltaPropagationDUnitTest.closeCache());
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-cq/src/test/java/com/gemstone/gemfire/internal/cache/RemoteCQTransactionDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-cq/src/test/java/com/gemstone/gemfire/internal/cache/RemoteCQTransactionDUnitTest.java b/geode-cq/src/test/java/com/gemstone/gemfire/internal/cache/RemoteCQTransactionDUnitTest.java
index 4bca2c4..386fb63 100755
--- a/geode-cq/src/test/java/com/gemstone/gemfire/internal/cache/RemoteCQTransactionDUnitTest.java
+++ b/geode-cq/src/test/java/com/gemstone/gemfire/internal/cache/RemoteCQTransactionDUnitTest.java
@@ -123,7 +123,7 @@ public class RemoteCQTransactionDUnitTest extends CacheTestCase {
}
@Override
- protected final void preTearDownCacheTestCase() throws Exception {
+ public final void preTearDownCacheTestCase() throws Exception {
// try { Thread.sleep(5000); } catch (InterruptedException e) { } // FOR MANUAL TESTING OF STATS - DON"T KEEP THIS
try {
Invoke.invokeInEveryVM(verifyNoTxState);
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-cq/src/test/java/com/gemstone/gemfire/internal/cache/ha/CQListGIIDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-cq/src/test/java/com/gemstone/gemfire/internal/cache/ha/CQListGIIDUnitTest.java b/geode-cq/src/test/java/com/gemstone/gemfire/internal/cache/ha/CQListGIIDUnitTest.java
index 95d46a4..1656306 100755
--- a/geode-cq/src/test/java/com/gemstone/gemfire/internal/cache/ha/CQListGIIDUnitTest.java
+++ b/geode-cq/src/test/java/com/gemstone/gemfire/internal/cache/ha/CQListGIIDUnitTest.java
@@ -158,9 +158,8 @@ public class CQListGIIDUnitTest extends DistributedTestCase {
/**
* Sets up the test.
*/
- public void setUp() throws Exception {
- super.setUp();
-
+ @Override
+ public final void postSetUp() throws Exception {
final Host host = Host.getHost(0);
serverVM0 = host.getVM(0);
serverVM1 = host.getVM(1);
@@ -175,7 +174,7 @@ public class CQListGIIDUnitTest extends DistributedTestCase {
* Tears down the test.
*/
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
serverVM0.invoke(() -> ConflationDUnitTest.unsetIsSlowStart());
serverVM1.invoke(() -> ConflationDUnitTest.unsetIsSlowStart());
closeCache();
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-cq/src/test/java/com/gemstone/gemfire/internal/cache/ha/HADispatcherDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-cq/src/test/java/com/gemstone/gemfire/internal/cache/ha/HADispatcherDUnitTest.java b/geode-cq/src/test/java/com/gemstone/gemfire/internal/cache/ha/HADispatcherDUnitTest.java
index d74f3ff..824fa82 100755
--- a/geode-cq/src/test/java/com/gemstone/gemfire/internal/cache/ha/HADispatcherDUnitTest.java
+++ b/geode-cq/src/test/java/com/gemstone/gemfire/internal/cache/ha/HADispatcherDUnitTest.java
@@ -118,9 +118,7 @@ public class HADispatcherDUnitTest extends DistributedTestCase
}
@Override
- public void setUp() throws Exception
- {
- super.setUp();
+ public final void postSetUp() throws Exception {
final Host host = Host.getHost(0);
// Server1 VM
@@ -151,12 +149,10 @@ public class HADispatcherDUnitTest extends DistributedTestCase
NetworkUtils.getServerHostName(host),
new Integer(PORT1), new Integer(PORT2),
new Boolean(true) ));
- //createClientCache(new Integer(PORT1), new Integer(PORT2), new Boolean(true) );
-
}
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
client1.invoke(() -> HADispatcherDUnitTest.closeCache());
client2.invoke(() -> HADispatcherDUnitTest.closeCache());
// close server
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-cq/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ClientToServerDeltaDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-cq/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ClientToServerDeltaDUnitTest.java b/geode-cq/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ClientToServerDeltaDUnitTest.java
index 0e589e4..6df5965 100755
--- a/geode-cq/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ClientToServerDeltaDUnitTest.java
+++ b/geode-cq/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ClientToServerDeltaDUnitTest.java
@@ -124,7 +124,8 @@ public class ClientToServerDeltaDUnitTest extends DistributedTestCase {
super(name);
}
- public void setUp() throws Exception {
+ @Override
+ public final void postSetUp() throws Exception {
disconnectAllFromDS();
final Host host = Host.getHost(0);
server = host.getVM(0);
@@ -134,7 +135,7 @@ public class ClientToServerDeltaDUnitTest extends DistributedTestCase {
}
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
// reset all flags
DeltaTestImpl.resetDeltaInvokationCounters();
server.invoke(() -> DeltaTestImpl.resetDeltaInvokationCounters());
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-cq/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DeltaPropagationWithCQDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-cq/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DeltaPropagationWithCQDUnitTest.java b/geode-cq/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DeltaPropagationWithCQDUnitTest.java
index 7316e0c..6e5521a 100644
--- a/geode-cq/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DeltaPropagationWithCQDUnitTest.java
+++ b/geode-cq/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DeltaPropagationWithCQDUnitTest.java
@@ -95,8 +95,8 @@ public class DeltaPropagationWithCQDUnitTest extends DistributedTestCase {
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
+ @Override
+ public final void postSetUp() throws Exception {
Host host = Host.getHost(0);
server1 = host.getVM(0);
server2 = host.getVM(1);
@@ -105,7 +105,7 @@ public class DeltaPropagationWithCQDUnitTest extends DistributedTestCase {
}
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
server1.invoke(() -> DeltaPropagationWithCQDUnitTest.close());
server2.invoke(() -> DeltaPropagationWithCQDUnitTest.close());
client1.invoke(() -> DeltaPropagationWithCQDUnitTest.close());
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-cq/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DeltaToRegionRelationCQRegistrationDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-cq/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DeltaToRegionRelationCQRegistrationDUnitTest.java b/geode-cq/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DeltaToRegionRelationCQRegistrationDUnitTest.java
index 824f2e7..579ac29 100755
--- a/geode-cq/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DeltaToRegionRelationCQRegistrationDUnitTest.java
+++ b/geode-cq/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DeltaToRegionRelationCQRegistrationDUnitTest.java
@@ -114,9 +114,9 @@ public class DeltaToRegionRelationCQRegistrationDUnitTest extends DistributedTes
public DeltaToRegionRelationCQRegistrationDUnitTest(String name) {
super(name);
}
-
- public void setUp() throws Exception
- {
+
+ @Override
+ public final void postSetUp() throws Exception {
disconnectAllFromDS();
Wait.pause(5000);
final Host host = Host.getHost(0);
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-cq/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientCrashDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-cq/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientCrashDUnitTest.java b/geode-cq/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientCrashDUnitTest.java
index dce35bf..399ecc4 100755
--- a/geode-cq/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientCrashDUnitTest.java
+++ b/geode-cq/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientCrashDUnitTest.java
@@ -33,8 +33,8 @@ public class DurableClientCrashDUnitTest extends DurableClientTestCase {
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
+ @Override
+ protected final void postSetUpDurableClientTestCase() throws Exception {
configureClientStop1();
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-cq/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientTestCase.java
----------------------------------------------------------------------
diff --git a/geode-cq/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientTestCase.java b/geode-cq/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientTestCase.java
index 1a37fbb..3ce9658 100755
--- a/geode-cq/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientTestCase.java
+++ b/geode-cq/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientTestCase.java
@@ -92,7 +92,8 @@ public class DurableClientTestCase extends DistributedTestCase {
super(name);
}
- public void setUp() throws Exception {
+ @Override
+ public final void postSetUp() throws Exception {
Host host = Host.getHost(0);
this.server1VM = host.getVM(0);
this.server2VM = host.getVM(1);
@@ -101,13 +102,15 @@ public class DurableClientTestCase extends DistributedTestCase {
this.regionName = getName() + "_region";
//Clients see this when the servers disconnect
IgnoredException.addIgnoredException("Could not find any server");
- setTestMethodName(getName());
- assertEquals(getName(), getTestMethodName());
System.out.println("\n\n[setup] START TEST " + getClass().getSimpleName()+"."+ getTestMethodName()+"\n\n");
+ postSetUpDurableClientTestCase();
+ }
+
+ protected void postSetUpDurableClientTestCase() throws Exception {
}
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
preTearDownDurableClientTestCase();
this.durableClientVM.invoke(() -> CacheServerTestUtil.closeCache());
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-cq/src/test/java/com/gemstone/gemfire/management/CacheServerManagementDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-cq/src/test/java/com/gemstone/gemfire/management/CacheServerManagementDUnitTest.java b/geode-cq/src/test/java/com/gemstone/gemfire/management/CacheServerManagementDUnitTest.java
index 64bbe0c..379f57d 100644
--- a/geode-cq/src/test/java/com/gemstone/gemfire/management/CacheServerManagementDUnitTest.java
+++ b/geode-cq/src/test/java/com/gemstone/gemfire/management/CacheServerManagementDUnitTest.java
@@ -88,9 +88,9 @@ public class CacheServerManagementDUnitTest extends LocatorTestBase {
}
- public void setUp() throws Exception {
+ @Override
+ public final void preSetUp() throws Exception {
disconnectAllFromDS();
- super.setUp();
}
@Override
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-cq/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/ClientCommandsDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-cq/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/ClientCommandsDUnitTest.java b/geode-cq/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/ClientCommandsDUnitTest.java
index 12b11e3..5e05561 100644
--- a/geode-cq/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/ClientCommandsDUnitTest.java
+++ b/geode-cq/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/ClientCommandsDUnitTest.java
@@ -1437,7 +1437,7 @@ private void setUpNonSubscribedClient() throws Exception {
}
@Override
- protected final void postTearDownCacheTestCase() throws Exception {
+ public final void postTearDownCacheTestCase() throws Exception {
Host.getHost(0).getVM(0).invoke(() -> CacheServerTestUtil.closeCache());
Host.getHost(0).getVM(1).invoke(() -> CacheServerTestUtil.closeCache());
Host.getHost(0).getVM(2).invoke(() -> CacheServerTestUtil.closeCache());
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-cq/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/DurableClientCommandsDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-cq/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/DurableClientCommandsDUnitTest.java b/geode-cq/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/DurableClientCommandsDUnitTest.java
index bb97cf3..0a1f433 100644
--- a/geode-cq/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/DurableClientCommandsDUnitTest.java
+++ b/geode-cq/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/DurableClientCommandsDUnitTest.java
@@ -428,7 +428,7 @@ public class DurableClientCommandsDUnitTest extends CliCommandTestBase {
}
@Override
- protected final void postTearDownCacheTestCase() throws Exception {
+ public final void postTearDownCacheTestCase() throws Exception {
Host.getHost(0).getVM(0).invoke(() -> CacheServerTestUtil.closeCache());
Host.getHost(0).getVM(1).invoke(() -> CacheServerTestUtil.closeCache());
Host.getHost(0).getVM(2).invoke(() -> CacheServerTestUtil.closeCache());
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-cq/src/test/java/com/gemstone/gemfire/management/internal/pulse/TestCQDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-cq/src/test/java/com/gemstone/gemfire/management/internal/pulse/TestCQDUnitTest.java b/geode-cq/src/test/java/com/gemstone/gemfire/management/internal/pulse/TestCQDUnitTest.java
index a8dcf59..a515db9 100644
--- a/geode-cq/src/test/java/com/gemstone/gemfire/management/internal/pulse/TestCQDUnitTest.java
+++ b/geode-cq/src/test/java/com/gemstone/gemfire/management/internal/pulse/TestCQDUnitTest.java
@@ -46,11 +46,6 @@ public class TestCQDUnitTest extends ManagementTestBase {
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
-
- }
-
public static long getNumOfCQ() {
final WaitCriterion waitCriteria = new WaitCriterion() {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-cq/src/test/java/com/gemstone/gemfire/management/internal/pulse/TestClientsDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-cq/src/test/java/com/gemstone/gemfire/management/internal/pulse/TestClientsDUnitTest.java b/geode-cq/src/test/java/com/gemstone/gemfire/management/internal/pulse/TestClientsDUnitTest.java
index 5decf7d..55b304c 100644
--- a/geode-cq/src/test/java/com/gemstone/gemfire/management/internal/pulse/TestClientsDUnitTest.java
+++ b/geode-cq/src/test/java/com/gemstone/gemfire/management/internal/pulse/TestClientsDUnitTest.java
@@ -43,11 +43,6 @@ public class TestClientsDUnitTest extends ManagementTestBase {
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
-
- }
-
public static Integer getNumOfClients() {
final WaitCriterion waitCriteria = new WaitCriterion() {
@Override
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-cq/src/test/java/com/gemstone/gemfire/management/internal/pulse/TestServerDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-cq/src/test/java/com/gemstone/gemfire/management/internal/pulse/TestServerDUnitTest.java b/geode-cq/src/test/java/com/gemstone/gemfire/management/internal/pulse/TestServerDUnitTest.java
index e632993..b37e43b 100644
--- a/geode-cq/src/test/java/com/gemstone/gemfire/management/internal/pulse/TestServerDUnitTest.java
+++ b/geode-cq/src/test/java/com/gemstone/gemfire/management/internal/pulse/TestServerDUnitTest.java
@@ -40,11 +40,6 @@ public class TestServerDUnitTest extends ManagementTestBase {
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
-
- }
-
public static int getNumOfServersFromMBean() {
final WaitCriterion waitCriteria = new WaitCriterion() {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-cq/src/test/java/com/gemstone/gemfire/security/ClientAuthorizationTwoDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-cq/src/test/java/com/gemstone/gemfire/security/ClientAuthorizationTwoDUnitTest.java b/geode-cq/src/test/java/com/gemstone/gemfire/security/ClientAuthorizationTwoDUnitTest.java
index 9910c8a..f146160 100644
--- a/geode-cq/src/test/java/com/gemstone/gemfire/security/ClientAuthorizationTwoDUnitTest.java
+++ b/geode-cq/src/test/java/com/gemstone/gemfire/security/ClientAuthorizationTwoDUnitTest.java
@@ -42,9 +42,7 @@ public class ClientAuthorizationTwoDUnitTest extends
}
@Override
- public void setUp() throws Exception {
-
- super.setUp();
+ public final void postSetUp() throws Exception {
final Host host = Host.getHost(0);
server1 = host.getVM(0);
server2 = host.getVM(1);
@@ -227,7 +225,7 @@ public class ClientAuthorizationTwoDUnitTest extends
// End Region: Tests
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
// close the clients first
client1.invoke(() -> SecurityTestUtil.closeCache());
client2.invoke(() -> SecurityTestUtil.closeCache());
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-cq/src/test/java/com/gemstone/gemfire/security/ClientAuthzObjectModDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-cq/src/test/java/com/gemstone/gemfire/security/ClientAuthzObjectModDUnitTest.java b/geode-cq/src/test/java/com/gemstone/gemfire/security/ClientAuthzObjectModDUnitTest.java
index efc8f48..984e5f1 100644
--- a/geode-cq/src/test/java/com/gemstone/gemfire/security/ClientAuthzObjectModDUnitTest.java
+++ b/geode-cq/src/test/java/com/gemstone/gemfire/security/ClientAuthzObjectModDUnitTest.java
@@ -110,9 +110,8 @@ public class ClientAuthzObjectModDUnitTest extends ClientAuthorizationTestBase {
}
}
- 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);
@@ -137,11 +136,6 @@ public class ClientAuthzObjectModDUnitTest extends ClientAuthorizationTestBase {
server2.invoke(registerInstantiator);
}
- @Override
- protected final void preTearDown() throws Exception {
- DistributedTestCase.cleanupAllVms();
- }
-
// Region: Utility and static functions invoked by the tests
private static Properties buildProperties(String authenticator,
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-cq/src/test/java/com/gemstone/gemfire/security/ClientCQPostAuthorizationDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-cq/src/test/java/com/gemstone/gemfire/security/ClientCQPostAuthorizationDUnitTest.java b/geode-cq/src/test/java/com/gemstone/gemfire/security/ClientCQPostAuthorizationDUnitTest.java
index 138b90b..1388bac 100644
--- a/geode-cq/src/test/java/com/gemstone/gemfire/security/ClientCQPostAuthorizationDUnitTest.java
+++ b/geode-cq/src/test/java/com/gemstone/gemfire/security/ClientCQPostAuthorizationDUnitTest.java
@@ -69,9 +69,8 @@ public class ClientCQPostAuthorizationDUnitTest extends
super(name);
}
- public void setUp() throws Exception {
-
- super.setUp();
+ @Override
+ public final void postSetUp() throws Exception {
getSystem();
Invoke.invokeInEveryVM(new SerializableRunnable("getSystem") {
public void run() {
@@ -92,7 +91,7 @@ public class ClientCQPostAuthorizationDUnitTest extends
}
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
client1.invoke(() -> SecurityTestUtil.closeCache());
client2.invoke(() -> SecurityTestUtil.closeCache());
server1.invoke(() -> SecurityTestUtil.closeCache());
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-cq/src/test/java/com/gemstone/gemfire/security/ClientPostAuthorizationDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-cq/src/test/java/com/gemstone/gemfire/security/ClientPostAuthorizationDUnitTest.java b/geode-cq/src/test/java/com/gemstone/gemfire/security/ClientPostAuthorizationDUnitTest.java
index 6cef09a..ec08b22 100644
--- a/geode-cq/src/test/java/com/gemstone/gemfire/security/ClientPostAuthorizationDUnitTest.java
+++ b/geode-cq/src/test/java/com/gemstone/gemfire/security/ClientPostAuthorizationDUnitTest.java
@@ -46,9 +46,8 @@ public class ClientPostAuthorizationDUnitTest extends
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);
@@ -378,7 +377,7 @@ public class ClientPostAuthorizationDUnitTest extends
// End Region: Tests
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
// close the clients first
client1.invoke(() -> SecurityTestUtil.closeCache());
client2.invoke(() -> SecurityTestUtil.closeCache());
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-cq/src/test/java/com/gemstone/gemfire/security/MultiuserAPIDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-cq/src/test/java/com/gemstone/gemfire/security/MultiuserAPIDUnitTest.java b/geode-cq/src/test/java/com/gemstone/gemfire/security/MultiuserAPIDUnitTest.java
index 8693217..c5a1afe 100644
--- a/geode-cq/src/test/java/com/gemstone/gemfire/security/MultiuserAPIDUnitTest.java
+++ b/geode-cq/src/test/java/com/gemstone/gemfire/security/MultiuserAPIDUnitTest.java
@@ -68,8 +68,8 @@ public class MultiuserAPIDUnitTest extends ClientAuthorizationTestBase {
AuthenticationFailedException.class.getName(),
SSLHandshakeException.class.getName()};
- 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);
@@ -370,7 +370,7 @@ public class MultiuserAPIDUnitTest extends ClientAuthorizationTestBase {
}
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
// close the clients first
client1.invoke(() -> SecurityTestUtil.closeCache());
client2.invoke(() -> SecurityTestUtil.closeCache());
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-cq/src/test/java/com/gemstone/gemfire/security/MultiuserDurableCQAuthzDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-cq/src/test/java/com/gemstone/gemfire/security/MultiuserDurableCQAuthzDUnitTest.java b/geode-cq/src/test/java/com/gemstone/gemfire/security/MultiuserDurableCQAuthzDUnitTest.java
index 6c641d0..68d52d9 100644
--- a/geode-cq/src/test/java/com/gemstone/gemfire/security/MultiuserDurableCQAuthzDUnitTest.java
+++ b/geode-cq/src/test/java/com/gemstone/gemfire/security/MultiuserDurableCQAuthzDUnitTest.java
@@ -60,8 +60,8 @@ public class MultiuserDurableCQAuthzDUnitTest extends
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
+ @Override
+ public final void postSetUp() throws Exception {
getSystem();
Invoke.invokeInEveryVM(new SerializableRunnable("getSystem") {
public void run() {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/distributed/LuceneFunctionReadPathDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/distributed/LuceneFunctionReadPathDUnitTest.java b/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/distributed/LuceneFunctionReadPathDUnitTest.java
index f24b136..901b363 100644
--- a/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/distributed/LuceneFunctionReadPathDUnitTest.java
+++ b/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/distributed/LuceneFunctionReadPathDUnitTest.java
@@ -64,8 +64,7 @@ public class LuceneFunctionReadPathDUnitTest extends CacheTestCase {
}
@Override
- public void setUp() throws Exception {
- super.setUp();
+ public final void postSetUp() throws Exception {
Host host = Host.getHost(0);
server1 = host.getVM(0);
server2 = host.getVM(1);
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/UpdateVersionDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/UpdateVersionDUnitTest.java b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/UpdateVersionDUnitTest.java
index cae30d2..61c4c28 100644
--- a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/UpdateVersionDUnitTest.java
+++ b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/UpdateVersionDUnitTest.java
@@ -81,7 +81,7 @@ public class UpdateVersionDUnitTest extends DistributedTestCase {
}
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
closeCache();
Invoke.invokeInEveryVM(new SerializableRunnable() { public void run() {
closeCache();
@@ -652,7 +652,7 @@ public class UpdateVersionDUnitTest extends DistributedTestCase {
private static void createCache(Integer locPort) {
UpdateVersionDUnitTest test = new UpdateVersionDUnitTest(getTestMethodName());
- Properties props = new Properties();
+ Properties props = test.getDistributedSystemProperties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + locPort + "]");
props.setProperty(DistributionConfig.LOG_LEVEL_NAME, LogWriterUtils.getDUnitLogLevel());
@@ -792,7 +792,7 @@ public class UpdateVersionDUnitTest extends DistributedTestCase {
public static Integer createFirstRemoteLocator(int dsId, int remoteLocPort) {
UpdateVersionDUnitTest test = new UpdateVersionDUnitTest(getTestMethodName());
int port = AvailablePortHelper.getRandomAvailablePortForDUnitSite();
- Properties props = new Properties();
+ Properties props = test.getDistributedSystemProperties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME,"0");
props.setProperty(DistributionConfig.DISTRIBUTED_SYSTEM_ID_NAME, ""+dsId);
props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + port + "]");
@@ -859,7 +859,7 @@ public class UpdateVersionDUnitTest extends DistributedTestCase {
public static int createReceiver(int locPort) {
UpdateVersionDUnitTest test = new UpdateVersionDUnitTest(getTestMethodName());
- Properties props = new Properties();
+ Properties props = test.getDistributedSystemProperties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + locPort
+ "]");
@@ -952,7 +952,7 @@ public class UpdateVersionDUnitTest extends DistributedTestCase {
public static Integer createFirstLocatorWithDSId(int dsId) {
UpdateVersionDUnitTest test = new UpdateVersionDUnitTest(getTestMethodName());
int port = AvailablePortHelper.getRandomAvailablePortForDUnitSite();
- Properties props = new Properties();
+ Properties props = test.getDistributedSystemProperties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME,"0");
props.setProperty(DistributionConfig.DISTRIBUTED_SYSTEM_ID_NAME, ""+dsId);
props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + port + "]");
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/WANTestBase.java
----------------------------------------------------------------------
diff --git a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/WANTestBase.java b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/WANTestBase.java
index 5da6b5c..2f44fce 100644
--- a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/WANTestBase.java
+++ b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/WANTestBase.java
@@ -170,27 +170,34 @@ public class WANTestBase extends DistributedTestCase{
public WANTestBase(String name) {
super(name);
}
-
- public void setUp() throws Exception {
+
+ @Override
+ public final void preSetUp() throws Exception {
final Host host = Host.getHost(0);
- vm0 = host.getVM(0);
+ vm0 = host.getVM(0);
vm1 = host.getVM(1);
vm2 = host.getVM(2);
- vm3 = host.getVM(3);
+ vm3 = host.getVM(3);
vm4 = host.getVM(4);
vm5 = host.getVM(5);
- vm6 = host.getVM(6);
+ vm6 = host.getVM(6);
vm7 = host.getVM(7);
//Need to set the test name after the VMs are created
- super.setUp();
- //this is done to vary the number of dispatchers for sender
+ }
+
+ @Override
+ public final void postSetUp() throws Exception {
+ //this is done to vary the number of dispatchers for sender
//during every test method run
shuffleNumDispatcherThreads();
- Invoke.invokeInEveryVM(WANTestBase.class,"setNumDispatcherThreadsForTheRun",
- new Object[]{dispatcherThreads.get(0)});
+ Invoke.invokeInEveryVM(() -> setNumDispatcherThreadsForTheRun(dispatcherThreads.get(0)));
IgnoredException.addIgnoredException("Connection refused");
IgnoredException.addIgnoredException("Software caused connection abort");
IgnoredException.addIgnoredException("Connection reset");
+ postSetUpWANTestBase();
+ }
+
+ protected void postSetUpWANTestBase() throws Exception {
}
public static void shuffleNumDispatcherThreads() {
@@ -209,7 +216,7 @@ public class WANTestBase extends DistributedTestCase{
public static void createLocator(int dsId, int port, Set<String> localLocatorsList, Set<String> remoteLocatorsList){
WANTestBase test = new WANTestBase(getTestMethodName());
- Properties props = new Properties();
+ Properties props = test.getDistributedSystemProperties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME,"0");
props.setProperty(DistributionConfig.DISTRIBUTED_SYSTEM_ID_NAME, ""+dsId);
StringBuffer localLocatorBuffer = new StringBuffer(localLocatorsList.toString());
@@ -233,7 +240,7 @@ public class WANTestBase extends DistributedTestCase{
stopOldLocator();
WANTestBase test = new WANTestBase(getTestMethodName());
int port = AvailablePortHelper.getRandomAvailablePortForDUnitSite();
- Properties props = new Properties();
+ Properties props = test.getDistributedSystemProperties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME,"0");
props.setProperty(DistributionConfig.DISTRIBUTED_SYSTEM_ID_NAME, ""+dsId);
props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + port + "]");
@@ -246,7 +253,7 @@ public class WANTestBase extends DistributedTestCase{
stopOldLocator();
WANTestBase test = new WANTestBase(getTestMethodName());
int port = AvailablePortHelper.getRandomAvailablePortForDUnitSite();
- Properties props = new Properties();
+ Properties props = test.getDistributedSystemProperties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME,"0");
props.setProperty(DistributionConfig.DISTRIBUTED_SYSTEM_ID_NAME, ""+dsId);
props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + port + "]");
@@ -259,7 +266,7 @@ public class WANTestBase extends DistributedTestCase{
stopOldLocator();
WANTestBase test = new WANTestBase(getTestMethodName());
int port = AvailablePortHelper.getRandomAvailablePortForDUnitSite();
- Properties props = new Properties();
+ Properties props = test.getDistributedSystemProperties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME,"0");
props.setProperty(DistributionConfig.DISTRIBUTED_SYSTEM_ID_NAME, ""+dsId);
props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + locatorPort + "]");
@@ -272,7 +279,7 @@ public class WANTestBase extends DistributedTestCase{
stopOldLocator();
WANTestBase test = new WANTestBase(getTestMethodName());
int port = AvailablePortHelper.getRandomAvailablePortForDUnitSite();
- Properties props = new Properties();
+ Properties props = test.getDistributedSystemProperties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME,"0");
props.setProperty(DistributionConfig.DISTRIBUTED_SYSTEM_ID_NAME, ""+dsId);
props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + locatorPort + "]");
@@ -285,7 +292,7 @@ public class WANTestBase extends DistributedTestCase{
stopOldLocator();
WANTestBase test = new WANTestBase(getTestMethodName());
int port = AvailablePortHelper.getRandomAvailablePortForDUnitSite();
- Properties props = new Properties();
+ Properties props = test.getDistributedSystemProperties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME,"0");
props.setProperty(DistributionConfig.DISTRIBUTED_SYSTEM_ID_NAME, ""+dsId);
props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + port + "]");
@@ -297,7 +304,7 @@ public class WANTestBase extends DistributedTestCase{
public static void bringBackLocatorOnOldPort(int dsId, int remoteLocPort, int oldPort) {
WANTestBase test = new WANTestBase(getTestMethodName());
- Properties props = new Properties();
+ Properties props = test.getDistributedSystemProperties();
props.put(DistributionConfig.LOG_LEVEL_NAME, "fine");
props.setProperty(DistributionConfig.MCAST_PORT_NAME,"0");
props.setProperty(DistributionConfig.DISTRIBUTED_SYSTEM_ID_NAME, ""+dsId);
@@ -313,7 +320,7 @@ public class WANTestBase extends DistributedTestCase{
stopOldLocator();
WANTestBase test = new WANTestBase(getTestMethodName());
int port = AvailablePortHelper.getRandomAvailablePortForDUnitSite();
- Properties props = new Properties();
+ Properties props = test.getDistributedSystemProperties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME,"0");
props.setProperty(DistributionConfig.DISTRIBUTED_SYSTEM_ID_NAME, ""+dsId);
props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + port + "]");
@@ -328,7 +335,7 @@ public class WANTestBase extends DistributedTestCase{
stopOldLocator();
WANTestBase test = new WANTestBase(getTestMethodName());
int port = AvailablePortHelper.getRandomAvailablePortForDUnitSite();
- Properties props = new Properties();
+ Properties props = test.getDistributedSystemProperties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME,"0");
props.setProperty(DistributionConfig.DISTRIBUTED_SYSTEM_ID_NAME, ""+dsId);
props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + localPort + "]");
@@ -343,7 +350,7 @@ public class WANTestBase extends DistributedTestCase{
stopOldLocator();
WANTestBase test = new WANTestBase(getTestMethodName());
int port = AvailablePortHelper.getRandomAvailablePortForDUnitSite();
- Properties props = new Properties();
+ Properties props = test.getDistributedSystemProperties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME,"0");
props.setProperty(DistributionConfig.DISTRIBUTED_SYSTEM_ID_NAME, ""+dsId);
props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + localPort + "]");
@@ -1333,7 +1340,7 @@ public class WANTestBase extends DistributedTestCase{
public static void createCacheConserveSockets(Boolean conserveSockets,Integer locPort){
WANTestBase test = new WANTestBase(getTestMethodName());
- Properties props = new Properties();
+ Properties props = test.getDistributedSystemProperties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + locPort + "]");
props.setProperty(DistributionConfig.CONSERVE_SOCKETS_NAME, conserveSockets.toString());
@@ -1343,7 +1350,7 @@ public class WANTestBase extends DistributedTestCase{
protected static void createCache(boolean management, Integer locPort) {
WANTestBase test = new WANTestBase(getTestMethodName());
- Properties props = new Properties();
+ Properties props = test.getDistributedSystemProperties();
if (management) {
props.setProperty(DistributionConfig.JMX_MANAGER_NAME, "true");
props.setProperty(DistributionConfig.JMX_MANAGER_START_NAME, "false");
@@ -1364,7 +1371,7 @@ public class WANTestBase extends DistributedTestCase{
String gatewaySslciphers = "any";
boolean gatewaySslRequireAuth = true;
- Properties gemFireProps = new Properties();
+ Properties gemFireProps = test.getDistributedSystemProperties();
gemFireProps.put(DistributionConfig.LOG_LEVEL_NAME, LogWriterUtils.getDUnitLogLevel());
gemFireProps.put(DistributionConfig.GATEWAY_SSL_ENABLED_NAME, String.valueOf(gatewaySslenabled));
gemFireProps.put(DistributionConfig.GATEWAY_SSL_PROTOCOLS_NAME, gatewaySslprotocols);
@@ -1390,7 +1397,7 @@ public class WANTestBase extends DistributedTestCase{
public static void createCache_PDX(Integer locPort){
WANTestBase test = new WANTestBase(getTestMethodName());
- Properties props = new Properties();
+ Properties props = test.getDistributedSystemProperties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + locPort + "]");
InternalDistributedSystem ds = test.getSystem(props);
@@ -1407,7 +1414,7 @@ public class WANTestBase extends DistributedTestCase{
public static void createCache(Integer locPort1, Integer locPort2){
WANTestBase test = new WANTestBase(getTestMethodName());
- Properties props = new Properties();
+ Properties props = test.getDistributedSystemProperties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + locPort1
+ "],localhost[" + locPort2 + "]");
@@ -1417,7 +1424,7 @@ public class WANTestBase extends DistributedTestCase{
public static void createCacheWithoutLocator(Integer mCastPort){
WANTestBase test = new WANTestBase(getTestMethodName());
- Properties props = new Properties();
+ Properties props = test.getDistributedSystemProperties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME, ""+mCastPort);
InternalDistributedSystem ds = test.getSystem(props);
cache = CacheFactory.create(ds);
@@ -2742,7 +2749,7 @@ public class WANTestBase extends DistributedTestCase{
public static int createReceiver(int locPort) {
WANTestBase test = new WANTestBase(getTestMethodName());
- Properties props = new Properties();
+ Properties props = test.getDistributedSystemProperties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + locPort
+ "]");
@@ -2768,7 +2775,7 @@ public class WANTestBase extends DistributedTestCase{
public static void createReceiverWithBindAddress(int locPort) {
WANTestBase test = new WANTestBase(getTestMethodName());
- Properties props = new Properties();
+ Properties props = test.getDistributedSystemProperties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
props.setProperty(DistributionConfig.LOG_LEVEL_NAME, LogWriterUtils.getDUnitLogLevel());
props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + locPort
@@ -2804,7 +2811,7 @@ public class WANTestBase extends DistributedTestCase{
String gatewaySslciphers = "any";
boolean gatewaySslRequireAuth = true;
- Properties gemFireProps = new Properties();
+ Properties gemFireProps = test.getDistributedSystemProperties();
gemFireProps.put(DistributionConfig.LOG_LEVEL_NAME, LogWriterUtils.getDUnitLogLevel());
gemFireProps.put(DistributionConfig.GATEWAY_SSL_ENABLED_NAME, String.valueOf(gatewaySslenabled));
@@ -2874,7 +2881,7 @@ public class WANTestBase extends DistributedTestCase{
public static void createReceiverAndServer(int locPort) {
WANTestBase test = new WANTestBase(getTestMethodName());
- Properties props = new Properties();
+ Properties props = test.getDistributedSystemProperties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + locPort
+ "]");
@@ -2926,7 +2933,7 @@ public class WANTestBase extends DistributedTestCase{
public static int createServer(int locPort) {
WANTestBase test = new WANTestBase(getTestMethodName());
- Properties props = new Properties();
+ Properties props = test.getDistributedSystemProperties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + locPort
+ "]");
@@ -2949,8 +2956,7 @@ public class WANTestBase extends DistributedTestCase{
public static void createClientWithLocator(int port0,String host,
String regionName) {
WANTestBase test = new WANTestBase(getTestMethodName());
- Properties props = new Properties();
- props = new Properties();
+ Properties props = test.getDistributedSystemProperties();
props.setProperty("mcast-port", "0");
props.setProperty("locators", "");
@@ -2984,7 +2990,7 @@ public class WANTestBase extends DistributedTestCase{
public static int createReceiver_PDX(int locPort) {
WANTestBase test = new WANTestBase(getTestMethodName());
- Properties props = new Properties();
+ Properties props = test.getDistributedSystemProperties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + locPort + "]");
InternalDistributedSystem ds = test.getSystem(props);
@@ -4277,7 +4283,7 @@ public class WANTestBase extends DistributedTestCase{
public static void checkAllSiteMetaData(
Map<Integer, ArrayList<Integer>> dsVsPorts) {
waitForSitesToUpdate();
- assertNotNull(system);
+ assertNotNull(getSystemStatic());
// Map<Integer,Set<DistributionLocatorId>> allSiteMetaData = ((DistributionConfigImpl)system
// .getConfig()).getAllServerLocatorsInfo();
@@ -4310,7 +4316,7 @@ public class WANTestBase extends DistributedTestCase{
WaitCriterion wc = new WaitCriterion() {
public boolean done() {
- if (system != null) {
+ if (getSystemStatic() != null) {
return true;
}
else {
@@ -4323,7 +4329,7 @@ public class WANTestBase extends DistributedTestCase{
}
};
Wait.waitForCriterion(wc, 50000, 1000, true);
- assertNotNull(system);
+ assertNotNull(getSystemStatic());
// final Map<Integer,Set<DistributionLocatorId>> allSiteMetaData = ((DistributionConfigImpl)system
// .getConfig()).getAllServerLocatorsInfo();
@@ -5137,7 +5143,7 @@ public class WANTestBase extends DistributedTestCase{
}*/
@Override
- protected final void preTearDown() throws Exception {
+ public final void preTearDown() throws Exception {
cleanupVM();
List<AsyncInvocation> invocations = new ArrayList<AsyncInvocation>();
final Host host = Host.getHost(0);
@@ -5186,14 +5192,15 @@ public class WANTestBase extends DistributedTestCase{
}
@Override
- public InternalDistributedSystem getSystem(Properties props) {
+ public final Properties getDistributedSystemProperties() {
// For now all WANTestBase tests allocate off-heap memory even though
// many of them never use it.
// The problem is that WANTestBase has static methods that create instances
// of WANTestBase (instead of instances of the subclass). So we can't override
// this method so that only the off-heap subclasses allocate off heap memory.
+ Properties props = new Properties();
props.setProperty(DistributionConfig.OFF_HEAP_MEMORY_SIZE_NAME, "300m");
- return super.getSystem(props);
+ return props;
}
/**
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/concurrent/ConcurrentParallelGatewaySenderDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/concurrent/ConcurrentParallelGatewaySenderDUnitTest.java b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/concurrent/ConcurrentParallelGatewaySenderDUnitTest.java
index 54b6431..670928f 100644
--- a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/concurrent/ConcurrentParallelGatewaySenderDUnitTest.java
+++ b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/concurrent/ConcurrentParallelGatewaySenderDUnitTest.java
@@ -43,10 +43,6 @@ public class ConcurrentParallelGatewaySenderDUnitTest extends WANTestBase {
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
- }
-
/**
* Normal happy scenario test case.
* checks that all the dispatchers have successfully
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/concurrent/ConcurrentParallelGatewaySenderOperation_1_DUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/concurrent/ConcurrentParallelGatewaySenderOperation_1_DUnitTest.java b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/concurrent/ConcurrentParallelGatewaySenderOperation_1_DUnitTest.java
index ed48b15..28971ce 100644
--- a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/concurrent/ConcurrentParallelGatewaySenderOperation_1_DUnitTest.java
+++ b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/concurrent/ConcurrentParallelGatewaySenderOperation_1_DUnitTest.java
@@ -33,9 +33,9 @@ public class ConcurrentParallelGatewaySenderOperation_1_DUnitTest extends WANTes
public ConcurrentParallelGatewaySenderOperation_1_DUnitTest(String name) {
super(name);
}
-
- public void setUp() throws Exception {
- super.setUp();
+
+ @Override
+ protected final void postSetUpWANTestBase() throws Exception {
IgnoredException.addIgnoredException("Broken pipe");
IgnoredException.addIgnoredException("Connection reset");
IgnoredException.addIgnoredException("Unexpected IOException");
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/concurrent/ConcurrentParallelGatewaySenderOperation_2_DUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/concurrent/ConcurrentParallelGatewaySenderOperation_2_DUnitTest.java b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/concurrent/ConcurrentParallelGatewaySenderOperation_2_DUnitTest.java
index a387e29..3348140 100644
--- a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/concurrent/ConcurrentParallelGatewaySenderOperation_2_DUnitTest.java
+++ b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/concurrent/ConcurrentParallelGatewaySenderOperation_2_DUnitTest.java
@@ -40,9 +40,9 @@ public class ConcurrentParallelGatewaySenderOperation_2_DUnitTest extends WANTes
public ConcurrentParallelGatewaySenderOperation_2_DUnitTest(String name) {
super(name);
}
-
- public void setUp() throws Exception {
- super.setUp();
+
+ @Override
+ protected final void postSetUpWANTestBase() throws Exception {
IgnoredException.addIgnoredException("RegionDestroyedException");
IgnoredException.addIgnoredException("Broken pipe");
IgnoredException.addIgnoredException("Connection reset");
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/disttx/DistTXWANDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/disttx/DistTXWANDUnitTest.java b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/disttx/DistTXWANDUnitTest.java
index 529ad47..cfa2dc0 100644
--- a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/disttx/DistTXWANDUnitTest.java
+++ b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/disttx/DistTXWANDUnitTest.java
@@ -33,9 +33,8 @@ public class DistTXWANDUnitTest extends WANTestBase {
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
-
+ @Override
+ protected final void postSetUpWANTestBase() throws Exception {
Invoke.invokeInEveryVM(new SerializableCallable() {
@Override
public Object call() throws Exception {
@@ -44,7 +43,6 @@ public class DistTXWANDUnitTest extends WANTestBase {
}
});
}
-
/*
* Disabled because it hangs with current implementation of notifying
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/NewWANConcurrencyCheckForDestroyDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/NewWANConcurrencyCheckForDestroyDUnitTest.java b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/NewWANConcurrencyCheckForDestroyDUnitTest.java
index e0e7836..fce71d3 100644
--- a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/NewWANConcurrencyCheckForDestroyDUnitTest.java
+++ b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/NewWANConcurrencyCheckForDestroyDUnitTest.java
@@ -50,10 +50,6 @@ public class NewWANConcurrencyCheckForDestroyDUnitTest extends WANTestBase {
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
- }
-
public void testVersionTagTimestampForDestroy() {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/PDXNewWanDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/PDXNewWanDUnitTest.java b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/PDXNewWanDUnitTest.java
index a7e17b6..dd9ab09 100644
--- a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/PDXNewWanDUnitTest.java
+++ b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/PDXNewWanDUnitTest.java
@@ -31,10 +31,6 @@ public class PDXNewWanDUnitTest extends WANTestBase{
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
- }
-
/**
* Test
* 1> Site 1 : 1 locator, 1 member
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/SenderWithTransportFilterDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/SenderWithTransportFilterDUnitTest.java b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/SenderWithTransportFilterDUnitTest.java
index a019751..1f4d72c 100644
--- a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/SenderWithTransportFilterDUnitTest.java
+++ b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/SenderWithTransportFilterDUnitTest.java
@@ -48,10 +48,6 @@ public class SenderWithTransportFilterDUnitTest extends WANTestBase {
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
- }
-
public void testSerialSenderWithTansportFilter() {
Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 ));
@@ -104,7 +100,7 @@ public class SenderWithTransportFilterDUnitTest extends WANTestBase {
public static int createReceiverWithTransportFilters(int locPort) {
WANTestBase test = new WANTestBase(getTestMethodName());
- Properties props = new Properties();
+ Properties props = test.getDistributedSystemProperties();
props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + locPort
+ "]");
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/ShutdownAllPersistentGatewaySenderDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/ShutdownAllPersistentGatewaySenderDUnitTest.java b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/ShutdownAllPersistentGatewaySenderDUnitTest.java
index 9028531..f821ab1 100644
--- a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/ShutdownAllPersistentGatewaySenderDUnitTest.java
+++ b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/ShutdownAllPersistentGatewaySenderDUnitTest.java
@@ -46,8 +46,7 @@ public class ShutdownAllPersistentGatewaySenderDUnitTest extends WANTestBase {
}
@Override
- public void setUp() throws Exception {
- super.setUp();
+ protected final void postSetUpWANTestBase() throws Exception {
IgnoredException.addIgnoredException("Cache is being closed by ShutdownAll");
}