diff --git a/core/src/test/java/org/apache/struts2/views/jsp/AbstractUITagTest.java b/core/src/test/java/org/apache/struts2/views/jsp/AbstractUITagTest.java index dddf2e45b..de8a0bdf4 100644 --- a/core/src/test/java/org/apache/struts2/views/jsp/AbstractUITagTest.java +++ b/core/src/test/java/org/apache/struts2/views/jsp/AbstractUITagTest.java @@ -244,18 +244,6 @@ public abstract class AbstractUITagTest extends AbstractTagTest { * @throws Exception if the validation failed */ public void verify(URL url) throws Exception { - verify(url, null); - } - - /** - * Attempt to verify the contents of this.writer against the contents of the URL specified. verify() performs a - * trim on both ends - * - * @param url the HTML snippet that we want to validate against - * @param excluded - * @throws Exception if the validation failed - */ - public void verify(URL url, String[] excluded) throws Exception { if (url == null) { fail("unable to verify a null URL"); } else if (this.writer == null) { diff --git a/core/src/test/java/org/apache/struts2/views/jsp/ui/LabelTest.java b/core/src/test/java/org/apache/struts2/views/jsp/ui/LabelTest.java index e17d85716..7ef1155de 100644 --- a/core/src/test/java/org/apache/struts2/views/jsp/ui/LabelTest.java +++ b/core/src/test/java/org/apache/struts2/views/jsp/ui/LabelTest.java @@ -21,12 +21,12 @@ package org.apache.struts2.views.jsp.ui; -import java.util.HashMap; -import java.util.Map; - import org.apache.struts2.TestAction; import org.apache.struts2.views.jsp.AbstractUITagTest; +import java.util.HashMap; +import java.util.Map; + /** */ @@ -152,4 +152,23 @@ public class LabelTest extends AbstractUITagTest { verify(LabelTest.class.getResource("Label-4.txt")); } + public void testWithJustKeyValueFromStack() throws Exception { + TestAction testAction = (TestAction) action; + final String key = "labelKey"; + final String value = "baz"; + + // put key with message in a "resource" + testAction.setText(key, value); + + LabelTag tag = new LabelTag(); + tag.setPageContext(pageContext); + tag.setKey(key); + tag.setTheme("simple"); + + tag.doStartTag(); + tag.doEndTag(); + + verify(LabelTest.class.getResource("Label-6.txt")); + } + } diff --git a/core/src/test/resources/org/apache/struts2/views/jsp/ui/Label-6.txt b/core/src/test/resources/org/apache/struts2/views/jsp/ui/Label-6.txt new file mode 100644 index 000000000..a7207777a --- /dev/null +++ b/core/src/test/resources/org/apache/struts2/views/jsp/ui/Label-6.txt @@ -0,0 +1 @@ +