svn commit: r429146 - /struts/struts2/trunk/core/src/test/java/org/apache/struts2/dispatcher/DispatcherTest.java

2006-08-06 Thread tmjee
Author: tmjee
Date: Sun Aug  6 09:06:08 2006
New Revision: 429146

URL: http://svn.apache.org/viewvc?rev=429146&view=rev
Log:
WW-1340
  - added more test case for Dispatcher


Modified:

struts/struts2/trunk/core/src/test/java/org/apache/struts2/dispatcher/DispatcherTest.java

Modified: 
struts/struts2/trunk/core/src/test/java/org/apache/struts2/dispatcher/DispatcherTest.java
URL: 
http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/test/java/org/apache/struts2/dispatcher/DispatcherTest.java?rev=429146&r1=429145&r2=429146&view=diff
==
--- 
struts/struts2/trunk/core/src/test/java/org/apache/struts2/dispatcher/DispatcherTest.java
 (original)
+++ 
struts/struts2/trunk/core/src/test/java/org/apache/struts2/dispatcher/DispatcherTest.java
 Sun Aug  6 09:06:08 2006
@@ -19,8 +19,16 @@
 
 import java.util.Locale;
 
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
 import org.apache.struts2.StrutsTestCase;
+import org.springframework.mock.web.MockHttpServletRequest;
+import org.springframework.mock.web.MockHttpServletResponse;
 
+import org.apache.struts2.StrutsConstants;
+import org.apache.struts2.config.Settings;
+import org.apache.struts2.dispatcher.Dispatcher;
 import com.opensymphony.xwork2.util.LocalizedTextUtil;
 
 /**
@@ -44,4 +52,30 @@
"Error uploading: some error messages");
}

+   public void testPrepareSetEncodingProperly() throws Exception {
+   HttpServletRequest req = new MockHttpServletRequest();
+   HttpServletResponse res = new MockHttpServletResponse();
+   
+   Settings.set(StrutsConstants.STRUTS_I18N_ENCODING, "utf-8");
+   
+   
+   Dispatcher du = Dispatcher.getInstance();
+   du.prepare(req, res);
+   
+   assertEquals(req.getCharacterEncoding(), "utf-8");
+   }
+   
+   public void testPrepareSetEncodingPropertyWithMultipartRequest() throws 
Exception {
+   MockHttpServletRequest req = new MockHttpServletRequest();
+   MockHttpServletResponse res = new MockHttpServletResponse();
+   
+   req.setContentType("multipart/form-data");
+   Settings.set(StrutsConstants.STRUTS_I18N_ENCODING, "utf-8");
+   
+   
+   Dispatcher du = Dispatcher.getInstance();
+   du.prepare(req, res);
+   
+   assertEquals(req.getCharacterEncoding(), "utf-8");
+   }
 }




[Struts Wiki] Update of "PoweredBy" by MichaelJouravlev

2006-08-06 Thread Apache Wiki
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Struts Wiki" for change 
notification.

The following page has been changed by MichaelJouravlev:
http://wiki.apache.org/struts/PoweredBy

--
   * http://www.amnestyusa.org - Amnesty International USA (as of August 2006)
   * http://www.contratacionesparaguay.gov.py/denuncia - Sistema de denuncias 
de casos de corrupción
   * http://www.officedepot.com - Office Depot, Inc., a seller of office 
products (as of August 2006)
+  * http://www.circuitcity.com - a seller of TVs and consumer electronics 
products (as of August 2006)
  
  See also:
   * StrutsWebLinks page for the list of third party software built on Struts.