Index: trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.expressionevaluator/org.gvsig.expressionevaluator.lib/org.gvsig.expressionevaluator.lib.impl/src/test/java/org/gvsig/expresionevaluator/impl/TestExpressionToString.java
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.expressionevaluator/org.gvsig.expressionevaluator.lib/org.gvsig.expressionevaluator.lib.impl/src/test/java/org/gvsig/expresionevaluator/impl/TestExpressionToString.java	(revision 44613)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.expressionevaluator/org.gvsig.expressionevaluator.lib/org.gvsig.expressionevaluator.lib.impl/src/test/java/org/gvsig/expresionevaluator/impl/TestExpressionToString.java	(revision 44614)
@@ -1,41 +0,0 @@
-package org.gvsig.expresionevaluator.impl;
-
-import junit.framework.TestCase;
-import org.gvsig.expressionevaluator.Expression;
-import org.gvsig.expressionevaluator.impl.DefaultExpression;
-import org.gvsig.tools.library.impl.DefaultLibrariesInitializer;
-
-
-public class TestExpressionToString extends TestCase {
-    
-    public TestExpressionToString(String testName) {
-        super(testName);
-    }
-    
-    @Override
-    protected void setUp() throws Exception {
-        super.setUp();
-        new DefaultLibrariesInitializer().fullInitialize();
-    }
-    
-    @Override
-    protected void tearDown() throws Exception {
-        super.tearDown();
-    }
-
-    // TODO add test methods here. The name must begin with 'test'. For example:
-    // public void testHello() {}
-
-    
-    public void testBasic1() {
-        String source = "precio + 10";
-
-        Expression expression = new DefaultExpression();
-        expression.setPhrase(source);
-        
-        assertEquals(
-                "{\"phrase\":\"precio + 10\"}", 
-                expression.toJSON()
-        );
-    }
-}
Index: trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.expressionevaluator/org.gvsig.expressionevaluator.lib/org.gvsig.expressionevaluator.lib.impl/src/test/java/org/gvsig/expresionevaluator/impl/TestExpression.java
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.expressionevaluator/org.gvsig.expressionevaluator.lib/org.gvsig.expressionevaluator.lib.impl/src/test/java/org/gvsig/expresionevaluator/impl/TestExpression.java	(revision 0)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.expressionevaluator/org.gvsig.expressionevaluator.lib/org.gvsig.expressionevaluator.lib.impl/src/test/java/org/gvsig/expresionevaluator/impl/TestExpression.java	(revision 44614)
@@ -0,0 +1,78 @@
+package org.gvsig.expresionevaluator.impl;
+
+import junit.framework.TestCase;
+import org.gvsig.expressionevaluator.Expression;
+import org.gvsig.expressionevaluator.ExpressionEvaluatorLocator;
+import org.gvsig.expressionevaluator.ExpressionEvaluatorManager;
+import org.gvsig.expressionevaluator.MutableSymbolTable;
+import org.gvsig.tools.library.impl.DefaultLibrariesInitializer;
+
+
+public class TestExpression extends TestCase {
+    
+    public TestExpression(String testName) {
+        super(testName);
+    }
+    
+    @Override
+    protected void setUp() throws Exception {
+        super.setUp();
+        new DefaultLibrariesInitializer().fullInitialize();
+    }
+    
+    @Override
+    protected void tearDown() throws Exception {
+        super.tearDown();
+    }
+
+    private MutableSymbolTable createMutableSymbolTable() {
+        ExpressionEvaluatorManager manager = ExpressionEvaluatorLocator.getManager();
+        MutableSymbolTable t = manager.createSymbolTable();
+        return  t;
+    }
+    
+    private Expression createExpression() {
+        ExpressionEvaluatorManager manager = ExpressionEvaluatorLocator.getManager();
+        Expression e = manager.createExpression();
+        return  e;
+    }
+    
+    
+    // TODO add test methods here. The name must begin with 'test'. For example:
+    // public void testHello() {}
+
+    
+    public void testToJSON1() {
+        String source = "precio + 10";
+
+        Expression expression = createExpression();
+        expression.setPhrase(source);
+        
+        assertEquals(
+                "{\"phrase\":\"precio + 10\"}", 
+                expression.toJSON()
+        );
+    }
+    
+    public void testA() {
+        
+        Expression expression = createExpression();
+        expression.setPhrase("precio * 10");
+        
+        MutableSymbolTable t1 = createMutableSymbolTable();
+        t1.setVar("precio", 2);
+        Object v1 = expression.execute(t1);
+        assertEquals(20, (int)v1);
+        
+        t1.setVar("precio", 3);
+        v1 = expression.execute(t1);
+        assertEquals(30, (int)v1);
+        
+        MutableSymbolTable t2 = createMutableSymbolTable();
+        t2.setVar("precio", 4);
+        v1 = expression.execute(t2);
+        assertEquals(40, (int)v1);
+        
+    }
+    
+}
