Skip to content

Commit 355e4b5

Browse files
committed
Adds additional test to cover deprecated option
1 parent 1ec1e71 commit 355e4b5

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

core/src/test/java/com/opensymphony/xwork2/ognl/accessor/XWorkListPropertyAccessorTest.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,4 +83,23 @@ public void testAutoGrowthCollectionLimit() {
8383
assertEquals(3, vs.findValue("strings.size()"));
8484
}
8585

86+
public void testDeprecatedAutoGrowCollectionLimit() {
87+
PropertyAccessor accessor = container.getInstance(PropertyAccessor.class, ArrayList.class.getName());
88+
((XWorkListPropertyAccessor) accessor).setDeprecatedAutoGrowCollectionLimit("2");
89+
90+
List<String> myList = new ArrayList<>();
91+
ListHolder listHolder = new ListHolder();
92+
listHolder.setStrings(myList);
93+
94+
ValueStack vs = ActionContext.getContext().getValueStack();
95+
vs.push(listHolder);
96+
97+
vs.setValue("strings[0]", "a");
98+
vs.setValue("strings[1]", "b");
99+
vs.setValue("strings[2]", "c");
100+
vs.setValue("strings[3]", "d");
101+
102+
assertEquals(3, vs.findValue("strings.size()"));
103+
}
104+
86105
}

0 commit comments

Comments
 (0)