diff options
Diffstat (limited to 'qpid/java/common/src/test/java/org/apache/qpid/test/utils/QpidTestCase.java')
-rw-r--r-- | qpid/java/common/src/test/java/org/apache/qpid/test/utils/QpidTestCase.java | 55 |
1 files changed, 0 insertions, 55 deletions
diff --git a/qpid/java/common/src/test/java/org/apache/qpid/test/utils/QpidTestCase.java b/qpid/java/common/src/test/java/org/apache/qpid/test/utils/QpidTestCase.java index 89542e8125..8b470d555e 100644 --- a/qpid/java/common/src/test/java/org/apache/qpid/test/utils/QpidTestCase.java +++ b/qpid/java/common/src/test/java/org/apache/qpid/test/utils/QpidTestCase.java @@ -25,22 +25,17 @@ import java.io.File; import java.io.FileReader; import java.io.IOException; import java.util.ArrayList; -import java.util.HashMap; import java.util.List; -import java.util.Map; import junit.framework.TestCase; import junit.framework.TestResult; import org.apache.log4j.Logger; -import org.apache.mina.util.AvailablePortFinder; public class QpidTestCase extends TestCase { protected static final Logger _logger = Logger.getLogger(QpidTestCase.class); - private final Map<String, String> _propertiesSetForTest = new HashMap<String, String>(); - /** * Some tests are excluded when the property test.excludes is set to true. * An exclusion list is either a file (prop test.excludesfile) which contains one test name @@ -132,54 +127,4 @@ public class QpidTestCase extends TestCase return storeClass != null ? storeClass : MEMORY_STORE_CLASS_NAME ; } - - public int findFreePort() - { - return AvailablePortFinder.getNextAvailable(10000); - } - - /** - * Set a System property for duration of this test only. The tearDown will - * guarantee to reset the property to its previous value after the test - * completes. - * - * @param property The property to set - * @param value the value to set it to. - */ - protected void setTestSystemProperty(String property, String value) - { - if (!_propertiesSetForTest.containsKey(property)) - { - // Record the current value so we can revert it later. - _propertiesSetForTest.put(property, System.getProperty(property)); - } - - System.setProperty(property, value); - } - - /** - * Restore the System property values that were set by this test run. - */ - protected void revertTestSystemProperties() - { - for (String key : _propertiesSetForTest.keySet()) - { - String value = _propertiesSetForTest.get(key); - if (value != null) - { - System.setProperty(key, value); - } - else - { - System.clearProperty(key); - } - } - - _propertiesSetForTest.clear(); - } - - protected void tearDown() throws java.lang.Exception - { - revertTestSystemProperties(); - } } |