From 604388159c904de5bb8d38578d2da66996e79003 Mon Sep 17 00:00:00 2001 From: "Donald J. Brown" Date: Mon, 16 Jul 2007 13:35:09 +0000 Subject: [PATCH] Adding tests to ensure recursive value attribute processing has been disabled WW-2030 git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@556624 13f79535-47bb-0310-9956-ffa450edef68 --- .../struts2/views/jsp/ui/TextfieldTest.java | 33 +++++++++++++++++++ .../struts2/views/jsp/ui/Textfield-5.txt | 4 +++ .../struts2/views/jsp/ui/Textfield-6.txt | 4 +++ 3 files changed, 41 insertions(+) create mode 100644 core/src/test/resources/org/apache/struts2/views/jsp/ui/Textfield-5.txt create mode 100644 core/src/test/resources/org/apache/struts2/views/jsp/ui/Textfield-6.txt diff --git a/core/src/test/java/org/apache/struts2/views/jsp/ui/TextfieldTest.java b/core/src/test/java/org/apache/struts2/views/jsp/ui/TextfieldTest.java index f4157a22bd..d3437d6ad6 100644 --- a/core/src/test/java/org/apache/struts2/views/jsp/ui/TextfieldTest.java +++ b/core/src/test/java/org/apache/struts2/views/jsp/ui/TextfieldTest.java @@ -148,4 +148,37 @@ public void testSimple() throws Exception { verify(TextFieldTag.class.getResource("Textfield-1.txt")); } + + public void testSimple_recursionTest() throws Exception { + TestAction testAction = (TestAction) action; + testAction.setFoo("%{1+1}"); + + TextFieldTag tag = new TextFieldTag(); + tag.setPageContext(pageContext); + tag.setLabel("mylabel"); + tag.setName("myname"); + tag.setValue("%{foo}"); + tag.setSize("10"); + + tag.doStartTag(); + tag.doEndTag(); + + verify(TextFieldTag.class.getResource("Textfield-5.txt")); + } + + public void testSimple_recursionTestNoValue() throws Exception { + TestAction testAction = (TestAction) action; + testAction.setFoo("%{1+1}"); + + TextFieldTag tag = new TextFieldTag(); + tag.setPageContext(pageContext); + tag.setLabel("mylabel"); + tag.setName("foo"); + tag.setSize("10"); + + tag.doStartTag(); + tag.doEndTag(); + + verify(TextFieldTag.class.getResource("Textfield-6.txt")); + } } diff --git a/core/src/test/resources/org/apache/struts2/views/jsp/ui/Textfield-5.txt b/core/src/test/resources/org/apache/struts2/views/jsp/ui/Textfield-5.txt new file mode 100644 index 0000000000..5dfc6245e8 --- /dev/null +++ b/core/src/test/resources/org/apache/struts2/views/jsp/ui/Textfield-5.txt @@ -0,0 +1,4 @@ + + + + diff --git a/core/src/test/resources/org/apache/struts2/views/jsp/ui/Textfield-6.txt b/core/src/test/resources/org/apache/struts2/views/jsp/ui/Textfield-6.txt new file mode 100644 index 0000000000..e6ecb5cec6 --- /dev/null +++ b/core/src/test/resources/org/apache/struts2/views/jsp/ui/Textfield-6.txt @@ -0,0 +1,4 @@ + + + +