From 741d7891f3f042ee7bc3ac681efa70ffea2b137e Mon Sep 17 00:00:00 2001 From: Joakim Erdfelt Date: Wed, 4 Feb 2015 10:41:04 -0700 Subject: [PATCH] 459006 - master branch does not build on norwegian locale + Adding appropriate locale settings to testcases to prevent machine specific locale from changing the expectations. Bug: 496006 Also-by: Kristian Rosenvold Signed-off-by: Joakim Erdfelt --- .../jsr356/server/samples/echo/ConfiguredEchoSocket.java | 5 +++-- .../server/samples/primitives/DoubleObjectTextSocket.java | 3 ++- .../jsr356/server/samples/primitives/DoubleTextSocket.java | 3 ++- .../server/samples/primitives/FloatObjectTextSocket.java | 3 ++- .../jsr356/server/samples/primitives/FloatTextSocket.java | 3 ++- 5 files changed, 11 insertions(+), 6 deletions(-) diff --git a/jetty-websocket/javax-websocket-server-impl/src/test/java/org/eclipse/jetty/websocket/jsr356/server/samples/echo/ConfiguredEchoSocket.java b/jetty-websocket/javax-websocket-server-impl/src/test/java/org/eclipse/jetty/websocket/jsr356/server/samples/echo/ConfiguredEchoSocket.java index 8ec623aba4e..85d99856777 100644 --- a/jetty-websocket/javax-websocket-server-impl/src/test/java/org/eclipse/jetty/websocket/jsr356/server/samples/echo/ConfiguredEchoSocket.java +++ b/jetty-websocket/javax-websocket-server-impl/src/test/java/org/eclipse/jetty/websocket/jsr356/server/samples/echo/ConfiguredEchoSocket.java @@ -23,6 +23,7 @@ import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.List; +import java.util.Locale; import java.util.Objects; import javax.websocket.EndpointConfig; @@ -67,9 +68,9 @@ public class ConfiguredEchoSocket switch (msg) { case "text-max": - return String.format("%,d",session.getMaxTextMessageBufferSize()); + return String.format(Locale.US, "%,d",session.getMaxTextMessageBufferSize()); case "binary-max": - return String.format("%,d",session.getMaxBinaryMessageBufferSize()); + return String.format(Locale.US, "%,d",session.getMaxBinaryMessageBufferSize()); case "decoders": return join(config.getDecoders(),", "); case "encoders": diff --git a/jetty-websocket/javax-websocket-server-impl/src/test/java/org/eclipse/jetty/websocket/jsr356/server/samples/primitives/DoubleObjectTextSocket.java b/jetty-websocket/javax-websocket-server-impl/src/test/java/org/eclipse/jetty/websocket/jsr356/server/samples/primitives/DoubleObjectTextSocket.java index baa429977c4..eade593f5a8 100644 --- a/jetty-websocket/javax-websocket-server-impl/src/test/java/org/eclipse/jetty/websocket/jsr356/server/samples/primitives/DoubleObjectTextSocket.java +++ b/jetty-websocket/javax-websocket-server-impl/src/test/java/org/eclipse/jetty/websocket/jsr356/server/samples/primitives/DoubleObjectTextSocket.java @@ -19,6 +19,7 @@ package org.eclipse.jetty.websocket.jsr356.server.samples.primitives; import java.io.IOException; +import java.util.Locale; import javax.websocket.OnError; import javax.websocket.OnMessage; @@ -52,7 +53,7 @@ public class DoubleObjectTextSocket } else { - String msg = String.format("%.4f",d); + String msg = String.format(Locale.US, "%.4f",d); session.getAsyncRemote().sendText(msg); } } diff --git a/jetty-websocket/javax-websocket-server-impl/src/test/java/org/eclipse/jetty/websocket/jsr356/server/samples/primitives/DoubleTextSocket.java b/jetty-websocket/javax-websocket-server-impl/src/test/java/org/eclipse/jetty/websocket/jsr356/server/samples/primitives/DoubleTextSocket.java index 43c712e03f6..71e5e4f154d 100644 --- a/jetty-websocket/javax-websocket-server-impl/src/test/java/org/eclipse/jetty/websocket/jsr356/server/samples/primitives/DoubleTextSocket.java +++ b/jetty-websocket/javax-websocket-server-impl/src/test/java/org/eclipse/jetty/websocket/jsr356/server/samples/primitives/DoubleTextSocket.java @@ -19,6 +19,7 @@ package org.eclipse.jetty.websocket.jsr356.server.samples.primitives; import java.io.IOException; +import java.util.Locale; import javax.websocket.OnError; import javax.websocket.OnMessage; @@ -46,7 +47,7 @@ public class DoubleTextSocket @OnMessage public void onMessage(double d) throws IOException { - String msg = String.format("%.4f",d); + String msg = String.format(Locale.US, "%.4f",d); session.getAsyncRemote().sendText(msg); } diff --git a/jetty-websocket/javax-websocket-server-impl/src/test/java/org/eclipse/jetty/websocket/jsr356/server/samples/primitives/FloatObjectTextSocket.java b/jetty-websocket/javax-websocket-server-impl/src/test/java/org/eclipse/jetty/websocket/jsr356/server/samples/primitives/FloatObjectTextSocket.java index 2558daa70d0..db826226686 100644 --- a/jetty-websocket/javax-websocket-server-impl/src/test/java/org/eclipse/jetty/websocket/jsr356/server/samples/primitives/FloatObjectTextSocket.java +++ b/jetty-websocket/javax-websocket-server-impl/src/test/java/org/eclipse/jetty/websocket/jsr356/server/samples/primitives/FloatObjectTextSocket.java @@ -19,6 +19,7 @@ package org.eclipse.jetty.websocket.jsr356.server.samples.primitives; import java.io.IOException; +import java.util.Locale; import javax.websocket.OnError; import javax.websocket.OnMessage; @@ -52,7 +53,7 @@ public class FloatObjectTextSocket } else { - String msg = String.format("%.4f",f); + String msg = String.format(Locale.US, "%.4f",f); session.getAsyncRemote().sendText(msg); } } diff --git a/jetty-websocket/javax-websocket-server-impl/src/test/java/org/eclipse/jetty/websocket/jsr356/server/samples/primitives/FloatTextSocket.java b/jetty-websocket/javax-websocket-server-impl/src/test/java/org/eclipse/jetty/websocket/jsr356/server/samples/primitives/FloatTextSocket.java index 1bb6cbefe8f..0b5423b2d12 100644 --- a/jetty-websocket/javax-websocket-server-impl/src/test/java/org/eclipse/jetty/websocket/jsr356/server/samples/primitives/FloatTextSocket.java +++ b/jetty-websocket/javax-websocket-server-impl/src/test/java/org/eclipse/jetty/websocket/jsr356/server/samples/primitives/FloatTextSocket.java @@ -19,6 +19,7 @@ package org.eclipse.jetty.websocket.jsr356.server.samples.primitives; import java.io.IOException; +import java.util.Locale; import javax.websocket.OnError; import javax.websocket.OnMessage; @@ -46,7 +47,7 @@ public class FloatTextSocket @OnMessage public void onMessage(float f) throws IOException { - String msg = String.format("%.4f",f); + String msg = String.format(Locale.US, "%.4f",f); session.getAsyncRemote().sendText(msg); }