Skip to content

Commit

Permalink
add test for parameter with name "value"
Browse files Browse the repository at this point in the history
Verified that the value parameter is added as the nameValue parameter.
  • Loading branch information
sdutry committed Jan 4, 2018
1 parent 7df1e67 commit 2fd2cb5
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions core/src/test/java/org/apache/struts2/components/UIBeanTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -271,4 +271,16 @@ public void testSetAccesskey() {
assertEquals(accesskeyValue, txtFld.getParameters().get("accesskey"));
}

public void testValueParameterEvaluation() {
String value = "myValue";
ValueStack stack = ActionContext.getContext().getValueStack();
MockHttpServletRequest req = new MockHttpServletRequest();
MockHttpServletResponse res = new MockHttpServletResponse();

TextField txtFld = new TextField(stack, req, res);
txtFld.addParameter("value", value);
txtFld.evaluateParams();

assertEquals(value, txtFld.getParameters().get("nameValue"));
}
}

0 comments on commit 2fd2cb5

Please sign in to comment.