1. opensymphony
  2. xwork


rainerh  committed 513d12e

Fixing Unit tests for Locale being de_DE, or fr_FR

git-svn-id: http://svn.opensymphony.com/svn/xwork/branches/2.0@1431e221344d-f017-0410-9bd5-d282ab1896d7

  • Participants
  • Parent commits 451050c
  • Branches 2.0, xwork_2_0_7

Comments (0)

Files changed (1)

File src/test/com/opensymphony/xwork2/util/LocalizedTextUtilTest.java

View file
  • Ignore whitespace
         // This tests will try to load bundles from the 3 locales but we only have files for France and Germany.
         // Before this fix loading the bundle for Germany failed since Italy have previously failed and thus the misses cache
         // contained a false entry
+        // Set default Locale to Locale.US
+        Locale defaultLocale = Locale.getDefault();
+        Locale.setDefault(Locale.US);
         ResourceBundle rbFrance = LocalizedTextUtil.findResourceBundle("com/opensymphony/xwork2/util/XW404", Locale.FRANCE);
         ResourceBundle rbItaly = LocalizedTextUtil.findResourceBundle("com/opensymphony/xwork2/util/XW404", Locale.ITALY);
         ResourceBundle rbGermany = LocalizedTextUtil.findResourceBundle("com/opensymphony/xwork2/util/XW404", Locale.GERMANY);
+        // Reset to previous default Locale
+        Locale.setDefault(defaultLocale);
         assertEquals("Bonjour", rbFrance.getString("hello"));