commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r810886 - /commons/proper/jexl/branches/2.0/src/test/java/org/apache/commons/jexl/IssuesTest.java
Date Thu, 03 Sep 2009 10:49:25 GMT
Author: sebb
Date: Thu Sep  3 10:49:25 2009
New Revision: 810886

URL: http://svn.apache.org/viewvc?rev=810886&view=rev
Log:
Remove unused code and variables
Simplify failure reporting

Modified:
    commons/proper/jexl/branches/2.0/src/test/java/org/apache/commons/jexl/IssuesTest.java

Modified: commons/proper/jexl/branches/2.0/src/test/java/org/apache/commons/jexl/IssuesTest.java
URL: http://svn.apache.org/viewvc/commons/proper/jexl/branches/2.0/src/test/java/org/apache/commons/jexl/IssuesTest.java?rev=810886&r1=810885&r2=810886&view=diff
==============================================================================
--- commons/proper/jexl/branches/2.0/src/test/java/org/apache/commons/jexl/IssuesTest.java
(original)
+++ commons/proper/jexl/branches/2.0/src/test/java/org/apache/commons/jexl/IssuesTest.java
Thu Sep  3 10:49:25 2009
@@ -277,15 +277,11 @@
             "while (x) 1 if (y) 2 3"
         };
         for (int f = 0; f < fexprs.length; ++f) {
-            boolean fail = true;
             try {
-                Script s = jexl.createScript(fexprs[f]);
+                jexl.createScript(fexprs[f]);
+                fail(fexprs[f] + ": Should have failed in parse");
             } catch (ParseException xany) {
                 // expected to fail in parse
-                fail = false;
-            }
-            if (fail) {
-                fail(fexprs[f] + ": Should have failed in parse");
             }
         }
         // ';' is necessary between expressions and only expressions
@@ -296,11 +292,11 @@
             "for(z : [3, 4, 5]) { z } y ? 2 : 1",
             "for(z : [3, 4, 5]) { z } if (y) 2 else 1"
         };
-        ctxt.getVars().put("x", false);
-        ctxt.getVars().put("y", true);
+        ctxt.getVars().put("x", Boolean.FALSE);
+        ctxt.getVars().put("y", Boolean.TRUE);
         for (int e = 0; e < exprs.length; ++e) {
             Script s = jexl.createScript(exprs[e]);
-            assertEquals(2, s.execute(ctxt));
+            assertEquals(Integer.valueOf(2), s.execute(ctxt));
         }
         debuggerCheck(jexl);
     }



Mime
View raw message