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 <kristian@zenior.no>
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
This commit is contained in:
Joakim Erdfelt 2015-02-04 10:41:04 -07:00
parent 44b3abc839
commit 741d7891f3
5 changed files with 11 additions and 6 deletions

View File

@ -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":

View File

@ -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);
}
}

View File

@ -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);
}

View File

@ -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);
}
}

View File

@ -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);
}