You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@struts.apache.org by mu...@apache.org on 2009/02/05 22:47:54 UTC
svn commit: r741310 -
/struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/IteratorTagTest.java
Author: musachy
Date: Thu Feb 5 21:47:54 2009
New Revision: 741310
URL: http://svn.apache.org/viewvc?rev=741310&view=rev
Log:
WW-2984 Add test cases for negative step and no end on iterator tag
Modified:
struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/IteratorTagTest.java
Modified: struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/IteratorTagTest.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/IteratorTagTest.java?rev=741310&r1=741309&r2=741310&view=diff
==============================================================================
--- struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/IteratorTagTest.java (original)
+++ struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/IteratorTagTest.java Thu Feb 5 21:47:54 2009
@@ -602,6 +602,25 @@
validateCounter(new String[]{"d", "c", "b"});
}
+ public void testCounterWithListAndNegativeStepNoEnd() throws JspException {
+ Foo foo = new Foo();
+ ArrayList list = new ArrayList();
+ list.add("a");
+ list.add("b");
+ list.add("c");
+ list.add("d");
+ foo.setList(list);
+
+ stack.push(foo);
+
+ tag.setValue("list");
+
+ tag.setStep("-1");
+ tag.setBegin("3");
+
+ validateCounter(new String[]{"d", "c", "b", "a"});
+ }
+
public void testCounterWithArrayAndNegativeStep() throws JspException {
Foo foo = new Foo();
ArrayList list = new ArrayList();
@@ -622,6 +641,25 @@
validateCounter(new String[]{"d", "c", "b"});
}
+ public void testCounterWithArrayAndNegativeStepNoEnd() throws JspException {
+ Foo foo = new Foo();
+ ArrayList list = new ArrayList();
+ list.add("a");
+ list.add("b");
+ list.add("c");
+ list.add("d");
+ foo.setList(list);
+
+ stack.push(foo);
+
+ tag.setValue("list");
+
+ tag.setStep("-1");
+ tag.setBegin("3");
+
+ validateCounter(new String[]{"d", "c", "b", "a"});
+ }
+
protected void validateCounter(Object[] expectedValues) throws JspException {
List values = new ArrayList();
try {