geirm 01/10/23 20:03:33
Modified: src/java/org/apache/velocity/test TemplateTestCase.java
src/java/org/apache/velocity/test/misc Test.java
Log:
Added int[] to context to test primitive array support
Revision Changes Path
1.33 +3 -1
jakarta-velocity/src/java/org/apache/velocity/test/TemplateTestCase.java
Index: TemplateTestCase.java
===================================================================
RCS file:
/home/cvs/jakarta-velocity/src/java/org/apache/velocity/test/TemplateTestCase.java,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -r1.32 -r1.33
--- TemplateTestCase.java 2001/10/22 03:53:26 1.32
+++ TemplateTestCase.java 2001/10/24 03:03:33 1.33
@@ -99,7 +99,7 @@
* @author <a href="mailto:[EMAIL PROTECTED]">Jason van Zyl</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Geir Magnusson Jr.</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Jon S. Stevens</a>
- * @version $Id: TemplateTestCase.java,v 1.32 2001/10/22 03:53:26 jon Exp $
+ * @version $Id: TemplateTestCase.java,v 1.33 2001/10/24 03:03:33 geirm Exp $
*/
public class TemplateTestCase extends BaseTestCase implements TemplateTestBase
{
@@ -186,12 +186,14 @@
*/
Object[] oarr = { "a","b","c","d" } ;
+ int intarr[] = { 10, 20, 30, 40, 50 };
context.put( "collection", vec );
context2.put("iterator", vec.iterator());
context1.put("map", h );
context.put("obarr", oarr );
context.put("enumerator", vec.elements());
+ context.put("intarr", intarr );
}
/**
1.33 +9 -4
jakarta-velocity/src/java/org/apache/velocity/test/misc/Test.java
Index: Test.java
===================================================================
RCS file:
/home/cvs/jakarta-velocity/src/java/org/apache/velocity/test/misc/Test.java,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -r1.32 -r1.33
--- Test.java 2001/10/22 03:53:26 1.32
+++ Test.java 2001/10/24 03:03:33 1.33
@@ -89,13 +89,16 @@
import org.apache.velocity.context.Context;
+import java.net.URL;
+
+
/**
* This class the testbed for Velocity. It is used to
* test all the directives support by Velocity.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Jason van Zyl</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Geir Magnusson Jr.</a>
- * @version $Id: Test.java,v 1.32 2001/10/22 03:53:26 jon Exp $
+ * @version $Id: Test.java,v 1.33 2001/10/24 03:03:33 geirm Exp $
*/
public class Test implements ReferenceInsertionEventHandler,
NullSetEventHandler,
@@ -241,12 +244,13 @@
context.put("Floog", "floogie woogie");
context.put("geirstring", str );
context.put("mylong", new Long(5) );
-
-
+
/*
* we want to make sure we test all types of iterative objects
* in #foreach()
*/
+
+ int intarr[] = { 10, 20, 30, 40, 50 };
Object[] oarr = { "a","b","c","d" } ;
@@ -254,7 +258,8 @@
context.put("iterator", v.iterator());
context.put("map", h );
context.put("obarr", oarr );
-
+ context.put("intarr", intarr );
+
String stest = " My name is $name -> $Floog";
StringWriter w = new StringWriter();
// Velocity.evaluate( context, w, "evaltest",stest );