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/07/12 15:55:52 UTC
svn commit: r676179 -
/struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ActionTagTest.java
Author: mrdon
Date: Sat Jul 12 06:55:51 2008
New Revision: 676179
URL: http://svn.apache.org/viewvc?rev=676179&view=rev
Log:
Adding test to ensure action tags are executed without the method from the URI polluting the result
WW-2290
Modified:
struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ActionTagTest.java
Modified: struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ActionTagTest.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ActionTagTest.java?rev=676179&r1=676178&r2=676179&view=diff
==============================================================================
--- struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ActionTagTest.java (original)
+++ struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ActionTagTest.java Sat Jul 12 06:55:51 2008
@@ -106,6 +106,35 @@
this.testSimple();
}
+ public void testSimpleWithctionMethodInOriginalURI() {
+ request.setupGetServletPath("/foo!foo.action");
+
+ ActionTag tag = new ActionTag();
+ tag.setPageContext(pageContext);
+ tag.setName("testAction");
+ tag.setId("testAction");
+
+ int stackSize = stack.size();
+
+ try {
+ tag.doStartTag();
+ tag.addParameter("foo", "myFoo");
+ tag.doEndTag();
+
+ assertEquals(stack.size(), ActionContext.getContext().getValueStack().size());
+ assertEquals("myFoo", stack.findValue("#testAction.foo"));
+ assertEquals(stackSize, stack.size());
+
+ Object o = pageContext.findAttribute("testAction");
+ assertTrue(o instanceof TestAction);
+ assertEquals("myFoo", ((TestAction) o).getFoo());
+ assertEquals(Action.SUCCESS, ((TestAction) o).getResult());
+ } catch (JspException ex) {
+ ex.printStackTrace();
+ fail();
+ }
+ }
+
public void testActionWithExecuteResult() throws Exception {
ActionTag tag = new ActionTag();
tag.setPageContext(pageContext);