summaryrefslogtreecommitdiff
path: root/qpid/java/systests
diff options
context:
space:
mode:
authorRobert Gemmell <robbie@apache.org>2011-07-14 08:15:31 +0000
committerRobert Gemmell <robbie@apache.org>2011-07-14 08:15:31 +0000
commita482bcfd2a86f3ef9a1717a370d4e89834e9cfa7 (patch)
tree544e607134b6e578594de90e79428ddcc28a1633 /qpid/java/systests
parent828637b7af6f61f5c85f08a73fb3d8fa96ca583c (diff)
downloadqpid-python-a482bcfd2a86f3ef9a1717a370d4e89834e9cfa7.tar.gz
QPID-3345: restore/add ability to use sys props to select the NetworkTransport used to make/accept connections
Applied patch by Keith Wall <keith.wall@gmail.com> git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1146594 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java/systests')
-rw-r--r--qpid/java/systests/src/main/java/org/apache/qpid/test/utils/QpidBrokerTestCase.java29
1 files changed, 5 insertions, 24 deletions
diff --git a/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/QpidBrokerTestCase.java b/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/QpidBrokerTestCase.java
index b39b31df58..c8ccdf91bb 100644
--- a/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/QpidBrokerTestCase.java
+++ b/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/QpidBrokerTestCase.java
@@ -91,7 +91,6 @@ public class QpidBrokerTestCase extends QpidTestCase
protected long RECEIVE_TIMEOUT = 1000l;
- private Map<String, String> _propertiesSetForTestOnly = new HashMap<String, String>();
private Map<String, String> _propertiesSetForBroker = new HashMap<String, String>();
private Map<Logger, Level> _loggerLevelSetForTest = new HashMap<Logger, Level>();
@@ -875,20 +874,14 @@ public class QpidBrokerTestCase extends QpidTestCase
}
/**
- * Set a System (-D) property for the external Broker of this test.
+ * Set a System property for the client (and broker if using the same vm) of this test.
*
* @param property The property to set
* @param value the value to set it to.
*/
protected void setTestClientSystemProperty(String property, String value)
{
- if (!_propertiesSetForTestOnly.containsKey(property))
- {
- // Record the current value so we can revert it later.
- _propertiesSetForTestOnly.put(property, System.getProperty(property));
- }
-
- System.setProperty(property, value);
+ setTestSystemProperty(property, value);
}
/**
@@ -896,20 +889,7 @@ public class QpidBrokerTestCase extends QpidTestCase
*/
protected void revertSystemProperties()
{
- for (String key : _propertiesSetForTestOnly.keySet())
- {
- String value = _propertiesSetForTestOnly.get(key);
- if (value != null)
- {
- System.setProperty(key, value);
- }
- else
- {
- System.clearProperty(key);
- }
- }
-
- _propertiesSetForTestOnly.clear();
+ revertTestSystemProperties();
// We don't change the current VMs settings for Broker only properties
// so we can just clear this map
@@ -1145,7 +1125,8 @@ public class QpidBrokerTestCase extends QpidTestCase
c.close();
}
}
- finally{
+ finally
+ {
// Ensure any problems with close does not interfer with property resets
revertSystemProperties();
revertLoggingLevels();