diff options
| author | Rafael H. Schloming <rhs@apache.org> | 2009-06-18 21:03:12 +0000 |
|---|---|---|
| committer | Rafael H. Schloming <rhs@apache.org> | 2009-06-18 21:03:12 +0000 |
| commit | 0ac0ba5e1d146a133abbd1ea0ddcabe6d25ab987 (patch) | |
| tree | 0d65318b1d4b1ff9eef825c31e6113d334146871 /qpid/java/client | |
| parent | c2e8e0f59377b04019decbe2eb6c6f3db634b988 (diff) | |
| download | qpid-python-0ac0ba5e1d146a133abbd1ea0ddcabe6d25ab987.tar.gz | |
made test ports configurable; this required adding variable expansion to PropertiesFileInitialContextFactory
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@786269 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java/client')
| -rw-r--r-- | qpid/java/client/src/main/java/org/apache/qpid/jndi/PropertiesFileInitialContextFactory.java | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/qpid/java/client/src/main/java/org/apache/qpid/jndi/PropertiesFileInitialContextFactory.java b/qpid/java/client/src/main/java/org/apache/qpid/jndi/PropertiesFileInitialContextFactory.java index 4b92d972b2..39176cd8dd 100644 --- a/qpid/java/client/src/main/java/org/apache/qpid/jndi/PropertiesFileInitialContextFactory.java +++ b/qpid/java/client/src/main/java/org/apache/qpid/jndi/PropertiesFileInitialContextFactory.java @@ -48,6 +48,7 @@ import org.apache.qpid.framing.AMQShortString; import org.apache.qpid.url.AMQBindingURL; import org.apache.qpid.url.BindingURL; import org.apache.qpid.url.URLSyntaxException; +import org.apache.qpid.util.Strings; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -84,9 +85,20 @@ public class PropertiesFileInitialContextFactory implements InitialContextFactor Properties p = new Properties(); p.load(new BufferedInputStream(new FileInputStream(file))); + Strings.Resolver resolver = new Strings.ChainedResolver + (Strings.SYSTEM_RESOLVER, new Strings.PropertiesResolver(p)); - environment.putAll(p); - System.getProperties().putAll(p); + for (Map.Entry me : p.entrySet()) + { + String key = (String) me.getKey(); + String value = (String) me.getValue(); + String expanded = Strings.expand(value, resolver); + environment.put(key, expanded); + if (System.getProperty(key) == null) + { + System.setProperty(key, expanded); + } + } _logger.info("Loaded Context Properties:" + environment.toString()); } else |
