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/08/04 17:00:38 UTC
svn commit: r800831 -
/commons/proper/jexl/branches/2.0/src/main/java/org/apache/commons/jexl/junit/Asserter.java
Author: sebb
Date: Tue Aug 4 15:00:38 2009
New Revision: 800831
URL: http://svn.apache.org/viewvc?rev=800831&view=rev
Log:
Stop using deprecated ExpressionFactory
Modified:
commons/proper/jexl/branches/2.0/src/main/java/org/apache/commons/jexl/junit/Asserter.java
Modified: commons/proper/jexl/branches/2.0/src/main/java/org/apache/commons/jexl/junit/Asserter.java
URL: http://svn.apache.org/viewvc/commons/proper/jexl/branches/2.0/src/main/java/org/apache/commons/jexl/junit/Asserter.java?rev=800831&r1=800830&r2=800831&view=diff
==============================================================================
--- commons/proper/jexl/branches/2.0/src/main/java/org/apache/commons/jexl/junit/Asserter.java (original)
+++ commons/proper/jexl/branches/2.0/src/main/java/org/apache/commons/jexl/junit/Asserter.java Tue Aug 4 15:00:38 2009
@@ -23,8 +23,8 @@
import junit.framework.Assert;
import org.apache.commons.jexl.Expression;
-import org.apache.commons.jexl.ExpressionFactory;
import org.apache.commons.jexl.JexlContext;
+import org.apache.commons.jexl.JexlEngine;
import org.apache.commons.jexl.JexlHelper;
/**
@@ -43,6 +43,9 @@
/** context to use during asserts. */
private final JexlContext context = JexlHelper.createContext();
+ /** Jexl engine to use during Asserts. */
+ private static final JexlEngine engine = new JexlEngine();
+
/**
*
* Create an asserter.
@@ -71,7 +74,7 @@
* fails
*/
public void assertExpression(String expression, Object expected) throws Exception {
- Expression exp = ExpressionFactory.createExpression(expression);
+ Expression exp = engine.createExpression(expression);
context.setVars(variables);
Object value = exp.evaluate(context);