You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by se...@apache.org on 2009/09/03 12:49:25 UTC
svn commit: r810886 -
/commons/proper/jexl/branches/2.0/src/test/java/org/apache/commons/jexl/IssuesTest.java
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);
}