You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@struts.apache.org by mr...@apache.org on 2008/02/19 09:35:36 UTC
svn commit: r629022 -
/struts/struts2/trunk/core/src/test/java/org/apache/struts2/dispatcher/mapper/DefaultActionMapperTest.java
Author: mrdon
Date: Tue Feb 19 00:35:35 2008
New Revision: 629022
URL: http://svn.apache.org/viewvc?rev=629022&view=rev
Log:
Adding test to ensure slashes in names works with root namespace
WW-2461
Modified:
struts/struts2/trunk/core/src/test/java/org/apache/struts2/dispatcher/mapper/DefaultActionMapperTest.java
Modified: struts/struts2/trunk/core/src/test/java/org/apache/struts2/dispatcher/mapper/DefaultActionMapperTest.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/test/java/org/apache/struts2/dispatcher/mapper/DefaultActionMapperTest.java?rev=629022&r1=629021&r2=629022&view=diff
==============================================================================
--- struts/struts2/trunk/core/src/test/java/org/apache/struts2/dispatcher/mapper/DefaultActionMapperTest.java (original)
+++ struts/struts2/trunk/core/src/test/java/org/apache/struts2/dispatcher/mapper/DefaultActionMapperTest.java Tue Feb 19 00:35:35 2008
@@ -115,6 +115,22 @@
assertNull(mapping.getMethod());
}
+ public void testGetMappingWithSlashedNameAtRoot() throws Exception {
+
+ req.setupGetRequestURI("/foo/actionName.action");
+ req.setupGetServletPath("/foo/actionName.action");
+ req.setupGetAttribute(null);
+ req.addExpectedGetAttributeName("javax.servlet.include.servlet_path");
+
+ DefaultActionMapper mapper = new DefaultActionMapper();
+ mapper.setSlashesInActionNames("true");
+ ActionMapping mapping = mapper.getMapping(req, configManager);
+
+ assertEquals("", mapping.getNamespace());
+ assertEquals("foo/actionName", mapping.getName());
+ assertNull(mapping.getMethod());
+ }
+
public void testGetMappingWithNamespaceSlash() throws Exception {
req.setupGetRequestURI("/my.hh/abc.action");