From 0f189f814d2a4e8ba8d73c57af11ffb0b77583f6 Mon Sep 17 00:00:00 2001 From: Keith Donald Date: Sun, 30 Mar 2008 15:37:01 +0000 Subject: [PATCH] fixed locale test issue --- .../webflow/mvc/view/MvcViewTests.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/spring-webflow/src/test/java/org/springframework/webflow/mvc/view/MvcViewTests.java b/spring-webflow/src/test/java/org/springframework/webflow/mvc/view/MvcViewTests.java index cd86a7fb..daec50d5 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/mvc/view/MvcViewTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/mvc/view/MvcViewTests.java @@ -3,6 +3,7 @@ package org.springframework.webflow.mvc.view; import java.security.Principal; import java.util.Calendar; import java.util.Date; +import java.util.Locale; import java.util.Map; import javax.servlet.http.HttpServletRequest; @@ -11,7 +12,7 @@ import javax.servlet.http.HttpServletResponse; import junit.framework.TestCase; import org.springframework.binding.expression.support.StaticExpression; -import org.springframework.binding.format.FormatterRegistry; +import org.springframework.binding.format.formatters.DateFormatter; import org.springframework.binding.format.registry.DefaultFormatterRegistry; import org.springframework.mock.web.MockHttpServletRequest; import org.springframework.mock.web.MockHttpServletResponse; @@ -27,7 +28,13 @@ public class MvcViewTests extends TestCase { private Map model; - private FormatterRegistry formatterRegistry = DefaultFormatterRegistry.getSharedInstance(); + private DefaultFormatterRegistry formatterRegistry = new DefaultFormatterRegistry(); + + protected void setUp() { + DateFormatter dateFormatter = new DateFormatter(); + dateFormatter.setLocale(Locale.ENGLISH); + formatterRegistry.registerFormatter(Date.class, dateFormatter); + } public void testRender() throws Exception { MockRequestContext context = new MockRequestContext();