jstrachan 02/05/20 07:11:25
Modified: jexl/src/test/org/apache/commons/jexl JexlTest.java
Log:
Added new test case for int properties, seems to work fine
Revision Changes Path
1.8 +22 -1
jakarta-commons-sandbox/jexl/src/test/org/apache/commons/jexl/JexlTest.java
Index: JexlTest.java
===================================================================
RCS file:
/home/cvs/jakarta-commons-sandbox/jexl/src/test/org/apache/commons/jexl/JexlTest.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- JexlTest.java 20 May 2002 12:32:23 -0000 1.7
+++ JexlTest.java 20 May 2002 14:11:25 -0000 1.8
@@ -71,7 +71,7 @@
* Simple testcases
*
* @author <a href="mailto:[EMAIL PROTECTED]">Geir Magnusson Jr.</a>
- * @version $Id: JexlTest.java,v 1.7 2002/05/20 12:32:23 jstrachan Exp $
+ * @version $Id: JexlTest.java,v 1.8 2002/05/20 14:11:25 jstrachan Exp $
*/
public class JexlTest extends TestCase
{
@@ -569,6 +569,23 @@
assertEquals("o incorrect", "123", o);
}
+ /**
+ * test the use of an int based property
+ */
+ public void testIntProperty()
+ throws Exception
+ {
+ Expression e = ExpressionFactory.createExpression("foo.count");
+ JexlContext jc = JexlHelper.createContext();
+
+ Foo foo = new Foo();
+
+ jc.getVars().put("foo", foo );
+ Object o = e.evaluate(jc);
+
+ assertEquals("o incorrect", new Integer(5), o);
+ }
+
public class Foo
{
public String bar()
@@ -594,6 +611,10 @@
public String convertBoolean(boolean b)
{
return "Boolean : " + b;
+ }
+
+ public int getCount() {
+ return 5;
}
}
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>