Browse Source

Fix SPEL tests when using maven. With the maven test runner expression.spel.SetValueTests is run before expression.spel.EvaluationTests. The order is reversed in eclipse/spring-build. Static variables are modifed in SetValueTests that cause EvaluationTests to fail if it is run first. Make a simple fix so SetValueTests uses a local evaluation context variable instead of a static variable.

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@848 50f2f4bb-b051-0410-bef5-90022cba6387
pull/1/head
Mark Pollack 17 years ago
parent
commit
6ac7a300c8
  1. 8
      org.springframework.expression/src/test/java/org/springframework/expression/spel/SetValueTests.java

8
org.springframework.expression/src/test/java/org/springframework/expression/spel/SetValueTests.java

@ -19,6 +19,7 @@ package org.springframework.expression.spel; @@ -19,6 +19,7 @@ package org.springframework.expression.spel;
import org.springframework.expression.EvaluationException;
import org.springframework.expression.Expression;
import org.springframework.expression.ParseException;
import org.springframework.expression.spel.support.StandardEvaluationContext;
/**
* Tests set value expressions.
@ -70,9 +71,10 @@ public class SetValueTests extends ExpressionTestCase { @@ -70,9 +71,10 @@ public class SetValueTests extends ExpressionTestCase {
if (DEBUG) {
SpelUtilities.printAbstractSyntaxTree(System.out, e);
}
assertTrue("Expression is not writeable but should be", e.isWritable(eContext));
e.setValue(eContext, value);
assertEquals("Retrieved value was not equal to set value", value, e.getValue(eContext));
StandardEvaluationContext lContext = TestScenarioCreator.getTestEvaluationContext();
assertTrue("Expression is not writeable but should be", e.isWritable(lContext));
e.setValue(lContext, value);
assertEquals("Retrieved value was not equal to set value", value, e.getValue(lContext));
} catch (EvaluationException ee) {
ee.printStackTrace();
fail("Unexpected Exception: " + ee.getMessage());

Loading…
Cancel
Save