Commits

Anonymous committed 07f5fa1

force this test to use a US locale

git-svn-id: http://svn.opensymphony.com/svn/webwork/trunk@377573baa09-0c28-0410-bef9-dab3c582ae83

  • Participants
  • Parent commits 4b2b7a5

Comments (0)

Files changed (1)

File src/test/com/opensymphony/webwork/views/velocity/TagDirectiveTest.java

 package com.opensymphony.webwork.views.velocity;
 
 import com.mockobjects.dynamic.Mock;
-
 import com.mockobjects.servlet.MockBodyContent;
 import com.mockobjects.servlet.MockJspWriter;
 import com.mockobjects.servlet.MockPageContext;
-
 import com.opensymphony.webwork.ServletActionContext;
 import com.opensymphony.webwork.views.jsp.WebWorkMockServletContext;
 import com.opensymphony.webwork.views.velocity.ui.MockTag;
-
 import com.opensymphony.xwork.ActionContext;
 import com.opensymphony.xwork.config.ConfigurationManager;
 import com.opensymphony.xwork.util.OgnlValueStack;
-
 import junit.framework.Assert;
 import junit.framework.TestCase;
-
 import org.apache.velocity.Template;
 import org.apache.velocity.app.VelocityEngine;
 import org.apache.velocity.context.Context;
 
-import java.io.File;
-import java.io.StringWriter;
-
-import java.util.Calendar;
-import java.util.Map;
-import java.util.Properties;
-
 import javax.servlet.ServletConfig;
 import javax.servlet.ServletRequest;
 import javax.servlet.ServletResponse;
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.jsp.JspWriter;
 import javax.servlet.jsp.tagext.BodyContent;
+import java.io.File;
+import java.io.StringWriter;
+import java.util.Calendar;
+import java.util.Locale;
+import java.util.Map;
+import java.util.Properties;
 
 
 /**
     OgnlValueStack stack;
     VelocityEngine velocityEngine;
     private ActionContext oldContext;
+    private Locale defaultLocale;
 
     //~ Methods ////////////////////////////////////////////////////////////////
 
     protected void setUp() throws Exception {
         super.setUp();
 
+        // set up the locale to be US
+        defaultLocale = Locale.getDefault();
+        Locale.setDefault(Locale.US);
+
         ConfigurationManager.clearConfigurationProviders();
         ConfigurationManager.destroyConfiguration();
 
     }
 
     protected void tearDown() throws Exception {
+        if (defaultLocale != null) {
+            Locale.setDefault(defaultLocale);
+        }
+
         pageContext.release();
         ActionContext.setContext(oldContext);
     }