You are viewing a plain text version of this content. The canonical link for it is here.
Posted to taglibs-dev@jakarta.apache.org by sh...@apache.org on 2002/10/14 01:57:14 UTC
cvs commit: jakarta-taglibs/standard/src/org/apache/taglibs/standard/lang/jstl/test StaticFunctionTests.java
shawn 2002/10/13 16:57:14
Modified: standard/src/org/apache/taglibs/standard/lang/jstl/test
StaticFunctionTests.java
Log:
Just some new tests for the EL evaluator.
Revision Changes Path
1.2 +23 -0 jakarta-taglibs/standard/src/org/apache/taglibs/standard/lang/jstl/test/StaticFunctionTests.java
Index: StaticFunctionTests.java
===================================================================
RCS file: /home/cvs/jakarta-taglibs/standard/src/org/apache/taglibs/standard/lang/jstl/test/StaticFunctionTests.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- StaticFunctionTests.java 15 Jul 2002 05:53:50 -0000 1.1
+++ StaticFunctionTests.java 13 Oct 2002 23:57:14 -0000 1.2
@@ -87,6 +87,17 @@
System.out.println(o);
o = e.evaluate("", "${add(2, 3) + 5}", Integer.class, null, null, m, "foo");
System.out.println(o);
+
+ System.out.println("---");
+ o = e.evaluate("", "${getInt(getInteger(getInt(5)))}", Integer.class, null, null, m, "foo");
+ System.out.println(o);
+ o = e.evaluate("", "${getInteger(getInt(getInteger(5)))}", Integer.class, null, null, m, "foo");
+ System.out.println(o);
+ o = e.evaluate("", "${getInt(getInt(getInt(5)))}", Integer.class, null, null, m, "foo");
+ System.out.println(o);
+ o = e.evaluate("", "${getInteger(getInteger(getInteger(5)))}", Integer.class, null, null, m, "foo");
+ System.out.println(o);
+
}
public static int add(int a, int b) {
@@ -97,6 +108,14 @@
return a * b;
}
+ public static int getInt(Integer i) {
+ return i.intValue();
+ }
+
+ public static Integer getInteger(int i) {
+ return new Integer(i);
+ }
+
public static Map getSampleMethodMap() throws Exception {
Map m = new HashMap();
Class c = StaticFunctionTests.class;
@@ -104,6 +123,10 @@
c.getMethod("add", new Class[] { Integer.TYPE, Integer.TYPE }));
m.put("foo:multiply",
c.getMethod("multiply", new Class[] { Integer.TYPE, Integer.TYPE }));
+ m.put("foo:getInt",
+ c.getMethod("getInt", new Class[] { Integer.class }));
+ m.put("foo:getInteger",
+ c.getMethod("getInteger", new Class[] { Integer.TYPE }));
return m;
}
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>