You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by cm...@apache.org on 2016/11/23 15:36:24 UTC
[4/5] wicket git commit: WICKET-6273 make BytesTest work with split
locale
WICKET-6273 make BytesTest work with split locale
Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/1ea7b7e4
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/1ea7b7e4
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/1ea7b7e4
Branch: refs/heads/wicket-7.x
Commit: 1ea7b7e44c73884abb6458c834988e1baa92f342
Parents: fc408ee
Author: Carl-Eric Menzel <cm...@apache.org>
Authored: Wed Nov 23 10:52:10 2016 +0100
Committer: Carl-Eric Menzel <cm...@apache.org>
Committed: Wed Nov 23 10:52:10 2016 +0100
----------------------------------------------------------------------
.../java/org/apache/wicket/util/lang/BytesTest.java | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/wicket/blob/1ea7b7e4/wicket-util/src/test/java/org/apache/wicket/util/lang/BytesTest.java
----------------------------------------------------------------------
diff --git a/wicket-util/src/test/java/org/apache/wicket/util/lang/BytesTest.java b/wicket-util/src/test/java/org/apache/wicket/util/lang/BytesTest.java
index 10026c3..ec2c5c0 100644
--- a/wicket-util/src/test/java/org/apache/wicket/util/lang/BytesTest.java
+++ b/wicket-util/src/test/java/org/apache/wicket/util/lang/BytesTest.java
@@ -32,7 +32,8 @@ public class BytesTest extends Assert
/**
* Backup of the default locale.
*/
- private Locale defaultLocale = null;
+ private Locale originalFormatLocale = null;
+ private Locale originalDefaultLocale = null;
/**
* Save the default locale.
@@ -40,9 +41,12 @@ public class BytesTest extends Assert
@Before
public void before()
{
- defaultLocale = Locale.getDefault(Locale.Category.FORMAT);
+ originalFormatLocale = Locale.getDefault(Locale.Category.FORMAT);
+ originalDefaultLocale = Locale.getDefault();
- // these tests run in US locale.
+ // these tests run in US locale for formatting and German default locale - they should still work with split
+ // locale.
+ Locale.setDefault(Locale.GERMANY);
Locale.setDefault(Locale.Category.FORMAT, Locale.US);
}
@@ -52,7 +56,8 @@ public class BytesTest extends Assert
@After
public void after()
{
- Locale.setDefault(Locale.Category.FORMAT, defaultLocale);
+ Locale.setDefault(originalDefaultLocale);
+ Locale.setDefault(Locale.Category.FORMAT, originalFormatLocale);
}
/**