Author: kkolinko
Date: Fri Jan 15 14:20:16 2016
New Revision: 1724815

URL: http://svn.apache.org/viewvc?rev=1724815&view=rev
Log:
For https://bz.apache.org/bugzilla/show_bug.cgi?id=58836
Beackport the testcase for BZ 58836 from r1724797.

Modified:
    
tomcat/tc6.0.x/branches/tomcat6-testing_20160106/test/org/apache/catalina/core/TestApplicationHttpRequest.java

Modified: 
tomcat/tc6.0.x/branches/tomcat6-testing_20160106/test/org/apache/catalina/core/TestApplicationHttpRequest.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc6.0.x/branches/tomcat6-testing_20160106/test/org/apache/catalina/core/TestApplicationHttpRequest.java?rev=1724815&r1=1724814&r2=1724815&view=diff
==============================================================================
--- 
tomcat/tc6.0.x/branches/tomcat6-testing_20160106/test/org/apache/catalina/core/TestApplicationHttpRequest.java
 (original)
+++ 
tomcat/tc6.0.x/branches/tomcat6-testing_20160106/test/org/apache/catalina/core/TestApplicationHttpRequest.java
 Fri Jan 15 14:20:16 2016
@@ -164,6 +164,19 @@ public class TestApplicationHttpRequest
         doQueryStringTest("a=b&c&a=e", "a", expected);
     }
 
+    @Test
+    public void testMergeQueryString05() throws Exception {
+        // https://ru.wikipedia.org/wiki/%D0%A2%D0%B5%D1%81%D1%82
+        // "Test" = "Test"
+        String test = "\u0422\u0435\u0441\u0442";
+        String query = test + "=%D0%A2%D0%B5%D1%81%D1%82";
+
+        Map<String, String[]> expected = new HashMap<String, String[]>();
+        expected.put("a", new String[] { "b" });
+        expected.put(test, new String[] { test });
+        doQueryStringTest("a=b", query, expected);
+    }
+
 
     private void doQueryStringTest(String originalQueryString, String 
forwardQueryString,
             Map<String,String[]> expected) throws Exception {
@@ -220,6 +233,7 @@ public class TestApplicationHttpRequest
         @Override
         protected void doGet(HttpServletRequest req, HttpServletResponse resp)
                 throws ServletException, IOException {
+            req.setCharacterEncoding("UTF-8");
             req.getRequestDispatcher(target).forward(req, resp);
         }
     }
@@ -238,6 +252,7 @@ public class TestApplicationHttpRequest
         @Override
         protected void doGet(HttpServletRequest req, HttpServletResponse resp)
                 throws ServletException, IOException {
+            req.setCharacterEncoding("UTF-8");
             resp.setContentType("text/plain");
             resp.setCharacterEncoding("UTF-8");
             PrintWriter w = resp.getWriter();



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to