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 2007/10/27 16:29:08 UTC
svn commit: r589115 -
/struts/sandbox/trunk/struts2-rest-plugin/src/test/java/org/apache/struts2/rest/RestActionMapperTest.java
Author: mrdon
Date: Sat Oct 27 07:29:08 2007
New Revision: 589115
URL: http://svn.apache.org/viewvc?rev=589115&view=rev
Log:
Added test for Rails 1.2-style ;edit urls
Modified:
struts/sandbox/trunk/struts2-rest-plugin/src/test/java/org/apache/struts2/rest/RestActionMapperTest.java
Modified: struts/sandbox/trunk/struts2-rest-plugin/src/test/java/org/apache/struts2/rest/RestActionMapperTest.java
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-rest-plugin/src/test/java/org/apache/struts2/rest/RestActionMapperTest.java?rev=589115&r1=589114&r2=589115&view=diff
==============================================================================
--- struts/sandbox/trunk/struts2-rest-plugin/src/test/java/org/apache/struts2/rest/RestActionMapperTest.java (original)
+++ struts/sandbox/trunk/struts2-rest-plugin/src/test/java/org/apache/struts2/rest/RestActionMapperTest.java Sat Oct 27 07:29:08 2007
@@ -122,6 +122,19 @@
assertEquals("edit", mapping.getMethod());
}
+ public void testEditSemicolonMapping() throws Exception {
+ req.setRequestURI("/myapp/animals/dog/fido;edit");
+ req.setServletPath("/animals/dog/fido;edit");
+ req.setMethod("GET");
+
+ ActionMapping mapping = mapper.getMapping(req, configManager);
+
+ assertEquals("/animals", mapping.getNamespace());
+ assertEquals("dog", mapping.getName());
+ assertEquals("fido", ((String[])mapping.getParams().get("id"))[0]);
+ assertEquals("edit", mapping.getMethod());
+ }
+
public void testParseNameAndNamespace() {
tryUri("/foo/23", "", "foo/23");
tryUri("/foo/", "", "foo/");