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/09 03:30:03 UTC
[1/2] incubator-geode git commit: Remove TODO
Repository: incubator-geode
Updated Branches:
refs/heads/feature/GEODE-1050 1011f1f30 -> 43a182a2e
Remove TODO
Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/7eb869d2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/7eb869d2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/7eb869d2
Branch: refs/heads/feature/GEODE-1050
Commit: 7eb869d2ac389a912d3b7d0c8c92985f9832b864
Parents: 1011f1f
Author: Kirk Lund <kl...@apache.org>
Authored: Tue Mar 8 10:34:38 2016 -0800
Committer: Kirk Lund <kl...@apache.org>
Committed: Tue Mar 8 10:34:38 2016 -0800
----------------------------------------------------------------------
.../src/test/java/com/gemstone/gemfire/cache30/CacheTestCase.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/7eb869d2/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 1258269..daa6e8a 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
@@ -79,7 +79,7 @@ public abstract class CacheTestCase extends DistributedTestCase {
* All references synchronized via <code>CacheTestCase.class</code>
* */
// static so it doesn't get serialized with SerializableRunnable inner classes
- private static Cache cache; // TODO: make private
+ private static Cache cache;
//////// Constructors
[2/2] incubator-geode git commit: Make DistributedTestCase system
private
Posted by kl...@apache.org.
Make DistributedTestCase system private
Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/43a182a2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/43a182a2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/43a182a2
Branch: refs/heads/feature/GEODE-1050
Commit: 43a182a2e21e24e2cdffda78e75932e5c1876b16
Parents: 7eb869d
Author: Kirk Lund <kl...@apache.org>
Authored: Tue Mar 8 18:26:29 2016 -0800
Committer: Kirk Lund <kl...@apache.org>
Committed: Tue Mar 8 18:26:29 2016 -0800
----------------------------------------------------------------------
.../cache/ClientServerTimeSyncDUnitTest.java | 4 +-
.../dunit/QueryIndexUsingXMLDUnitTest.java | 6 +--
.../query/dunit/QueryUsingPoolDUnitTest.java | 22 +++++-----
.../cache/query/dunit/RemoteQueryDUnitTest.java | 38 ++++++++---------
.../gemstone/gemfire/cache30/CacheTestCase.java | 2 +-
.../gemfire/cache30/ReconnectDUnitTest.java | 12 +++---
.../RegionMembershipListenerDUnitTest.java | 2 +-
.../gemfire/cache30/TXDistributedDUnitTest.java | 4 +-
.../distributed/DistributedSystemDUnitTest.java | 22 ++++++----
.../gemfire/distributed/LocatorDUnitTest.java | 10 +++++
.../distributed/SystemAdminDUnitTest.java | 44 ++++++++++----------
.../internal/DistributionManagerDUnitTest.java | 38 ++++++++---------
.../cache/ClientServerTransactionDUnitTest.java | 2 +-
.../cache/RemoteTransactionDUnitTest.java | 12 +++---
.../internal/cache/SystemFailureDUnitTest.java | 6 +--
.../LocalFunctionExecutionDUnitTest.java | 4 +-
...tentColocatedPartitionedRegionDUnitTest.java | 6 +--
.../sockets/InterestListRecoveryDUnitTest.java | 2 +-
.../internal/jta/dunit/TxnTimeOutDUnitTest.java | 4 +-
.../statistics/StatisticsDUnitTest.java | 2 +-
.../stats/DistributedSystemStatsDUnitTest.java | 2 +-
.../cli/commands/ConfigCommandsDUnitTest.java | 2 +-
.../cli/commands/ShowDeadlockDUnitTest.java | 2 +-
.../gemfire/security/SecurityTestUtil.java | 10 ++---
.../gemfire/test/dunit/DistributedTestCase.java | 14 ++++++-
.../cache/internal/JUnit3CacheTestCase.java | 26 ++----------
.../cache/internal/JUnit4CacheTestCase.java | 14 +++----
.../internal/JUnit3DistributedTestCase.java | 24 ++++++++---
.../internal/JUnit4DistributedTestCase.java | 35 ++++++++++++----
.../gemfire/internal/cache/wan/WANTestBase.java | 6 +--
30 files changed, 208 insertions(+), 169 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/43a182a2/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/43a182a2/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..775ea29 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
@@ -945,12 +945,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/43a182a2/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..1bffce5 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
@@ -171,7 +171,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 +308,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 +440,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 +577,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 +636,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 +1666,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 +1769,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 +1907,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 +2003,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 +2161,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 +2377,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());
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/43a182a2/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..c0de700 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
@@ -99,7 +99,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 +129,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 +242,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 +272,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 +370,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 +400,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 +496,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 +633,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 +690,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 +720,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 +855,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 +890,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 +956,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 +986,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 +1001,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 +1115,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 +1145,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 +1219,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 +1256,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/43a182a2/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 daa6e8a..561209a 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
@@ -416,7 +416,7 @@ public abstract class CacheTestCase extends DistributedTestCase {
* @return internal arguements, which may be null. If null, then default
* InternalRegionArguments are used to construct the Region
*/
- public final InternalRegionArguments getInternalRegionArguments()
+ private final InternalRegionArguments getInternalRegionArguments()
{
return null;
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/43a182a2/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..de3d7a2 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
@@ -680,8 +680,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 +691,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 +901,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 +1015,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 +1139,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/43a182a2/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..f693c29 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
@@ -295,7 +295,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/43a182a2/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/43a182a2/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 f32c26f..3fd686c 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
@@ -45,6 +45,7 @@ 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;
@@ -63,9 +64,14 @@ import org.junit.experimental.categories.Category;
* @author David Whitlock
*/
@Category(DistributedTest.class)
-public class DistributedSystemDUnitTest extends JUnit4DistributedTestCase {
+public class DistributedSystemDUnitTest extends DistributedTestCase {
+
+ public DistributedSystemDUnitTest(String name) {
+ super(name);
+ }
public void postSetUp() throws Exception {
+ System.out.println("KIRK:postSetUp");
disconnectAllFromDS();
}
@@ -248,7 +254,7 @@ public class DistributedSystemDUnitTest extends JUnit4DistributedTestCase {
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());
@@ -268,7 +274,7 @@ public class DistributedSystemDUnitTest extends JUnit4DistributedTestCase {
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();
@@ -300,7 +306,7 @@ public class DistributedSystemDUnitTest extends JUnit4DistributedTestCase {
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) {
@@ -318,8 +324,8 @@ public class DistributedSystemDUnitTest extends JUnit4DistributedTestCase {
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();
@@ -334,7 +340,7 @@ public class DistributedSystemDUnitTest extends JUnit4DistributedTestCase {
config.setProperty(DistributionConfig.MEMBERSHIP_PORT_RANGE_NAME, ""
+ (DistributionConfig.DEFAULT_MEMBERSHIP_PORT_RANGE[1] - 2) + "-"
+ (DistributionConfig.DEFAULT_MEMBERSHIP_PORT_RANGE[1]));
- system = (InternalDistributedSystem)DistributedSystem.connect(config);
+ InternalDistributedSystem system = getSystem(config);
Cache cache = CacheFactory.create(system);
cache.addCacheServer();
DistributionManager dm = (DistributionManager) system.getDistributionManager();
@@ -356,7 +362,7 @@ public class DistributedSystemDUnitTest extends JUnit4DistributedTestCase {
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();
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/43a182a2/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..7e4943d 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;
/**
@@ -115,6 +117,14 @@ public class LocatorDUnitTest extends DistributedTestCase {
}
}
+ @Override
+ protected 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/43a182a2/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..18159f8 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 {
@@ -45,14 +45,14 @@ public class SystemAdminDUnitTest extends DistributedTestCase {
disconnect();
}
- @Override
- protected final void preTearDown() throws Exception {
+ @Override
+ protected 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/43a182a2/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 084ada5..af765a3 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
@@ -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/43a182a2/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..995e1cf 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
@@ -152,7 +152,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/43a182a2/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..7f5f4bb 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
@@ -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/43a182a2/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/43a182a2/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..fc3777d 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
@@ -158,8 +158,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"));
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/43a182a2/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..defba4f 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
@@ -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/43a182a2/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..5243015 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
@@ -129,7 +129,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());
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/43a182a2/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..6109852 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
@@ -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/43a182a2/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..fcc2e7b 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
@@ -272,7 +272,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/43a182a2/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..7e70b85 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
@@ -63,7 +63,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/43a182a2/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/43a182a2/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..cee7229 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
@@ -188,7 +188,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/43a182a2/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/43a182a2/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 6ddbf0d..1f7daa1 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
@@ -81,7 +81,7 @@ public abstract class DistributedTestCase extends TestCase implements java.io.Se
private static final Set<String> testHistory = new LinkedHashSet<String>();
/** This VM's connection to the distributed system */
- public static InternalDistributedSystem system; // TODO: make private
+ private static InternalDistributedSystem system; // TODO: make private
private static Class lastSystemCreatedInTest;
private static Properties lastSystemProperties;
private static volatile String testMethodName;
@@ -202,6 +202,18 @@ public abstract class DistributedTestCase extends TestCase implements java.io.Se
return getSystem(getDistributedSystemProperties());
}
+ public final InternalDistributedSystem basicGetSystem() {
+ return this.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.
*
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/43a182a2/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
index ea827c6..ace9c31 100644
--- 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
@@ -69,15 +69,6 @@ public abstract class JUnit3CacheTestCase extends JUnit3DistributedTestCase impl
private final JUnit4CacheTestCase delegate = new JUnit4CacheTestCase(this);
-// private static final Logger logger = LogService.getLogger();
-//
-// /** The Cache from which regions are obtained
-// *
-// * All references synchronized via <code>JUnit3CacheTestCase.class</code>
-// * */
-// // static so it doesn't get serialized with SerializableRunnable inner classes
-// protected static Cache cache;
-
public JUnit3CacheTestCase(final String name) {
super(name);
}
@@ -159,9 +150,9 @@ public abstract class JUnit3CacheTestCase extends JUnit3DistributedTestCase impl
return JUnit4CacheTestCase.basicGetCache();
}
- public static synchronized final void disconnectFromDS() {
- JUnit4CacheTestCase.disconnectFromDS();
- }
+// public static synchronized final void disconnectFromDS() {
+// JUnit4CacheTestCase.disconnectFromDS();
+// }
/** Close the cache */
public static synchronized final void closeCache() {
@@ -200,17 +191,6 @@ public abstract class JUnit3CacheTestCase extends JUnit3DistributedTestCase impl
return delegate.createRegion(name, 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
- */
- public final InternalRegionArguments getInternalRegionArguments() {
- return delegate.getInternalRegionArguments();
- }
-
public final Region createRegion(final String name, final String rootName, final RegionAttributes attributes) throws CacheException {
return delegate.createRegion(name, rootName, attributes);
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/43a182a2/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
index 97e14ba..e16e65b 100644
--- 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
@@ -77,7 +77,7 @@ public class JUnit4CacheTestCase extends JUnit4DistributedTestCase implements Ca
*
* <p>Field is static so it doesn't get serialized with SerializableRunnable inner classes.
*/
- protected static Cache cache; // TODO: make private
+ private static Cache cache;
private final CacheTestFixture cacheTestFixture;
@@ -96,7 +96,7 @@ public class JUnit4CacheTestCase extends JUnit4DistributedTestCase implements Ca
}
JUnit4CacheTestCase(final CacheTestFixture cacheTestFixture) {
- super(); // TODO: what about DistributedTestFixture?
+ super(); // TODO: what about DistributedTestFixture? Make CacheTestFixture extend DistributedTestFixture
if (cacheTestFixture == null) {
this.cacheTestFixture = this;
} else {
@@ -325,10 +325,10 @@ public class JUnit4CacheTestCase extends JUnit4DistributedTestCase implements Ca
return cache;
}
- public static final synchronized void disconnectFromDS() {
- closeCache();
- JUnit4DistributedTestCase.disconnectFromDS();
- }
+// public static final synchronized void disconnectFromDS() {
+// closeCache();
+// JUnit4DistributedTestCase.disconnectFromDS();
+// }
/**
* Close the cache
@@ -442,7 +442,7 @@ public class JUnit4CacheTestCase extends JUnit4DistributedTestCase implements Ca
* @return internal arguments, which may be null. If null, then default
* InternalRegionArguments are used to construct the Region
*/
- public final InternalRegionArguments getInternalRegionArguments() { // TODO: delete?
+ private final InternalRegionArguments getInternalRegionArguments() { // TODO: delete?
return null;
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/43a182a2/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
index 394cf09..b990c2e 100755
--- 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
@@ -94,7 +94,7 @@ public abstract class JUnit3DistributedTestCase extends TestCase implements Dist
* @since 3.0
*/
public /*final*/ InternalDistributedSystem getSystem(final Properties props) { // TODO: make final
- return delegate.getSystem(props);
+ return delegate.defaultGetSystem(props);
}
/**
@@ -111,6 +111,18 @@ public abstract class JUnit3DistributedTestCase extends TestCase implements Dist
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
@@ -139,17 +151,17 @@ public abstract class JUnit3DistributedTestCase extends TestCase implements Dist
* @since 3.0
*/
public Properties getDistributedSystemProperties() {
- return delegate.getDistributedSystemProperties();
+ return delegate.defaultGetDistributedSystemProperties();
}
- public static void disconnectAllFromDS() {
+ public static final void disconnectAllFromDS() {
JUnit4DistributedTestCase.disconnectAllFromDS();
}
/**
* Disconnects this VM from the distributed system
*/
- public static void disconnectFromDS() {
+ public static final void disconnectFromDS() {
JUnit4DistributedTestCase.disconnectFromDS();
}
@@ -157,7 +169,7 @@ public abstract class JUnit3DistributedTestCase extends TestCase implements Dist
// name methods
//---------------------------------------------------------------------------
- public static String getTestMethodName() {
+ public static final String getTestMethodName() {
return JUnit4DistributedTestCase.getTestMethodName();
}
@@ -169,7 +181,7 @@ public abstract class JUnit3DistributedTestCase extends TestCase implements Dist
* 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() {
+ public final String getUniqueName() {
return delegate.getUniqueName();
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/43a182a2/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
index be44f94..915aee9 100755
--- 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
@@ -154,7 +154,10 @@ public class JUnit4DistributedTestCase implements DistributedTestFixture, Serial
if (this.distributedTestFixture != this) {
return this.distributedTestFixture.getSystem(props);
}
+ return defaultGetSystem(props);
+ }
+ final InternalDistributedSystem defaultGetSystem(final Properties props) {
// Setting the default disk store name is now done in setUp
if (system == null) {
system = InternalDistributedSystem.getAnyInstance();
@@ -168,10 +171,10 @@ public class JUnit4DistributedTestCase implements DistributedTestFixture, Serial
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"));
+ 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"));
+ oldStatFile.replace("statArchive.gfs", testName+".gfs"));
}
system = (InternalDistributedSystem)DistributedSystem.connect(p);
lastSystemProperties = p;
@@ -182,9 +185,9 @@ public class JUnit4DistributedTestCase implements DistributedTestFixture, Serial
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);
+ "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();
@@ -196,8 +199,8 @@ public class JUnit4DistributedTestCase implements DistributedTestFixture, Serial
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);
+ + " old value = " + activeProps.getProperty(key)
+ + " new value = " + value);
break;
}
}
@@ -227,6 +230,18 @@ public class JUnit4DistributedTestCase implements DistributedTestFixture, Serial
return getSystem(getDistributedSystemProperties());
}
+ public final InternalDistributedSystem basicGetSystem() {
+ return this.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
@@ -264,6 +279,10 @@ public class JUnit4DistributedTestCase implements DistributedTestFixture, Serial
if (this.distributedTestFixture != this) {
return this.distributedTestFixture.getDistributedSystemProperties();
}
+ return defaultGetDistributedSystemProperties();
+ }
+
+ final Properties defaultGetDistributedSystemProperties() {
return new Properties();
}
@@ -275,7 +294,7 @@ public class JUnit4DistributedTestCase implements DistributedTestFixture, Serial
/**
* Disconnects this VM from the distributed system
*/
- public static void disconnectFromDS() { // TODO: this is overridden by CacheTestCase
+ public static final void disconnectFromDS() { // TODO: this is overridden by CacheTestCase
setTestMethodName(null);
GemFireCacheImpl.testCacheXml = null;
if (system != null) {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/43a182a2/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 0a1a7ef..58292f7 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
@@ -4259,7 +4259,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();
@@ -4292,7 +4292,7 @@ public class WANTestBase extends DistributedTestCase{
WaitCriterion wc = new WaitCriterion() {
public boolean done() {
- if (system != null) {
+ if (getSystemStatic() != null) {
return true;
}
else {
@@ -4305,7 +4305,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();