You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@velocity.apache.org by by...@apache.org on 2008/12/28 11:30:33 UTC
svn commit: r729716 - in /velocity/engine/branches/1.6.x: ./
src/test/org/apache/velocity/test/ForeachTestCase.java
src/test/org/apache/velocity/test/StrictCompareTestCase.java
Author: byron
Date: Sun Dec 28 02:30:33 2008
New Revision: 729716
URL: http://svn.apache.org/viewvc?rev=729716&view=rev
Log:
merge VELOCITY-657 from trunk
Modified:
velocity/engine/branches/1.6.x/ (props changed)
velocity/engine/branches/1.6.x/src/test/org/apache/velocity/test/ForeachTestCase.java
velocity/engine/branches/1.6.x/src/test/org/apache/velocity/test/StrictCompareTestCase.java
Propchange: velocity/engine/branches/1.6.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sun Dec 28 02:30:33 2008
@@ -1 +1 @@
-/velocity/engine/trunk:728869
+/velocity/engine/trunk:728869-729216
Modified: velocity/engine/branches/1.6.x/src/test/org/apache/velocity/test/ForeachTestCase.java
URL: http://svn.apache.org/viewvc/velocity/engine/branches/1.6.x/src/test/org/apache/velocity/test/ForeachTestCase.java?rev=729716&r1=729715&r2=729716&view=diff
==============================================================================
--- velocity/engine/branches/1.6.x/src/test/org/apache/velocity/test/ForeachTestCase.java (original)
+++ velocity/engine/branches/1.6.x/src/test/org/apache/velocity/test/ForeachTestCase.java Sun Dec 28 02:30:33 2008
@@ -124,6 +124,20 @@
assertEquals("", writer.toString());
}
+ public void testVelocityHasNextProperty()
+ throws Exception
+ {
+ List list = new ArrayList();
+ list.add("test1");
+ list.add("test2");
+ list.add("test3");
+ context.put("list", list);
+
+ StringWriter writer = new StringWriter();
+ String template = "#foreach ($value in $list)$value #if( $velocityHasNext )SEPARATOR #end#end";
+ Velocity.evaluate(context, writer, "test", template);
+ assertEquals("test1 SEPARATOR test2 SEPARATOR test3 ", writer.toString());
+ }
public static class MyIterable
{
Modified: velocity/engine/branches/1.6.x/src/test/org/apache/velocity/test/StrictCompareTestCase.java
URL: http://svn.apache.org/viewvc/velocity/engine/branches/1.6.x/src/test/org/apache/velocity/test/StrictCompareTestCase.java?rev=729716&r1=729715&r2=729716&view=diff
==============================================================================
--- velocity/engine/branches/1.6.x/src/test/org/apache/velocity/test/StrictCompareTestCase.java (original)
+++ velocity/engine/branches/1.6.x/src/test/org/apache/velocity/test/StrictCompareTestCase.java Sun Dec 28 02:30:33 2008
@@ -1,5 +1,24 @@
package org.apache.velocity.test;
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
import org.apache.velocity.exception.MethodInvocationException;
import org.apache.velocity.exception.VelocityException;
import org.apache.velocity.exception.ParseErrorException;