You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by go...@apache.org on 2017/10/18 21:10:44 UTC
[geode] branch develop updated: GEODE-3614 remove
JUnit3CacheTestCase, cleanup JUnit4CacheTestCase
This is an automated email from the ASF dual-hosted git repository.
gosullivan pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode.git
The following commit(s) were added to refs/heads/develop by this push:
new 6206fc1 GEODE-3614 remove JUnit3CacheTestCase, cleanup JUnit4CacheTestCase
6206fc1 is described below
commit 6206fc1c2e07d6373cabc3b8dda6d24d6050fc5b
Author: Galen O'Sullivan <go...@pivotal.io>
AuthorDate: Wed Sep 13 14:43:15 2017 -0700
GEODE-3614 remove JUnit3CacheTestCase, cleanup JUnit4CacheTestCase
* Use LogService instead of LogWriter
* get rid of an unused method or two
* remove redundant error handling
* remove TODOs.
---
.../SharedConfigurationTestUtils.java | 4 +-
.../dunit/cache/internal/JUnit3CacheTestCase.java | 236 --------------------
.../dunit/cache/internal/JUnit4CacheTestCase.java | 96 ++-------
.../dunit/internal/JUnit3DistributedTestCase.java | 240 ---------------------
.../dunit/internal/JUnit4DistributedTestCase.java | 2 +-
5 files changed, 26 insertions(+), 552 deletions(-)
diff --git a/geode-core/src/test/java/org/apache/geode/management/internal/configuration/SharedConfigurationTestUtils.java b/geode-core/src/test/java/org/apache/geode/management/internal/configuration/SharedConfigurationTestUtils.java
index eddaad2..cd4f40a 100644
--- a/geode-core/src/test/java/org/apache/geode/management/internal/configuration/SharedConfigurationTestUtils.java
+++ b/geode-core/src/test/java/org/apache/geode/management/internal/configuration/SharedConfigurationTestUtils.java
@@ -17,7 +17,7 @@ package org.apache.geode.management.internal.configuration;
import org.apache.geode.distributed.internal.ClusterConfigurationService;
import org.apache.geode.distributed.internal.InternalLocator;
import org.apache.geode.test.dunit.SerializableRunnable;
-import org.apache.geode.test.dunit.internal.JUnit3DistributedTestCase;
+import org.apache.geode.test.dunit.internal.JUnit4DistributedTestCase;
public class SharedConfigurationTestUtils {
@@ -32,7 +32,7 @@ public class SharedConfigurationTestUtils {
}
locator.stop();
}
- JUnit3DistributedTestCase.disconnectAllFromDS();
+ JUnit4DistributedTestCase.disconnectAllFromDS();
}
};
}
diff --git a/geode-core/src/test/java/org/apache/geode/test/dunit/cache/internal/JUnit3CacheTestCase.java b/geode-core/src/test/java/org/apache/geode/test/dunit/cache/internal/JUnit3CacheTestCase.java
deleted file mode 100644
index 7c88cc3..0000000
--- a/geode-core/src/test/java/org/apache/geode/test/dunit/cache/internal/JUnit3CacheTestCase.java
+++ /dev/null
@@ -1,236 +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 org.apache.geode.test.dunit.cache.internal;
-
-import java.io.File;
-import java.io.IOException;
-
-import org.apache.geode.cache.Cache;
-import org.apache.geode.cache.CacheException;
-import org.apache.geode.cache.CacheFactory;
-import org.apache.geode.cache.Region;
-import org.apache.geode.cache.RegionAttributes;
-import org.apache.geode.cache.RegionExistsException;
-import org.apache.geode.cache.TimeoutException;
-import org.apache.geode.cache.client.ClientCache;
-import org.apache.geode.cache.client.ClientCacheFactory;
-import org.apache.geode.cache30.CacheSerializableRunnable;
-import org.apache.geode.internal.cache.GemFireCacheImpl;
-import org.apache.geode.internal.cache.InternalCache;
-import org.apache.geode.test.dunit.IgnoredException;
-import org.apache.geode.test.dunit.cache.CacheTestCase;
-import org.apache.geode.test.dunit.internal.JUnit3DistributedTestCase;
-
-/**
- * The abstract superclass of tests that require the creation of a {@link Cache}.
- *
- * @deprecated Please use {@link CacheTestCase} which extends {@link JUnit4CacheTestCase} when
- * writing new tests.
- */
-@Deprecated
-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 File root, final String name, final boolean useSchema,
- final String xmlVersion) {
- delegate.finishCacheXml(root, name, useSchema, xmlVersion);
- }
-
- /**
- * Return a cache for obtaining regions, created lazily.
- */
- public final InternalCache getCache() {
- return delegate.getCache();
- }
-
- public final InternalCache getCache(final CacheFactory factory) {
- return delegate.getCache(factory);
- }
-
- public final InternalCache getCache(final boolean client) {
- return delegate.getCache(client);
- }
-
- public final InternalCache 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 GemFire 6.5
- */
- public final ClientCache getClientCache(final ClientCacheFactory factory) {
- return delegate.getClientCache(factory);
- }
-
- /**
- * Invokes {@link #getCache()} and casts the return to {@code GemFireCacheImpl}.
- *
- * @deprecated Please use {@link #getCache} which returns InternalCache instead.
- */
- @Deprecated
- public final GemFireCacheImpl getGemfireCache() {
- 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 {
- // nothing
- }
-
- @Override
- public void postTearDownCacheTestCase() throws Exception {
- // nothing
- }
-
- /**
- * 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();
- }
-}
diff --git a/geode-core/src/test/java/org/apache/geode/test/dunit/cache/internal/JUnit4CacheTestCase.java b/geode-core/src/test/java/org/apache/geode/test/dunit/cache/internal/JUnit4CacheTestCase.java
index 34507d2..3f11f82 100644
--- a/geode-core/src/test/java/org/apache/geode/test/dunit/cache/internal/JUnit4CacheTestCase.java
+++ b/geode-core/src/test/java/org/apache/geode/test/dunit/cache/internal/JUnit4CacheTestCase.java
@@ -24,13 +24,15 @@ import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Map;
import java.util.Properties;
+import java.util.concurrent.TimeUnit;
import org.apache.commons.io.FileUtils;
+import org.apache.logging.log4j.Logger;
+import org.awaitility.Awaitility;
import org.apache.geode.cache.AttributesFactory;
import org.apache.geode.cache.Cache;
import org.apache.geode.cache.CacheException;
-import org.apache.geode.cache.CacheExistsException;
import org.apache.geode.cache.CacheFactory;
import org.apache.geode.cache.CacheTransactionManager;
import org.apache.geode.cache.ExpirationAttributes;
@@ -49,12 +51,10 @@ import org.apache.geode.internal.cache.LocalRegion;
import org.apache.geode.internal.cache.xmlcache.CacheCreation;
import org.apache.geode.internal.cache.xmlcache.CacheXmlGenerator;
import org.apache.geode.test.dunit.Assert;
+import org.apache.geode.internal.logging.LogService;
import org.apache.geode.test.dunit.IgnoredException;
import org.apache.geode.test.dunit.Invoke;
-import org.apache.geode.test.dunit.LogWriterUtils;
import org.apache.geode.test.dunit.VM;
-import org.apache.geode.test.dunit.Wait;
-import org.apache.geode.test.dunit.WaitCriterion;
import org.apache.geode.test.dunit.internal.JUnit4DistributedTestCase;
/**
@@ -64,6 +64,7 @@ import org.apache.geode.test.dunit.internal.JUnit4DistributedTestCase;
public abstract class JUnit4CacheTestCase extends JUnit4DistributedTestCase
implements CacheTestFixture {
+ private static final Logger logger = LogService.getLogger();
/**
* The Cache from which regions are obtained.
*
@@ -122,16 +123,6 @@ public abstract class JUnit4CacheTestCase extends JUnit4DistributedTestCase
}
}
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_PREFIX + "DISABLE_DISCONNECT_DS_ON_CACHE_CLOSE");
System.clearProperty(GEMFIRE_PREFIX + "locators");
@@ -149,16 +140,6 @@ public abstract class JUnit4CacheTestCase extends JUnit4DistributedTestCase
System.setProperty(GEMFIRE_PREFIX + "DISABLE_DISCONNECT_DS_ON_CACHE_CLOSE", "true");
InternalCache newCache = (InternalCache) CacheFactory.create(getLonerSystem());
cache = newCache;
-
- } 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_PREFIX + "DISABLE_DISCONNECT_DS_ON_CACHE_CLOSE");
}
@@ -170,7 +151,7 @@ public abstract class JUnit4CacheTestCase extends JUnit4DistributedTestCase
* 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() {
+ public static synchronized void beginCacheXml() {
closeCache();
cache = new TestCacheCreation();
}
@@ -181,19 +162,16 @@ public abstract class JUnit4CacheTestCase extends JUnit4DistributedTestCase
*/
public final void finishCacheXml(final String name) {
synchronized (JUnit4CacheTestCase.class) {
- File file = new File(name + "-cache.xml");
try {
+ File file = new File(name + "-cache.xml");
PrintWriter printWriter = new PrintWriter(new FileWriter(file), true);
CacheXmlGenerator.generate(cache, printWriter);
printWriter.close();
- } catch (IOException ex) {
- Assert.fail("IOException during cache.xml generation to " + file, ex);
- }
- // TODO: System.setProperty(GEMFIRE_PREFIX + CACHE_XML_FILE, file.getAbsolutePath());
- cache = null;
- GemFireCacheImpl.testCacheXml = file;
- try {
+ cache = null;
+ GemFireCacheImpl.testCacheXml = file;
createCache();
+ } catch (Exception ex) {
+ throw new RuntimeException(ex);
} finally {
GemFireCacheImpl.testCacheXml = null;
}
@@ -205,19 +183,14 @@ public abstract class JUnit4CacheTestCase extends JUnit4DistributedTestCase
* creating a real cache using that cache.xml.
*/
public final void finishCacheXml(final File root, final String name, final boolean useSchema,
- final String xmlVersion) {
+ final String xmlVersion) throws IOException {
synchronized (JUnit4CacheTestCase.class) {
File dir = new File(root, "XML_" + xmlVersion);
dir.mkdirs();
File file = new File(dir, name + ".xml");
- try {
- PrintWriter printWriter = new PrintWriter(new FileWriter(file), true);
- CacheXmlGenerator.generate(cache, printWriter, useSchema, xmlVersion);
- printWriter.close();
- } catch (IOException ex) {
- // TODO: remove error handling
- Assert.fail("IOException during cache.xml generation to " + file, ex);
- }
+ PrintWriter printWriter = new PrintWriter(new FileWriter(file), true);
+ CacheXmlGenerator.generate(cache, printWriter, useSchema, xmlVersion);
+ printWriter.close();
cache = null;
GemFireCacheImpl.testCacheXml = file;
try {
@@ -253,18 +226,8 @@ public abstract class JUnit4CacheTestCase extends JUnit4DistributedTestCase
InternalCache gemFireCache = GemFireCacheImpl.getInstance();
if (gemFireCache != null && !gemFireCache.isClosed()
&& gemFireCache.getCancelCriterion().isCancelInProgress()) {
- 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);
+ Awaitility.await("waiting for cache to close").atMost(30, TimeUnit.SECONDS)
+ .until(gemFireCache::isClosed);
}
if (cache == null || cache.isClosed()) {
cache = null;
@@ -287,18 +250,8 @@ public abstract class JUnit4CacheTestCase extends JUnit4DistributedTestCase
InternalCache gemFireCache = GemFireCacheImpl.getInstance();
if (gemFireCache != null && !gemFireCache.isClosed()
&& gemFireCache.getCancelCriterion().isCancelInProgress()) {
- 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);
+ Awaitility.await("waiting for cache to close").atMost(30, TimeUnit.SECONDS)
+ .until(gemFireCache::isClosed);
}
if (cache == null || cache.isClosed()) {
cache = null;
@@ -383,7 +336,7 @@ public abstract class JUnit4CacheTestCase extends JUnit4DistributedTestCase
*/
protected final void closeAllCache() {
closeCache();
- Invoke.invokeInEveryVM(() -> closeCache());
+ Invoke.invokeInEveryVM(JUnit4CacheTestCase::closeCache);
}
@Override
@@ -395,7 +348,7 @@ public abstract class JUnit4CacheTestCase extends JUnit4DistributedTestCase
private final void tearDownCacheTestCase() {
remoteTearDown();
- Invoke.invokeInEveryVM(() -> remoteTearDown());
+ Invoke.invokeInEveryVM(JUnit4CacheTestCase::remoteTearDown);
}
@Override
@@ -415,7 +368,7 @@ public abstract class JUnit4CacheTestCase extends JUnit4DistributedTestCase
/**
* Local destroy all root regions and close the cache.
*/
- protected static final synchronized void remoteTearDown() {
+ private static synchronized void remoteTearDown() {
try {
DistributionMessageObserver.setInstance(null);
destroyRegions(cache);
@@ -426,7 +379,7 @@ public abstract class JUnit4CacheTestCase extends JUnit4DistributedTestCase
try {
cleanDiskDirs();
} catch (Exception e) {
- LogWriterUtils.getLogWriter().error("Error cleaning disk dirs", e);
+ logger.error("Error cleaning disk dirs", e);
}
}
}
@@ -493,14 +446,11 @@ public abstract class JUnit4CacheTestCase extends JUnit4DistributedTestCase
}
/**
- * TODO: delete addExceptionTag1 method
- *
* @deprecated Please use {@link IgnoredException#addIgnoredException(String)} instead.
*/
@Deprecated
public final CacheSerializableRunnable addExceptionTag1(final String exceptionStringToIgnore) {
return new CacheSerializableRunnable("addExceptionTag") {
-
@Override
public void run2() {
getCache().getLogger().info(
diff --git a/geode-core/src/test/java/org/apache/geode/test/dunit/internal/JUnit3DistributedTestCase.java b/geode-core/src/test/java/org/apache/geode/test/dunit/internal/JUnit3DistributedTestCase.java
deleted file mode 100755
index b43a817..0000000
--- a/geode-core/src/test/java/org/apache/geode/test/dunit/internal/JUnit3DistributedTestCase.java
+++ /dev/null
@@ -1,240 +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 org.apache.geode.test.dunit.internal;
-
-import java.io.Serializable;
-import java.util.Properties;
-
-import junit.framework.TestCase;
-import org.junit.experimental.categories.Category;
-
-import org.apache.geode.distributed.DistributedSystem;
-import org.apache.geode.distributed.internal.InternalDistributedSystem;
-import org.apache.geode.test.dunit.DistributedTestCase;
-import org.apache.geode.test.junit.categories.DistributedTest;
-
-/**
- * This class is the superclass of all distributed tests using JUnit 3.
- *
- * @deprecated Please use {@link DistributedTestCase} which extends
- * {@link JUnit4DistributedTestCase} when writing new tests.
- */
-@Deprecated
-@Category(DistributedTest.class)
-public abstract class JUnit3DistributedTestCase extends TestCase
- implements DistributedTestFixture, Serializable {
-
- 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();
- }
-
- /**
- * @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 GemFire 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 GemFire 3.0
- */
- public final InternalDistributedSystem getSystem() {
- return delegate.getSystem();
- }
-
- public final InternalDistributedSystem basicGetSystem() {
- return delegate.basicGetSystem();
- }
-
- public static final InternalDistributedSystem getSystemStatic() {
- return JUnit4DistributedTestCase.getSystemStatic();
- }
-
- /**
- * Returns a loner distributed system that isn't connected to other vms.
- *
- * @since GemFire 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 GemFire 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();
- }
-
- 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();
- }
-
- /**
- * 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.setUpDistributedTestCase();
- }
-
- /**
- * {@code preSetUp()} is invoked before
- * {@link JUnit4DistributedTestCase#doSetUpDistributedTestCase()}.
- *
- * <p>
- * Override this as needed. Default implementation is empty.
- */
- public void preSetUp() throws Exception {
- // nothing by default
- }
-
- /**
- * {@code postSetUp()} is invoked after
- * {@link JUnit4DistributedTestCase#doSetUpDistributedTestCase()}.
- *
- * <p>
- * Override this as needed. Default implementation is empty.
- */
- public void postSetUp() throws Exception {
- // nothing by default
- }
-
- /**
- * 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.tearDownDistributedTestCase();
- }
-
- /**
- * {@code preTearDown()} is invoked before
- * {@link JUnit4DistributedTestCase#doTearDownDistributedTestCase()}.
- *
- * <p>
- * Override this as needed. Default implementation is empty.
- */
- public void preTearDown() throws Exception {
- // nothing by default
- }
-
- /**
- * {@code postTearDown()} is invoked after
- * {@link JUnit4DistributedTestCase#doTearDownDistributedTestCase()}.
- *
- * <p>
- * Override this as needed. Default implementation is empty.
- */
- public void postTearDown() throws Exception {
- // nothing by default
- }
-
- /**
- * {@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 {
- // nothing by default
- }
-
- /**
- * {@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 {
- // nothing by default
- }
-
-}
diff --git a/geode-core/src/test/java/org/apache/geode/test/dunit/internal/JUnit4DistributedTestCase.java b/geode-core/src/test/java/org/apache/geode/test/dunit/internal/JUnit4DistributedTestCase.java
index 7ff8532..c58df8d 100644
--- a/geode-core/src/test/java/org/apache/geode/test/dunit/internal/JUnit4DistributedTestCase.java
+++ b/geode-core/src/test/java/org/apache/geode/test/dunit/internal/JUnit4DistributedTestCase.java
@@ -102,7 +102,7 @@ public abstract class JUnit4DistributedTestCase implements DistributedTestFixtur
}
/**
- * This constructor should only be used by {@link JUnit3DistributedTestCase}.
+ * This constructor should only be used internally, not by tests.
*/
protected JUnit4DistributedTestCase(final DistributedTestFixture distributedTestFixture) {
if (distributedTestFixture == null) {
--
To stop receiving notification emails like this one, please contact
['"commits@geode.apache.org" <co...@geode.apache.org>'].