|
|
|
@ -64,7 +64,7 @@ import static org.springframework.expression.spel.standard.SpelExpressionTestUti |
|
|
|
public class SpelCompilationCoverageTests extends AbstractExpressionTests { |
|
|
|
public class SpelCompilationCoverageTests extends AbstractExpressionTests { |
|
|
|
|
|
|
|
|
|
|
|
/* |
|
|
|
/* |
|
|
|
* Further TODOs for compilation: |
|
|
|
* TODO Potential optimizations for SpEL compilation: |
|
|
|
* |
|
|
|
* |
|
|
|
* - OpMinus with a single literal operand could be treated as a negative literal. Will save a |
|
|
|
* - OpMinus with a single literal operand could be treated as a negative literal. Will save a |
|
|
|
* pointless loading of 0 and then a subtract instruction in code gen. |
|
|
|
* pointless loading of 0 and then a subtract instruction in code gen. |
|
|
|
@ -1205,12 +1205,12 @@ public class SpelCompilationCoverageTests extends AbstractExpressionTests { |
|
|
|
assertCanCompile(expression); |
|
|
|
assertCanCompile(expression); |
|
|
|
assertThat(expression.getValue(context, new SomeCompareMethod2()).toString()).isEqualTo("xyz"); |
|
|
|
assertThat(expression.getValue(context, new SomeCompareMethod2()).toString()).isEqualTo("xyz"); |
|
|
|
|
|
|
|
|
|
|
|
// TODO fails due to conversionservice handling of String[] to Object...
|
|
|
|
// TODO Determine why the String[] is passed as the first element of the Object... varargs array instead of the entire varargs array.
|
|
|
|
// expression = parser.parseExpression("#append2(#stringArray)");
|
|
|
|
// expression = parser.parseExpression("#append2(#stringArray)");
|
|
|
|
// assertEquals("xyz", expression.getValue(context).toString());
|
|
|
|
// assertThat(expression.getValue(context)).hasToString("xyz");
|
|
|
|
// assertTrue(((SpelNodeImpl)((SpelExpression) expression).getAST()).isCompilable());
|
|
|
|
// assertThat(((SpelNodeImpl) ((SpelExpression) expression).getAST()).isCompilable()).isTrue();
|
|
|
|
// assertCanCompile(expression);
|
|
|
|
// assertCanCompile(expression);
|
|
|
|
// assertEquals("xyz", expression.getValue(context).toString());
|
|
|
|
// assertThat(expression.getValue(context)).hasToString("xyz");
|
|
|
|
|
|
|
|
|
|
|
|
expression = parser.parseExpression("#sum(1,2,3)"); |
|
|
|
expression = parser.parseExpression("#sum(1,2,3)"); |
|
|
|
assertThat(expression.getValue(context)).isEqualTo(6); |
|
|
|
assertThat(expression.getValue(context)).isEqualTo(6); |
|
|
|
@ -3703,15 +3703,15 @@ public class SpelCompilationCoverageTests extends AbstractExpressionTests { |
|
|
|
assertThat(tc.s).isEqualTo("aaabbbccc"); |
|
|
|
assertThat(tc.s).isEqualTo("aaabbbccc"); |
|
|
|
tc.reset(); |
|
|
|
tc.reset(); |
|
|
|
|
|
|
|
|
|
|
|
// TODO Fails related to conversion service converting a String[] to satisfy Object...
|
|
|
|
// TODO Determine why the String[] is passed as the first element of the Object... varargs array instead of the entire varargs array.
|
|
|
|
// expression = parser.parseExpression("sixteen(stringArray)");
|
|
|
|
// expression = parser.parseExpression("sixteen(stringArray)");
|
|
|
|
// assertCantCompile(expression);
|
|
|
|
// assertCantCompile(expression);
|
|
|
|
// expression.getValue(tc);
|
|
|
|
// expression.getValue(tc);
|
|
|
|
// assertEquals("aaabbbccc", tc.s);
|
|
|
|
// assertThat(tc.s).isEqualTo("aaabbbccc");
|
|
|
|
// assertCanCompile(expression);
|
|
|
|
// assertCanCompile(expression);
|
|
|
|
// tc.reset();
|
|
|
|
// tc.reset();
|
|
|
|
// expression.getValue(tc);
|
|
|
|
// expression.getValue(tc);
|
|
|
|
// assertEquals("aaabbbccc", tc.s);
|
|
|
|
// assertThat(tc.s).isEqualTo("aaabbbccc");
|
|
|
|
// tc.reset();
|
|
|
|
// tc.reset();
|
|
|
|
|
|
|
|
|
|
|
|
// varargs int
|
|
|
|
// varargs int
|
|
|
|
|