validators = new ArrayList<>();
@@ -299,7 +303,7 @@ public List getValidators(String name) {
private boolean isValidateAnnotatedMethodOnly(String actionName) {
RuntimeConfiguration runtimeConfiguration = configuration.getRuntimeConfiguration();
- String actionNamespace = TagUtils.buildNamespace(actionMapper, stack, request);
+ String actionNamespace = getNamespace(stack);
ActionConfig actionConfig = runtimeConfiguration.getActionConfig(actionNamespace, actionName);
if (actionConfig != null) {
@@ -355,64 +359,84 @@ private void findFieldValidators(String name, Class actionClass, String actionNa
public static class FieldVisitorValidatorWrapper implements FieldValidator {
private FieldValidator fieldValidator;
private String namePrefix;
+
public FieldVisitorValidatorWrapper(FieldValidator fv, String namePrefix) {
this.fieldValidator = fv;
this.namePrefix = namePrefix;
}
+
public String getValidatorType() {
return "field-visitor";
}
+
public String getFieldName() {
return namePrefix + fieldValidator.getFieldName();
}
+
public FieldValidator getFieldValidator() {
return fieldValidator;
}
+
public void setFieldValidator(FieldValidator fieldValidator) {
this.fieldValidator = fieldValidator;
}
+
public String getDefaultMessage() {
return fieldValidator.getDefaultMessage();
}
+
public String getMessage(Object object) {
return fieldValidator.getMessage(object);
}
+
public String getMessageKey() {
return fieldValidator.getMessageKey();
}
+
public String[] getMessageParameters() {
return fieldValidator.getMessageParameters();
}
+
public ValidatorContext getValidatorContext() {
return fieldValidator.getValidatorContext();
}
+
public void setDefaultMessage(String message) {
fieldValidator.setDefaultMessage(message);
}
+
public void setFieldName(String fieldName) {
fieldValidator.setFieldName(fieldName);
}
+
public void setMessageKey(String key) {
fieldValidator.setMessageKey(key);
}
+
public void setMessageParameters(String[] messageParameters) {
fieldValidator.setMessageParameters(messageParameters);
}
+
public void setValidatorContext(ValidatorContext validatorContext) {
fieldValidator.setValidatorContext(validatorContext);
}
+
public void setValidatorType(String type) {
fieldValidator.setValidatorType(type);
}
+
public void setValueStack(ValueStack stack) {
fieldValidator.setValueStack(stack);
}
+
public void validate(Object object) throws ValidationException {
fieldValidator.validate(object);
}
+
public String getNamePrefix() {
return namePrefix;
}
+
public void setNamePrefix(String namePrefix) {
this.namePrefix = namePrefix;
}
@@ -421,7 +445,7 @@ public void setNamePrefix(String namePrefix) {
/**
* Return type of visited object.
*
- * @param actionClass action class
+ * @param actionClass action class
* @param visitorFieldName field name
* @return type of visited object
*/
@@ -451,68 +475,68 @@ protected int getSequence() {
return sequence++;
}
- @StrutsTagAttribute(description="HTML onsubmit attribute")
+ @StrutsTagAttribute(description = "HTML onsubmit attribute")
public void setOnsubmit(String onsubmit) {
this.onsubmit = onsubmit;
}
- @StrutsTagAttribute(description="HTML onreset attribute")
+ @StrutsTagAttribute(description = "HTML onreset attribute")
public void setOnreset(String onreset) {
this.onreset = onreset;
}
- @StrutsTagAttribute(description="Set action name to submit to, without .action suffix", defaultValue="current action")
+ @StrutsTagAttribute(description = "Set action name to submit to, without .action suffix", defaultValue = "current action")
public void setAction(String action) {
this.action = action;
}
- @StrutsTagAttribute(description="HTML form target attribute")
+ @StrutsTagAttribute(description = "HTML form target attribute")
public void setTarget(String target) {
this.target = target;
}
- @StrutsTagAttribute(description="HTML form enctype attribute")
+ @StrutsTagAttribute(description = "HTML form enctype attribute")
public void setEnctype(String enctype) {
this.enctype = enctype;
}
- @StrutsTagAttribute(description="HTML form method attribute")
+ @StrutsTagAttribute(description = "HTML form method attribute")
public void setMethod(String method) {
this.method = method;
}
- @StrutsTagAttribute(description="Namespace for action to submit to", defaultValue="current namespace")
+ @StrutsTagAttribute(description = "Namespace for action to submit to", defaultValue = "current namespace")
public void setNamespace(String namespace) {
this.namespace = namespace;
}
- @StrutsTagAttribute(description="Whether client side/remote validation should be performed. Only" +
- " useful with theme xhtml/ajax", type="Boolean", defaultValue="false")
+ @StrutsTagAttribute(description = "Whether client side/remote validation should be performed. Only" +
+ " useful with theme xhtml/ajax", type = "Boolean", defaultValue = "false")
public void setValidate(String validate) {
this.validate = validate;
}
- @StrutsTagAttribute(description="The portlet mode to display after the form submit")
+ @StrutsTagAttribute(description = "The portlet mode to display after the form submit")
public void setPortletMode(String portletMode) {
this.portletMode = portletMode;
}
- @StrutsTagAttribute(description="The window state to display after the form submit")
+ @StrutsTagAttribute(description = "The window state to display after the form submit")
public void setWindowState(String windowState) {
this.windowState = windowState;
}
- @StrutsTagAttribute(description="The accepted charsets for this form. The values may be comma or blank delimited.")
+ @StrutsTagAttribute(description = "The accepted charsets for this form. The values may be comma or blank delimited.")
public void setAcceptcharset(String acceptcharset) {
this.acceptcharset = acceptcharset;
}
- @StrutsTagAttribute(description="Id of element that will receive the focus when page loads.")
+ @StrutsTagAttribute(description = "Id of element that will receive the focus when page loads.")
public void setFocusElement(String focusElement) {
this.focusElement = focusElement;
}
- @StrutsTagAttribute(description="Whether actual context should be included in URL", type="Boolean", defaultValue="true")
+ @StrutsTagAttribute(description = "Whether actual context should be included in URL", type = "Boolean", defaultValue = "true")
public void setIncludeContext(boolean includeContext) {
this.includeContext = includeContext;
}
diff --git a/core/src/main/java/org/apache/struts2/views/jsp/StrutsBodyTagSupport.java b/core/src/main/java/org/apache/struts2/views/jsp/StrutsBodyTagSupport.java
index 2bccb3a25c..0fd430c585 100644
--- a/core/src/main/java/org/apache/struts2/views/jsp/StrutsBodyTagSupport.java
+++ b/core/src/main/java/org/apache/struts2/views/jsp/StrutsBodyTagSupport.java
@@ -20,15 +20,15 @@
import com.opensymphony.xwork2.util.TextParseUtil;
import com.opensymphony.xwork2.util.ValueStack;
-import java.io.PrintWriter;
-import javax.servlet.jsp.JspException;
-import javax.servlet.jsp.tagext.BodyTagSupport;
import org.apache.struts2.util.ComponentUtils;
import org.apache.struts2.util.FastByteArrayOutputStream;
+import javax.servlet.jsp.JspException;
+import javax.servlet.jsp.tagext.BodyTagSupport;
+import java.io.PrintWriter;
/**
- * Contains common functonalities for Struts JSP Tags.
+ * Contains common functionalities for Struts JSP Tags.
*/
public class StrutsBodyTagSupport extends BodyTagSupport {
@@ -84,7 +84,7 @@ public int doEndTag() throws JspException {
/**
* Release state for a Struts JSP Tag handler.
- *
+ *
* According to the JSP API documentation, the page compiler guarantees that the release() method
* will be invoked on the Tag handler before releasing it to the GC (garbage collector). It does
* not specify when the release() call will be made, though, and timing likely depends
@@ -94,7 +94,7 @@ public int doEndTag() throws JspException {
public void release() {
// Ensure release() performs the clearTagStateForTagPoolingServers tag state clearing processing with
// the clear state flag forced to true (if not already set to true), to ensure cleanup.
- // The performClearTagStateForTagPoolingServers flag state is preserved for consistency, in case
+ // The performClearTagStateForTagPoolingServers flag state is preserved for consistency, in case
// release() is called by framework code.
final boolean originalPerformClearTagState = getPerformClearTagStateForTagPoolingServers();
if (originalPerformClearTagState == true) {
@@ -110,18 +110,18 @@ public void release() {
/**
* Request that the tag state be cleared during {@link StrutsBodyTagSupport#doEndTag()} processing,
* which may help with certain edge cases with tag logic running on servers that implement JSP Tag Pooling.
- *
+ *
* Note: Even though the Tag classes extend this class {@link StrutsBodyTagSupport}, and this method
* {@link StrutsBodyTagSupport#setPerformClearTagStateForTagPoolingServers(boolean)} exists in the method hierarchy,
* the JSP processing requires us to explicitly override it in every Tag class in order for the Tag handler
- * method to be visible to the JSP processing.
+ * method to be visible to the JSP processing.
* Defining a setter in the superclass alone is insufficient (results in "Cannot find a setter method for the attribute").
- *
+ *
* See {@link StrutsBodyTagSupport#clearTagStateForTagPoolingServers()} for additional details.
- *
+ *
* Warning: Setting this value to true may allow for the desired behaviour, but doing so
* may violate the JSP specification. Set to true at your own risk.
- *
+ *
* @param performClearTagStateForTagPoolingServers true if tag state should be cleared, false otherwise.
*/
public void setPerformClearTagStateForTagPoolingServers(boolean performClearTagStateForTagPoolingServers) {
@@ -130,7 +130,7 @@ public void setPerformClearTagStateForTagPoolingServers(boolean performClearTagS
/**
* Allow descendant tags to check if the tag state should be cleared during {@link StrutsBodyTagSupport#doEndTag()} processing,
- *
+ *
* @return true if tag state should be cleared, false (default) otherwise.
*/
protected boolean getPerformClearTagStateForTagPoolingServers() {
@@ -140,16 +140,16 @@ protected boolean getPerformClearTagStateForTagPoolingServers() {
/**
* Provide a mechanism to clear tag state, to handle servlet container JSP tag pooling
* behaviour with some servers, such as Glassfish.
- *
- * Usage: Override this method in descendant classes to clear any state that might cause issues should the
- * servlet container re-use a cached instance of the tag object. If the descendant class does not
- * declare any new field members then it should not be strictly necessary to call this method there.
- * Typically that means calling the ancestor's {@link ComponentTagSupport#clearTagStateForTagPoolingServers()}
- * method first, then resetting instance variables at the current level to their default state.
- *
+ *
+ * Usage: Override this method in descendant classes to clear any state that might cause issues should the
+ * servlet container re-use a cached instance of the tag object. If the descendant class does not
+ * declare any new field members then it should not be strictly necessary to call this method there.
+ * Typically that means calling the ancestor's {@link ComponentTagSupport#clearTagStateForTagPoolingServers()}
+ * method first, then resetting instance variables at the current level to their default state.
+ *
* Note: If the descendant overrides {@link StrutsBodyTagSupport#doEndTag()}, and does not call
- * super.doEndTag(), then the descendant should call this method in the descendant doEndTag() method
- * to ensure consistent clearing of tag state.
+ * super.doEndTag(), then the descendant should call this method in the descendant doEndTag() method
+ * to ensure consistent clearing of tag state.
*/
protected void clearTagStateForTagPoolingServers() {
// Default implementation.
diff --git a/core/src/main/java/org/apache/struts2/views/jsp/TagUtils.java b/core/src/main/java/org/apache/struts2/views/jsp/TagUtils.java
index 966ce1c55c..7bff47dc31 100644
--- a/core/src/main/java/org/apache/struts2/views/jsp/TagUtils.java
+++ b/core/src/main/java/org/apache/struts2/views/jsp/TagUtils.java
@@ -19,97 +19,40 @@
package org.apache.struts2.views.jsp;
import com.opensymphony.xwork2.ActionContext;
-import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.config.ConfigurationException;
import com.opensymphony.xwork2.util.ValueStack;
-import com.opensymphony.xwork2.util.ValueStackFactory;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
-import org.apache.struts2.RequestUtils;
import org.apache.struts2.ServletActionContext;
-import org.apache.struts2.dispatcher.ApplicationMap;
-import org.apache.struts2.dispatcher.Dispatcher;
-import org.apache.struts2.dispatcher.HttpParameters;
-import org.apache.struts2.dispatcher.RequestMap;
-import org.apache.struts2.dispatcher.SessionMap;
-import org.apache.struts2.dispatcher.mapper.ActionMapper;
-import org.apache.struts2.dispatcher.mapper.ActionMapping;
import org.apache.struts2.util.AttributeMap;
import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
import javax.servlet.jsp.PageContext;
-import java.util.Map;
public class TagUtils {
private static final Logger LOG = LogManager.getLogger(TagUtils.class);
public static ValueStack getStack(PageContext pageContext) {
+ LOG.trace("Reading ValueStack out of page context: {}", pageContext);
HttpServletRequest req = (HttpServletRequest) pageContext.getRequest();
ValueStack stack = ServletActionContext.getValueStack(req);
+ stack = stack != null ? stack : ActionContext.getContext().getValueStack();
if (stack == null) {
-
- HttpServletResponse res = (HttpServletResponse) pageContext.getResponse();
- Dispatcher du = Dispatcher.getInstance();
- if (du == null) {
- throw new ConfigurationException("The Struts dispatcher cannot be found. This is usually caused by "+
- "using Struts tags without the associated filter. Struts tags are only usable when the request "+
- "has passed through its servlet filter, which initializes the Struts dispatcher needed for this tag.");
- }
- stack = du.getContainer().getInstance(ValueStackFactory.class).createValueStack();
-
- HttpParameters params = HttpParameters.create(req.getParameterMap()).build();
-
- Map extraContext = du.createContextMap(new RequestMap(req),
- params,
- new SessionMap(req),
- new ApplicationMap(pageContext.getServletContext()),
- req,
- res);
- extraContext.put(ServletActionContext.PAGE_CONTEXT, pageContext);
- stack.getContext().putAll(extraContext);
- req.setAttribute(ServletActionContext.STRUTS_VALUESTACK_KEY, stack);
-
- // also tie this stack/context to the ThreadLocal
- ActionContext.of(stack.getContext()).bind();
+ LOG.warn("No ValueStack in ActionContext!");
+ throw new ConfigurationException("Rendering tag out of Action scope, accessing directly JSPs is not recommended! " +
+ "Please read https://struts.apache.org/security/#never-expose-jsp-files-directly");
} else {
- // let's make sure that the current page context is in the action context
- // TODO: refactor this to stop using put()
- Map context = stack.getContext();
- context.put(ServletActionContext.PAGE_CONTEXT, pageContext);
+ LOG.trace("Adds the current PageContext to ActionContext");
+ AttributeMap attrMap = new AttributeMap(stack.getContext());
- AttributeMap attrMap = new AttributeMap(context);
- context.put("attr", attrMap);
+ stack.getActionContext()
+ .withPageContext(pageContext)
+ .with("attr", attrMap);
}
return stack;
}
- public static String buildNamespace(ActionMapper mapper, ValueStack stack, HttpServletRequest request) {
- ActionContext context = ActionContext.of(stack.getContext());
- ActionInvocation invocation = context.getActionInvocation();
-
- if (invocation == null) {
- TagUtils.LOG.warn("ActionInvocation is null, tag has been executed out of the Action and this can lead " +
- "to a security vulnerability, please read http://struts.apache.org/security/#never-expose-jsp-files-directly !");
-
- ActionMapping mapping = mapper.getMapping(request,
- Dispatcher.getInstance().getConfigurationManager());
-
- if (mapping != null) {
- return mapping.getNamespace();
- } else {
- // well, if the ActionMapper can't tell us, and there is no existing action invocation,
- // let's just go with a default guess that the namespace is the last the path minus the
- // last part (/foo/bar/baz.xyz -> /foo/bar)
-
- String path = RequestUtils.getServletPath(request);
- return path.substring(0, path.lastIndexOf('/'));
- }
- } else {
- return invocation.getProxy().getNamespace();
- }
- }
}
diff --git a/core/src/test/java/org/apache/struts2/views/jsp/AbstractTagTest.java b/core/src/test/java/org/apache/struts2/views/jsp/AbstractTagTest.java
index 243af77979..c1b8188fa9 100644
--- a/core/src/test/java/org/apache/struts2/views/jsp/AbstractTagTest.java
+++ b/core/src/test/java/org/apache/struts2/views/jsp/AbstractTagTest.java
@@ -21,7 +21,11 @@
import com.mockobjects.dynamic.Mock;
import com.opensymphony.xwork2.Action;
import com.opensymphony.xwork2.ActionContext;
+import com.opensymphony.xwork2.ActionInvocation;
+import com.opensymphony.xwork2.ActionProxy;
import com.opensymphony.xwork2.inject.Container;
+import com.opensymphony.xwork2.mock.MockActionInvocation;
+import com.opensymphony.xwork2.mock.MockActionProxy;
import com.opensymphony.xwork2.util.ValueStack;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.struts2.ServletActionContext;
@@ -46,6 +50,7 @@
*/
public abstract class AbstractTagTest extends StrutsInternalTestCase {
protected Action action;
+ protected ActionProxy actionProxy;
protected Map context;
protected Map session;
protected ValueStack stack;
@@ -57,6 +62,7 @@ public abstract class AbstractTagTest extends StrutsInternalTestCase {
protected StrutsMockHttpServletRequest request;
protected StrutsMockPageContext pageContext;
protected HttpServletResponse response;
+ protected ActionInvocation actionInvocation;
protected Mock mockContainer;
@@ -78,6 +84,7 @@ protected void setUp() throws Exception {
protected void createMocks() {
action = this.getAction();
+ actionProxy = new MockActionProxy();
container.inject(action);
stack = ActionContext.getContext().getValueStack();
@@ -119,11 +126,35 @@ protected void createMocks() {
extraContext = ActionContext.of(extraContext).withLocale(null).getContextMap();
stack.getContext().putAll(extraContext);
- ActionContext.of(context)
+ actionInvocation = new MockActionInvocation();
+ ((MockActionInvocation) actionInvocation).setAction(action);
+
+ ((MockActionProxy) actionProxy).setAction(action);
+ ((MockActionProxy) actionProxy).setInvocation(actionInvocation);
+ ((MockActionInvocation) actionInvocation).setProxy(actionProxy);
+
+ request.setRequestURI("/");
+ withRequestPath(request.getRequestURI());
+
+ ActionContext ac = ActionContext.of(context)
.withServletRequest(request)
.withServletResponse(response)
.withServletContext(servletContext)
+ .withActionInvocation(actionInvocation)
.bind();
+
+ ((MockActionInvocation) actionInvocation).setInvocationContext(ac);
+ }
+
+ protected void withRequestPath(String path) {
+ request.setRequestURI(path);
+ String namespace = path.substring(0, path.lastIndexOf('/'));
+ String actionName = path.substring(path.lastIndexOf('/') + 1);
+ if (namespace.equals("") && !actionName.contains(".action")) {
+ actionName = path;
+ }
+ ((MockActionProxy) actionProxy).setNamespace(namespace);
+ ((MockActionProxy) actionProxy).setActionName(actionName);
}
@Override
diff --git a/core/src/test/java/org/apache/struts2/views/jsp/ActionTagTest.java b/core/src/test/java/org/apache/struts2/views/jsp/ActionTagTest.java
index 4d3eb3b3e6..9678b600eb 100644
--- a/core/src/test/java/org/apache/struts2/views/jsp/ActionTagTest.java
+++ b/core/src/test/java/org/apache/struts2/views/jsp/ActionTagTest.java
@@ -45,7 +45,7 @@
public class ActionTagTest extends AbstractTagTest {
public void testActionTagWithNamespace() {
- request.setupGetServletPath(TestConfigurationProvider.TEST_NAMESPACE + "/" + "foo.action");
+ withRequestPath(TestConfigurationProvider.TEST_NAMESPACE + "/" + "foo.action");
ActionTag tag = new ActionTag();
tag.setPageContext(pageContext);
@@ -72,11 +72,11 @@ public void testActionTagWithNamespace() {
freshTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testActionTagWithNamespace_clearTagStateSet() {
- request.setupGetServletPath(TestConfigurationProvider.TEST_NAMESPACE + "/" + "foo.action");
+ withRequestPath(TestConfigurationProvider.TEST_NAMESPACE + "/" + "foo.action");
ActionTag tag = new ActionTag();
tag.setPerformClearTagStateForTagPoolingServers(true); // Explicitly request tag state clearing.
@@ -106,7 +106,7 @@ public void testActionTagWithNamespace_clearTagStateSet() {
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testSimple() {
@@ -145,7 +145,7 @@ public void testSimple() {
freshTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
@@ -188,7 +188,7 @@ public void testSimple_clearTagStateSet() {
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
@@ -234,7 +234,7 @@ public void testSimpleWithActionMethodInOriginalURI() {
freshTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
@@ -277,7 +277,7 @@ public void testSimpleWithctionMethodInOriginalURI_clearTagStateSet() {
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
@@ -306,7 +306,7 @@ public void testActionWithExecuteResult() throws Exception {
freshTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
@@ -329,7 +329,7 @@ public void testActionWithExecuteResult_clearTagStateSet() throws Exception {
TestActionTagResult result = (TestActionTagResult) component.getProxy().getInvocation().getResult();
assertTrue(stack.getContext().containsKey(ServletActionContext.PAGE_CONTEXT));
- assertTrue(stack.getContext().get(ServletActionContext.PAGE_CONTEXT)instanceof PageContext);
+ assertTrue(stack.getContext().get(ServletActionContext.PAGE_CONTEXT) instanceof PageContext);
assertTrue(result.isExecuted());
// Basic sanity check of clearTagStateForTagPoolingServers() behaviour for Struts Tags after doEndTag().
@@ -338,7 +338,7 @@ public void testActionWithExecuteResult_clearTagStateSet() throws Exception {
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
@@ -367,7 +367,7 @@ public void testActionWithoutExecuteResult() throws Exception {
freshTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testActionWithoutExecuteResult_clearTagStateSet() throws Exception {
@@ -389,7 +389,7 @@ public void testActionWithoutExecuteResult_clearTagStateSet() throws Exception {
TestActionTagResult result = (TestActionTagResult) component.getProxy().getInvocation().getResult();
assertTrue(stack.getContext().containsKey(ServletActionContext.PAGE_CONTEXT));
- assertTrue(stack.getContext().get(ServletActionContext.PAGE_CONTEXT)instanceof PageContext);
+ assertTrue(stack.getContext().get(ServletActionContext.PAGE_CONTEXT) instanceof PageContext);
assertNull(result); // result is never executed, hence never set into invocation
// Basic sanity check of clearTagStateForTagPoolingServers() behaviour for Struts Tags after doEndTag().
@@ -398,7 +398,7 @@ public void testActionWithoutExecuteResult_clearTagStateSet() throws Exception {
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testExecuteButResetReturnSameInvocation() throws Exception {
@@ -426,11 +426,11 @@ public void testExecuteButResetReturnSameInvocation() throws Exception {
freshTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
- public void testExecuteButResetReturnSameInvocation_clearTagStateSet() throws Exception {
+ public void testExecuteButResetReturnSameInvocation_clearTagStateSet() throws Exception {
Mock mockActionInv = new Mock(ActionInvocation.class);
ActionTag tag = new ActionTag();
tag.setPerformClearTagStateForTagPoolingServers(true); // Explicitly request tag state clearing.
@@ -458,7 +458,7 @@ public void testExecuteButResetReturnSameInvocation_clearTagStateSet() throws Ex
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testIngoreContextParamsFalse() throws Exception {
@@ -490,7 +490,7 @@ public void testIngoreContextParamsFalse() throws Exception {
freshTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
@@ -526,7 +526,7 @@ public void testIngoreContextParamsFalse_clearTagStateSet() throws Exception {
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
@@ -559,7 +559,7 @@ public void testIngoreContextParamsTrue() throws Exception {
freshTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testIngoreContextParamsTrue_clearTagStateSet() throws Exception {
@@ -572,7 +572,7 @@ public void testIngoreContextParamsTrue_clearTagStateSet() throws Exception {
tag.setIgnoreContextParams(true);
Map params = new HashMap<>();
- params.put("user", new String[] { "Santa Claus" });
+ params.put("user", new String[]{"Santa Claus"});
ActionContext.getContext().withParameters(HttpParameters.create(params).build());
tag.doStartTag();
@@ -594,7 +594,7 @@ public void testIngoreContextParamsTrue_clearTagStateSet() throws Exception {
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testNoNameDefined() throws Exception {
@@ -632,7 +632,7 @@ public void testUnknownNameDefined() throws Exception {
freshTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
// FIXME: Logging the error seems to cause the standard Maven build to fail
@@ -655,7 +655,7 @@ public void testUnknownNameDefined_clearTagStateSet() throws Exception {
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testActionMethodWithExecuteResult() throws Exception {
@@ -684,7 +684,7 @@ public void testActionMethodWithExecuteResult() throws Exception {
freshTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testActionMethodWithExecuteResult_clearTagStateSet() throws Exception {
@@ -694,7 +694,7 @@ public void testActionMethodWithExecuteResult_clearTagStateSet() throws Exceptio
tag.setNamespace("");
tag.setName("testActionTagAction!input");
tag.setExecuteResult(true);
- ((DefaultActionMapper)container.getInstance(ActionMapper.class)).setAllowDynamicMethodCalls("true");
+ ((DefaultActionMapper) container.getInstance(ActionMapper.class)).setAllowDynamicMethodCalls("true");
tag.doStartTag();
setComponentTagClearTagState(tag, true); // Ensure component tag state clearing is set true (to match tag).
@@ -707,7 +707,7 @@ public void testActionMethodWithExecuteResult_clearTagStateSet() throws Exceptio
TestActionTagResult result = (TestActionTagResult) component.getProxy().getInvocation().getResult();
assertTrue(stack.getContext().containsKey(ServletActionContext.PAGE_CONTEXT));
- assertTrue(stack.getContext().get(ServletActionContext.PAGE_CONTEXT)instanceof PageContext);
+ assertTrue(stack.getContext().get(ServletActionContext.PAGE_CONTEXT) instanceof PageContext);
assertTrue(result.isExecuted());
// Basic sanity check of clearTagStateForTagPoolingServers() behaviour for Struts Tags after doEndTag().
@@ -716,7 +716,7 @@ public void testActionMethodWithExecuteResult_clearTagStateSet() throws Exceptio
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
@Override
diff --git a/core/src/test/java/org/apache/struts2/views/jsp/AnchorTagTest.java b/core/src/test/java/org/apache/struts2/views/jsp/AnchorTagTest.java
index 7d0de563c6..ccc728945b 100644
--- a/core/src/test/java/org/apache/struts2/views/jsp/AnchorTagTest.java
+++ b/core/src/test/java/org/apache/struts2/views/jsp/AnchorTagTest.java
@@ -18,18 +18,17 @@
*/
package org.apache.struts2.views.jsp;
-import java.io.StringWriter;
-import java.util.Map;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.text.MessageFormat;
+import org.apache.struts2.views.jsp.ui.AnchorTag;
+import org.apache.struts2.views.jsp.ui.StrutsBodyContent;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.JspWriter;
-
-import org.apache.struts2.views.jsp.ui.AnchorTag;
-import org.apache.struts2.views.jsp.ui.StrutsBodyContent;
+import java.io.StringWriter;
+import java.text.MessageFormat;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
/**
@@ -55,7 +54,7 @@ public void testActionURL() {
freshTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testActionURL_clearTagStateSet() {
@@ -77,7 +76,7 @@ public void testActionURL_clearTagStateSet() {
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testAddParameters() {
@@ -100,7 +99,7 @@ public void testAddParameters() {
freshTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testAddParameters_clearTagStateSet() {
@@ -126,7 +125,7 @@ public void testAddParameters_clearTagStateSet() {
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
/**
@@ -206,14 +205,14 @@ public void testParametersPriority() throws Exception {
tag.doEndTag();
assertEquals(wrapWithAnchor("testAction.action?id1=paramId1&id2=tagId2&" +
- "amp;tagId=tagValue&urlParam1=urlValue1&urlParam2=urlValue2¶m1=param1value¶m2=param2value"), writer.toString());
+ "amp;tagId=tagValue&urlParam1=urlValue1&urlParam2=urlValue2¶m1=param1value¶m2=param2value"), writer.toString());
// Basic sanity check of clearTagStateForTagPoolingServers() behaviour for Struts Tags after doEndTag().
AnchorTag freshTag = new AnchorTag();
freshTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
/**
@@ -298,7 +297,7 @@ public void testParametersPriority_clearTagStateSet() throws Exception {
tag.doEndTag();
assertEquals(wrapWithAnchor("testAction.action?id1=paramId1&id2=tagId2&" +
- "amp;tagId=tagValue&urlParam1=urlValue1&urlParam2=urlValue2¶m1=param1value¶m2=param2value"), writer.toString());
+ "amp;tagId=tagValue&urlParam1=urlValue1&urlParam2=urlValue2¶m1=param1value¶m2=param2value"), writer.toString());
// Basic sanity check of clearTagStateForTagPoolingServers() behaviour for Struts Tags after doEndTag().
AnchorTag freshTag = new AnchorTag();
@@ -306,7 +305,7 @@ public void testParametersPriority_clearTagStateSet() throws Exception {
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
/**
@@ -336,7 +335,7 @@ public void testIterableParameters() throws Exception {
freshParamTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(param1, freshParamTag));
+ strutsBodyTagsAreReflectionEqual(param1, freshParamTag));
//String[]
stack.getContext().put("param2value", new String[]{"d", "e"});
@@ -350,11 +349,11 @@ public void testIterableParameters() throws Exception {
// Basic sanity check of clearTagStateForTagPoolingServers() behaviour for Struts Tags after doEndTag().
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(param2, freshParamTag));
+ strutsBodyTagsAreReflectionEqual(param2, freshParamTag));
//ValueHolder[]
stack.getContext().put("param3value", new URLTagTest.ValueHolder[]{
- new URLTagTest.ValueHolder("f"), new URLTagTest.ValueHolder("g")});
+ new URLTagTest.ValueHolder("f"), new URLTagTest.ValueHolder("g")});
ParamTag param3 = new ParamTag();
param3.setPageContext(pageContext);
param3.setName("p3");
@@ -365,11 +364,11 @@ public void testIterableParameters() throws Exception {
// Basic sanity check of clearTagStateForTagPoolingServers() behaviour for Struts Tags after doEndTag().
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(param3, freshParamTag));
+ strutsBodyTagsAreReflectionEqual(param3, freshParamTag));
tag.doEndTag();
-
- String result = writer.toString();
+
+ String result = writer.toString();
assertTrue(result.contains("p1=a"));
assertTrue(result.contains("p1=b"));
assertTrue(result.contains("p2=d"));
@@ -383,7 +382,7 @@ public void testIterableParameters() throws Exception {
freshTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
/**
@@ -418,7 +417,7 @@ public void testIterableParameters_clearTagStateSet() throws Exception {
freshParamTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(param1, freshParamTag));
+ strutsBodyTagsAreReflectionEqual(param1, freshParamTag));
//String[]
stack.getContext().put("param2value", new String[]{"d", "e"});
@@ -434,11 +433,11 @@ public void testIterableParameters_clearTagStateSet() throws Exception {
// Basic sanity check of clearTagStateForTagPoolingServers() behaviour for Struts Tags after doEndTag().
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(param2, freshParamTag));
+ strutsBodyTagsAreReflectionEqual(param2, freshParamTag));
//ValueHolder[]
stack.getContext().put("param3value", new URLTagTest.ValueHolder[]{
- new URLTagTest.ValueHolder("f"), new URLTagTest.ValueHolder("g")});
+ new URLTagTest.ValueHolder("f"), new URLTagTest.ValueHolder("g")});
ParamTag param3 = new ParamTag();
param3.setPerformClearTagStateForTagPoolingServers(true); // Explicitly request tag state clearing.
param3.setPageContext(pageContext);
@@ -451,11 +450,11 @@ public void testIterableParameters_clearTagStateSet() throws Exception {
// Basic sanity check of clearTagStateForTagPoolingServers() behaviour for Struts Tags after doEndTag().
assertTrue("Tag state after doEndTag() inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(param3, freshParamTag));
+ strutsBodyTagsAreReflectionEqual(param3, freshParamTag));
tag.doEndTag();
- String result = writer.toString();
+ String result = writer.toString();
assertTrue(result.contains("p1=a"));
assertTrue(result.contains("p1=b"));
assertTrue(result.contains("p2=d"));
@@ -470,7 +469,7 @@ public void testIterableParameters_clearTagStateSet() throws Exception {
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
/**
@@ -478,7 +477,7 @@ public void testIterableParameters_clearTagStateSet() throws Exception {
* To test priority of parameter passed in to url component though
* various way, with includeParams="NONE"
*
- *
+ *
* - current request url
* - tag's value attribute
* - tag's nested param tag
@@ -488,6 +487,7 @@ public void testIterableParameters_clearTagStateSet() throws Exception {
* Those from request will not count, only those in tag's value attribute
* and nested param tag.
*
+ *
* @throws Exception
*/
public void testParametersPriorityWithIncludeParamsAsNONE() throws Exception {
@@ -528,28 +528,28 @@ public void testParametersPriorityWithIncludeParamsAsNONE() throws Exception {
freshParamTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(param1, freshParamTag));
+ strutsBodyTagsAreReflectionEqual(param1, freshParamTag));
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(param2, freshParamTag));
+ strutsBodyTagsAreReflectionEqual(param2, freshParamTag));
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(param3, freshParamTag));
+ strutsBodyTagsAreReflectionEqual(param3, freshParamTag));
// Basic sanity check of clearTagStateForTagPoolingServers() behaviour for Struts Tags after doEndTag().
AnchorTag freshTag = new AnchorTag();
freshTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
- /**
+ /**
*
* To test priority of parameter passed in to url component though
* various way, with includeParams="NONE"
*
- *
+ *
* - current request url
* - tag's value attribute
* - tag's nested param tag
@@ -559,6 +559,7 @@ public void testParametersPriorityWithIncludeParamsAsNONE() throws Exception {
* Those from request will not count, only those in tag's value attribute
* and nested param tag.
*
+ *
* @throws Exception
*/
public void testParametersPriorityWithIncludeParamsAsNONE_clearTagStateSet() throws Exception {
@@ -608,13 +609,13 @@ public void testParametersPriorityWithIncludeParamsAsNONE_clearTagStateSet() thr
freshParamTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(param1, freshParamTag));
+ strutsBodyTagsAreReflectionEqual(param1, freshParamTag));
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(param2, freshParamTag));
+ strutsBodyTagsAreReflectionEqual(param2, freshParamTag));
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(param3, freshParamTag));
+ strutsBodyTagsAreReflectionEqual(param3, freshParamTag));
// Basic sanity check of clearTagStateForTagPoolingServers() behaviour for Struts Tags after doEndTag().
AnchorTag freshTag = new AnchorTag();
@@ -622,7 +623,7 @@ public void testParametersPriorityWithIncludeParamsAsNONE_clearTagStateSet() thr
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testIncludeParamsDefaultToGET() throws Exception {
@@ -648,7 +649,7 @@ public void testIncludeParamsDefaultToGET() throws Exception {
freshTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testIncludeParamsDefaultToGET_clearTagStateSet() throws Exception {
@@ -677,7 +678,7 @@ public void testIncludeParamsDefaultToGET_clearTagStateSet() throws Exception {
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testActionURL2() throws Exception {
@@ -689,7 +690,7 @@ public void testActionURL2() throws Exception {
}
public void testAddParameters2() throws Exception {
- request.setAttribute("struts.request_uri", "/TestAction.action");
+ withRequestPath("/TestAction.action");
request.setQueryString("param0=value0");
tag.doStartTag();
@@ -719,21 +720,21 @@ public void testAddParameters2() throws Exception {
freshParamTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(param1, freshParamTag));
+ strutsBodyTagsAreReflectionEqual(param1, freshParamTag));
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(param2, freshParamTag));
+ strutsBodyTagsAreReflectionEqual(param2, freshParamTag));
// Basic sanity check of clearTagStateForTagPoolingServers() behaviour for Struts Tags after doEndTag().
AnchorTag freshTag = new AnchorTag();
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() under default tag clear state is inequal to new Tag with pageContext/parent set. " +
"For this test, tag only has pageContext set, so it should still be equal.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testAddParameters2_clearTagStateSet() throws Exception {
- request.setAttribute("struts.request_uri", "/TestAction.action");
+ withRequestPath("/TestAction.action");
request.setQueryString("param0=value0");
tag.setPerformClearTagStateForTagPoolingServers(true); // Explicitly request tag state clearing.
@@ -770,10 +771,10 @@ public void testAddParameters2_clearTagStateSet() throws Exception {
freshParamTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(param1, freshParamTag));
+ strutsBodyTagsAreReflectionEqual(param1, freshParamTag));
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(param2, freshParamTag));
+ strutsBodyTagsAreReflectionEqual(param2, freshParamTag));
// Basic sanity check of clearTagStateForTagPoolingServers() behaviour for Struts Tags after doEndTag().
AnchorTag freshTag = new AnchorTag();
@@ -781,7 +782,7 @@ public void testAddParameters2_clearTagStateSet() throws Exception {
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testEvaluateValue() throws Exception {
@@ -799,7 +800,7 @@ public void testEvaluateValue() throws Exception {
freshTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testEvaluateValue_clearTagStateSet() throws Exception {
@@ -820,7 +821,7 @@ public void testEvaluateValue_clearTagStateSet() throws Exception {
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testHttps() throws Exception {
@@ -839,7 +840,7 @@ public void testHttps() throws Exception {
freshTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testHttps_clearTagStateSet() throws Exception {
@@ -861,7 +862,7 @@ public void testHttps_clearTagStateSet() throws Exception {
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testAnchor() throws Exception {
@@ -881,7 +882,7 @@ public void testAnchor() throws Exception {
freshTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testAnchor_clearTagStateSet() throws Exception {
@@ -904,11 +905,11 @@ public void testAnchor_clearTagStateSet() throws Exception {
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testParamPrecedence() throws Exception {
- request.setRequestURI("/context/someAction.action");
+ withRequestPath("/context/someAction.action");
request.setQueryString("id=22&name=John");
AnchorTag anchor = new AnchorTag();
@@ -933,18 +934,18 @@ public void testParamPrecedence() throws Exception {
freshParamTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(paramTag, freshParamTag));
+ strutsBodyTagsAreReflectionEqual(paramTag, freshParamTag));
// Basic sanity check of clearTagStateForTagPoolingServers() behaviour for Struts Tags after doEndTag().
AnchorTag freshTag = new AnchorTag();
freshTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(anchor, freshTag));
+ strutsBodyTagsAreReflectionEqual(anchor, freshTag));
}
public void testParamPrecedence_clearTagStateSet() throws Exception {
- request.setRequestURI("/context/someAction.action");
+ withRequestPath("/context/someAction.action");
request.setQueryString("id=22&name=John");
AnchorTag anchor = new AnchorTag();
@@ -974,7 +975,7 @@ public void testParamPrecedence_clearTagStateSet() throws Exception {
freshParamTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(paramTag, freshParamTag));
+ strutsBodyTagsAreReflectionEqual(paramTag, freshParamTag));
// Basic sanity check of clearTagStateForTagPoolingServers() behaviour for Struts Tags after doEndTag().
AnchorTag freshTag = new AnchorTag();
@@ -982,11 +983,11 @@ public void testParamPrecedence_clearTagStateSet() throws Exception {
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(anchor, freshTag));
+ strutsBodyTagsAreReflectionEqual(anchor, freshTag));
}
public void testParamPrecedenceWithAnchor() throws Exception {
- request.setRequestURI("/context/someAction.action");
+ withRequestPath("/context/someAction.action");
request.setQueryString("id=22&name=John");
AnchorTag anchorTag = new AnchorTag();
@@ -1012,18 +1013,18 @@ public void testParamPrecedenceWithAnchor() throws Exception {
freshParamTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(paramTag, freshParamTag));
+ strutsBodyTagsAreReflectionEqual(paramTag, freshParamTag));
// Basic sanity check of clearTagStateForTagPoolingServers() behaviour for Struts Tags after doEndTag().
AnchorTag freshTag = new AnchorTag();
freshTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(anchorTag, freshTag));
+ strutsBodyTagsAreReflectionEqual(anchorTag, freshTag));
}
public void testParamPrecedenceWithAnchor_clearTagStateSet() throws Exception {
- request.setRequestURI("/context/someAction.action");
+ withRequestPath("/context/someAction.action");
request.setQueryString("id=22&name=John");
AnchorTag anchorTag = new AnchorTag();
@@ -1054,7 +1055,7 @@ public void testParamPrecedenceWithAnchor_clearTagStateSet() throws Exception {
freshParamTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(paramTag, freshParamTag));
+ strutsBodyTagsAreReflectionEqual(paramTag, freshParamTag));
// Basic sanity check of clearTagStateForTagPoolingServers() behaviour for Struts Tags after doEndTag().
AnchorTag freshTag = new AnchorTag();
@@ -1062,7 +1063,7 @@ public void testParamPrecedenceWithAnchor_clearTagStateSet() throws Exception {
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(anchorTag, freshTag));
+ strutsBodyTagsAreReflectionEqual(anchorTag, freshTag));
}
public void testUsingValueOnly() throws Exception {
@@ -1076,7 +1077,7 @@ public void testUsingValueOnly() throws Exception {
freshTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testUsingValueOnly_clearTagStateSet() throws Exception {
@@ -1093,7 +1094,7 @@ public void testUsingValueOnly_clearTagStateSet() throws Exception {
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testRequestURIActionIncludeNone() throws Exception {
@@ -1112,7 +1113,7 @@ public void testRequestURIActionIncludeNone() throws Exception {
freshTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testRequestURIActionIncludeNone_clearTagStateSet() throws Exception {
@@ -1134,7 +1135,7 @@ public void testRequestURIActionIncludeNone_clearTagStateSet() throws Exception
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testRequestURIActionIncludeGet() throws Exception {
@@ -1153,7 +1154,7 @@ public void testRequestURIActionIncludeGet() throws Exception {
freshTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testRequestURIActionIncludeGet_clearTagStateSet() throws Exception {
@@ -1175,7 +1176,7 @@ public void testRequestURIActionIncludeGet_clearTagStateSet() throws Exception {
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testRequestURIActionIncludeGetDoNotEscapeAmp() throws Exception {
@@ -1195,7 +1196,7 @@ public void testRequestURIActionIncludeGetDoNotEscapeAmp() throws Exception {
freshTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testRequestURIActionIncludeGetDoNotEscapeAmp_clearTagStateSet() throws Exception {
@@ -1218,11 +1219,11 @@ public void testRequestURIActionIncludeGetDoNotEscapeAmp_clearTagStateSet() thro
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testRequestURINoActionIncludeNone() throws Exception {
- request.setRequestURI("/public/about");
+ withRequestPath("/public/about.action");
request.setQueryString("section=team&company=acme inc");
tag.setAction(null);
@@ -1230,18 +1231,18 @@ public void testRequestURINoActionIncludeNone() throws Exception {
tag.doStartTag();
tag.doEndTag();
- assertEquals(wrapWithAnchor("/public/about"), writer.toString());
+ assertEquals(wrapWithAnchor("/public/about.action"), writer.toString());
// Basic sanity check of clearTagStateForTagPoolingServers() behaviour for Struts Tags after doEndTag().
AnchorTag freshTag = new AnchorTag();
freshTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testRequestURINoActionIncludeNone_clearTagStateSet() throws Exception {
- request.setRequestURI("/public/about");
+ withRequestPath("/public/about.action");
request.setQueryString("section=team&company=acme inc");
tag.setPerformClearTagStateForTagPoolingServers(true); // Explicitly request tag state clearing.
@@ -1251,7 +1252,7 @@ public void testRequestURINoActionIncludeNone_clearTagStateSet() throws Exceptio
setComponentTagClearTagState(tag, true); // Ensure component tag state clearing is set true (to match tag).
tag.doEndTag();
- assertEquals(wrapWithAnchor("/public/about"), writer.toString());
+ assertEquals(wrapWithAnchor("/public/about.action"), writer.toString());
// Basic sanity check of clearTagStateForTagPoolingServers() behaviour for Struts Tags after doEndTag().
AnchorTag freshTag = new AnchorTag();
@@ -1259,11 +1260,11 @@ public void testRequestURINoActionIncludeNone_clearTagStateSet() throws Exceptio
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testNoActionIncludeGet() throws Exception {
- request.setRequestURI("/public/about");
+ withRequestPath("/public/about.action");
request.setQueryString("section=team&company=acme inc");
tag.setAction(null);
@@ -1271,18 +1272,18 @@ public void testNoActionIncludeGet() throws Exception {
tag.doStartTag();
tag.doEndTag();
- assertEquals(wrapWithAnchor("/public/about?section=team&company=acme+inc"), writer.toString());
+ assertEquals(wrapWithAnchor("/public/about.action?section=team&company=acme+inc"), writer.toString());
// Basic sanity check of clearTagStateForTagPoolingServers() behaviour for Struts Tags after doEndTag().
AnchorTag freshTag = new AnchorTag();
freshTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testNoActionIncludeGet_clearTagStateSet() throws Exception {
- request.setRequestURI("/public/about");
+ withRequestPath("/public/about.action");
request.setQueryString("section=team&company=acme inc");
tag.setPerformClearTagStateForTagPoolingServers(true); // Explicitly request tag state clearing.
@@ -1292,7 +1293,7 @@ public void testNoActionIncludeGet_clearTagStateSet() throws Exception {
setComponentTagClearTagState(tag, true); // Ensure component tag state clearing is set true (to match tag).
tag.doEndTag();
- assertEquals(wrapWithAnchor("/public/about?section=team&company=acme+inc"), writer.toString());
+ assertEquals(wrapWithAnchor("/public/about.action?section=team&company=acme+inc"), writer.toString());
// Basic sanity check of clearTagStateForTagPoolingServers() behaviour for Struts Tags after doEndTag().
AnchorTag freshTag = new AnchorTag();
@@ -1300,7 +1301,7 @@ public void testNoActionIncludeGet_clearTagStateSet() throws Exception {
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testRequestURIActionIncludeAll() throws Exception {
@@ -1333,14 +1334,14 @@ public void testRequestURIActionIncludeAll() throws Exception {
freshParamTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(paramTag, freshParamTag));
+ strutsBodyTagsAreReflectionEqual(paramTag, freshParamTag));
// Basic sanity check of clearTagStateForTagPoolingServers() behaviour for Struts Tags after doEndTag().
AnchorTag freshTag = new AnchorTag();
freshTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testRequestURIActionIncludeAll_clearTagStateSet() throws Exception {
@@ -1374,11 +1375,11 @@ public void testRequestURIActionIncludeAll_clearTagStateSet() throws Exception {
// Basic sanity check of clearTagStateForTagPoolingServers() behaviour for Struts Tags after doEndTag().
ParamTag freshParamTag = new ParamTag();
- freshParamTag.setPerformClearTagStateForTagPoolingServers(true);
+ freshParamTag.setPerformClearTagStateForTagPoolingServers(true);
freshParamTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(paramTag, freshParamTag));
+ strutsBodyTagsAreReflectionEqual(paramTag, freshParamTag));
// Basic sanity check of clearTagStateForTagPoolingServers() behaviour for Struts Tags after doEndTag().
AnchorTag freshTag = new AnchorTag();
@@ -1386,11 +1387,11 @@ public void testRequestURIActionIncludeAll_clearTagStateSet() throws Exception {
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testRequestURINoActionIncludeAll() throws Exception {
- request.setRequestURI("/public/about");
+ withRequestPath("/public/about.action");
request.setQueryString("section=team&company=acme inc");
tag.setAction(null);
@@ -1409,7 +1410,7 @@ public void testRequestURINoActionIncludeAll() throws Exception {
tag.doEndTag();
String result = writer.toString();
- assertTrue(result.contains("/public/about?"));
+ assertTrue(result.contains("/public/about.action?"));
assertTrue(result.contains("section=team"));
assertTrue(result.contains("company=acme+inc"));
assertTrue(result.contains("year=2006"));
@@ -1419,18 +1420,18 @@ public void testRequestURINoActionIncludeAll() throws Exception {
freshParamTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(paramTag, freshParamTag));
+ strutsBodyTagsAreReflectionEqual(paramTag, freshParamTag));
// Basic sanity check of clearTagStateForTagPoolingServers() behaviour for Struts Tags after doEndTag().
AnchorTag freshTag = new AnchorTag();
freshTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testRequestURINoActionIncludeAll_clearTagStateSet() throws Exception {
- request.setRequestURI("/public/about");
+ withRequestPath("/public/about.action");
request.setQueryString("section=team&company=acme inc");
tag.setPerformClearTagStateForTagPoolingServers(true); // Explicitly request tag state clearing.
@@ -1453,7 +1454,7 @@ public void testRequestURINoActionIncludeAll_clearTagStateSet() throws Exception
tag.doEndTag();
String result = writer.toString();
- assertTrue(result.contains("/public/about?"));
+ assertTrue(result.contains("/public/about.action?"));
assertTrue(result.contains("section=team"));
assertTrue(result.contains("company=acme+inc"));
assertTrue(result.contains("year=2006"));
@@ -1464,7 +1465,7 @@ public void testRequestURINoActionIncludeAll_clearTagStateSet() throws Exception
freshParamTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(paramTag, freshParamTag));
+ strutsBodyTagsAreReflectionEqual(paramTag, freshParamTag));
// Basic sanity check of clearTagStateForTagPoolingServers() behaviour for Struts Tags after doEndTag().
AnchorTag freshTag = new AnchorTag();
@@ -1472,28 +1473,28 @@ public void testRequestURINoActionIncludeAll_clearTagStateSet() throws Exception
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testUnknownIncludeParam() throws Exception {
- request.setRequestURI("/public/about");
+ withRequestPath("/public/about.action");
request.setQueryString("section=team");
tag.setIncludeParams("unknown"); // will log at WARN level
tag.doStartTag();
tag.doEndTag();
- assertEquals(wrapWithAnchor("/public/about"), writer.toString()); // should not add any request parameters
+ assertEquals(wrapWithAnchor("/public/about.action"), writer.toString()); // should not add any request parameters
// Basic sanity check of clearTagStateForTagPoolingServers() behaviour for Struts Tags after doEndTag().
AnchorTag freshTag = new AnchorTag();
freshTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testUnknownIncludeParam_clearTagStateSet() throws Exception {
- request.setRequestURI("/public/about");
+ withRequestPath("/public/about.action");
request.setQueryString("section=team");
tag.setPerformClearTagStateForTagPoolingServers(true); // Explicitly request tag state clearing.
@@ -1501,7 +1502,7 @@ public void testUnknownIncludeParam_clearTagStateSet() throws Exception {
tag.doStartTag();
setComponentTagClearTagState(tag, true); // Ensure component tag state clearing is set true (to match tag).
tag.doEndTag();
- assertEquals(wrapWithAnchor("/public/about"), writer.toString()); // should not add any request parameters
+ assertEquals(wrapWithAnchor("/public/about.action"), writer.toString()); // should not add any request parameters
// Basic sanity check of clearTagStateForTagPoolingServers() behaviour for Struts Tags after doEndTag().
AnchorTag freshTag = new AnchorTag();
@@ -1509,7 +1510,7 @@ public void testUnknownIncludeParam_clearTagStateSet() throws Exception {
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testRequestURIWithAnchor() throws Exception {
@@ -1528,10 +1529,10 @@ public void testRequestURIWithAnchor() throws Exception {
freshTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
- public void testRequestURIWithAnchor_clearTagStateSet() throws Exception {
+ public void testRequestURIWithAnchor_clearTagStateSet() throws Exception {
request.setRequestURI("/public/about");
request.setQueryString("company=acme inc#canada");
@@ -1550,7 +1551,7 @@ public void testRequestURIWithAnchor_clearTagStateSet() throws Exception {
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testIncludeContext() throws Exception {
@@ -1568,7 +1569,7 @@ public void testIncludeContext() throws Exception {
freshTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testIncludeContext_clearTagStateSet() throws Exception {
@@ -1589,7 +1590,7 @@ public void testIncludeContext_clearTagStateSet() throws Exception {
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testForceAddSchemeHostAndPort() throws Exception {
@@ -1605,7 +1606,7 @@ public void testForceAddSchemeHostAndPort() throws Exception {
freshTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testForceAddSchemeHostAndPort_clearTagStateSet() throws Exception {
@@ -1624,7 +1625,7 @@ public void testForceAddSchemeHostAndPort_clearTagStateSet() throws Exception {
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
private String wrapWithAnchor(String href) {
diff --git a/core/src/test/java/org/apache/struts2/views/jsp/URLTagTest.java b/core/src/test/java/org/apache/struts2/views/jsp/URLTagTest.java
index 2a06a65b17..fc9fbe7575 100644
--- a/core/src/test/java/org/apache/struts2/views/jsp/URLTagTest.java
+++ b/core/src/test/java/org/apache/struts2/views/jsp/URLTagTest.java
@@ -18,18 +18,13 @@
*/
package org.apache.struts2.views.jsp;
-import java.io.File;
-import java.io.StringWriter;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Locale;
-import java.util.Map;
-
-import javax.servlet.http.HttpSession;
-import javax.servlet.jsp.JspWriter;
-
+import com.mockobjects.dynamic.Mock;
+import com.mockobjects.servlet.MockBodyContent;
+import com.opensymphony.xwork2.ActionContext;
+import com.opensymphony.xwork2.ActionProxy;
+import com.opensymphony.xwork2.DefaultActionInvocation;
+import com.opensymphony.xwork2.DefaultActionProxyFactory;
+import com.opensymphony.xwork2.inject.Container;
import org.apache.struts2.ServletActionContext;
import org.apache.struts2.components.URL;
import org.apache.struts2.dispatcher.ApplicationMap;
@@ -40,17 +35,18 @@
import org.apache.struts2.dispatcher.mapper.ActionMapping;
import org.apache.struts2.dispatcher.mapper.DefaultActionMapper;
-import com.mockobjects.dynamic.Mock;
-import com.mockobjects.servlet.MockBodyContent;
-import com.opensymphony.xwork2.ActionContext;
-import com.opensymphony.xwork2.ActionProxy;
-import com.opensymphony.xwork2.DefaultActionInvocation;
-import com.opensymphony.xwork2.DefaultActionProxyFactory;
-import com.opensymphony.xwork2.inject.Container;
+import javax.servlet.http.HttpSession;
+import javax.servlet.jsp.JspWriter;
+import java.io.File;
+import java.io.StringWriter;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
/**
* Unit test for {@link URLTag}.
- *
*/
public class URLTagTest extends AbstractUITagTest {
@@ -60,43 +56,43 @@ public class URLTagTest extends AbstractUITagTest {
/**
* To test priority of parameter passed in to url component though
* various way
- * - current request url
- * - tag's value attribute
- * - tag's nested param tag
- *
+ * - current request url
+ * - tag's value attribute
+ * - tag's nested param tag
+ *
* id1
* ===
* - found in current request url
* - found in tag's value attribute
* - found in tag's param tag
* CONCLUSION: tag's param tag takes precedence (paramId1)
- *
+ *
* id2
* ===
* - found in current request url
* - found in tag's value attribute
* CONCLUSION: tag's value attribute take precedence (tagId2)
- *
+ *
* urlParam1
* =========
* - found in current request url
* CONCLUSION: param in current request url will be used (urlValue1)
- *
+ *
* urlParam2
* =========
* - found in current request url
* CONCLUSION: param in current request url will be used. (urlValue2)
- *
+ *
* tagId
* =====
* - found in tag's value attribute
* CONCLUSION: param in tag's value attribute wil; be used. (tagValue)
- *
+ *
* param1
* ======
* - found in nested param tag
* CONCLUSION: param in nested param tag will be used. (param1value)
- *
+ *
* param2
* ======
* - found in nested param tag
@@ -152,62 +148,62 @@ public void testParametersPriority() throws Exception {
freshParamTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(param1, freshParamTag));
+ strutsBodyTagsAreReflectionEqual(param1, freshParamTag));
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(param2, freshParamTag));
+ strutsBodyTagsAreReflectionEqual(param2, freshParamTag));
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(param3, freshParamTag));
+ strutsBodyTagsAreReflectionEqual(param3, freshParamTag));
// Basic sanity check of clearTagStateForTagPoolingServers() behaviour for Struts Tags after doEndTag().
URLTag freshTag = new URLTag();
freshTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
/**
* To test priority of parameter passed in to url component though
* various way
- * - current request url
- * - tag's value attribute
- * - tag's nested param tag
- *
+ * - current request url
+ * - tag's value attribute
+ * - tag's nested param tag
+ *
* id1
* ===
* - found in current request url
* - found in tag's value attribute
* - found in tag's param tag
* CONCLUSION: tag's param tag takes precedence (paramId1)
- *
+ *
* id2
* ===
* - found in current request url
* - found in tag's value attribute
* CONCLUSION: tag's value attribute take precedence (tagId2)
- *
+ *
* urlParam1
* =========
* - found in current request url
* CONCLUSION: param in current request url will be used (urlValue1)
- *
+ *
* urlParam2
* =========
* - found in current request url
* CONCLUSION: param in current request url will be used. (urlValue2)
- *
+ *
* tagId
* =====
* - found in tag's value attribute
* CONCLUSION: param in tag's value attribute wil; be used. (tagValue)
- *
+ *
* param1
* ======
* - found in nested param tag
* CONCLUSION: param in nested param tag will be used. (param1value)
- *
+ *
* param2
* ======
* - found in nested param tag
@@ -272,13 +268,13 @@ public void testParametersPriority_clearTagStateSet() throws Exception {
freshParamTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(param1, freshParamTag));
+ strutsBodyTagsAreReflectionEqual(param1, freshParamTag));
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(param2, freshParamTag));
+ strutsBodyTagsAreReflectionEqual(param2, freshParamTag));
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(param3, freshParamTag));
+ strutsBodyTagsAreReflectionEqual(param3, freshParamTag));
// Basic sanity check of clearTagStateForTagPoolingServers() behaviour for Struts Tags after doEndTag().
URLTag freshTag = new URLTag();
@@ -286,7 +282,7 @@ public void testParametersPriority_clearTagStateSet() throws Exception {
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
/**
@@ -303,10 +299,10 @@ public void testIterableParameters() throws Exception {
tag.component.addParameter("p1", list);
//String[]
- tag.component.addParameter("p2", new String[] { "d", "e" });
+ tag.component.addParameter("p2", new String[]{"d", "e"});
//ValueHolder[]
- tag.component.addParameter("p3", new ValueHolder[] {
- new ValueHolder("f"), new ValueHolder("g") });
+ tag.component.addParameter("p3", new ValueHolder[]{
+ new ValueHolder("f"), new ValueHolder("g")});
tag.doEndTag();
@@ -317,11 +313,12 @@ public void testIterableParameters() throws Exception {
freshTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
/**
* Use Iterable values as the value of the param tags
+ *
* @throws Exception
*/
public void testIterableParameters_clearTagStateSet() throws Exception {
@@ -337,10 +334,10 @@ public void testIterableParameters_clearTagStateSet() throws Exception {
tag.component.addParameter("p1", list);
//String[]
- tag.component.addParameter("p2", new String[] { "d", "e" });
+ tag.component.addParameter("p2", new String[]{"d", "e"});
//ValueHolder[]
- tag.component.addParameter("p3", new ValueHolder[] {
- new ValueHolder("f"), new ValueHolder("g") });
+ tag.component.addParameter("p3", new ValueHolder[]{
+ new ValueHolder("f"), new ValueHolder("g")});
tag.doEndTag();
@@ -352,19 +349,19 @@ public void testIterableParameters_clearTagStateSet() throws Exception {
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
/**
* To test priority of parameter passed in to url component though
* various way, with includeParams="NONE"
- * - current request url
- * - tag's value attribute
- * - tag's nested param tag
- *
- * In this case only parameters from the tag itself is taken into account.
- * Those from request will not count, only those in tag's value attribute
- * and nested param tag.
+ * - current request url
+ * - tag's value attribute
+ * - tag's nested param tag
+ *
+ * In this case only parameters from the tag itself is taken into account.
+ * Those from request will not count, only those in tag's value attribute
+ * and nested param tag.
*/
public void testParametersPriorityWithIncludeParamsAsNONE() throws Exception {
request.setQueryString("id1=urlId1&id2=urlId2&urlParam1=urlValue1&urlParam2=urlValue2");
@@ -412,32 +409,32 @@ public void testParametersPriorityWithIncludeParamsAsNONE() throws Exception {
freshParamTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(param1, freshParamTag));
+ strutsBodyTagsAreReflectionEqual(param1, freshParamTag));
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(param2, freshParamTag));
+ strutsBodyTagsAreReflectionEqual(param2, freshParamTag));
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(param3, freshParamTag));
+ strutsBodyTagsAreReflectionEqual(param3, freshParamTag));
// Basic sanity check of clearTagStateForTagPoolingServers() behaviour for Struts Tags after doEndTag().
URLTag freshTag = new URLTag();
freshTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
/**
* To test priority of parameter passed in to url component though
* various way, with includeParams="NONE"
- * - current request url
- * - tag's value attribute
- * - tag's nested param tag
- *
- * In this case only parameters from the tag itself is taken into account.
- * Those from request will not count, only those in tag's value attribute
- * and nested param tag.
+ * - current request url
+ * - tag's value attribute
+ * - tag's nested param tag
+ *
+ * In this case only parameters from the tag itself is taken into account.
+ * Those from request will not count, only those in tag's value attribute
+ * and nested param tag.
*
* @throws Exception
*/
@@ -496,13 +493,13 @@ public void testParametersPriorityWithIncludeParamsAsNONE_clearTagStateSet() thr
freshParamTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(param1, freshParamTag));
+ strutsBodyTagsAreReflectionEqual(param1, freshParamTag));
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(param2, freshParamTag));
+ strutsBodyTagsAreReflectionEqual(param2, freshParamTag));
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(param3, freshParamTag));
+ strutsBodyTagsAreReflectionEqual(param3, freshParamTag));
// Basic sanity check of clearTagStateForTagPoolingServers() behaviour for Struts Tags after doEndTag().
URLTag freshTag = new URLTag();
@@ -510,7 +507,7 @@ public void testParametersPriorityWithIncludeParamsAsNONE_clearTagStateSet() thr
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testIncludeParamsDefaultToGET() throws Exception {
@@ -542,7 +539,7 @@ public void testIncludeParamsDefaultToGET() throws Exception {
freshTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testIncludeParamsDefaultToGET_clearTagStateSet() throws Exception {
@@ -577,7 +574,7 @@ public void testIncludeParamsDefaultToGET_clearTagStateSet() throws Exception {
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testActionURL() throws Exception {
@@ -592,7 +589,7 @@ public void testActionURL() throws Exception {
freshTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testActionURL_clearTagStateSet() throws Exception {
@@ -610,13 +607,11 @@ public void testActionURL_clearTagStateSet() throws Exception {
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testAddParameters() throws Exception {
- request.setAttribute("struts.request_uri", "/Test.action");
-
- request.setAttribute("struts.request_uri", "/TestAction.action");
+ withRequestPath("/TestAction.action");
request.setQueryString("param0=value0");
tag.doStartTag();
@@ -631,13 +626,11 @@ public void testAddParameters() throws Exception {
// URLTag clears component in doEndTag and has no additional state set here, so it compares as equal with the default tag clear state as well.
assertTrue("Tag state after doEndTag() under default tag clear state is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testAddParameters_clearTagStateSet() throws Exception {
- request.setAttribute("struts.request_uri", "/Test.action");
-
- request.setAttribute("struts.request_uri", "/TestAction.action");
+ withRequestPath("/TestAction.action");
request.setQueryString("param0=value0");
tag.setPerformClearTagStateForTagPoolingServers(true); // Explicitly request tag state clearing.
@@ -654,7 +647,7 @@ public void testAddParameters_clearTagStateSet() throws Exception {
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testEvaluateValue() throws Exception {
@@ -672,7 +665,7 @@ public void testEvaluateValue() throws Exception {
freshTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testEvaluateValue_clearTagStateSet() throws Exception {
@@ -693,7 +686,7 @@ public void testEvaluateValue_clearTagStateSet() throws Exception {
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testHttps() throws Exception {
@@ -712,7 +705,7 @@ public void testHttps() throws Exception {
freshTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testHttps_clearTagStateSet() throws Exception {
@@ -734,7 +727,7 @@ public void testHttps_clearTagStateSet() throws Exception {
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testAnchor() throws Exception {
@@ -754,7 +747,7 @@ public void testAnchor() throws Exception {
freshTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testAnchor_clearTagStateSet() throws Exception {
@@ -777,11 +770,11 @@ public void testAnchor_clearTagStateSet() throws Exception {
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testParamPrecedence() throws Exception {
- request.setRequestURI("/context/someAction.action");
+ withRequestPath("/context/someAction.action");
request.setQueryString("id=22&name=John");
URLTag urlTag = new URLTag();
@@ -806,18 +799,18 @@ public void testParamPrecedence() throws Exception {
freshParamTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(paramTag, freshParamTag));
+ strutsBodyTagsAreReflectionEqual(paramTag, freshParamTag));
// Basic sanity check of clearTagStateForTagPoolingServers() behaviour for Struts Tags after doEndTag().
URLTag freshTag = new URLTag();
freshTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(urlTag, freshTag));
+ strutsBodyTagsAreReflectionEqual(urlTag, freshTag));
}
public void testParamPrecedence_clearTagStateSet() throws Exception {
- request.setRequestURI("/context/someAction.action");
+ withRequestPath("/context/someAction.action");
request.setQueryString("id=22&name=John");
URLTag urlTag = new URLTag();
@@ -847,7 +840,7 @@ public void testParamPrecedence_clearTagStateSet() throws Exception {
freshParamTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(paramTag, freshParamTag));
+ strutsBodyTagsAreReflectionEqual(paramTag, freshParamTag));
// Basic sanity check of clearTagStateForTagPoolingServers() behaviour for Struts Tags after doEndTag().
URLTag freshTag = new URLTag();
@@ -855,11 +848,11 @@ public void testParamPrecedence_clearTagStateSet() throws Exception {
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(urlTag, freshTag));
+ strutsBodyTagsAreReflectionEqual(urlTag, freshTag));
}
public void testParamPrecedenceWithAnchor() throws Exception {
- request.setRequestURI("/context/someAction.action");
+ withRequestPath("/context/someAction.action");
request.setQueryString("id=22&name=John");
URLTag urlTag = new URLTag();
@@ -885,18 +878,18 @@ public void testParamPrecedenceWithAnchor() throws Exception {
freshParamTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(paramTag, freshParamTag));
+ strutsBodyTagsAreReflectionEqual(paramTag, freshParamTag));
// Basic sanity check of clearTagStateForTagPoolingServers() behaviour for Struts Tags after doEndTag().
URLTag freshTag = new URLTag();
freshTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(urlTag, freshTag));
+ strutsBodyTagsAreReflectionEqual(urlTag, freshTag));
}
public void testParamPrecedenceWithAnchor_clearTagStateSet() throws Exception {
- request.setRequestURI("/context/someAction.action");
+ withRequestPath("/context/someAction.action");
request.setQueryString("id=22&name=John");
URLTag urlTag = new URLTag();
@@ -927,7 +920,7 @@ public void testParamPrecedenceWithAnchor_clearTagStateSet() throws Exception {
freshParamTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(paramTag, freshParamTag));
+ strutsBodyTagsAreReflectionEqual(paramTag, freshParamTag));
// Basic sanity check of clearTagStateForTagPoolingServers() behaviour for Struts Tags after doEndTag().
URLTag freshTag = new URLTag();
@@ -935,7 +928,7 @@ public void testParamPrecedenceWithAnchor_clearTagStateSet() throws Exception {
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(urlTag, freshTag));
+ strutsBodyTagsAreReflectionEqual(urlTag, freshTag));
}
public void testPutId() throws Exception {
@@ -952,7 +945,7 @@ public void testPutId() throws Exception {
freshTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testPutId_clearTagStateSet() throws Exception {
@@ -972,7 +965,7 @@ public void testPutId_clearTagStateSet() throws Exception {
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testUsingValueOnly() throws Exception {
@@ -986,7 +979,7 @@ public void testUsingValueOnly() throws Exception {
freshTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testUsingValueOnly_clearTagStateSet() throws Exception {
@@ -1003,7 +996,7 @@ public void testUsingValueOnly_clearTagStateSet() throws Exception {
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testRequestURIActionIncludeNone() throws Exception {
@@ -1022,7 +1015,7 @@ public void testRequestURIActionIncludeNone() throws Exception {
freshTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testRequestURIActionIncludeNone_clearTagStateSet() throws Exception {
@@ -1044,7 +1037,7 @@ public void testRequestURIActionIncludeNone_clearTagStateSet() throws Exception
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testRequestURIActionIncludeGet() throws Exception {
@@ -1063,7 +1056,7 @@ public void testRequestURIActionIncludeGet() throws Exception {
freshTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testRequestURIActionIncludeGet_clearTagStateSet() throws Exception {
@@ -1085,7 +1078,7 @@ public void testRequestURIActionIncludeGet_clearTagStateSet() throws Exception {
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testRequestURIActionIncludeGetDoNotEscapeAmp() throws Exception {
@@ -1105,7 +1098,7 @@ public void testRequestURIActionIncludeGetDoNotEscapeAmp() throws Exception {
freshTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testRequestURIActionIncludeGetDoNotEscapeAmp_clearTagStateSet() throws Exception {
@@ -1128,11 +1121,11 @@ public void testRequestURIActionIncludeGetDoNotEscapeAmp_clearTagStateSet() thro
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testRequestURINoActionIncludeNone() throws Exception {
- request.setRequestURI("/public/about");
+ withRequestPath("/public/about.action");
request.setQueryString("section=team&company=acme inc");
tag.setAction(null);
@@ -1140,18 +1133,18 @@ public void testRequestURINoActionIncludeNone() throws Exception {
tag.doStartTag();
tag.doEndTag();
- assertEquals("/public/about", writer.toString());
+ assertEquals("/public/about.action", writer.toString());
// Basic sanity check of clearTagStateForTagPoolingServers() behaviour for Struts Tags after doEndTag().
URLTag freshTag = new URLTag();
freshTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testRequestURINoActionIncludeNone_clearTagStateSet() throws Exception {
- request.setRequestURI("/public/about");
+ withRequestPath("/public/about.action");
request.setQueryString("section=team&company=acme inc");
tag.setPerformClearTagStateForTagPoolingServers(true); // Explicitly request tag state clearing.
@@ -1161,7 +1154,7 @@ public void testRequestURINoActionIncludeNone_clearTagStateSet() throws Exceptio
setComponentTagClearTagState(tag, true); // Ensure component tag state clearing is set true (to match tag).
tag.doEndTag();
- assertEquals("/public/about", writer.toString());
+ assertEquals("/public/about.action", writer.toString());
// Basic sanity check of clearTagStateForTagPoolingServers() behaviour for Struts Tags after doEndTag().
URLTag freshTag = new URLTag();
@@ -1169,11 +1162,11 @@ public void testRequestURINoActionIncludeNone_clearTagStateSet() throws Exceptio
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testNoActionIncludeGet() throws Exception {
- request.setRequestURI("/public/about");
+ withRequestPath("/public/about.action");
request.setQueryString("section=team&company=acme inc");
tag.setAction(null);
@@ -1181,18 +1174,18 @@ public void testNoActionIncludeGet() throws Exception {
tag.doStartTag();
tag.doEndTag();
- assertEquals("/public/about?section=team&company=acme+inc", writer.toString());
+ assertEquals("/public/about.action?section=team&company=acme+inc", writer.toString());
// Basic sanity check of clearTagStateForTagPoolingServers() behaviour for Struts Tags after doEndTag().
URLTag freshTag = new URLTag();
freshTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testNoActionIncludeGet_clearTagStateSet() throws Exception {
- request.setRequestURI("/public/about");
+ withRequestPath("/public/about.action");
request.setQueryString("section=team&company=acme inc");
tag.setPerformClearTagStateForTagPoolingServers(true); // Explicitly request tag state clearing.
@@ -1202,7 +1195,7 @@ public void testNoActionIncludeGet_clearTagStateSet() throws Exception {
setComponentTagClearTagState(tag, true); // Ensure component tag state clearing is set true (to match tag).
tag.doEndTag();
- assertEquals("/public/about?section=team&company=acme+inc", writer.toString());
+ assertEquals("/public/about.action?section=team&company=acme+inc", writer.toString());
// Basic sanity check of clearTagStateForTagPoolingServers() behaviour for Struts Tags after doEndTag().
URLTag freshTag = new URLTag();
@@ -1210,7 +1203,7 @@ public void testNoActionIncludeGet_clearTagStateSet() throws Exception {
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testRequestURIActionIncludeAll() throws Exception {
@@ -1239,14 +1232,14 @@ public void testRequestURIActionIncludeAll() throws Exception {
freshParamTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(paramTag, freshParamTag));
+ strutsBodyTagsAreReflectionEqual(paramTag, freshParamTag));
// Basic sanity check of clearTagStateForTagPoolingServers() behaviour for Struts Tags after doEndTag().
URLTag freshTag = new URLTag();
freshTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testRequestURIActionIncludeAll_clearTagStateSet() throws Exception {
@@ -1280,7 +1273,7 @@ public void testRequestURIActionIncludeAll_clearTagStateSet() throws Exception {
freshParamTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(paramTag, freshParamTag));
+ strutsBodyTagsAreReflectionEqual(paramTag, freshParamTag));
// Basic sanity check of clearTagStateForTagPoolingServers() behaviour for Struts Tags after doEndTag().
URLTag freshTag = new URLTag();
@@ -1288,11 +1281,11 @@ public void testRequestURIActionIncludeAll_clearTagStateSet() throws Exception {
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testRequestURINoActionIncludeAll() throws Exception {
- request.setRequestURI("/public/about");
+ withRequestPath("/public/about.action");
request.setQueryString("section=team&company=acme inc");
tag.setAction(null);
@@ -1310,25 +1303,25 @@ public void testRequestURINoActionIncludeAll() throws Exception {
tag.doEndTag();
- assertEquals("/public/about?section=team&company=acme+inc&year=2006", writer.toString());
+ assertEquals("/public/about.action?section=team&company=acme+inc&year=2006", writer.toString());
// Basic sanity check of clearTagStateForTagPoolingServers() behaviour for Struts Tags after doEndTag().
ParamTag freshParamTag = new ParamTag();
freshParamTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(paramTag, freshParamTag));
+ strutsBodyTagsAreReflectionEqual(paramTag, freshParamTag));
// Basic sanity check of clearTagStateForTagPoolingServers() behaviour for Struts Tags after doEndTag().
URLTag freshTag = new URLTag();
freshTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testRequestURINoActionIncludeAll_clearTagStateSet() throws Exception {
- request.setRequestURI("/public/about");
+ withRequestPath("/public/about.action");
request.setQueryString("section=team&company=acme inc");
tag.setPerformClearTagStateForTagPoolingServers(true); // Explicitly request tag state clearing.
@@ -1350,7 +1343,7 @@ public void testRequestURINoActionIncludeAll_clearTagStateSet() throws Exception
tag.doEndTag();
- assertEquals("/public/about?section=team&company=acme+inc&year=2006", writer.toString());
+ assertEquals("/public/about.action?section=team&company=acme+inc&year=2006", writer.toString());
// Basic sanity check of clearTagStateForTagPoolingServers() behaviour for Struts Tags after doEndTag().
ParamTag freshParamTag = new ParamTag();
@@ -1358,7 +1351,7 @@ public void testRequestURINoActionIncludeAll_clearTagStateSet() throws Exception
freshParamTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(paramTag, freshParamTag));
+ strutsBodyTagsAreReflectionEqual(paramTag, freshParamTag));
// Basic sanity check of clearTagStateForTagPoolingServers() behaviour for Struts Tags after doEndTag().
URLTag freshTag = new URLTag();
@@ -1366,28 +1359,28 @@ public void testRequestURINoActionIncludeAll_clearTagStateSet() throws Exception
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testUnknownIncludeParam() throws Exception {
- request.setRequestURI("/public/about");
+ withRequestPath("/public/about.action");
request.setQueryString("section=team");
tag.setIncludeParams("unknown"); // will log at WARN level
tag.doStartTag();
tag.doEndTag();
- assertEquals("/public/about", writer.toString()); // should not add any request parameters
+ assertEquals("/public/about.action", writer.toString()); // should not add any request parameters
// Basic sanity check of clearTagStateForTagPoolingServers() behaviour for Struts Tags after doEndTag().
URLTag freshTag = new URLTag();
freshTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testUnknownIncludeParam_clearTagStateSet() throws Exception {
- request.setRequestURI("/public/about");
+ withRequestPath("/public/about.action");
request.setQueryString("section=team");
tag.setPerformClearTagStateForTagPoolingServers(true); // Explicitly request tag state clearing.
@@ -1395,7 +1388,7 @@ public void testUnknownIncludeParam_clearTagStateSet() throws Exception {
tag.doStartTag();
setComponentTagClearTagState(tag, true); // Ensure component tag state clearing is set true (to match tag).
tag.doEndTag();
- assertEquals("/public/about", writer.toString()); // should not add any request parameters
+ assertEquals("/public/about.action", writer.toString()); // should not add any request parameters
// Basic sanity check of clearTagStateForTagPoolingServers() behaviour for Struts Tags after doEndTag().
URLTag freshTag = new URLTag();
@@ -1403,7 +1396,7 @@ public void testUnknownIncludeParam_clearTagStateSet() throws Exception {
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testRequestURIWithAnchor() throws Exception {
@@ -1422,7 +1415,7 @@ public void testRequestURIWithAnchor() throws Exception {
freshTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testRequestURIWithAnchor_clearTagStateSet() throws Exception {
@@ -1444,7 +1437,7 @@ public void testRequestURIWithAnchor_clearTagStateSet() throws Exception {
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testIncludeContext() throws Exception {
@@ -1462,7 +1455,7 @@ public void testIncludeContext() throws Exception {
freshTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testIncludeContext_clearTagStateSet() throws Exception {
@@ -1483,7 +1476,7 @@ public void testIncludeContext_clearTagStateSet() throws Exception {
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testForceAddSchemeHostAndPort() throws Exception {
@@ -1499,7 +1492,7 @@ public void testForceAddSchemeHostAndPort() throws Exception {
freshTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testForceAddSchemeHostAndPort_clearTagStateSet() throws Exception {
@@ -1518,11 +1511,11 @@ public void testForceAddSchemeHostAndPort_clearTagStateSet() throws Exception {
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testEmptyActionCustomMapper() throws Exception {
- Map props = new HashMap<>();
+ Map props = new HashMap<>();
props.put("config", "struts-default.xml,struts-plugin.xml,struts.xml,org/apache/struts2/views/jsp/WW3090-struts.xml");
this.tearDown();
@@ -1558,11 +1551,11 @@ public void testEmptyActionCustomMapper() throws Exception {
session = new SessionMap(request);
Map extraContext = du.createContextMap(new RequestMap(request),
- HttpParameters.create(request.getParameterMap()).build(),
- session,
- new ApplicationMap(pageContext.getServletContext()),
- request,
- response);
+ HttpParameters.create(request.getParameterMap()).build(),
+ session,
+ new ApplicationMap(pageContext.getServletContext()),
+ request,
+ response);
// let's not set the locale -- there is a test that checks if Dispatcher actually picks this up...
// ... but generally we want to just use no locale (let it stay system default)
ActionContext.of(extraContext).withLocale(null);
@@ -1609,7 +1602,7 @@ public void testEmptyActionCustomMapper() throws Exception {
// URLTag clears component in doEndTag and has no additional state set here, so it compares as equal with the default tag clear state as well.
assertTrue("Tag state after doEndTag() under default tag clear state is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
writer = new StringWriter();
jspWriter = new StrutsMockJspWriter(writer);
@@ -1624,7 +1617,7 @@ public void testEmptyActionCustomMapper() throws Exception {
// URLTag clears component in doEndTag and has no additional state set here, so it compares as equal with the default tag clear state as well.
assertTrue("Tag state after doEndTag() under default tag clear state is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
writer = new StringWriter();
jspWriter = new StrutsMockJspWriter(writer);
@@ -1639,11 +1632,11 @@ public void testEmptyActionCustomMapper() throws Exception {
// URLTag clears component in doEndTag and has no additional state set here, so it compares as equal with the default tag clear state as well.
assertTrue("Tag state after doEndTag() under default tag clear state is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testEmptyActionCustomMapper_clearTagStateSet() throws Exception {
- Map props = new HashMap();
+ Map props = new HashMap();
props.put("config", "struts-default.xml,struts-plugin.xml,struts.xml,org/apache/struts2/views/jsp/WW3090-struts.xml");
this.tearDown();
@@ -1676,11 +1669,11 @@ public void testEmptyActionCustomMapper_clearTagStateSet() throws Exception {
session = new SessionMap(request);
Map extraContext = du.createContextMap(new RequestMap(request),
- HttpParameters.create(request.getParameterMap()).build(),
- session,
- new ApplicationMap(pageContext.getServletContext()),
- request,
- response);
+ HttpParameters.create(request.getParameterMap()).build(),
+ session,
+ new ApplicationMap(pageContext.getServletContext()),
+ request,
+ response);
// let's not set the locale -- there is a test that checks if Dispatcher actually picks this up...
// ... but generally we want to just use no locale (let it stay system default)
extraContext = ActionContext.of(extraContext).withLocale(null).getContextMap();
@@ -1725,7 +1718,7 @@ public void testEmptyActionCustomMapper_clearTagStateSet() throws Exception {
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
writer = new StringWriter();
jspWriter = new StrutsMockJspWriter(writer);
@@ -1740,7 +1733,7 @@ public void testEmptyActionCustomMapper_clearTagStateSet() throws Exception {
// Basic sanity check of clearTagStateForTagPoolingServers() behaviour for Struts Tags after doEndTag().
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
writer = new StringWriter();
jspWriter = new StrutsMockJspWriter(writer);
@@ -1755,181 +1748,181 @@ public void testEmptyActionCustomMapper_clearTagStateSet() throws Exception {
// Basic sanity check of clearTagStateForTagPoolingServers() behaviour for Struts Tags after doEndTag().
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
- public void testEmbeddedParamTagExpressionGetsEvaluatedCorrectly() throws Exception {
- request.setRequestURI("/public/about");
- request.setQueryString("section=team&company=acme inc");
-
- tag.setAction("team");
- tag.setIncludeParams("all");
-
- tag.doStartTag();
-
- Foo foo = new Foo("test");
- stack.push(foo);
-
- // include nested param tag
- ParamTag paramTag = new ParamTag();
- paramTag.setPageContext(pageContext);
- paramTag.setName("title");
- paramTag.setValue("%{title}");
- paramTag.doStartTag();
- paramTag.doEndTag();
-
- tag.doEndTag();
-
- assertEquals("/team.action?section=team&company=acme+inc&title=test", writer.toString());
-
- // Basic sanity check of clearTagStateForTagPoolingServers() behaviour for Struts Tags after doEndTag().
- ParamTag freshParamTag = new ParamTag();
- freshParamTag.setPageContext(pageContext);
- assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
- "May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(paramTag, freshParamTag));
-
- // Basic sanity check of clearTagStateForTagPoolingServers() behaviour for Struts Tags after doEndTag().
- URLTag freshTag = new URLTag();
- freshTag.setPageContext(pageContext);
- assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
- "May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
- }
-
- public void testEmbeddedParamTagExpressionGetsEvaluatedCorrectly_clearTagStateSet() throws Exception {
- request.setRequestURI("/public/about");
- request.setQueryString("section=team&company=acme inc");
-
- tag.setPerformClearTagStateForTagPoolingServers(true); // Explicitly request tag state clearing.
- tag.setAction("team");
- tag.setIncludeParams("all");
-
- tag.doStartTag();
- setComponentTagClearTagState(tag, true); // Ensure component tag state clearing is set true (to match tag).
-
- Foo foo = new Foo("test");
- stack.push(foo);
-
- // include nested param tag
- ParamTag paramTag = new ParamTag();
- paramTag.setPerformClearTagStateForTagPoolingServers(true); // Explicitly request tag state clearing.
- paramTag.setPageContext(pageContext);
- paramTag.setName("title");
- paramTag.setValue("%{title}");
- paramTag.doStartTag();
- setComponentTagClearTagState(paramTag, true); // Ensure component tag state clearing is set true (to match tag).
- paramTag.doEndTag();
-
- tag.doEndTag();
-
- assertEquals("/team.action?section=team&company=acme+inc&title=test", writer.toString());
-
- // Basic sanity check of clearTagStateForTagPoolingServers() behaviour for Struts Tags after doEndTag().
- ParamTag freshParamTag = new ParamTag();
- freshParamTag.setPerformClearTagStateForTagPoolingServers(true);
- freshParamTag.setPageContext(pageContext);
- assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
- "May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(paramTag, freshParamTag));
-
- // Basic sanity check of clearTagStateForTagPoolingServers() behaviour for Struts Tags after doEndTag().
- URLTag freshTag = new URLTag();
- freshTag.setPerformClearTagStateForTagPoolingServers(true);
- freshTag.setPageContext(pageContext);
- assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
- "May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
- }
-
- public void testAccessToStackInternalsGetsHandledCorrectly() throws Exception {
- Map params = new LinkedHashMap<>();
- params.put("aaa", new String[] {"1${#session[\"foo\"]='true'}"});
- params.put("aab", new String[]{"1${#session[\"bar\"]}"});
- params.put("aac", new String[]{"1${#_memberAccess[\"allowStaticMethodAccess\"]='true'}"});
- params.put("aad", new String[]{"1${#_memberAccess[\"allowStaticMethodAccess\"]}"});
-
- request.setParameterMap(params);
- request.setRequestURI("/public/about");
- request.setQueryString("aae${%23session[\"bar\"]}=1%24%7B%23session%5B%22bar%22%5D%7D");
- session.put("bar", "rab");
-
- tag.setAction("team");
- tag.setIncludeParams("all");
-
- tag.doStartTag();
- tag.doEndTag();
-
- Object allowMethodAccess = stack.findValue("\u0023_memberAccess['allowStaticMethodAccess']");
- assertNull(allowMethodAccess);
-
- assertNull(session.get("foo"));
-
- assertEquals("/team.action?aaa=1%24%7B%23session%5B%22foo%22%5D%3D%27true%27%7D" +
- "&" +
- "aab=1%24%7B%23session%5B%22bar%22%5D%7D" +
- "&" +
- "aac=1%24%7B%23_memberAccess%5B%22allowStaticMethodAccess%22%5D%3D%27true%27%7D" +
- "&" +
- "aad=1%24%7B%23_memberAccess%5B%22allowStaticMethodAccess%22%5D%7D" +
- "&" +
- "aae%24%7B%23session%5B%22bar%22%5D%7D=1%24%7B%23session%5B%22bar%22%5D%7D"
- , writer.toString()
- );
-
- // Basic sanity check of clearTagStateForTagPoolingServers() behaviour for Struts Tags after doEndTag().
- URLTag freshTag = new URLTag();
- freshTag.setPageContext(pageContext);
- assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
- "May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
- }
-
- public void testAccessToStackInternalsGetsHandledCorrectly_clearTagStateSet() throws Exception {
- Map params = new LinkedHashMap<>();
- params.put("aaa", new String[] {"1${#session[\"foo\"]='true'}"});
- params.put("aab", new String[]{"1${#session[\"bar\"]}"});
- params.put("aac", new String[]{"1${#_memberAccess[\"allowStaticMethodAccess\"]='true'}"});
- params.put("aad", new String[]{"1${#_memberAccess[\"allowStaticMethodAccess\"]}"});
-
- request.setParameterMap(params);
- request.setRequestURI("/public/about");
- request.setQueryString("aae${%23session[\"bar\"]}=1%24%7B%23session%5B%22bar%22%5D%7D");
- session.put("bar", "rab");
-
- tag.setPerformClearTagStateForTagPoolingServers(true); // Explicitly request tag state clearing.
- tag.setAction("team");
- tag.setIncludeParams("all");
-
- tag.doStartTag();
- setComponentTagClearTagState(tag, true); // Ensure component tag state clearing is set true (to match tag).
- tag.doEndTag();
-
- Object allowMethodAccess = stack.findValue("\u0023_memberAccess['allowStaticMethodAccess']");
- assertNull(allowMethodAccess);
-
- assertNull(session.get("foo"));
-
- assertEquals("/team.action?aaa=1%24%7B%23session%5B%22foo%22%5D%3D%27true%27%7D" +
- "&" +
- "aab=1%24%7B%23session%5B%22bar%22%5D%7D" +
- "&" +
- "aac=1%24%7B%23_memberAccess%5B%22allowStaticMethodAccess%22%5D%3D%27true%27%7D" +
- "&" +
- "aad=1%24%7B%23_memberAccess%5B%22allowStaticMethodAccess%22%5D%7D" +
- "&" +
- "aae%24%7B%23session%5B%22bar%22%5D%7D=1%24%7B%23session%5B%22bar%22%5D%7D"
- , writer.toString()
- );
-
- // Basic sanity check of clearTagStateForTagPoolingServers() behaviour for Struts Tags after doEndTag().
- URLTag freshTag = new URLTag();
- freshTag.setPerformClearTagStateForTagPoolingServers(true);
- freshTag.setPageContext(pageContext);
- assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
- "May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
- }
+ public void testEmbeddedParamTagExpressionGetsEvaluatedCorrectly() throws Exception {
+ request.setRequestURI("/public/about");
+ request.setQueryString("section=team&company=acme inc");
+
+ tag.setAction("team");
+ tag.setIncludeParams("all");
+
+ tag.doStartTag();
+
+ Foo foo = new Foo("test");
+ stack.push(foo);
+
+ // include nested param tag
+ ParamTag paramTag = new ParamTag();
+ paramTag.setPageContext(pageContext);
+ paramTag.setName("title");
+ paramTag.setValue("%{title}");
+ paramTag.doStartTag();
+ paramTag.doEndTag();
+
+ tag.doEndTag();
+
+ assertEquals("/team.action?section=team&company=acme+inc&title=test", writer.toString());
+
+ // Basic sanity check of clearTagStateForTagPoolingServers() behaviour for Struts Tags after doEndTag().
+ ParamTag freshParamTag = new ParamTag();
+ freshParamTag.setPageContext(pageContext);
+ assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
+ "May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
+ strutsBodyTagsAreReflectionEqual(paramTag, freshParamTag));
+
+ // Basic sanity check of clearTagStateForTagPoolingServers() behaviour for Struts Tags after doEndTag().
+ URLTag freshTag = new URLTag();
+ freshTag.setPageContext(pageContext);
+ assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
+ "May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ }
+
+ public void testEmbeddedParamTagExpressionGetsEvaluatedCorrectly_clearTagStateSet() throws Exception {
+ request.setRequestURI("/public/about");
+ request.setQueryString("section=team&company=acme inc");
+
+ tag.setPerformClearTagStateForTagPoolingServers(true); // Explicitly request tag state clearing.
+ tag.setAction("team");
+ tag.setIncludeParams("all");
+
+ tag.doStartTag();
+ setComponentTagClearTagState(tag, true); // Ensure component tag state clearing is set true (to match tag).
+
+ Foo foo = new Foo("test");
+ stack.push(foo);
+
+ // include nested param tag
+ ParamTag paramTag = new ParamTag();
+ paramTag.setPerformClearTagStateForTagPoolingServers(true); // Explicitly request tag state clearing.
+ paramTag.setPageContext(pageContext);
+ paramTag.setName("title");
+ paramTag.setValue("%{title}");
+ paramTag.doStartTag();
+ setComponentTagClearTagState(paramTag, true); // Ensure component tag state clearing is set true (to match tag).
+ paramTag.doEndTag();
+
+ tag.doEndTag();
+
+ assertEquals("/team.action?section=team&company=acme+inc&title=test", writer.toString());
+
+ // Basic sanity check of clearTagStateForTagPoolingServers() behaviour for Struts Tags after doEndTag().
+ ParamTag freshParamTag = new ParamTag();
+ freshParamTag.setPerformClearTagStateForTagPoolingServers(true);
+ freshParamTag.setPageContext(pageContext);
+ assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
+ "May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
+ strutsBodyTagsAreReflectionEqual(paramTag, freshParamTag));
+
+ // Basic sanity check of clearTagStateForTagPoolingServers() behaviour for Struts Tags after doEndTag().
+ URLTag freshTag = new URLTag();
+ freshTag.setPerformClearTagStateForTagPoolingServers(true);
+ freshTag.setPageContext(pageContext);
+ assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
+ "May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ }
+
+ public void testAccessToStackInternalsGetsHandledCorrectly() throws Exception {
+ Map params = new LinkedHashMap<>();
+ params.put("aaa", new String[]{"1${#session[\"foo\"]='true'}"});
+ params.put("aab", new String[]{"1${#session[\"bar\"]}"});
+ params.put("aac", new String[]{"1${#_memberAccess[\"allowStaticMethodAccess\"]='true'}"});
+ params.put("aad", new String[]{"1${#_memberAccess[\"allowStaticMethodAccess\"]}"});
+
+ request.setParameterMap(params);
+ request.setRequestURI("/public/about");
+ request.setQueryString("aae${%23session[\"bar\"]}=1%24%7B%23session%5B%22bar%22%5D%7D");
+ session.put("bar", "rab");
+
+ tag.setAction("team");
+ tag.setIncludeParams("all");
+
+ tag.doStartTag();
+ tag.doEndTag();
+
+ Object allowMethodAccess = stack.findValue("\u0023_memberAccess['allowStaticMethodAccess']");
+ assertNull(allowMethodAccess);
+
+ assertNull(session.get("foo"));
+
+ assertEquals("/team.action?aaa=1%24%7B%23session%5B%22foo%22%5D%3D%27true%27%7D" +
+ "&" +
+ "aab=1%24%7B%23session%5B%22bar%22%5D%7D" +
+ "&" +
+ "aac=1%24%7B%23_memberAccess%5B%22allowStaticMethodAccess%22%5D%3D%27true%27%7D" +
+ "&" +
+ "aad=1%24%7B%23_memberAccess%5B%22allowStaticMethodAccess%22%5D%7D" +
+ "&" +
+ "aae%24%7B%23session%5B%22bar%22%5D%7D=1%24%7B%23session%5B%22bar%22%5D%7D"
+ , writer.toString()
+ );
+
+ // Basic sanity check of clearTagStateForTagPoolingServers() behaviour for Struts Tags after doEndTag().
+ URLTag freshTag = new URLTag();
+ freshTag.setPageContext(pageContext);
+ assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
+ "May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ }
+
+ public void testAccessToStackInternalsGetsHandledCorrectly_clearTagStateSet() throws Exception {
+ Map params = new LinkedHashMap<>();
+ params.put("aaa", new String[]{"1${#session[\"foo\"]='true'}"});
+ params.put("aab", new String[]{"1${#session[\"bar\"]}"});
+ params.put("aac", new String[]{"1${#_memberAccess[\"allowStaticMethodAccess\"]='true'}"});
+ params.put("aad", new String[]{"1${#_memberAccess[\"allowStaticMethodAccess\"]}"});
+
+ request.setParameterMap(params);
+ request.setRequestURI("/public/about");
+ request.setQueryString("aae${%23session[\"bar\"]}=1%24%7B%23session%5B%22bar%22%5D%7D");
+ session.put("bar", "rab");
+
+ tag.setPerformClearTagStateForTagPoolingServers(true); // Explicitly request tag state clearing.
+ tag.setAction("team");
+ tag.setIncludeParams("all");
+
+ tag.doStartTag();
+ setComponentTagClearTagState(tag, true); // Ensure component tag state clearing is set true (to match tag).
+ tag.doEndTag();
+
+ Object allowMethodAccess = stack.findValue("\u0023_memberAccess['allowStaticMethodAccess']");
+ assertNull(allowMethodAccess);
+
+ assertNull(session.get("foo"));
+
+ assertEquals("/team.action?aaa=1%24%7B%23session%5B%22foo%22%5D%3D%27true%27%7D" +
+ "&" +
+ "aab=1%24%7B%23session%5B%22bar%22%5D%7D" +
+ "&" +
+ "aac=1%24%7B%23_memberAccess%5B%22allowStaticMethodAccess%22%5D%3D%27true%27%7D" +
+ "&" +
+ "aad=1%24%7B%23_memberAccess%5B%22allowStaticMethodAccess%22%5D%7D" +
+ "&" +
+ "aae%24%7B%23session%5B%22bar%22%5D%7D=1%24%7B%23session%5B%22bar%22%5D%7D"
+ , writer.toString()
+ );
+
+ // Basic sanity check of clearTagStateForTagPoolingServers() behaviour for Struts Tags after doEndTag().
+ URLTag freshTag = new URLTag();
+ freshTag.setPerformClearTagStateForTagPoolingServers(true);
+ freshTag.setPageContext(pageContext);
+ assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
+ "May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ }
public void testIncludeEmptyParameters() throws Exception {
request.setRequestURI("/public/about");
@@ -1990,23 +1983,23 @@ public String getString() {
freshParamTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(param1, freshParamTag));
+ strutsBodyTagsAreReflectionEqual(param1, freshParamTag));
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(param2, freshParamTag));
+ strutsBodyTagsAreReflectionEqual(param2, freshParamTag));
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(param3, freshParamTag));
+ strutsBodyTagsAreReflectionEqual(param3, freshParamTag));
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(param4, freshParamTag));
+ strutsBodyTagsAreReflectionEqual(param4, freshParamTag));
// Basic sanity check of clearTagStateForTagPoolingServers() behaviour for Struts Tags after doEndTag().
URLTag freshTag = new URLTag();
freshTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testIncludeEmptyParameters_clearTagStateSet() throws Exception {
@@ -2079,16 +2072,16 @@ public String getString() {
freshParamTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(param1, freshParamTag));
+ strutsBodyTagsAreReflectionEqual(param1, freshParamTag));
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(param2, freshParamTag));
+ strutsBodyTagsAreReflectionEqual(param2, freshParamTag));
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(param3, freshParamTag));
+ strutsBodyTagsAreReflectionEqual(param3, freshParamTag));
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(param4, freshParamTag));
+ strutsBodyTagsAreReflectionEqual(param4, freshParamTag));
// Basic sanity check of clearTagStateForTagPoolingServers() behaviour for Struts Tags after doEndTag().
URLTag freshTag = new URLTag();
@@ -2096,7 +2089,7 @@ public String getString() {
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
@Override
@@ -2116,14 +2109,14 @@ protected void setUp() throws Exception {
public static class Foo {
private String title;
- public Foo() {
- }
+ public Foo() {
+ }
- public Foo( String title ) {
- this.title = title;
- }
+ public Foo(String title) {
+ this.title = title;
+ }
- public void setTitle(String title) {
+ public void setTitle(String title) {
this.title = title;
}
@@ -2158,7 +2151,7 @@ public static class RedBlueActionMapper extends DefaultActionMapper {
public String getUriFromActionMapping(ActionMapping mapping) {
String baseUri = super.getUriFromActionMapping(mapping);
HttpSession session = ServletActionContext.getRequest().getSession();
- if (session.getAttribute("redBlue")==null) {
+ if (session.getAttribute("redBlue") == null) {
// We are red
session.setAttribute("redBlue", 0);
return baseUri + "-red";
diff --git a/core/src/test/java/org/apache/struts2/views/jsp/ui/FormTagTest.java b/core/src/test/java/org/apache/struts2/views/jsp/ui/FormTagTest.java
index 6aa273574a..0b05762724 100644
--- a/core/src/test/java/org/apache/struts2/views/jsp/ui/FormTagTest.java
+++ b/core/src/test/java/org/apache/struts2/views/jsp/ui/FormTagTest.java
@@ -64,7 +64,7 @@ public void testFormWithActionAttributeContainingQueryString() throws Exception
freshTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testFormWithActionAttributeContainingQueryString_clearTagStateSet() throws Exception {
@@ -93,7 +93,7 @@ public void testFormWithActionAttributeContainingQueryString_clearTagStateSet()
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testFormWithActionAttributeContainingBothActionAndMethod() throws Exception {
@@ -116,10 +116,10 @@ public void testFormWithActionAttributeContainingBothActionAndMethod() throws Ex
freshTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
- public void testFormWithActionAttributeContainingBothActionAndMethod_clearTagStateSet() throws Exception {
+ public void testFormWithActionAttributeContainingBothActionAndMethod_clearTagStateSet() throws Exception {
FormTag tag = new FormTag();
tag.setPerformClearTagStateForTagPoolingServers(true); // Explicitly request tag state clearing.
tag.setPageContext(pageContext);
@@ -142,7 +142,7 @@ public void testFormWithActionAttributeContainingBothActionAndMethod_clearTagSta
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testFormWithoutContext() throws Exception {
@@ -164,7 +164,7 @@ public void testFormWithoutContext() throws Exception {
freshTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testFormWithoutContext_clearTagStateSet() throws Exception {
@@ -189,7 +189,7 @@ public void testFormWithoutContext_clearTagStateSet() throws Exception {
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testFormWithContext() throws Exception {
@@ -210,7 +210,7 @@ public void testFormWithContext() throws Exception {
freshTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testFormWithContext_clearTagStateSet() throws Exception {
@@ -234,7 +234,7 @@ public void testFormWithContext_clearTagStateSet() throws Exception {
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testFormWithActionAttributeContainingBothActionAndDMIMethod() throws Exception {
@@ -261,8 +261,8 @@ public void testFormWithActionAttributeContainingBothActionAndDMIMethod() throws
freshTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
- }
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ }
public void testFormWithActionAttributeContainingBothActionAndDMIMethod_clearTagStateSet() throws Exception {
FormTag tag = new FormTag();
@@ -276,7 +276,7 @@ public void testFormWithActionAttributeContainingBothActionAndDMIMethod_clearTag
tag.setTitle("mytitle");
tag.setOnsubmit("submitMe()");
- ((DefaultActionMapper)container.getInstance(ActionMapper.class)).setAllowDynamicMethodCalls("true");
+ ((DefaultActionMapper) container.getInstance(ActionMapper.class)).setAllowDynamicMethodCalls("true");
tag.doStartTag();
setComponentTagClearTagState(tag, true); // Ensure component tag state clearing is set true (to match tag).
@@ -290,7 +290,7 @@ public void testFormWithActionAttributeContainingBothActionAndDMIMethod_clearTag
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testFormWithFocusElement() throws Exception {
@@ -310,7 +310,7 @@ public void testFormWithFocusElement() throws Exception {
freshTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testFormWithFocusElement_clearTagStateSet() throws Exception {
@@ -332,7 +332,7 @@ public void testFormWithFocusElement_clearTagStateSet() throws Exception {
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testFormWithActionAttributeContainingBothActionAndMethodAndNamespace() throws Exception {
@@ -358,7 +358,7 @@ public void testFormWithActionAttributeContainingBothActionAndMethodAndNamespace
freshTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testFormWithActionAttributeContainingBothActionAndMethodAndNamespace_clearTagStateSet() throws Exception {
@@ -386,7 +386,7 @@ public void testFormWithActionAttributeContainingBothActionAndMethodAndNamespace
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testForm() throws Exception {
@@ -418,7 +418,7 @@ public void testForm() throws Exception {
freshTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testForm_clearTagStateSet() throws Exception {
@@ -452,7 +452,7 @@ public void testForm_clearTagStateSet() throws Exception {
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testFormId() throws Exception {
@@ -479,7 +479,7 @@ public void testFormId() throws Exception {
freshTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testFormId_clearTagStateSet() throws Exception {
@@ -508,7 +508,7 @@ public void testFormId_clearTagStateSet() throws Exception {
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testFormNoNameOrId() throws Exception {
@@ -537,10 +537,10 @@ public void testFormNoNameOrId() throws Exception {
freshTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
- public void testFormNoNameOrId_clearTagStateSet() throws Exception {
+ public void testFormNoNameOrId_clearTagStateSet() throws Exception {
request.setupGetServletPath("/testAction");
@@ -569,7 +569,7 @@ public void testFormNoNameOrId_clearTagStateSet() throws Exception {
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
/**
@@ -610,14 +610,14 @@ public void testFormWithCustomOnsubmitEnabledWithValidateEnabled1() throws Excep
freshParamTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(t, freshParamTag));
+ strutsBodyTagsAreReflectionEqual(t, freshParamTag));
// Basic sanity check of clearTagStateForTagPoolingServers() behaviour for Struts Tags after doEndTag().
FormTag freshTag = new FormTag();
freshTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
/**
@@ -663,7 +663,7 @@ public void testFormWithCustomOnsubmitEnabledWithValidateEnabled1_clearTagStateS
freshParamTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(t, freshParamTag));
+ strutsBodyTagsAreReflectionEqual(t, freshParamTag));
// Basic sanity check of clearTagStateForTagPoolingServers() behaviour for Struts Tags after doEndTag().
FormTag freshTag = new FormTag();
@@ -671,7 +671,7 @@ public void testFormWithCustomOnsubmitEnabledWithValidateEnabled1_clearTagStateS
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
/**
@@ -711,14 +711,14 @@ public void testFormWithCustomOnsubmitEnabledWithValidateEnabled2() throws Excep
freshParamTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(t, freshParamTag));
+ strutsBodyTagsAreReflectionEqual(t, freshParamTag));
// Basic sanity check of clearTagStateForTagPoolingServers() behaviour for Struts Tags after doEndTag().
FormTag freshTag = new FormTag();
freshTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
/**
@@ -763,7 +763,7 @@ public void testFormWithCustomOnsubmitEnabledWithValidateEnabled2_clearTagStateS
freshParamTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(t, freshParamTag));
+ strutsBodyTagsAreReflectionEqual(t, freshParamTag));
// Basic sanity check of clearTagStateForTagPoolingServers() behaviour for Struts Tags after doEndTag().
FormTag freshTag = new FormTag();
@@ -771,7 +771,7 @@ public void testFormWithCustomOnsubmitEnabledWithValidateEnabled2_clearTagStateS
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
/**
@@ -810,14 +810,14 @@ public void testFormWithCustomOnsubmitEnabledWithValidateEnabled3() throws Excep
freshParamTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(t, freshParamTag));
+ strutsBodyTagsAreReflectionEqual(t, freshParamTag));
// Basic sanity check of clearTagStateForTagPoolingServers() behaviour for Struts Tags after doEndTag().
FormTag freshTag = new FormTag();
freshTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
/**
@@ -861,7 +861,7 @@ public void testFormWithCustomOnsubmitEnabledWithValidateEnabled3_clearTagStateS
freshParamTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(t, freshParamTag));
+ strutsBodyTagsAreReflectionEqual(t, freshParamTag));
// Basic sanity check of clearTagStateForTagPoolingServers() behaviour for Struts Tags after doEndTag().
FormTag freshTag = new FormTag();
@@ -869,10 +869,10 @@ public void testFormWithCustomOnsubmitEnabledWithValidateEnabled3_clearTagStateS
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
-/**
+ /**
* Tests the numbers are formatted correctly to not break the javascript, using doubles
*/
public void testFormWithCustomOnsubmitEnabledWithValidateEnabled4() throws Exception {
@@ -908,17 +908,17 @@ public void testFormWithCustomOnsubmitEnabledWithValidateEnabled4() throws Excep
freshParamTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(t, freshParamTag));
+ strutsBodyTagsAreReflectionEqual(t, freshParamTag));
// Basic sanity check of clearTagStateForTagPoolingServers() behaviour for Struts Tags after doEndTag().
FormTag freshTag = new FormTag();
freshTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
-/**
+ /**
* Tests the numbers are formatted correctly to not break the javascript, using doubles
*/
public void testFormWithCustomOnsubmitEnabledWithValidateEnabled4_clearTagStateSet() throws Exception {
@@ -959,7 +959,7 @@ public void testFormWithCustomOnsubmitEnabledWithValidateEnabled4_clearTagStateS
freshParamTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(t, freshParamTag));
+ strutsBodyTagsAreReflectionEqual(t, freshParamTag));
// Basic sanity check of clearTagStateForTagPoolingServers() behaviour for Struts Tags after doEndTag().
FormTag freshTag = new FormTag();
@@ -967,7 +967,7 @@ public void testFormWithCustomOnsubmitEnabledWithValidateEnabled4_clearTagStateS
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
private void prepareMockInvocation() throws Exception {
@@ -1018,14 +1018,14 @@ public void testFormWithCustomOnsubmitEnabledWithValidateDisabled() throws Excep
freshParamTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(t, freshParamTag));
+ strutsBodyTagsAreReflectionEqual(t, freshParamTag));
// Basic sanity check of clearTagStateForTagPoolingServers() behaviour for Struts Tags after doEndTag().
FormTag freshTag = new FormTag();
freshTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
/**
@@ -1064,7 +1064,7 @@ public void testFormWithCustomOnsubmitEnabledWithValidateDisabled_clearTagStateS
freshParamTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(t, freshParamTag));
+ strutsBodyTagsAreReflectionEqual(t, freshParamTag));
// Basic sanity check of clearTagStateForTagPoolingServers() behaviour for Struts Tags after doEndTag().
FormTag freshTag = new FormTag();
@@ -1072,7 +1072,7 @@ public void testFormWithCustomOnsubmitEnabledWithValidateDisabled_clearTagStateS
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
/**
@@ -1112,7 +1112,7 @@ public void testFormTagWithDifferentActionExtension() throws Exception {
freshTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
/**
@@ -1128,7 +1128,7 @@ public void testFormTagWithDifferentActionExtension() throws Exception {
*
*/
public void testFormTagWithDifferentActionExtension_clearTagStateSet() throws Exception {
- initDispatcher(new HashMap(){{
+ initDispatcher(new HashMap() {{
put(StrutsConstants.STRUTS_ACTION_EXTENSION, "jspa");
put("configProviders", TestConfigurationProvider.class.getName());
}});
@@ -1155,7 +1155,7 @@ public void testFormTagWithDifferentActionExtension_clearTagStateSet() throws Ex
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
/**
@@ -1183,7 +1183,7 @@ public void testFormTagWithDifferentActionExtensionHardcoded() throws Exception
freshTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
/**
@@ -1214,11 +1214,11 @@ public void testFormTagWithDifferentActionExtensionHardcoded_clearTagStateSet()
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testFormWithNamespaceDefaulting() throws Exception {
- request.setupGetServletPath("/testNamespace/testNamespaceAction");
+ withRequestPath("/testNamespace/testNamespaceAction");
TestAction testAction = (TestAction) action;
testAction.setFoo("bar");
@@ -1239,11 +1239,11 @@ public void testFormWithNamespaceDefaulting() throws Exception {
freshTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testFormWithNamespaceDefaulting_clearTagStateSet() throws Exception {
- request.setupGetServletPath("/testNamespace/testNamespaceAction");
+ withRequestPath("/testNamespace/testNamespaceAction");
TestAction testAction = (TestAction) action;
testAction.setFoo("bar");
@@ -1267,11 +1267,11 @@ public void testFormWithNamespaceDefaulting_clearTagStateSet() throws Exception
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testFormTagForStackOverflowException1() throws Exception {
- request.setRequestURI("/testAction");
+ withRequestPath("/testAction");
FormTag form1 = new FormTag();
form1.setPageContext(pageContext);
@@ -1300,18 +1300,18 @@ public void testFormTagForStackOverflowException1() throws Exception {
// FormTag has no non=default state set here, so it compares as equal with the default tag clear state as well.
assertTrue("Tag state after doEndTag() under default tag clear state is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(form1, freshFormTag));
+ strutsBodyTagsAreReflectionEqual(form1, freshFormTag));
// Basic sanity check of clearTagStateForTagPoolingServers() behaviour for Struts Tags after doEndTag().
ActionTag freshTag = new ActionTag();
freshTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testFormTagForStackOverflowException1_clearTagStateSet() throws Exception {
- request.setRequestURI("/testAction");
+ withRequestPath("/testAction");
FormTag form1 = new FormTag();
form1.setPerformClearTagStateForTagPoolingServers(true); // Explicitly request tag state clearing.
@@ -1344,7 +1344,7 @@ public void testFormTagForStackOverflowException1_clearTagStateSet() throws Exce
freshFormTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(form1, freshFormTag));
+ strutsBodyTagsAreReflectionEqual(form1, freshFormTag));
// Basic sanity check of clearTagStateForTagPoolingServers() behaviour for Struts Tags after doEndTag().
ActionTag freshTag = new ActionTag();
@@ -1352,11 +1352,11 @@ public void testFormTagForStackOverflowException1_clearTagStateSet() throws Exce
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testFormTagForStackOverflowException2() throws Exception {
- request.setRequestURI("/requestUri");
+ withRequestPath("/requestUri");
FormTag form1 = new FormTag();
form1.setPageContext(pageContext);
@@ -1392,25 +1392,25 @@ public void testFormTagForStackOverflowException2() throws Exception {
// Basic sanity check of clearTagStateForTagPoolingServers() behaviour for Struts Tags after doEndTag().
FormTag freshFormTag = new FormTag();
freshFormTag.setPageContext(pageContext);
- // FormTag has no non=default state set here, so it compares as equal with the default tag clear state as well.
+ // FormTag has no non=default state set here, so it compares as equal with the default tag clear state as well.
assertTrue("Tag state after doEndTag() under default tag clear state is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(form1, freshFormTag));
+ strutsBodyTagsAreReflectionEqual(form1, freshFormTag));
// FormTag has no non=default state set here, so it compares as equal with the default tag clear state as well.
assertTrue("Tag state after doEndTag() under default tag clear state is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(form2, freshFormTag));
+ strutsBodyTagsAreReflectionEqual(form2, freshFormTag));
// Basic sanity check of clearTagStateForTagPoolingServers() behaviour for Struts Tags after doEndTag().
ActionTag freshTag = new ActionTag();
freshTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testFormTagForStackOverflowException2_clearTagStateSet() throws Exception {
- request.setRequestURI("/requestUri");
+ withRequestPath("/requestUri");
FormTag form1 = new FormTag();
form1.setPerformClearTagStateForTagPoolingServers(true); // Explicitly request tag state clearing.
@@ -1455,10 +1455,10 @@ public void testFormTagForStackOverflowException2_clearTagStateSet() throws Exce
freshFormTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(form1, freshFormTag));
+ strutsBodyTagsAreReflectionEqual(form1, freshFormTag));
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(form2, freshFormTag));
+ strutsBodyTagsAreReflectionEqual(form2, freshFormTag));
// Basic sanity check of clearTagStateForTagPoolingServers() behaviour for Struts Tags after doEndTag().
ActionTag freshTag = new ActionTag();
@@ -1466,11 +1466,11 @@ public void testFormTagForStackOverflowException2_clearTagStateSet() throws Exce
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testFormTagForStackOverflowException3() throws Exception {
- request.setRequestURI("/requestUri");
+ withRequestPath("/requestUri");
FormTag form1 = new FormTag();
form1.setPageContext(pageContext);
@@ -1519,26 +1519,26 @@ public void testFormTagForStackOverflowException3() throws Exception {
// FormTag has no non=default state set here, so it compares as equal with the default tag clear state as well.
assertTrue("Tag state after doEndTag() under default tag clear state is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(form1, freshFormTag));
+ strutsBodyTagsAreReflectionEqual(form1, freshFormTag));
// FormTag has no non=default state set here, so it compares as equal with the default tag clear state as well.
assertTrue("Tag state after doEndTag() under default tag clear state is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(form2, freshFormTag));
+ strutsBodyTagsAreReflectionEqual(form2, freshFormTag));
// FormTag has no non=default state set here, so it compares as equal with the default tag clear state as well.
assertTrue("Tag state after doEndTag() under default tag clear state is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(form3, freshFormTag));
+ strutsBodyTagsAreReflectionEqual(form3, freshFormTag));
// Basic sanity check of clearTagStateForTagPoolingServers() behaviour for Struts Tags after doEndTag().
ActionTag freshTag = new ActionTag();
freshTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testFormTagForStackOverflowException3_clearTagStateSet() throws Exception {
- request.setRequestURI("/requestUri");
+ withRequestPath("/requestUri");
FormTag form1 = new FormTag();
form1.setPerformClearTagStateForTagPoolingServers(true); // Explicitly request tag state clearing.
@@ -1595,13 +1595,13 @@ public void testFormTagForStackOverflowException3_clearTagStateSet() throws Exce
freshFormTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(form1, freshFormTag));
+ strutsBodyTagsAreReflectionEqual(form1, freshFormTag));
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(form2, freshFormTag));
+ strutsBodyTagsAreReflectionEqual(form2, freshFormTag));
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(form3, freshFormTag));
+ strutsBodyTagsAreReflectionEqual(form3, freshFormTag));
// Basic sanity check of clearTagStateForTagPoolingServers() behaviour for Struts Tags after doEndTag().
ActionTag freshTag = new ActionTag();
@@ -1609,11 +1609,11 @@ public void testFormTagForStackOverflowException3_clearTagStateSet() throws Exce
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testFormComponentIsRemoved() throws Exception {
- request.setRequestURI("/requestUri");
+ withRequestPath("/requestUri");
FormTag form = new FormTag();
form.setPageContext(pageContext);
@@ -1631,11 +1631,11 @@ public void testFormComponentIsRemoved() throws Exception {
// FormTag has no non=default state set here, so it compares as equal with the default tag clear state as well.
assertTrue("Tag state after doEndTag() under default tag clear state is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(form, freshTag));
+ strutsBodyTagsAreReflectionEqual(form, freshTag));
}
public void testFormComponentIsRemoved_clearTagStateSet() throws Exception {
- request.setRequestURI("/requestUri");
+ withRequestPath("/requestUri");
FormTag form = new FormTag();
form.setPerformClearTagStateForTagPoolingServers(true); // Explicitly request tag state clearing.
@@ -1655,13 +1655,11 @@ public void testFormComponentIsRemoved_clearTagStateSet() throws Exception {
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(form, freshTag));
+ strutsBodyTagsAreReflectionEqual(form, freshTag));
}
public void testFormWithNoAction() throws Exception {
- request.setupGetServletPath("/");
- request.setupGetContextPath("/");
- request.setRequestURI("/foo.jsp");
+ withRequestPath("/foo.jsp");
FormTag tag = new FormTag();
tag.setPageContext(pageContext);
@@ -1676,13 +1674,11 @@ public void testFormWithNoAction() throws Exception {
// FormTag has no non=default state set here, so it compares as equal with the default tag clear state as well.
assertTrue("Tag state after doEndTag() under default tag clear state is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testFormWithNoAction_clearTagStateSet() throws Exception {
- request.setupGetServletPath("/");
- request.setupGetContextPath("/");
- request.setRequestURI("/foo.jsp");
+ withRequestPath("/foo.jsp");
FormTag tag = new FormTag();
tag.setPerformClearTagStateForTagPoolingServers(true); // Explicitly request tag state clearing.
@@ -1699,7 +1695,7 @@ public void testFormWithNoAction_clearTagStateSet() throws Exception {
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testFormWithStaticAction() throws Exception {
@@ -1720,7 +1716,7 @@ public void testFormWithStaticAction() throws Exception {
freshTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testFormWithStaticAction_clearTagStateSet() throws Exception {
@@ -1744,7 +1740,7 @@ public void testFormWithStaticAction_clearTagStateSet() throws Exception {
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testFormWithActionAndExtension() throws Exception {
@@ -1766,7 +1762,7 @@ public void testFormWithActionAndExtension() throws Exception {
freshTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testFormWithActionAndExtension_clearTagStateSet() throws Exception {
@@ -1791,7 +1787,7 @@ public void testFormWithActionAndExtension_clearTagStateSet() throws Exception {
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testFormWithTopLabelPosition() throws Exception {
@@ -1818,14 +1814,14 @@ public void testFormWithTopLabelPosition() throws Exception {
freshFormTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(form, freshFormTag));
+ strutsBodyTagsAreReflectionEqual(form, freshFormTag));
// Basic sanity check of clearTagStateForTagPoolingServers() behaviour for Struts Tags after doEndTag().
TextFieldTag freshTag = new TextFieldTag();
freshTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(text, freshTag));
+ strutsBodyTagsAreReflectionEqual(text, freshTag));
}
public void testFormWithTopLabelPosition_clearTagStateSet() throws Exception {
@@ -1857,7 +1853,7 @@ public void testFormWithTopLabelPosition_clearTagStateSet() throws Exception {
freshFormTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(form, freshFormTag));
+ strutsBodyTagsAreReflectionEqual(form, freshFormTag));
// Basic sanity check of clearTagStateForTagPoolingServers() behaviour for Struts Tags after doEndTag().
TextFieldTag freshTag = new TextFieldTag();
@@ -1865,7 +1861,7 @@ public void testFormWithTopLabelPosition_clearTagStateSet() throws Exception {
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(text, freshTag));
+ strutsBodyTagsAreReflectionEqual(text, freshTag));
}
public void testFormWithTopLabelPositionWithElementOverride() throws Exception {
@@ -1893,14 +1889,14 @@ public void testFormWithTopLabelPositionWithElementOverride() throws Exception {
freshFormTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(form, freshFormTag));
+ strutsBodyTagsAreReflectionEqual(form, freshFormTag));
// Basic sanity check of clearTagStateForTagPoolingServers() behaviour for Struts Tags after doEndTag().
TextFieldTag freshTag = new TextFieldTag();
freshTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(text, freshTag));
+ strutsBodyTagsAreReflectionEqual(text, freshTag));
}
public void testFormWithTopLabelPositionWithElementOverride_clearTagStateSet() throws Exception {
@@ -1933,7 +1929,7 @@ public void testFormWithTopLabelPositionWithElementOverride_clearTagStateSet() t
freshFormTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(form, freshFormTag));
+ strutsBodyTagsAreReflectionEqual(form, freshFormTag));
// Basic sanity check of clearTagStateForTagPoolingServers() behaviour for Struts Tags after doEndTag().
TextFieldTag freshTag = new TextFieldTag();
@@ -1941,7 +1937,7 @@ public void testFormWithTopLabelPositionWithElementOverride_clearTagStateSet() t
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(text, freshTag));
+ strutsBodyTagsAreReflectionEqual(text, freshTag));
}
public void testFormWithTopLabelPositionCssXhtml() throws Exception {
@@ -1968,14 +1964,14 @@ public void testFormWithTopLabelPositionCssXhtml() throws Exception {
freshFormTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(form, freshFormTag));
+ strutsBodyTagsAreReflectionEqual(form, freshFormTag));
// Basic sanity check of clearTagStateForTagPoolingServers() behaviour for Struts Tags after doEndTag().
TextFieldTag freshTag = new TextFieldTag();
freshTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(text, freshTag));
+ strutsBodyTagsAreReflectionEqual(text, freshTag));
}
public void testFormWithTopLabelPositionCssXhtml_clearTagStateSet() throws Exception {
@@ -2007,7 +2003,7 @@ public void testFormWithTopLabelPositionCssXhtml_clearTagStateSet() throws Excep
freshFormTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(form, freshFormTag));
+ strutsBodyTagsAreReflectionEqual(form, freshFormTag));
// Basic sanity check of clearTagStateForTagPoolingServers() behaviour for Struts Tags after doEndTag().
TextFieldTag freshTag = new TextFieldTag();
@@ -2015,7 +2011,7 @@ public void testFormWithTopLabelPositionCssXhtml_clearTagStateSet() throws Excep
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(text, freshTag));
+ strutsBodyTagsAreReflectionEqual(text, freshTag));
}
public void testFormWithTopLabelPositionWithElementOverrideCssXhtml() throws Exception {
@@ -2043,14 +2039,14 @@ public void testFormWithTopLabelPositionWithElementOverrideCssXhtml() throws Exc
freshFormTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(form, freshFormTag));
+ strutsBodyTagsAreReflectionEqual(form, freshFormTag));
// Basic sanity check of clearTagStateForTagPoolingServers() behaviour for Struts Tags after doEndTag().
TextFieldTag freshTag = new TextFieldTag();
freshTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(text, freshTag));
+ strutsBodyTagsAreReflectionEqual(text, freshTag));
}
public void testFormWithTopLabelPositionWithElementOverrideCssXhtml_clearTagStateSet() throws Exception {
@@ -2083,7 +2079,7 @@ public void testFormWithTopLabelPositionWithElementOverrideCssXhtml_clearTagStat
freshFormTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(form, freshFormTag));
+ strutsBodyTagsAreReflectionEqual(form, freshFormTag));
// Basic sanity check of clearTagStateForTagPoolingServers() behaviour for Struts Tags after doEndTag().
TextFieldTag freshTag = new TextFieldTag();
@@ -2091,7 +2087,7 @@ public void testFormWithTopLabelPositionWithElementOverrideCssXhtml_clearTagStat
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(text, freshTag));
+ strutsBodyTagsAreReflectionEqual(text, freshTag));
}
@Override
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 f42fdbccfa..ad28ee4bd4 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
@@ -28,6 +28,7 @@
/**
+ *
*/
public class TextfieldTest extends AbstractUITagTest {
@@ -37,7 +38,7 @@ public class TextfieldTest extends AbstractUITagTest {
* String, String[])} as properties to verify.
This implementation extends testdata from AbstractUITag.
*
* @return A Map of PropertyHolders values bound to {@link org.apache.struts2.views.jsp.AbstractUITagTest.PropertyHolder#getName()}
- * as key.
+ * as key.
*/
@Override
protected Map initializedGenericTagTestProperties() {
@@ -81,7 +82,7 @@ public void testErrors() throws Exception {
freshTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testErrors_clearTagStateSet() throws Exception {
@@ -110,7 +111,7 @@ public void testErrors_clearTagStateSet() throws Exception {
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testNoLabelJsp() throws Exception {
@@ -134,7 +135,7 @@ public void testNoLabelJsp() throws Exception {
freshTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testNoLabelJsp_clearTagStateSet() throws Exception {
@@ -161,7 +162,7 @@ public void testNoLabelJsp_clearTagStateSet() throws Exception {
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testLabelSeparatorJsp() throws Exception {
@@ -187,7 +188,7 @@ public void testLabelSeparatorJsp() throws Exception {
freshTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testLabelSeparatorJsp_clearTagStateSet() throws Exception {
@@ -216,7 +217,7 @@ public void testLabelSeparatorJsp_clearTagStateSet() throws Exception {
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testNoLabelFtl() throws Exception {
@@ -257,7 +258,7 @@ public void testSimple() throws Exception {
freshTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testSimple_clearTagStateSet() throws Exception {
@@ -284,13 +285,13 @@ public void testSimple_clearTagStateSet() throws Exception {
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testWW5125() throws Exception {
TestAction testAction = (TestAction) action;
- for(String fieldName : new String[] {"clone", "size", "clear", "values", "hashCode", "isEmpty", "keySet", "entrySet"}) {
+ for (String fieldName : new String[]{"clone", "size", "clear", "values", "hashCode", "isEmpty", "keySet", "entrySet"}) {
testAction.addFieldError(fieldName, fieldName + " error");
TextFieldTag tag = new TextFieldTag();
@@ -304,7 +305,7 @@ public void testWW5125() throws Exception {
freshTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
verify(TextFieldTag.class.getResource("Textfield-WW-5125.txt"));
@@ -313,7 +314,7 @@ public void testWW5125() throws Exception {
public void testWW5125_clearTagStateSet() throws Exception {
TestAction testAction = (TestAction) action;
- for(String fieldName : new String[] {"clone", "size", "clear", "values", "hashCode", "isEmpty", "keySet", "entrySet"}) {
+ for (String fieldName : new String[]{"clone", "size", "clear", "values", "hashCode", "isEmpty", "keySet", "entrySet"}) {
testAction.addFieldError(fieldName, fieldName + " error");
TextFieldTag tag = new TextFieldTag();
@@ -330,7 +331,7 @@ public void testWW5125_clearTagStateSet() throws Exception {
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
verify(TextFieldTag.class.getResource("Textfield-WW-5125.txt"));
@@ -359,7 +360,7 @@ public void testSimple_recursionTest() throws Exception {
freshTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testSimple_recursionTest_clearTagStateSet() throws Exception {
@@ -388,7 +389,7 @@ public void testSimple_recursionTest_clearTagStateSet() throws Exception {
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testSimple_recursionTestNoValue() throws Exception {
@@ -411,7 +412,7 @@ public void testSimple_recursionTestNoValue() throws Exception {
freshTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testSimple_recursionTestNoValue_clearTagStateSet() throws Exception {
@@ -437,7 +438,7 @@ public void testSimple_recursionTestNoValue_clearTagStateSet() throws Exception
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testHtml5EmailTag() throws Exception {
@@ -461,7 +462,7 @@ public void testHtml5EmailTag() throws Exception {
freshTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testHtml5EmailTag_clearTagStateSet() throws Exception {
@@ -488,7 +489,7 @@ public void testHtml5EmailTag_clearTagStateSet() throws Exception {
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testErrorPositionBottom() throws Exception {
@@ -515,7 +516,7 @@ public void testErrorPositionBottom() throws Exception {
freshTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testErrorPositionBottom_clearTagStateSet() throws Exception {
@@ -545,7 +546,7 @@ public void testErrorPositionBottom_clearTagStateSet() throws Exception {
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testErrorPositionTop() throws Exception {
@@ -572,7 +573,7 @@ public void testErrorPositionTop() throws Exception {
freshTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testErrorPositionTop_clearTagStateSet() throws Exception {
@@ -602,7 +603,7 @@ public void testErrorPositionTop_clearTagStateSet() throws Exception {
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testRequiredLabelPositionDefault() throws Exception {
@@ -627,7 +628,7 @@ public void testRequiredLabelPositionDefault() throws Exception {
freshTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testRequiredLabelPositionDefault_clearTagStateSet() throws Exception {
@@ -655,7 +656,7 @@ public void testRequiredLabelPositionDefault_clearTagStateSet() throws Exception
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testRequiredLabelPositionRight() throws Exception {
@@ -681,7 +682,7 @@ public void testRequiredLabelPositionRight() throws Exception {
freshTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testRequiredLabelPositionRight_clearTagStateSet() throws Exception {
@@ -710,7 +711,7 @@ public void testRequiredLabelPositionRight_clearTagStateSet() throws Exception {
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testRequiredLabelPositionLeft() throws Exception {
@@ -736,7 +737,7 @@ public void testRequiredLabelPositionLeft() throws Exception {
freshTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
@@ -766,7 +767,7 @@ public void testRequiredLabelPositionLeft_clearTagStateSet() throws Exception {
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testErrorPositionBottomCssXhtmlTheme() throws Exception {
@@ -794,7 +795,7 @@ public void testErrorPositionBottomCssXhtmlTheme() throws Exception {
freshTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testErrorPositionBottomCssXhtmlTheme_clearTagStateSet() throws Exception {
@@ -825,7 +826,7 @@ public void testErrorPositionBottomCssXhtmlTheme_clearTagStateSet() throws Excep
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testErrorPositionTopCssXhtmlTheme() throws Exception {
@@ -853,7 +854,7 @@ public void testErrorPositionTopCssXhtmlTheme() throws Exception {
freshTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testErrorPositionTopCssXhtmlTheme_clearTagStateSet() throws Exception {
@@ -884,7 +885,7 @@ public void testErrorPositionTopCssXhtmlTheme_clearTagStateSet() throws Exceptio
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testNameEvaluation() throws Exception {
@@ -906,7 +907,7 @@ public void testNameEvaluation() throws Exception {
freshTag.setPageContext(pageContext);
assertFalse("Tag state after doEndTag() under default tag clear state is equal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
public void testNameEvaluation_clearTagStateSet() throws Exception {
@@ -931,7 +932,7 @@ public void testNameEvaluation_clearTagStateSet() throws Exception {
freshTag.setPageContext(pageContext);
assertTrue("Tag state after doEndTag() and explicit tag state clearing is inequal to new Tag with pageContext/parent set. " +
"May indicate that clearTagStateForTagPoolingServers() calls are not working properly.",
- strutsBodyTagsAreReflectionEqual(tag, freshTag));
+ strutsBodyTagsAreReflectionEqual(tag, freshTag));
}
}