diff options
author | Martin Ritchie <ritchiem@apache.org> | 2009-08-14 12:50:36 +0000 |
---|---|---|
committer | Martin Ritchie <ritchiem@apache.org> | 2009-08-14 12:50:36 +0000 |
commit | e998b312406f35cd49eee45c0701ade51953b748 (patch) | |
tree | 2a8eb0ae9b8ee5274f28d19998efedf59d16aa88 | |
parent | c39fc2363874ac2b368db5673cdfb103375838e1 (diff) | |
download | qpid-python-e998b312406f35cd49eee45c0701ade51953b748.tar.gz |
QPID-2001 : Default Locale should be the VMs locale not en_US.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@804201 13f79535-47bb-0310-9956-ffa450edef68
3 files changed, 22 insertions, 14 deletions
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/ServerConfiguration.java b/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/ServerConfiguration.java index 90b4590d4c..7ea7738189 100644 --- a/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/ServerConfiguration.java +++ b/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/ServerConfiguration.java @@ -55,7 +55,6 @@ public class ServerConfiguration implements SignalHandler public static final int DEFAULT_BUFFER_WRITE_LIMIT_SIZE = 262144; public static final boolean DEFAULT_BROKER_CONNECTOR_PROTECTIO_ENABLED = false; public static final String DEFAULT_STATUS_UPDATES = "on"; - public static final String DEFAULT_ADVANCED_LOCALE = Locale.US.toString(); private static final int DEFAULT_FRAME_SIZE = 65536; private static final int DEFAULT_PORT = 5672; @@ -150,7 +149,7 @@ public class ServerConfiguration implements SignalHandler { XMLConfiguration vhostConfiguration = new XMLConfiguration((String) thing); List hosts = vhostConfiguration.getList("virtualhost.name"); - for (int j = 0; j < hosts.size(); j++) + for (int j = 0; j < hosts.size(); j++) { String name = (String) hosts.get(j); // Add the keys of the virtual host to the main config then bail out @@ -221,12 +220,18 @@ public class ServerConfiguration implements SignalHandler public Locale getLocale() { - String localeString = getConfig().getString(ADVANCED_LOCALE, DEFAULT_ADVANCED_LOCALE); + String localeString = getConfig().getString(ADVANCED_LOCALE); // Expecting locale of format langauge_country_variant + // If the configuration does not have a defined locale use the JVM default + if (localeString == null) + { + return Locale.getDefault(); + } + String[] parts = localeString.split("_"); - Locale locale = null; + Locale locale; switch (parts.length) { case 1: diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/ServerConfigurationTest.java b/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/ServerConfigurationTest.java index 4e20f537f1..8cb0837b39 100644 --- a/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/ServerConfigurationTest.java +++ b/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/ServerConfigurationTest.java @@ -263,9 +263,8 @@ public class ServerConfigurationTest extends TestCase // Check default ServerConfiguration serverConfig = new ServerConfiguration(_config); - String defaultParts[] = ServerConfiguration.DEFAULT_ADVANCED_LOCALE.split("_"); - // The Default is en_US so will split well - Locale defaultLocale = new Locale(defaultParts[0],defaultParts[1]); + // The Default is what ever the VMs default is + Locale defaultLocale = Locale.getDefault(); assertEquals(defaultLocale, serverConfig.getLocale()); diff --git a/qpid/java/systests/src/main/java/org/apache/qpid/test/client/FlowControlTest.java b/qpid/java/systests/src/main/java/org/apache/qpid/test/client/FlowControlTest.java index 91ed9766f6..95808e454f 100644 --- a/qpid/java/systests/src/main/java/org/apache/qpid/test/client/FlowControlTest.java +++ b/qpid/java/systests/src/main/java/org/apache/qpid/test/client/FlowControlTest.java @@ -196,13 +196,17 @@ public class FlowControlTest extends QpidTestCase { System.err.println("Test Run:" + ++run); Thread.sleep(1000); - - test.startBroker(); - test.testBasicBytesFlowControl(); - - Thread.sleep(1000); - - test.stopBroker(); + try + { + test.startBroker(); + test.testBasicBytesFlowControl(); + + Thread.sleep(1000); + } + finally + { + test.stopBroker(); + } } } } |