You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by di...@apache.org on 2006/04/06 05:35:00 UTC

svn commit: r391888 - /jakarta/commons/proper/jexl/trunk/src/test/org/apache/commons/jexl/JexlTest.java

Author: dion
Date: Wed Apr  5 20:34:59 2006
New Revision: 391888

URL: http://svn.apache.org/viewcvs?rev=391888&view=rev
Log:
Ensure there are tests for the various supported numbers in a unary minus.

Modified:
    jakarta/commons/proper/jexl/trunk/src/test/org/apache/commons/jexl/JexlTest.java

Modified: jakarta/commons/proper/jexl/trunk/src/test/org/apache/commons/jexl/JexlTest.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/jexl/trunk/src/test/org/apache/commons/jexl/JexlTest.java?rev=391888&r1=391887&r2=391888&view=diff
==============================================================================
--- jakarta/commons/proper/jexl/trunk/src/test/org/apache/commons/jexl/JexlTest.java (original)
+++ jakarta/commons/proper/jexl/trunk/src/test/org/apache/commons/jexl/JexlTest.java Wed Apr  5 20:34:59 2006
@@ -16,6 +16,8 @@
 package org.apache.commons.jexl;
 
 import java.io.StringReader;
+import java.math.BigDecimal;
+import java.math.BigInteger;
 import java.util.ArrayList;
 import java.util.BitSet;
 import java.util.Calendar;
@@ -363,8 +365,25 @@
         throws Exception
    {
        JexlContext jc = JexlHelper.createContext();
-       assertExpression(jc, "-3", new Integer(-3));
+
+       jc.getVars().put("aByte", new Byte((byte)1));
+       jc.getVars().put("aShort", new Short((short)2));
+       jc.getVars().put("anInteger", new Integer(3));
+       jc.getVars().put("aLong", new Long(4));
+       jc.getVars().put("aFloat", new Float(5.5));
+       jc.getVars().put("aDouble", new Double(6.6));
+       jc.getVars().put("aBigInteger", new BigInteger("7"));
+       jc.getVars().put("aBigDecimal", new BigDecimal("8.8"));
+       assertExpression(jc, "-3", new Integer("-3"));
        assertExpression(jc, "-3.0", new Float("-3.0"));
+       assertExpression(jc, "-aByte", new Byte((byte)-1));
+       assertExpression(jc, "-aShort", new Short((short)-2));
+       assertExpression(jc, "-anInteger", new Integer(-3));
+       assertExpression(jc, "-aLong", new Long(-4));
+       assertExpression(jc, "-aFloat", new Float(-5.5));
+       assertExpression(jc, "-aDouble", new Double(-6.6));
+       assertExpression(jc, "-aBigInteger", new BigInteger("-7"));
+       assertExpression(jc, "-aBigDecimal", new BigDecimal("-8.8"));
    }
 
     



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org