use of org.springframework.expression.ExpressionParser in project spring-framework by spring-projects.
the class SpelReproTests method SPR9486_subtractFloatWithDouble.
@Test
public void SPR9486_subtractFloatWithDouble() {
Number expectedNumber = 10.21f - 10.2;
ExpressionParser parser = new SpelExpressionParser();
StandardEvaluationContext context = new StandardEvaluationContext();
Expression expression = parser.parseExpression("10.21f - 10.2");
Number result = expression.getValue(context, null, Number.class);
assertEquals(expectedNumber, result);
}
use of org.springframework.expression.ExpressionParser in project spring-framework by spring-projects.
the class SpelReproTests method SPR9486_floatDivideByFloat.
@Test
public void SPR9486_floatDivideByFloat() {
Number expectedNumber = -10.21f / -10.2f;
ExpressionParser parser = new SpelExpressionParser();
StandardEvaluationContext context = new StandardEvaluationContext();
Expression expression = parser.parseExpression("-10.21f / -10.2f");
Number result = expression.getValue(context, null, Number.class);
assertEquals(expectedNumber, result);
}
use of org.springframework.expression.ExpressionParser in project spring-framework by spring-projects.
the class SpelReproTests method SPR10091_primitiveTestValueType.
@Test
public void SPR10091_primitiveTestValueType() {
ExpressionParser parser = new SpelExpressionParser();
StandardEvaluationContext evaluationContext = new StandardEvaluationContext(new BooleanHolder());
Class<?> valueType = parser.parseExpression("primitiveProperty").getValueType(evaluationContext);
assertNotNull(valueType);
}
use of org.springframework.expression.ExpressionParser in project spring-framework by spring-projects.
the class SpelReproTests method SPR10091_simpleTestValue.
@Test
public void SPR10091_simpleTestValue() {
ExpressionParser parser = new SpelExpressionParser();
StandardEvaluationContext evaluationContext = new StandardEvaluationContext(new BooleanHolder());
Object value = parser.parseExpression("simpleProperty").getValue(evaluationContext);
assertNotNull(value);
}
use of org.springframework.expression.ExpressionParser in project spring-framework by spring-projects.
the class SpelReproTests method SPR9486_addFloatWithDouble.
@Test
public void SPR9486_addFloatWithDouble() {
Number expectedNumber = 10.21f + 10.2;
ExpressionParser parser = new SpelExpressionParser();
StandardEvaluationContext context = new StandardEvaluationContext();
Expression expression = parser.parseExpression("10.21f + 10.2");
Number result = expression.getValue(context, null, Number.class);
assertEquals(expectedNumber, result);
}
Aggregations