Return-Path: Delivered-To: apmail-struts-commits-archive@locus.apache.org Received: (qmail 9388 invoked from network); 12 Jul 2008 13:56:14 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 12 Jul 2008 13:56:14 -0000 Received: (qmail 42933 invoked by uid 500); 12 Jul 2008 13:56:14 -0000 Delivered-To: apmail-struts-commits-archive@struts.apache.org Received: (qmail 42479 invoked by uid 500); 12 Jul 2008 13:56:13 -0000 Mailing-List: contact commits-help@struts.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@struts.apache.org Delivered-To: mailing list commits@struts.apache.org Received: (qmail 42470 invoked by uid 99); 12 Jul 2008 13:56:13 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 12 Jul 2008 06:56:13 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 12 Jul 2008 13:55:29 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 6C1EA2388A15; Sat, 12 Jul 2008 06:55:52 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r676179 - /struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ActionTagTest.java Date: Sat, 12 Jul 2008 13:55:52 -0000 To: commits@struts.apache.org From: mrdon@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080712135552.6C1EA2388A15@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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);