commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1135717 - in /commons/proper/jexl/trunk/src/test/java/org/apache/commons/jexl2: ArithmeticTest.java ArrayAccessTest.java MethodTest.java PublicFieldsTest.java
Date Tue, 14 Jun 2011 17:28:14 GMT
Author: sebb
Date: Tue Jun 14 17:28:14 2011
New Revision: 1135717

URL: http://svn.apache.org/viewvc?rev=1135717&view=rev
Log:
Boxing fixes

Modified:
    commons/proper/jexl/trunk/src/test/java/org/apache/commons/jexl2/ArithmeticTest.java
    commons/proper/jexl/trunk/src/test/java/org/apache/commons/jexl2/ArrayAccessTest.java
    commons/proper/jexl/trunk/src/test/java/org/apache/commons/jexl2/MethodTest.java
    commons/proper/jexl/trunk/src/test/java/org/apache/commons/jexl2/PublicFieldsTest.java

Modified: commons/proper/jexl/trunk/src/test/java/org/apache/commons/jexl2/ArithmeticTest.java
URL: http://svn.apache.org/viewvc/commons/proper/jexl/trunk/src/test/java/org/apache/commons/jexl2/ArithmeticTest.java?rev=1135717&r1=1135716&r2=1135717&view=diff
==============================================================================
--- commons/proper/jexl/trunk/src/test/java/org/apache/commons/jexl2/ArithmeticTest.java (original)
+++ commons/proper/jexl/trunk/src/test/java/org/apache/commons/jexl2/ArithmeticTest.java Tue
Jun 14 17:28:14 2011
@@ -42,7 +42,7 @@ public class ArithmeticTest extends Jexl
     
     public void testLeftNullOperand() throws Exception {
         asserter.setVariable("left", null);
-        asserter.setVariable("right", 8);
+        asserter.setVariable("right", Integer.valueOf(8));
         asserter.failExpression("left + right", ".*null.*");
         asserter.failExpression("left - right", ".*null.*");
         asserter.failExpression("left * right", ".*null.*");
@@ -54,7 +54,7 @@ public class ArithmeticTest extends Jexl
     }
 
     public void testRightNullOperand() throws Exception {
-        asserter.setVariable("left", 9);
+        asserter.setVariable("left", Integer.valueOf(9));
         asserter.setVariable("right", null);
         asserter.failExpression("left + right", ".*null.*");
         asserter.failExpression("left - right", ".*null.*");
@@ -260,13 +260,12 @@ public class ArithmeticTest extends Jexl
         // number of permutations this will generate
         final int PERMS = tnames.length * tnames.length;
 
-        JexlEngine jexl = this.createThreadedArithmeticEngine(true);
-        JexlThreadedArithmetic arith = (JexlThreadedArithmetic) jexl.getArithmetic();
+        JexlEngine jexl = createThreadedArithmeticEngine(true);
         jexl.setCache(128);
         jexl.setSilent(false);
         // for non-silent, silent...
         for (int s = 0; s < 2; ++s) {
-            arith.setLenient(s == 0);
+            JexlThreadedArithmetic.setLenient(Boolean.valueOf(s == 0));
             int zthrow = 0;
             int zeval = 0;
             // for vars of all types...

Modified: commons/proper/jexl/trunk/src/test/java/org/apache/commons/jexl2/ArrayAccessTest.java
URL: http://svn.apache.org/viewvc/commons/proper/jexl/trunk/src/test/java/org/apache/commons/jexl2/ArrayAccessTest.java?rev=1135717&r1=1135716&r2=1135717&view=diff
==============================================================================
--- commons/proper/jexl/trunk/src/test/java/org/apache/commons/jexl2/ArrayAccessTest.java
(original)
+++ commons/proper/jexl/trunk/src/test/java/org/apache/commons/jexl2/ArrayAccessTest.java
Tue Jun 14 17:28:14 2011
@@ -161,9 +161,9 @@ public class ArrayAccessTest extends Jex
         foo[1] = i42;
         foo[2] = s42;
         asserter.setVariable("foo", foo);
-        asserter.setVariable("zero", 0);
-        asserter.setVariable("one", 1);
-        asserter.setVariable("two", 2);
+        asserter.setVariable("zero", Integer.valueOf(0));
+        asserter.setVariable("one", Integer.valueOf(1));
+        asserter.setVariable("two", Integer.valueOf(2));
         for(int l = 0; l < 2; ++l) {
             asserter.assertExpression("foo[0]", foo);
             asserter.assertExpression("foo[0][0]", foo);

Modified: commons/proper/jexl/trunk/src/test/java/org/apache/commons/jexl2/MethodTest.java
URL: http://svn.apache.org/viewvc/commons/proper/jexl/trunk/src/test/java/org/apache/commons/jexl2/MethodTest.java?rev=1135717&r1=1135716&r2=1135717&view=diff
==============================================================================
--- commons/proper/jexl/trunk/src/test/java/org/apache/commons/jexl2/MethodTest.java (original)
+++ commons/proper/jexl/trunk/src/test/java/org/apache/commons/jexl2/MethodTest.java Tue Jun
14 17:28:14 2011
@@ -34,7 +34,7 @@ public class MethodTest extends JexlTest
             int result = 0;
             if (args != null) {
                 for (int i = 0; i < args.length; i++) {
-                        result += args[i] != null ?args[i] : -100;
+                        result += args[i] != null ? args[i].intValue() : -100;
                 }
             } else {
                 result = -1000;
@@ -46,7 +46,7 @@ public class MethodTest extends JexlTest
             int result = fixed.intValue();
             if (args != null) {
                 for (int i = 0; i < args.length; i++) {
-                    result += args[i] != null ?args[i] : -100;
+                    result += args[i] != null ? args[i].intValue() : -100;
                 }
             } else {
                 result -= 1000;
@@ -58,7 +58,7 @@ public class MethodTest extends JexlTest
             int result = 0;
             if (args != null) {
                 for (int i = 0; i < args.length; i++) {
-                    result += args[i] != null ?args[i] : -100;
+                    result += args[i] != null ? args[i].intValue() : -100;
                 }
             } else {
                 result = -1000;
@@ -116,11 +116,11 @@ public class MethodTest extends JexlTest
     public void testCallMixedVarArgMethod() throws Exception {
         VarArgs test = new VarArgs();
         asserter.setVariable("test", test);
-        assertEquals("Mixed:1", test.callMixed(1));
+        assertEquals("Mixed:1", test.callMixed(Integer.valueOf(1)));
         asserter.assertExpression("test.callMixed(1)", "Mixed:1");
         // Java and JEXL equivalent behavior: 'Mixed:-999' expected
         //{
-        assertEquals("Mixed:-999", test.callMixed(1, null));
+        assertEquals("Mixed:-999", test.callMixed(Integer.valueOf(1), (Integer[]) null));
         asserter.assertExpression("test.callMixed(1, null)", "Mixed:-999");
         //}
         asserter.assertExpression("test.callMixed(1,2)", "Mixed:3");
@@ -134,7 +134,7 @@ public class MethodTest extends JexlTest
         asserter.assertExpression("test.callMixed('jexl')", "jexl:0");
         // Java and JEXL equivalent behavior: 'jexl:-1000' expected
         //{
-        assertEquals("jexl:-1000", test.callMixed("jexl", null));
+        assertEquals("jexl:-1000", test.callMixed("jexl", (Integer []) null));
         asserter.assertExpression("test.callMixed('jexl', null)", "jexl:-1000");
         //}
         asserter.assertExpression("test.callMixed('jexl', 2)", "jexl:2");

Modified: commons/proper/jexl/trunk/src/test/java/org/apache/commons/jexl2/PublicFieldsTest.java
URL: http://svn.apache.org/viewvc/commons/proper/jexl/trunk/src/test/java/org/apache/commons/jexl2/PublicFieldsTest.java?rev=1135717&r1=1135716&r2=1135717&view=diff
==============================================================================
--- commons/proper/jexl/trunk/src/test/java/org/apache/commons/jexl2/PublicFieldsTest.java
(original)
+++ commons/proper/jexl/trunk/src/test/java/org/apache/commons/jexl2/PublicFieldsTest.java
Tue Jun 14 17:28:14 2011
@@ -19,6 +19,7 @@ package org.apache.commons.jexl2;
 /**
  * Tests public field set/get.
  */
+@SuppressWarnings("boxing")
 public class PublicFieldsTest extends JexlTestCase {
     // some constants
     private static final String LOWER42 = "fourty-two";



Mime
View raw message