Commits

Anonymous committed 3bcd267

XW-60: Fixing localized text tests so they should (hopefully) work in Germany

git-svn-id: http://svn.opensymphony.com/svn/xwork/trunk@12e221344d-f017-0410-9bd5-d282ab1896d7

Comments (0)

Files changed (3)

src/test/com/opensymphony/xwork/LocaleAwareTest.java

 
     public void testGetText() {
         try {
+            ActionProxy proxy = ActionProxyFactory.getFactory().createActionProxy("", MockConfigurationProvider.FOO_ACTION_NAME, null);
             ActionContext.getContext().setLocale(Locale.US);
 
-            ActionProxy proxy = ActionProxyFactory.getFactory().createActionProxy("", MockConfigurationProvider.FOO_ACTION_NAME, null);
             LocaleAware localeAware = (LocaleAware) proxy.getAction();
             assertEquals("Foo Range Message", localeAware.getText("foo.range"));
         } catch (Exception e) {

src/test/com/opensymphony/xwork/util/LocalizedTextUtilTest.java

         LocalizedTextUtil.addDefaultResourceBundle("com/opensymphony/xwork/SimpleAction");
 
         try {
-            String message = LocalizedTextUtil.findDefaultText("foo.range");
+            String message = LocalizedTextUtil.findDefaultText("foo.range", Locale.US);
             assertEquals("Foo Range Message", message);
         } catch (MissingResourceException e) {
             e.printStackTrace();

src/test/com/opensymphony/xwork/validator/SimpleActionValidationTest.java

 
         try {
             ActionProxy proxy = ActionProxyFactory.getFactory().createActionProxy("", MockConfigurationProvider.VALIDATION_ACTION_NAME, extraContext);
+            ActionContext.getContext().setLocale(Locale.US);
             proxy.execute();
             assertTrue(((ValidationAware) proxy.getAction()).hasFieldErrors());
 
         ConfigurationManager.clearConfigurationProviders();
         ConfigurationManager.addConfigurationProvider(new MockConfigurationProvider());
         ConfigurationManager.getConfiguration().reload();
-        ActionContext.getContext().setLocale(Locale.US);
     }
 }