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/20 12:04:57 UTC

svn commit: r586696 - /struts/struts2/trunk/core/src/test/java/org/apache/struts2/dispatcher/mapper/DefaultActionMapperTest.java

Author: mrdon
Date: Sat Oct 20 03:04:53 2007
New Revision: 586696

URL: http://svn.apache.org/viewvc?rev=586696&view=rev
Log:
Adding test for original extension uri building
WW-2267

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=586696&r1=586695&r2=586696&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 Sat Oct 20 03:04:53 2007
@@ -196,6 +196,17 @@
 
         assertEquals("/my/namespace/actionName!add.action", mapper.getUriFromActionMapping(mapping));
     }
+    
+    public void testGetUriWithOriginalExtension() throws Exception {
+        ActionMapping mapping = new ActionMapping("actionName", "/ns", null, new HashMap());
+        
+        ActionMapping orig = new ActionMapping();
+        orig.setExtension("foo");
+        ActionContext.getContext().put(ServletActionContext.ACTION_MAPPING, orig);
+        
+        DefaultActionMapper mapper = new DefaultActionMapper();
+        assertEquals("/ns/actionName.foo", mapper.getUriFromActionMapping(mapping));
+    }
 
     public void testGetMappingWithNoExtension() throws Exception {
         req.setupGetParameterMap(new HashMap());