rainerh  committed 513d12e

Fixing Unit tests for Locale being de_DE, or fr_FR


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

Comments (0)

Files changed (1)

File src/test/com/opensymphony/xwork2/util/

         // 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"));