Polish tests
See gh-27248
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2020 the original author or authors.
|
||||
* Copyright 2002-2021 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -41,11 +41,11 @@ import org.springframework.expression.spel.support.StandardEvaluationContext;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
public class IndexingTests {
|
||||
class IndexingTests {
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("unchecked")
|
||||
public void indexIntoGenericPropertyContainingMap() {
|
||||
void indexIntoGenericPropertyContainingMap() {
|
||||
Map<String, String> property = new HashMap<>();
|
||||
property.put("foo", "bar");
|
||||
this.property = property;
|
||||
@@ -63,7 +63,7 @@ public class IndexingTests {
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("unchecked")
|
||||
public void indexIntoGenericPropertyContainingMapObject() {
|
||||
void indexIntoGenericPropertyContainingMapObject() {
|
||||
Map<String, Map<String, String>> property = new HashMap<>();
|
||||
Map<String, String> map = new HashMap<>();
|
||||
map.put("foo", "bar");
|
||||
@@ -112,7 +112,7 @@ public class IndexingTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void setGenericPropertyContainingMap() {
|
||||
void setGenericPropertyContainingMap() {
|
||||
Map<String, String> property = new HashMap<>();
|
||||
property.put("foo", "bar");
|
||||
this.property = property;
|
||||
@@ -127,7 +127,7 @@ public class IndexingTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void setPropertyContainingMap() {
|
||||
void setPropertyContainingMap() {
|
||||
Map<Integer, Integer> property = new HashMap<>();
|
||||
property.put(9, 3);
|
||||
this.parameterizedMap = property;
|
||||
@@ -144,7 +144,7 @@ public class IndexingTests {
|
||||
public Map<Integer, Integer> parameterizedMap;
|
||||
|
||||
@Test
|
||||
public void setPropertyContainingMapAutoGrow() {
|
||||
void setPropertyContainingMapAutoGrow() {
|
||||
SpelExpressionParser parser = new SpelExpressionParser(new SpelParserConfiguration(true, false));
|
||||
Expression expression = parser.parseExpression("parameterizedMap");
|
||||
assertThat(expression.getValueTypeDescriptor(this).toString()).isEqualTo("java.util.Map<java.lang.Integer, java.lang.Integer>");
|
||||
@@ -156,7 +156,7 @@ public class IndexingTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void indexIntoGenericPropertyContainingList() {
|
||||
void indexIntoGenericPropertyContainingList() {
|
||||
List<String> property = new ArrayList<>();
|
||||
property.add("bar");
|
||||
this.property = property;
|
||||
@@ -169,7 +169,7 @@ public class IndexingTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void setGenericPropertyContainingList() {
|
||||
void setGenericPropertyContainingList() {
|
||||
List<Integer> property = new ArrayList<>();
|
||||
property.add(3);
|
||||
this.property = property;
|
||||
@@ -184,7 +184,7 @@ public class IndexingTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void setGenericPropertyContainingListAutogrow() {
|
||||
void setGenericPropertyContainingListAutogrow() {
|
||||
List<Integer> property = new ArrayList<>();
|
||||
this.property = property;
|
||||
SpelExpressionParser parser = new SpelExpressionParser(new SpelParserConfiguration(true, true));
|
||||
@@ -203,7 +203,7 @@ public class IndexingTests {
|
||||
public List<BigDecimal> decimals;
|
||||
|
||||
@Test
|
||||
public void autoGrowListOfElementsWithoutDefaultConstructor() {
|
||||
void autoGrowListOfElementsWithoutDefaultConstructor() {
|
||||
this.decimals = new ArrayList<>();
|
||||
SpelExpressionParser parser = new SpelExpressionParser(new SpelParserConfiguration(true, true));
|
||||
parser.parseExpression("decimals[0]").setValue(this, "123.4");
|
||||
@@ -211,7 +211,7 @@ public class IndexingTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void indexIntoPropertyContainingListContainingNullElement() {
|
||||
void indexIntoPropertyContainingListContainingNullElement() {
|
||||
this.decimals = new ArrayList<>();
|
||||
this.decimals.add(null);
|
||||
this.decimals.add(BigDecimal.ONE);
|
||||
@@ -221,7 +221,7 @@ public class IndexingTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void indexIntoPropertyContainingList() {
|
||||
void indexIntoPropertyContainingList() {
|
||||
List<Integer> property = new ArrayList<>();
|
||||
property.add(3);
|
||||
this.parameterizedList = property;
|
||||
@@ -236,7 +236,7 @@ public class IndexingTests {
|
||||
public List<Integer> parameterizedList;
|
||||
|
||||
@Test
|
||||
public void indexIntoPropertyContainingListOfList() {
|
||||
void indexIntoPropertyContainingListOfList() {
|
||||
List<List<Integer>> property = new ArrayList<>();
|
||||
property.add(Arrays.asList(3));
|
||||
this.parameterizedListOfList = property;
|
||||
@@ -251,7 +251,7 @@ public class IndexingTests {
|
||||
public List<List<Integer>> parameterizedListOfList;
|
||||
|
||||
@Test
|
||||
public void setPropertyContainingList() {
|
||||
void setPropertyContainingList() {
|
||||
List<Integer> property = new ArrayList<>();
|
||||
property.add(3);
|
||||
this.parameterizedList = property;
|
||||
@@ -266,7 +266,7 @@ public class IndexingTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void indexIntoGenericPropertyContainingNullList() {
|
||||
void indexIntoGenericPropertyContainingNullList() {
|
||||
SpelParserConfiguration configuration = new SpelParserConfiguration(true, true);
|
||||
SpelExpressionParser parser = new SpelExpressionParser(configuration);
|
||||
Expression expression = parser.parseExpression("property");
|
||||
@@ -282,7 +282,7 @@ public class IndexingTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void indexIntoGenericPropertyContainingGrowingList() {
|
||||
void indexIntoGenericPropertyContainingGrowingList() {
|
||||
List<String> property = new ArrayList<>();
|
||||
this.property = property;
|
||||
SpelParserConfiguration configuration = new SpelParserConfiguration(true, true);
|
||||
@@ -300,7 +300,7 @@ public class IndexingTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void indexIntoGenericPropertyContainingGrowingList2() {
|
||||
void indexIntoGenericPropertyContainingGrowingList2() {
|
||||
List<String> property2 = new ArrayList<>();
|
||||
this.property2 = property2;
|
||||
SpelParserConfiguration configuration = new SpelParserConfiguration(true, true);
|
||||
@@ -320,7 +320,7 @@ public class IndexingTests {
|
||||
public List property2;
|
||||
|
||||
@Test
|
||||
public void indexIntoGenericPropertyContainingArray() {
|
||||
void indexIntoGenericPropertyContainingArray() {
|
||||
String[] property = new String[] { "bar" };
|
||||
this.property = property;
|
||||
SpelExpressionParser parser = new SpelExpressionParser();
|
||||
@@ -332,7 +332,7 @@ public class IndexingTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void emptyList() {
|
||||
void emptyList() {
|
||||
listOfScalarNotGeneric = new ArrayList();
|
||||
SpelExpressionParser parser = new SpelExpressionParser();
|
||||
Expression expression = parser.parseExpression("listOfScalarNotGeneric");
|
||||
@@ -342,7 +342,7 @@ public class IndexingTests {
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Test
|
||||
public void resolveCollectionElementType() {
|
||||
void resolveCollectionElementType() {
|
||||
listNotGeneric = new ArrayList(2);
|
||||
listNotGeneric.add(5);
|
||||
listNotGeneric.add(6);
|
||||
@@ -353,7 +353,7 @@ public class IndexingTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void resolveCollectionElementTypeNull() {
|
||||
void resolveCollectionElementTypeNull() {
|
||||
SpelExpressionParser parser = new SpelExpressionParser();
|
||||
Expression expression = parser.parseExpression("listNotGeneric");
|
||||
assertThat(expression.getValueTypeDescriptor(this).toString()).isEqualTo("@org.springframework.expression.spel.IndexingTests$FieldAnnotation java.util.List<?>");
|
||||
@@ -370,7 +370,7 @@ public class IndexingTests {
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Test
|
||||
public void resolveMapKeyValueTypes() {
|
||||
void resolveMapKeyValueTypes() {
|
||||
mapNotGeneric = new HashMap();
|
||||
mapNotGeneric.put("baseAmount", 3.11);
|
||||
mapNotGeneric.put("bonusAmount", 7.17);
|
||||
@@ -384,12 +384,12 @@ public class IndexingTests {
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Test
|
||||
public void testListOfScalar() {
|
||||
void testListOfScalar() {
|
||||
listOfScalarNotGeneric = new ArrayList(1);
|
||||
listOfScalarNotGeneric.add("5");
|
||||
SpelExpressionParser parser = new SpelExpressionParser();
|
||||
Expression expression = parser.parseExpression("listOfScalarNotGeneric[0]");
|
||||
assertThat(expression.getValue(this, Integer.class)).isEqualTo(new Integer(5));
|
||||
assertThat(expression.getValue(this, Integer.class)).isEqualTo(Integer.valueOf(5));
|
||||
}
|
||||
|
||||
public List listOfScalarNotGeneric;
|
||||
@@ -397,7 +397,7 @@ public class IndexingTests {
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Test
|
||||
public void testListsOfMap() {
|
||||
void testListsOfMap() {
|
||||
listOfMapsNotGeneric = new ArrayList();
|
||||
Map map = new HashMap();
|
||||
map.put("fruit", "apple");
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
* Copyright 2002-2021 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -33,10 +33,10 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
* @author Juergen Hoeller
|
||||
* @author Giovanni Dall'Oglio Risso
|
||||
*/
|
||||
public class OperatorTests extends AbstractExpressionTests {
|
||||
class OperatorTests extends AbstractExpressionTests {
|
||||
|
||||
@Test
|
||||
public void testEqual() {
|
||||
void testEqual() {
|
||||
evaluate("3 == 5", false, Boolean.class);
|
||||
evaluate("5 == 3", false, Boolean.class);
|
||||
evaluate("6 == 6", true, Boolean.class);
|
||||
@@ -85,7 +85,7 @@ public class OperatorTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testNotEqual() {
|
||||
void testNotEqual() {
|
||||
evaluate("3 != 5", true, Boolean.class);
|
||||
evaluate("5 != 3", true, Boolean.class);
|
||||
evaluate("6 != 6", false, Boolean.class);
|
||||
@@ -134,7 +134,7 @@ public class OperatorTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testLessThan() {
|
||||
void testLessThan() {
|
||||
evaluate("5 < 5", false, Boolean.class);
|
||||
evaluate("3 < 5", true, Boolean.class);
|
||||
evaluate("5 < 3", false, Boolean.class);
|
||||
@@ -176,7 +176,7 @@ public class OperatorTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testLessThanOrEqual() {
|
||||
void testLessThanOrEqual() {
|
||||
evaluate("3 <= 5", true, Boolean.class);
|
||||
evaluate("5 <= 3", false, Boolean.class);
|
||||
evaluate("6 <= 6", true, Boolean.class);
|
||||
@@ -225,7 +225,7 @@ public class OperatorTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGreaterThan() {
|
||||
void testGreaterThan() {
|
||||
evaluate("3 > 5", false, Boolean.class);
|
||||
evaluate("5 > 3", true, Boolean.class);
|
||||
evaluate("3L > 5L", false, Boolean.class);
|
||||
@@ -266,7 +266,7 @@ public class OperatorTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGreaterThanOrEqual() {
|
||||
void testGreaterThanOrEqual() {
|
||||
evaluate("3 >= 5", false, Boolean.class);
|
||||
evaluate("5 >= 3", true, Boolean.class);
|
||||
evaluate("6 >= 6", true, Boolean.class);
|
||||
@@ -315,27 +315,27 @@ public class OperatorTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testIntegerLiteral() {
|
||||
void testIntegerLiteral() {
|
||||
evaluate("3", 3, Integer.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRealLiteral() {
|
||||
void testRealLiteral() {
|
||||
evaluate("3.5", 3.5d, Double.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testMultiplyStringInt() {
|
||||
void testMultiplyStringInt() {
|
||||
evaluate("'a' * 5", "aaaaa", String.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testMultiplyDoubleDoubleGivesDouble() {
|
||||
void testMultiplyDoubleDoubleGivesDouble() {
|
||||
evaluate("3.0d * 5.0d", 15.0d, Double.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testMixedOperandsBigDecimal() {
|
||||
void testMixedOperandsBigDecimal() {
|
||||
evaluate("3 * new java.math.BigDecimal('5')", new BigDecimal("15"), BigDecimal.class);
|
||||
evaluate("3L * new java.math.BigDecimal('5')", new BigDecimal("15"), BigDecimal.class);
|
||||
evaluate("3.0d * new java.math.BigDecimal('5')", new BigDecimal("15.0"), BigDecimal.class);
|
||||
@@ -361,19 +361,19 @@ public class OperatorTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testMathOperatorAdd02() {
|
||||
void testMathOperatorAdd02() {
|
||||
evaluate("'hello' + ' ' + 'world'", "hello world", String.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testMathOperatorsInChains() {
|
||||
void testMathOperatorsInChains() {
|
||||
evaluate("1+2+3",6,Integer.class);
|
||||
evaluate("2*3*4",24,Integer.class);
|
||||
evaluate("12-1-2",9,Integer.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testIntegerArithmetic() {
|
||||
void testIntegerArithmetic() {
|
||||
evaluate("2 + 4", "6", Integer.class);
|
||||
evaluate("5 - 4", "1", Integer.class);
|
||||
evaluate("3 * 5", 15, Integer.class);
|
||||
@@ -388,7 +388,7 @@ public class OperatorTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testPlus() throws Exception {
|
||||
void testPlus() {
|
||||
evaluate("7 + 2", "9", Integer.class);
|
||||
evaluate("3.0f + 5.0f", 8.0f, Float.class);
|
||||
evaluate("3.0d + 5.0d", 8.0d, Double.class);
|
||||
@@ -419,7 +419,7 @@ public class OperatorTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testMinus() throws Exception {
|
||||
void testMinus() {
|
||||
evaluate("'c' - 2", "a", String.class);
|
||||
evaluate("3.0f - 5.0f", -2.0f, Float.class);
|
||||
evaluateAndCheckError("'ab' - 2", SpelMessage.OPERATOR_NOT_SUPPORTED_BETWEEN_TYPES);
|
||||
@@ -437,7 +437,7 @@ public class OperatorTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testModulus() {
|
||||
void testModulus() {
|
||||
evaluate("3%2",1,Integer.class);
|
||||
evaluate("3L%2L",1L,Long.class);
|
||||
evaluate("3.0f%2.0f",1f,Float.class);
|
||||
@@ -448,7 +448,7 @@ public class OperatorTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDivide() {
|
||||
void testDivide() {
|
||||
evaluate("3.0f / 5.0f", 0.6f, Float.class);
|
||||
evaluate("4L/2L",2L,Long.class);
|
||||
evaluate("3.0f div 5.0f", 0.6f, Float.class);
|
||||
@@ -461,17 +461,17 @@ public class OperatorTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testMathOperatorDivide_ConvertToDouble() {
|
||||
evaluateAndAskForReturnType("8/4", new Double(2.0), Double.class);
|
||||
void testMathOperatorDivide_ConvertToDouble() {
|
||||
evaluateAndAskForReturnType("8/4", 2.0, Double.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testMathOperatorDivide04_ConvertToFloat() {
|
||||
evaluateAndAskForReturnType("8/4", new Float(2.0), Float.class);
|
||||
void testMathOperatorDivide04_ConvertToFloat() {
|
||||
evaluateAndAskForReturnType("8/4", 2.0F, Float.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDoubles() {
|
||||
void testDoubles() {
|
||||
evaluate("3.0d == 5.0d", false, Boolean.class);
|
||||
evaluate("3.0d == 3.0d", true, Boolean.class);
|
||||
evaluate("3.0d != 5.0d", true, Boolean.class);
|
||||
@@ -484,7 +484,7 @@ public class OperatorTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testBigDecimals() {
|
||||
void testBigDecimals() {
|
||||
evaluate("3 + new java.math.BigDecimal('5')", new BigDecimal("8"), BigDecimal.class);
|
||||
evaluate("3 - new java.math.BigDecimal('5')", new BigDecimal("-2"), BigDecimal.class);
|
||||
evaluate("3 * new java.math.BigDecimal('5')", new BigDecimal("15"), BigDecimal.class);
|
||||
@@ -495,7 +495,7 @@ public class OperatorTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testOperatorNames() throws Exception {
|
||||
void testOperatorNames() {
|
||||
Operator node = getOperatorNode((SpelExpression)parser.parseExpression("1==3"));
|
||||
assertThat(node.getOperatorName()).isEqualTo("==");
|
||||
|
||||
@@ -534,13 +534,13 @@ public class OperatorTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testOperatorOverloading() {
|
||||
void testOperatorOverloading() {
|
||||
evaluateAndCheckError("'a' * '2'", SpelMessage.OPERATOR_NOT_SUPPORTED_BETWEEN_TYPES);
|
||||
evaluateAndCheckError("'a' ^ '2'", SpelMessage.OPERATOR_NOT_SUPPORTED_BETWEEN_TYPES);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testPower() {
|
||||
void testPower() {
|
||||
evaluate("3^2",9,Integer.class);
|
||||
evaluate("3.0d^2.0d",9.0d,Double.class);
|
||||
evaluate("3L^2L",9L,Long.class);
|
||||
@@ -549,7 +549,7 @@ public class OperatorTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testMixedOperands_FloatsAndDoubles() {
|
||||
void testMixedOperands_FloatsAndDoubles() {
|
||||
evaluate("3.0d + 5.0f", 8.0d, Double.class);
|
||||
evaluate("3.0D - 5.0f", -2.0d, Double.class);
|
||||
evaluate("3.0f * 5.0d", 15.0d, Double.class);
|
||||
@@ -558,7 +558,7 @@ public class OperatorTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testMixedOperands_DoublesAndInts() {
|
||||
void testMixedOperands_DoublesAndInts() {
|
||||
evaluate("3.0d + 5", 8.0d, Double.class);
|
||||
evaluate("3.0D - 5", -2.0d, Double.class);
|
||||
evaluate("3.0f * 5", 15.0f, Float.class);
|
||||
@@ -569,7 +569,7 @@ public class OperatorTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testStrings() {
|
||||
void testStrings() {
|
||||
evaluate("'abc' == 'abc'", true, Boolean.class);
|
||||
evaluate("'abc' == 'def'", false, Boolean.class);
|
||||
evaluate("'abc' != 'abc'", false, Boolean.class);
|
||||
@@ -577,7 +577,7 @@ public class OperatorTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testLongs() {
|
||||
void testLongs() {
|
||||
evaluate("3L == 4L", false, Boolean.class);
|
||||
evaluate("3L == 3L", true, Boolean.class);
|
||||
evaluate("3L != 4L", true, Boolean.class);
|
||||
@@ -588,7 +588,7 @@ public class OperatorTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testBigIntegers() {
|
||||
void testBigIntegers() {
|
||||
evaluate("3 + new java.math.BigInteger('5')", new BigInteger("8"), BigInteger.class);
|
||||
evaluate("3 - new java.math.BigInteger('5')", new BigInteger("-2"), BigInteger.class);
|
||||
evaluate("3 * new java.math.BigInteger('5')", new BigInteger("15"), BigInteger.class);
|
||||
|
||||
@@ -128,7 +128,7 @@ public class SpelCompilationCoverageTests extends AbstractExpressionTests {
|
||||
|
||||
|
||||
@Test
|
||||
public void typeReference() throws Exception {
|
||||
void typeReference() {
|
||||
expression = parse("T(String)");
|
||||
assertThat(expression.getValue()).isEqualTo(String.class);
|
||||
assertCanCompile(expression);
|
||||
@@ -196,7 +196,7 @@ public class SpelCompilationCoverageTests extends AbstractExpressionTests {
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Test
|
||||
public void operatorInstanceOf() throws Exception {
|
||||
void operatorInstanceOf() {
|
||||
expression = parse("'xyz' instanceof T(String)");
|
||||
assertThat(expression.getValue()).isEqualTo(true);
|
||||
assertCanCompile(expression);
|
||||
@@ -245,7 +245,7 @@ public class SpelCompilationCoverageTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void operatorInstanceOf_SPR14250() throws Exception {
|
||||
void operatorInstanceOf_SPR14250() throws Exception {
|
||||
// primitive left operand - should get boxed, return true
|
||||
expression = parse("3 instanceof T(Integer)");
|
||||
assertThat(expression.getValue()).isEqualTo(true);
|
||||
@@ -292,7 +292,7 @@ public class SpelCompilationCoverageTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void stringLiteral() throws Exception {
|
||||
void stringLiteral() throws Exception {
|
||||
expression = parser.parseExpression("'abcde'");
|
||||
assertThat(expression.getValue(new TestClass1(), String.class)).isEqualTo("abcde");
|
||||
assertCanCompile(expression);
|
||||
@@ -307,18 +307,18 @@ public class SpelCompilationCoverageTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nullLiteral() throws Exception {
|
||||
void nullLiteral() throws Exception {
|
||||
expression = parser.parseExpression("null");
|
||||
Object resultI = expression.getValue(new TestClass1(), Object.class);
|
||||
assertCanCompile(expression);
|
||||
Object resultC = expression.getValue(new TestClass1(), Object.class);
|
||||
assertThat(resultI).isEqualTo(null);
|
||||
assertThat(resultC).isEqualTo(null);
|
||||
assertThat(resultC).isEqualTo(null);
|
||||
assertThat(resultI).isNull();
|
||||
assertThat(resultC).isNull();
|
||||
assertThat(resultC).isNull();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void realLiteral() throws Exception {
|
||||
void realLiteral() throws Exception {
|
||||
expression = parser.parseExpression("3.4d");
|
||||
double resultI = expression.getValue(new TestClass1(), Double.TYPE);
|
||||
assertCanCompile(expression);
|
||||
@@ -332,7 +332,7 @@ public class SpelCompilationCoverageTests extends AbstractExpressionTests {
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
@Test
|
||||
public void inlineList() throws Exception {
|
||||
void inlineList() throws Exception {
|
||||
expression = parser.parseExpression("'abcde'.substring({1,3,4}[0])");
|
||||
Object o = expression.getValue();
|
||||
assertThat(o).isEqualTo("bcde");
|
||||
@@ -371,7 +371,7 @@ public class SpelCompilationCoverageTests extends AbstractExpressionTests {
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
@Test
|
||||
public void nestedInlineLists() throws Exception {
|
||||
void nestedInlineLists() throws Exception {
|
||||
Object o = null;
|
||||
|
||||
expression = parser.parseExpression("{{1,2,3},{4,5,6},{7,8,9}}");
|
||||
@@ -446,7 +446,7 @@ public class SpelCompilationCoverageTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void intLiteral() throws Exception {
|
||||
void intLiteral() throws Exception {
|
||||
expression = parser.parseExpression("42");
|
||||
int resultI = expression.getValue(new TestClass1(), Integer.TYPE);
|
||||
assertCanCompile(expression);
|
||||
@@ -477,7 +477,7 @@ public class SpelCompilationCoverageTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void longLiteral() throws Exception {
|
||||
void longLiteral() throws Exception {
|
||||
expression = parser.parseExpression("99L");
|
||||
long resultI = expression.getValue(new TestClass1(), Long.TYPE);
|
||||
assertCanCompile(expression);
|
||||
@@ -487,24 +487,24 @@ public class SpelCompilationCoverageTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void booleanLiteral() throws Exception {
|
||||
void booleanLiteral() throws Exception {
|
||||
expression = parser.parseExpression("true");
|
||||
boolean resultI = expression.getValue(1, Boolean.TYPE);
|
||||
assertThat(resultI).isEqualTo(true);
|
||||
assertThat(resultI).isTrue();
|
||||
assertThat(SpelCompiler.compile(expression)).isTrue();
|
||||
boolean resultC = expression.getValue(1, Boolean.TYPE);
|
||||
assertThat(resultC).isEqualTo(true);
|
||||
assertThat(resultC).isTrue();
|
||||
|
||||
expression = parser.parseExpression("false");
|
||||
resultI = expression.getValue(1, Boolean.TYPE);
|
||||
assertThat(resultI).isEqualTo(false);
|
||||
assertThat(resultI).isFalse();
|
||||
assertThat(SpelCompiler.compile(expression)).isTrue();
|
||||
resultC = expression.getValue(1, Boolean.TYPE);
|
||||
assertThat(resultC).isEqualTo(false);
|
||||
assertThat(resultC).isFalse();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void floatLiteral() throws Exception {
|
||||
void floatLiteral() throws Exception {
|
||||
expression = parser.parseExpression("3.4f");
|
||||
float resultI = expression.getValue(new TestClass1(), Float.TYPE);
|
||||
assertCanCompile(expression);
|
||||
@@ -517,42 +517,42 @@ public class SpelCompilationCoverageTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void opOr() throws Exception {
|
||||
void opOr() throws Exception {
|
||||
Expression expression = parser.parseExpression("false or false");
|
||||
boolean resultI = expression.getValue(1, Boolean.TYPE);
|
||||
SpelCompiler.compile(expression);
|
||||
boolean resultC = expression.getValue(1, Boolean.TYPE);
|
||||
assertThat(resultI).isEqualTo(false);
|
||||
assertThat(resultC).isEqualTo(false);
|
||||
assertThat(resultI).isFalse();
|
||||
assertThat(resultC).isFalse();
|
||||
|
||||
expression = parser.parseExpression("false or true");
|
||||
resultI = expression.getValue(1, Boolean.TYPE);
|
||||
assertCanCompile(expression);
|
||||
resultC = expression.getValue(1, Boolean.TYPE);
|
||||
assertThat(resultI).isEqualTo(true);
|
||||
assertThat(resultC).isEqualTo(true);
|
||||
assertThat(resultI).isTrue();
|
||||
assertThat(resultC).isTrue();
|
||||
|
||||
expression = parser.parseExpression("true or false");
|
||||
resultI = expression.getValue(1, Boolean.TYPE);
|
||||
assertCanCompile(expression);
|
||||
resultC = expression.getValue(1, Boolean.TYPE);
|
||||
assertThat(resultI).isEqualTo(true);
|
||||
assertThat(resultC).isEqualTo(true);
|
||||
assertThat(resultI).isTrue();
|
||||
assertThat(resultC).isTrue();
|
||||
|
||||
expression = parser.parseExpression("true or true");
|
||||
resultI = expression.getValue(1, Boolean.TYPE);
|
||||
assertCanCompile(expression);
|
||||
resultC = expression.getValue(1, Boolean.TYPE);
|
||||
assertThat(resultI).isEqualTo(true);
|
||||
assertThat(resultC).isEqualTo(true);
|
||||
assertThat(resultI).isTrue();
|
||||
assertThat(resultC).isTrue();
|
||||
|
||||
TestClass4 tc = new TestClass4();
|
||||
expression = parser.parseExpression("getfalse() or gettrue()");
|
||||
resultI = expression.getValue(tc, Boolean.TYPE);
|
||||
assertCanCompile(expression);
|
||||
resultC = expression.getValue(tc, Boolean.TYPE);
|
||||
assertThat(resultI).isEqualTo(true);
|
||||
assertThat(resultC).isEqualTo(true);
|
||||
assertThat(resultI).isTrue();
|
||||
assertThat(resultC).isTrue();
|
||||
|
||||
// Can't compile this as we aren't going down the getfalse() branch in our evaluation
|
||||
expression = parser.parseExpression("gettrue() or getfalse()");
|
||||
@@ -584,29 +584,29 @@ public class SpelCompilationCoverageTests extends AbstractExpressionTests {
|
||||
boolean resultI = expression.getValue(1, Boolean.TYPE);
|
||||
SpelCompiler.compile(expression);
|
||||
boolean resultC = expression.getValue(1, Boolean.TYPE);
|
||||
assertThat(resultI).isEqualTo(false);
|
||||
assertThat(resultC).isEqualTo(false);
|
||||
assertThat(resultI).isFalse();
|
||||
assertThat(resultC).isFalse();
|
||||
|
||||
expression = parser.parseExpression("false and true");
|
||||
resultI = expression.getValue(1, Boolean.TYPE);
|
||||
SpelCompiler.compile(expression);
|
||||
resultC = expression.getValue(1, Boolean.TYPE);
|
||||
assertThat(resultI).isEqualTo(false);
|
||||
assertThat(resultC).isEqualTo(false);
|
||||
assertThat(resultI).isFalse();
|
||||
assertThat(resultC).isFalse();
|
||||
|
||||
expression = parser.parseExpression("true and false");
|
||||
resultI = expression.getValue(1, Boolean.TYPE);
|
||||
SpelCompiler.compile(expression);
|
||||
resultC = expression.getValue(1, Boolean.TYPE);
|
||||
assertThat(resultI).isEqualTo(false);
|
||||
assertThat(resultC).isEqualTo(false);
|
||||
assertThat(resultI).isFalse();
|
||||
assertThat(resultC).isFalse();
|
||||
|
||||
expression = parser.parseExpression("true and true");
|
||||
resultI = expression.getValue(1, Boolean.TYPE);
|
||||
SpelCompiler.compile(expression);
|
||||
resultC = expression.getValue(1, Boolean.TYPE);
|
||||
assertThat(resultI).isEqualTo(true);
|
||||
assertThat(resultC).isEqualTo(true);
|
||||
assertThat(resultI).isTrue();
|
||||
assertThat(resultC).isTrue();
|
||||
|
||||
TestClass4 tc = new TestClass4();
|
||||
|
||||
@@ -3481,7 +3481,7 @@ public class SpelCompilationCoverageTests extends AbstractExpressionTests {
|
||||
assertThat(tc8.s).isEqualTo("123");
|
||||
assertThat(tc8.d).isCloseTo(4.0d, within(0.5d));
|
||||
|
||||
assertThat(tc8.z).isEqualTo(true);
|
||||
assertThat(tc8.z).isTrue();
|
||||
|
||||
// no-arg ctor
|
||||
expression = parser.parseExpression("new " + testclass8 + "()");
|
||||
@@ -3507,7 +3507,7 @@ public class SpelCompilationCoverageTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void methodReferenceReflectiveMethodSelectionWithVarargs() throws Exception {
|
||||
void methodReferenceReflectiveMethodSelectionWithVarargs() throws Exception {
|
||||
TestClass10 tc = new TestClass10();
|
||||
|
||||
// Should call the non varargs version of concat
|
||||
@@ -3526,11 +3526,11 @@ public class SpelCompilationCoverageTests extends AbstractExpressionTests {
|
||||
expression = parser.parseExpression("concat()");
|
||||
assertCantCompile(expression);
|
||||
expression.getValue(tc);
|
||||
assertThat(tc.s).isEqualTo("");
|
||||
assertThat(tc.s).isEmpty();
|
||||
assertCanCompile(expression);
|
||||
tc.reset();
|
||||
expression.getValue(tc);
|
||||
assertThat(tc.s).isEqualTo("");
|
||||
assertThat(tc.s).isEmpty();
|
||||
tc.reset();
|
||||
|
||||
// Should call the non varargs version of concat
|
||||
@@ -3549,27 +3549,27 @@ public class SpelCompilationCoverageTests extends AbstractExpressionTests {
|
||||
expression = parser.parseExpression("concat2()");
|
||||
assertCantCompile(expression);
|
||||
expression.getValue(tc);
|
||||
assertThat(tc.s).isEqualTo("");
|
||||
assertThat(tc.s).isEmpty();
|
||||
assertCanCompile(expression);
|
||||
tc.reset();
|
||||
expression.getValue(tc);
|
||||
assertThat(tc.s).isEqualTo("");
|
||||
assertThat(tc.s).isEmpty();
|
||||
tc.reset();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void methodReferenceVarargs() throws Exception {
|
||||
void methodReferenceVarargs() {
|
||||
TestClass5 tc = new TestClass5();
|
||||
|
||||
// varargs string
|
||||
expression = parser.parseExpression("eleven()");
|
||||
assertCantCompile(expression);
|
||||
expression.getValue(tc);
|
||||
assertThat(tc.s).isEqualTo("");
|
||||
assertThat(tc.s).isEmpty();
|
||||
assertCanCompile(expression);
|
||||
tc.reset();
|
||||
expression.getValue(tc);
|
||||
assertThat(tc.s).isEqualTo("");
|
||||
assertThat(tc.s).isEmpty();
|
||||
tc.reset();
|
||||
|
||||
// varargs string
|
||||
@@ -3840,7 +3840,7 @@ public class SpelCompilationCoverageTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void methodReference() throws Exception {
|
||||
void methodReference() {
|
||||
TestClass5 tc = new TestClass5();
|
||||
|
||||
// non-static method, no args, void return
|
||||
@@ -3985,7 +3985,7 @@ public class SpelCompilationCoverageTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void errorHandling() throws Exception {
|
||||
void errorHandling() {
|
||||
TestClass5 tc = new TestClass5();
|
||||
|
||||
// changing target
|
||||
@@ -4040,7 +4040,7 @@ public class SpelCompilationCoverageTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void methodReference_staticMethod() throws Exception {
|
||||
void methodReference_staticMethod() {
|
||||
Expression expression = parser.parseExpression("T(Integer).valueOf(42)");
|
||||
int resultI = expression.getValue(new TestClass1(), Integer.TYPE);
|
||||
assertCanCompile(expression);
|
||||
@@ -4050,7 +4050,7 @@ public class SpelCompilationCoverageTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void methodReference_literalArguments_int() throws Exception {
|
||||
void methodReference_literalArguments_int() {
|
||||
Expression expression = parser.parseExpression("'abcd'.substring(1,3)");
|
||||
String resultI = expression.getValue(new TestClass1(), String.class);
|
||||
assertCanCompile(expression);
|
||||
@@ -4060,7 +4060,7 @@ public class SpelCompilationCoverageTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void methodReference_simpleInstanceMethodNoArg() throws Exception {
|
||||
void methodReference_simpleInstanceMethodNoArg() {
|
||||
Expression expression = parser.parseExpression("toString()");
|
||||
String resultI = expression.getValue(42, String.class);
|
||||
assertCanCompile(expression);
|
||||
@@ -4070,7 +4070,7 @@ public class SpelCompilationCoverageTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void methodReference_simpleInstanceMethodNoArgReturnPrimitive() throws Exception {
|
||||
void methodReference_simpleInstanceMethodNoArgReturnPrimitive() {
|
||||
expression = parser.parseExpression("intValue()");
|
||||
int resultI = expression.getValue(42, Integer.TYPE);
|
||||
assertThat(resultI).isEqualTo(42);
|
||||
@@ -4080,7 +4080,7 @@ public class SpelCompilationCoverageTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void methodReference_simpleInstanceMethodOneArgReturnPrimitive1() throws Exception {
|
||||
void methodReference_simpleInstanceMethodOneArgReturnPrimitive1() {
|
||||
Expression expression = parser.parseExpression("indexOf('b')");
|
||||
int resultI = expression.getValue("abc", Integer.TYPE);
|
||||
assertCanCompile(expression);
|
||||
@@ -4090,7 +4090,7 @@ public class SpelCompilationCoverageTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void methodReference_simpleInstanceMethodOneArgReturnPrimitive2() throws Exception {
|
||||
void methodReference_simpleInstanceMethodOneArgReturnPrimitive2() {
|
||||
expression = parser.parseExpression("charAt(2)");
|
||||
char resultI = expression.getValue("abc", Character.TYPE);
|
||||
assertThat(resultI).isEqualTo('c');
|
||||
@@ -4100,7 +4100,7 @@ public class SpelCompilationCoverageTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void compoundExpression() throws Exception {
|
||||
void compoundExpression() {
|
||||
Payload payload = new Payload();
|
||||
expression = parser.parseExpression("DR[0]");
|
||||
assertThat(expression.getValue(payload).toString()).isEqualTo("instanceof Two");
|
||||
@@ -4137,7 +4137,7 @@ public class SpelCompilationCoverageTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void mixingItUp_indexerOpEqTernary() throws Exception {
|
||||
void mixingItUp_indexerOpEqTernary() {
|
||||
Map<String, String> m = new HashMap<>();
|
||||
m.put("andy","778");
|
||||
|
||||
@@ -4150,7 +4150,7 @@ public class SpelCompilationCoverageTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void propertyReference() throws Exception {
|
||||
void propertyReference() {
|
||||
TestClass6 tc = new TestClass6();
|
||||
|
||||
// non static field
|
||||
@@ -4190,7 +4190,7 @@ public class SpelCompilationCoverageTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void propertyReferenceVisibility_SPR12771() {
|
||||
void propertyReferenceVisibility_SPR12771() {
|
||||
StandardEvaluationContext ctx = new StandardEvaluationContext();
|
||||
ctx.setVariable("httpServletRequest", HttpServlet3RequestFactory.getOne());
|
||||
// Without a fix compilation was inserting a checkcast to a private type
|
||||
@@ -4202,7 +4202,7 @@ public class SpelCompilationCoverageTests extends AbstractExpressionTests {
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Test
|
||||
public void indexer() throws Exception {
|
||||
void indexer() {
|
||||
String[] sss = new String[] {"a","b","c"};
|
||||
Number[] ns = new Number[] {2,8,9};
|
||||
int[] is = new int[] {8,9,10};
|
||||
@@ -4509,7 +4509,7 @@ public class SpelCompilationCoverageTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void plusNeedingCheckcast_SPR12426() {
|
||||
void plusNeedingCheckcast_SPR12426() {
|
||||
expression = parser.parseExpression("object + ' world'");
|
||||
Object v = expression.getValue(new FooObject());
|
||||
assertThat(v).isEqualTo("hello world");
|
||||
@@ -4524,7 +4524,7 @@ public class SpelCompilationCoverageTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void mixingItUp_propertyAccessIndexerOpLtTernaryRootNull() throws Exception {
|
||||
void mixingItUp_propertyAccessIndexerOpLtTernaryRootNull() {
|
||||
Payload payload = new Payload();
|
||||
|
||||
expression = parser.parseExpression("DR[0].three");
|
||||
@@ -4552,7 +4552,7 @@ public class SpelCompilationCoverageTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void variantGetter() throws Exception {
|
||||
void variantGetter() throws Exception {
|
||||
Payload2Holder holder = new Payload2Holder();
|
||||
StandardEvaluationContext ctx = new StandardEvaluationContext();
|
||||
ctx.addPropertyAccessor(new MyAccessor());
|
||||
@@ -4566,7 +4566,7 @@ public class SpelCompilationCoverageTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void compilerWithGenerics_12040() {
|
||||
void compilerWithGenerics_12040() {
|
||||
expression = parser.parseExpression("payload!=2");
|
||||
assertThat(expression.getValue(new GenericMessageTestHelper<>(4), Boolean.class)).isTrue();
|
||||
assertCanCompile(expression);
|
||||
@@ -4675,7 +4675,7 @@ public class SpelCompilationCoverageTests extends AbstractExpressionTests {
|
||||
|
||||
// The new helper class here uses an upper bound on the generic
|
||||
@Test
|
||||
public void compilerWithGenerics_12040_2() {
|
||||
void compilerWithGenerics_12040_2() {
|
||||
expression = parser.parseExpression("payload/2");
|
||||
assertThat(expression.getValue(new GenericMessageTestHelper2<>(4))).isEqualTo(2);
|
||||
assertCanCompile(expression);
|
||||
@@ -4719,7 +4719,7 @@ public class SpelCompilationCoverageTests extends AbstractExpressionTests {
|
||||
|
||||
// The other numeric operators
|
||||
@Test
|
||||
public void compilerWithGenerics_12040_3() {
|
||||
void compilerWithGenerics_12040_3() {
|
||||
expression = parser.parseExpression("payload >= 2");
|
||||
assertThat(expression.getValue(new GenericMessageTestHelper2<>(4), Boolean.TYPE)).isTrue();
|
||||
assertCanCompile(expression);
|
||||
@@ -4762,7 +4762,7 @@ public class SpelCompilationCoverageTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void indexerMapAccessor_12045() throws Exception {
|
||||
void indexerMapAccessor_12045() throws Exception {
|
||||
SpelParserConfiguration spc = new SpelParserConfiguration(
|
||||
SpelCompilerMode.IMMEDIATE,getClass().getClassLoader());
|
||||
SpelExpressionParser sep = new SpelExpressionParser(spc);
|
||||
@@ -4791,7 +4791,7 @@ public class SpelCompilationCoverageTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void elvisOperator_SPR15192() {
|
||||
void elvisOperator_SPR15192() {
|
||||
SpelParserConfiguration configuration = new SpelParserConfiguration(SpelCompilerMode.IMMEDIATE, null);
|
||||
Expression exp;
|
||||
|
||||
@@ -4875,7 +4875,7 @@ public class SpelCompilationCoverageTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void elvisOperator_SPR17214() throws Exception {
|
||||
void elvisOperator_SPR17214() {
|
||||
SpelParserConfiguration spc = new SpelParserConfiguration(SpelCompilerMode.IMMEDIATE, null);
|
||||
SpelExpressionParser sep = new SpelExpressionParser(spc);
|
||||
|
||||
@@ -4923,7 +4923,7 @@ public class SpelCompilationCoverageTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testNullComparison_SPR22358() {
|
||||
void testNullComparison_SPR22358() {
|
||||
SpelParserConfiguration configuration = new SpelParserConfiguration(SpelCompilerMode.OFF, null);
|
||||
SpelExpressionParser parser = new SpelExpressionParser(configuration);
|
||||
StandardEvaluationContext ctx = new StandardEvaluationContext();
|
||||
@@ -5004,7 +5004,7 @@ public class SpelCompilationCoverageTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void ternaryOperator_SPR15192() {
|
||||
void ternaryOperator_SPR15192() {
|
||||
SpelParserConfiguration configuration = new SpelParserConfiguration(SpelCompilerMode.IMMEDIATE, null);
|
||||
Expression exp;
|
||||
StandardEvaluationContext context = new StandardEvaluationContext();
|
||||
@@ -5048,9 +5048,9 @@ public class SpelCompilationCoverageTests extends AbstractExpressionTests {
|
||||
|
||||
// null condition
|
||||
exp = new SpelExpressionParser(configuration).parseExpression("3==3?null:4L");
|
||||
assertThat(exp.getValue(context, new Foo(), String.class)).isEqualTo(null);
|
||||
assertThat(exp.getValue(context, new Foo(), String.class)).isNull();
|
||||
assertCanCompile(exp);
|
||||
assertThat(exp.getValue(context, new Foo(), String.class)).isEqualTo(null);
|
||||
assertThat(exp.getValue(context, new Foo(), String.class)).isNull();
|
||||
assertIsCompiled(exp);
|
||||
|
||||
// variable access returning primitive
|
||||
@@ -5078,7 +5078,7 @@ public class SpelCompilationCoverageTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void repeatedCompilation() throws Exception {
|
||||
void repeatedCompilation() throws Exception {
|
||||
// Verifying that after a number of compilations, the classloaders
|
||||
// used to load the compiled expressions are discarded/replaced.
|
||||
// See SpelCompiler.loadClass()
|
||||
@@ -6204,9 +6204,9 @@ public class SpelCompilationCoverageTests extends AbstractExpressionTests {
|
||||
|
||||
public Reg(int v) {
|
||||
this._value = v;
|
||||
this._valueL = new Long(v);
|
||||
this._valueD = new Double(v);
|
||||
this._valueF = new Float(v);
|
||||
this._valueL = Long.valueOf(v);
|
||||
this._valueD = (double) v;
|
||||
this._valueF = (float) v;
|
||||
}
|
||||
|
||||
public Integer getValue() {
|
||||
@@ -6243,16 +6243,16 @@ public class SpelCompilationCoverageTests extends AbstractExpressionTests {
|
||||
|
||||
public void setValue(Integer value) {
|
||||
_value = value;
|
||||
_valueL = value==null?null:new Long(value);
|
||||
_valueD = value==null?null:new Double(value);
|
||||
_valueF = value==null?null:new Float(value);
|
||||
_valueL = value==null?null:Long.valueOf(value);
|
||||
_valueD = value==null?null:Double.valueOf(value);
|
||||
_valueF = value==null?null:Float.valueOf(value);
|
||||
}
|
||||
|
||||
public void setValue2(Integer value) {
|
||||
_value2 = value;
|
||||
_valueL2 = value==null?null:new Long(value);
|
||||
_valueD2 = value==null?null:new Double(value);
|
||||
_valueF2 = value==null?null:new Float(value);
|
||||
_valueL2 = value==null?null:Long.valueOf(value);
|
||||
_valueD2 = value==null?null:Double.valueOf(value);
|
||||
_valueF2 = value==null?null:Float.valueOf(value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2020 the original author or authors.
|
||||
* Copyright 2002-2021 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -74,35 +74,35 @@ import static org.assertj.core.api.Assertions.assertThatIllegalStateException;
|
||||
* @author Phillip Webb
|
||||
* @author Sam Brannen
|
||||
*/
|
||||
public class SpelReproTests extends AbstractExpressionTests {
|
||||
class SpelReproTests extends AbstractExpressionTests {
|
||||
|
||||
@Test
|
||||
public void NPE_SPR5661() {
|
||||
void NPE_SPR5661() {
|
||||
evaluate("joinThreeStrings('a',null,'c')", "anullc", String.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void SWF1086() {
|
||||
void SWF1086() {
|
||||
evaluate("printDouble(T(java.math.BigDecimal).valueOf(14.35))", "14.35", String.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void doubleCoercion() {
|
||||
void doubleCoercion() {
|
||||
evaluate("printDouble(14.35)", "14.35", String.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void doubleArrayCoercion() {
|
||||
void doubleArrayCoercion() {
|
||||
evaluate("printDoubles(getDoublesAsStringList())", "{14.35, 15.45}", String.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void SPR5899() {
|
||||
void SPR5899() {
|
||||
StandardEvaluationContext context = new StandardEvaluationContext(new Spr5899Class());
|
||||
Expression expr = new SpelExpressionParser().parseRaw("tryToInvokeWithNull(12)");
|
||||
assertThat(expr.getValue(context)).isEqualTo(12);
|
||||
expr = new SpelExpressionParser().parseRaw("tryToInvokeWithNull(null)");
|
||||
assertThat(expr.getValue(context)).isEqualTo(null);
|
||||
assertThat(expr.getValue(context)).isNull();
|
||||
expr = new SpelExpressionParser().parseRaw("tryToInvokeWithNull2(null)");
|
||||
assertThatExceptionOfType(EvaluationException.class).isThrownBy(
|
||||
expr::getValue);
|
||||
@@ -133,7 +133,7 @@ public class SpelReproTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void SPR5905_InnerTypeReferences() {
|
||||
void SPR5905_InnerTypeReferences() {
|
||||
StandardEvaluationContext context = new StandardEvaluationContext(new Spr5899Class());
|
||||
Expression expr = new SpelExpressionParser().parseRaw("T(java.util.Map$Entry)");
|
||||
assertThat(expr.getValue(context)).isEqualTo(Map.Entry.class);
|
||||
@@ -146,7 +146,7 @@ public class SpelReproTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void SPR5804() {
|
||||
void SPR5804() {
|
||||
Map<String, String> m = new HashMap<>();
|
||||
m.put("foo", "bar");
|
||||
StandardEvaluationContext context = new StandardEvaluationContext(m); // root is a map instance
|
||||
@@ -156,7 +156,7 @@ public class SpelReproTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void SPR5847() {
|
||||
void SPR5847() {
|
||||
StandardEvaluationContext context = new StandardEvaluationContext(new TestProperties());
|
||||
String name = null;
|
||||
Expression expr = null;
|
||||
@@ -192,7 +192,7 @@ public class SpelReproTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void NPE_SPR5673() {
|
||||
void NPE_SPR5673() {
|
||||
ParserContext hashes = TemplateExpressionParsingTests.HASH_DELIMITED_PARSER_CONTEXT;
|
||||
ParserContext dollars = TemplateExpressionParsingTests.DEFAULT_TEMPLATE_PARSER_CONTEXT;
|
||||
|
||||
@@ -227,7 +227,7 @@ public class SpelReproTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void propertyAccessOnNullTarget_SPR5663() throws AccessException {
|
||||
void propertyAccessOnNullTarget_SPR5663() throws AccessException {
|
||||
PropertyAccessor accessor = new ReflectivePropertyAccessor();
|
||||
EvaluationContext context = TestScenarioCreator.getTestEvaluationContext();
|
||||
assertThat(accessor.canRead(context, null, "abc")).isFalse();
|
||||
@@ -239,7 +239,7 @@ public class SpelReproTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nestedProperties_SPR6923() {
|
||||
void nestedProperties_SPR6923() {
|
||||
StandardEvaluationContext context = new StandardEvaluationContext(new Foo());
|
||||
Expression expr = new SpelExpressionParser().parseRaw("resource.resource.server");
|
||||
String name = expr.getValue(context, String.class);
|
||||
@@ -248,7 +248,7 @@ public class SpelReproTests extends AbstractExpressionTests {
|
||||
|
||||
/** Should be accessing Goo.getKey because 'bar' field evaluates to "key" */
|
||||
@Test
|
||||
public void indexingAsAPropertyAccess_SPR6968_1() {
|
||||
void indexingAsAPropertyAccess_SPR6968_1() {
|
||||
StandardEvaluationContext context = new StandardEvaluationContext(new Goo());
|
||||
String name = null;
|
||||
Expression expr = null;
|
||||
@@ -261,7 +261,7 @@ public class SpelReproTests extends AbstractExpressionTests {
|
||||
|
||||
/** Should be accessing Goo.getKey because 'bar' variable evaluates to "key" */
|
||||
@Test
|
||||
public void indexingAsAPropertyAccess_SPR6968_2() {
|
||||
void indexingAsAPropertyAccess_SPR6968_2() {
|
||||
StandardEvaluationContext context = new StandardEvaluationContext(new Goo());
|
||||
context.setVariable("bar", "key");
|
||||
String name = null;
|
||||
@@ -275,7 +275,7 @@ public class SpelReproTests extends AbstractExpressionTests {
|
||||
|
||||
/** $ related identifiers */
|
||||
@Test
|
||||
public void dollarPrefixedIdentifier_SPR7100() {
|
||||
void dollarPrefixedIdentifier_SPR7100() {
|
||||
Holder h = new Holder();
|
||||
StandardEvaluationContext context = new StandardEvaluationContext(h);
|
||||
context.addPropertyAccessor(new MapAccessor());
|
||||
@@ -315,7 +315,7 @@ public class SpelReproTests extends AbstractExpressionTests {
|
||||
|
||||
/** Should be accessing Goo.wibble field because 'bar' variable evaluates to "wibble" */
|
||||
@Test
|
||||
public void indexingAsAPropertyAccess_SPR6968_3() {
|
||||
void indexingAsAPropertyAccess_SPR6968_3() {
|
||||
StandardEvaluationContext context = new StandardEvaluationContext(new Goo());
|
||||
context.setVariable("bar", "wibble");
|
||||
String name = null;
|
||||
@@ -333,7 +333,7 @@ public class SpelReproTests extends AbstractExpressionTests {
|
||||
* "wibble"
|
||||
*/
|
||||
@Test
|
||||
public void indexingAsAPropertyAccess_SPR6968_4() {
|
||||
void indexingAsAPropertyAccess_SPR6968_4() {
|
||||
Goo g = Goo.instance;
|
||||
StandardEvaluationContext context = new StandardEvaluationContext(g);
|
||||
context.setVariable("bar", "wibble");
|
||||
@@ -348,7 +348,7 @@ public class SpelReproTests extends AbstractExpressionTests {
|
||||
|
||||
/** Should be accessing Goo.setKey field because 'bar' variable evaluates to "key" */
|
||||
@Test
|
||||
public void indexingAsAPropertyAccess_SPR6968_5() {
|
||||
void indexingAsAPropertyAccess_SPR6968_5() {
|
||||
Goo g = Goo.instance;
|
||||
StandardEvaluationContext context = new StandardEvaluationContext(g);
|
||||
Expression expr = null;
|
||||
@@ -360,7 +360,7 @@ public class SpelReproTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void dollars() {
|
||||
void dollars() {
|
||||
StandardEvaluationContext context = new StandardEvaluationContext(new XX());
|
||||
Expression expr = null;
|
||||
expr = new SpelExpressionParser().parseRaw("m['$foo']");
|
||||
@@ -369,7 +369,7 @@ public class SpelReproTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void dollars2() {
|
||||
void dollars2() {
|
||||
StandardEvaluationContext context = new StandardEvaluationContext(new XX());
|
||||
Expression expr = null;
|
||||
expr = new SpelExpressionParser().parseRaw("m[$foo]");
|
||||
@@ -421,7 +421,7 @@ public class SpelReproTests extends AbstractExpressionTests {
|
||||
};
|
||||
|
||||
@Test
|
||||
public void beanResolution() {
|
||||
void beanResolution() {
|
||||
StandardEvaluationContext context = new StandardEvaluationContext(new XX());
|
||||
Expression expr = null;
|
||||
|
||||
@@ -443,12 +443,12 @@ public class SpelReproTests extends AbstractExpressionTests {
|
||||
|
||||
// bean does not exist
|
||||
expr = new SpelExpressionParser().parseRaw("@bar");
|
||||
assertThat(expr.getValue(context, String.class)).isEqualTo(null);
|
||||
assertThat(expr.getValue(context, String.class)).isNull();
|
||||
|
||||
// bean name will cause AccessException
|
||||
expr = new SpelExpressionParser().parseRaw("@goo");
|
||||
try {
|
||||
assertThat(expr.getValue(context, String.class)).isEqualTo(null);
|
||||
assertThat(expr.getValue(context, String.class)).isNull();
|
||||
}
|
||||
catch (SpelEvaluationException see) {
|
||||
assertThat(see.getMessageCode()).isEqualTo(SpelMessage.EXCEPTION_DURING_BEAN_RESOLUTION);
|
||||
@@ -472,7 +472,7 @@ public class SpelReproTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void elvis_SPR7209_1() {
|
||||
void elvis_SPR7209_1() {
|
||||
StandardEvaluationContext context = new StandardEvaluationContext(new XX());
|
||||
Expression expr = null;
|
||||
|
||||
@@ -482,14 +482,14 @@ public class SpelReproTests extends AbstractExpressionTests {
|
||||
expr = new SpelExpressionParser().parseRaw("?:'default'");
|
||||
assertThat(expr.getValue()).isEqualTo("default");
|
||||
expr = new SpelExpressionParser().parseRaw("?:");
|
||||
assertThat(expr.getValue()).isEqualTo(null);
|
||||
assertThat(expr.getValue()).isNull();
|
||||
|
||||
// Different parts of ternary expression are null
|
||||
assertThatExceptionOfType(SpelEvaluationException.class).isThrownBy(() ->
|
||||
new SpelExpressionParser().parseRaw("(?'abc':'default')").getValue(context))
|
||||
.satisfies(ex -> assertThat(ex.getMessageCode()).isEqualTo(SpelMessage.TYPE_CONVERSION_ERROR));
|
||||
expr = new SpelExpressionParser().parseRaw("(false?'abc':null)");
|
||||
assertThat(expr.getValue()).isEqualTo(null);
|
||||
assertThat(expr.getValue()).isNull();
|
||||
|
||||
// Assignment
|
||||
assertThatExceptionOfType(SpelEvaluationException.class).isThrownBy(() ->
|
||||
@@ -498,7 +498,7 @@ public class SpelReproTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void elvis_SPR7209_2() {
|
||||
void elvis_SPR7209_2() {
|
||||
Expression expr = null;
|
||||
// Have empty string treated as null for elvis
|
||||
expr = new SpelExpressionParser().parseRaw("?:'default'");
|
||||
@@ -510,7 +510,7 @@ public class SpelReproTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void mapOfMap_SPR7244() {
|
||||
void mapOfMap_SPR7244() {
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("uri", "http:");
|
||||
Map<String, String> nameMap = new LinkedHashMap<>();
|
||||
@@ -531,7 +531,7 @@ public class SpelReproTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void projectionTypeDescriptors_1() {
|
||||
void projectionTypeDescriptors_1() {
|
||||
StandardEvaluationContext context = new StandardEvaluationContext(new C());
|
||||
SpelExpressionParser parser = new SpelExpressionParser();
|
||||
String el1 = "ls.![#this.equals('abc')]";
|
||||
@@ -540,11 +540,11 @@ public class SpelReproTests extends AbstractExpressionTests {
|
||||
// value is list containing [true,false]
|
||||
assertThat(value.get(0).getClass()).isEqualTo(Boolean.class);
|
||||
TypeDescriptor evaluated = exp.getValueTypeDescriptor(context);
|
||||
assertThat(evaluated.getElementTypeDescriptor()).isEqualTo(null);
|
||||
assertThat(evaluated.getElementTypeDescriptor()).isNull();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void projectionTypeDescriptors_2() {
|
||||
void projectionTypeDescriptors_2() {
|
||||
StandardEvaluationContext context = new StandardEvaluationContext(new C());
|
||||
SpelExpressionParser parser = new SpelExpressionParser();
|
||||
String el1 = "as.![#this.equals('abc')]";
|
||||
@@ -557,7 +557,7 @@ public class SpelReproTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void projectionTypeDescriptors_3() {
|
||||
void projectionTypeDescriptors_3() {
|
||||
StandardEvaluationContext context = new StandardEvaluationContext(new C());
|
||||
SpelExpressionParser parser = new SpelExpressionParser();
|
||||
String el1 = "ms.![key.equals('abc')]";
|
||||
@@ -566,11 +566,11 @@ public class SpelReproTests extends AbstractExpressionTests {
|
||||
// value is list containing [true,false]
|
||||
assertThat(value.get(0).getClass()).isEqualTo(Boolean.class);
|
||||
TypeDescriptor evaluated = exp.getValueTypeDescriptor(context);
|
||||
assertThat(evaluated.getElementTypeDescriptor()).isEqualTo(null);
|
||||
assertThat(evaluated.getElementTypeDescriptor()).isNull();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void greaterThanWithNulls_SPR7840() {
|
||||
void greaterThanWithNulls_SPR7840() {
|
||||
List<D> list = new ArrayList<>();
|
||||
list.add(new D("aaa"));
|
||||
list.add(new D("bbb"));
|
||||
@@ -605,7 +605,7 @@ public class SpelReproTests extends AbstractExpressionTests {
|
||||
* than a unboxing conversion.
|
||||
*/
|
||||
@Test
|
||||
public void conversionPriority_SPR8224() throws Exception {
|
||||
void conversionPriority_SPR8224() throws Exception {
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
class ConversionPriority1 {
|
||||
@@ -637,7 +637,7 @@ public class SpelReproTests extends AbstractExpressionTests {
|
||||
ConversionPriority1 target = new ConversionPriority1();
|
||||
MethodExecutor me = new ReflectiveMethodResolver(true).resolve(emptyEvalContext, target, "getX", args);
|
||||
// MethodInvoker chooses getX(int i) when passing Integer
|
||||
final int actual = (Integer) me.execute(emptyEvalContext, target, new Integer(42)).getValue();
|
||||
final int actual = (Integer) me.execute(emptyEvalContext, target, Integer.valueOf(42)).getValue();
|
||||
// Compiler chooses getX(Number i) when passing Integer
|
||||
final int compiler = target.getX(INTEGER);
|
||||
// Fails!
|
||||
@@ -646,7 +646,7 @@ public class SpelReproTests extends AbstractExpressionTests {
|
||||
ConversionPriority2 target2 = new ConversionPriority2();
|
||||
MethodExecutor me2 = new ReflectiveMethodResolver(true).resolve(emptyEvalContext, target2, "getX", args);
|
||||
// MethodInvoker chooses getX(int i) when passing Integer
|
||||
int actual2 = (Integer) me2.execute(emptyEvalContext, target2, new Integer(42)).getValue();
|
||||
int actual2 = (Integer) me2.execute(emptyEvalContext, target2, Integer.valueOf(42)).getValue();
|
||||
// Compiler chooses getX(Number i) when passing Integer
|
||||
int compiler2 = target2.getX(INTEGER);
|
||||
// Fails!
|
||||
@@ -659,7 +659,7 @@ public class SpelReproTests extends AbstractExpressionTests {
|
||||
* method accepting 'long' is ok.
|
||||
*/
|
||||
@Test
|
||||
public void wideningPrimitiveConversion_SPR8224() throws Exception {
|
||||
void wideningPrimitiveConversion_SPR8224() throws Exception {
|
||||
|
||||
class WideningPrimitiveConversion {
|
||||
public int getX(long i) {
|
||||
@@ -667,7 +667,7 @@ public class SpelReproTests extends AbstractExpressionTests {
|
||||
}
|
||||
}
|
||||
|
||||
final Integer INTEGER_VALUE = Integer.valueOf(7);
|
||||
final Integer INTEGER_VALUE = 7;
|
||||
WideningPrimitiveConversion target = new WideningPrimitiveConversion();
|
||||
EvaluationContext emptyEvalContext = new StandardEvaluationContext();
|
||||
|
||||
@@ -682,7 +682,7 @@ public class SpelReproTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void varargsAgainstProxy_SPR16122() {
|
||||
void varargsAgainstProxy_SPR16122() {
|
||||
SpelExpressionParser parser = new SpelExpressionParser();
|
||||
Expression expr = parser.parseExpression("process('a', 'b')");
|
||||
|
||||
@@ -696,7 +696,7 @@ public class SpelReproTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCompiledExpressionForProxy_SPR16191() {
|
||||
void testCompiledExpressionForProxy_SPR16191() {
|
||||
SpelExpressionParser expressionParser =
|
||||
new SpelExpressionParser(new SpelParserConfiguration(SpelCompilerMode.IMMEDIATE, null));
|
||||
Expression expression = expressionParser.parseExpression("#target.process(#root)");
|
||||
@@ -715,7 +715,7 @@ public class SpelReproTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void varargsAndPrimitives_SPR8174() throws Exception {
|
||||
void varargsAndPrimitives_SPR8174() throws Exception {
|
||||
EvaluationContext emptyEvalContext = new StandardEvaluationContext();
|
||||
List<TypeDescriptor> args = new ArrayList<>();
|
||||
|
||||
@@ -763,7 +763,7 @@ public class SpelReproTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void reservedWords_SPR8228() {
|
||||
void reservedWords_SPR8228() {
|
||||
|
||||
// "DIV","EQ","GE","GT","LE","LT","MOD","NE","NOT"
|
||||
@SuppressWarnings("unused")
|
||||
@@ -814,7 +814,7 @@ public class SpelReproTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void reservedWordProperties_SPR9862() {
|
||||
void reservedWordProperties_SPR9862() {
|
||||
StandardEvaluationContext context = new StandardEvaluationContext();
|
||||
SpelExpressionParser parser = new SpelExpressionParser();
|
||||
SpelExpression expression = parser.parseRaw("T(org.springframework.expression.spel.testresources.le.div.mod.reserved.Reserver).CONST");
|
||||
@@ -829,7 +829,7 @@ public class SpelReproTests extends AbstractExpressionTests {
|
||||
* in evaluation of SPEL expressions for a given context.
|
||||
*/
|
||||
@Test
|
||||
public void propertyAccessorOrder_SPR8211() {
|
||||
void propertyAccessorOrder_SPR8211() {
|
||||
ExpressionParser expressionParser = new SpelExpressionParser();
|
||||
StandardEvaluationContext evaluationContext = new StandardEvaluationContext(new ContextObject());
|
||||
|
||||
@@ -849,7 +849,7 @@ public class SpelReproTests extends AbstractExpressionTests {
|
||||
* determines the set of methods for a type.
|
||||
*/
|
||||
@Test
|
||||
public void customStaticFunctions_SPR9038() {
|
||||
void customStaticFunctions_SPR9038() {
|
||||
ExpressionParser parser = new SpelExpressionParser();
|
||||
StandardEvaluationContext context = new StandardEvaluationContext();
|
||||
List<MethodResolver> methodResolvers = new ArrayList<>();
|
||||
@@ -873,7 +873,7 @@ public class SpelReproTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void array() {
|
||||
void array() {
|
||||
ExpressionParser parser = new SpelExpressionParser();
|
||||
StandardEvaluationContext context = new StandardEvaluationContext();
|
||||
Expression expression = null;
|
||||
@@ -902,7 +902,7 @@ public class SpelReproTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void SPR9486_floatFunctionResolver() {
|
||||
void SPR9486_floatFunctionResolver() {
|
||||
Number expectedResult = Math.abs(-10.2f);
|
||||
ExpressionParser parser = new SpelExpressionParser();
|
||||
SPR9486_FunctionsClass testObject = new SPR9486_FunctionsClass();
|
||||
@@ -914,7 +914,7 @@ public class SpelReproTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void SPR9486_addFloatWithDouble() {
|
||||
void SPR9486_addFloatWithDouble() {
|
||||
Number expectedNumber = 10.21f + 10.2;
|
||||
ExpressionParser parser = new SpelExpressionParser();
|
||||
StandardEvaluationContext context = new StandardEvaluationContext();
|
||||
@@ -924,7 +924,7 @@ public class SpelReproTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void SPR9486_addFloatWithFloat() {
|
||||
void SPR9486_addFloatWithFloat() {
|
||||
Number expectedNumber = 10.21f + 10.2f;
|
||||
ExpressionParser parser = new SpelExpressionParser();
|
||||
StandardEvaluationContext context = new StandardEvaluationContext();
|
||||
@@ -934,7 +934,7 @@ public class SpelReproTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void SPR9486_subtractFloatWithDouble() {
|
||||
void SPR9486_subtractFloatWithDouble() {
|
||||
Number expectedNumber = 10.21f - 10.2;
|
||||
ExpressionParser parser = new SpelExpressionParser();
|
||||
StandardEvaluationContext context = new StandardEvaluationContext();
|
||||
@@ -944,7 +944,7 @@ public class SpelReproTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void SPR9486_subtractFloatWithFloat() {
|
||||
void SPR9486_subtractFloatWithFloat() {
|
||||
Number expectedNumber = 10.21f - 10.2f;
|
||||
ExpressionParser parser = new SpelExpressionParser();
|
||||
StandardEvaluationContext context = new StandardEvaluationContext();
|
||||
@@ -954,7 +954,7 @@ public class SpelReproTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void SPR9486_multiplyFloatWithDouble() {
|
||||
void SPR9486_multiplyFloatWithDouble() {
|
||||
Number expectedNumber = 10.21f * 10.2;
|
||||
ExpressionParser parser = new SpelExpressionParser();
|
||||
StandardEvaluationContext context = new StandardEvaluationContext();
|
||||
@@ -964,7 +964,7 @@ public class SpelReproTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void SPR9486_multiplyFloatWithFloat() {
|
||||
void SPR9486_multiplyFloatWithFloat() {
|
||||
Number expectedNumber = 10.21f * 10.2f;
|
||||
ExpressionParser parser = new SpelExpressionParser();
|
||||
StandardEvaluationContext context = new StandardEvaluationContext();
|
||||
@@ -974,7 +974,7 @@ public class SpelReproTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void SPR9486_floatDivideByFloat() {
|
||||
void SPR9486_floatDivideByFloat() {
|
||||
Number expectedNumber = -10.21f / -10.2f;
|
||||
ExpressionParser parser = new SpelExpressionParser();
|
||||
StandardEvaluationContext context = new StandardEvaluationContext();
|
||||
@@ -984,7 +984,7 @@ public class SpelReproTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void SPR9486_floatDivideByDouble() {
|
||||
void SPR9486_floatDivideByDouble() {
|
||||
Number expectedNumber = -10.21f / -10.2;
|
||||
ExpressionParser parser = new SpelExpressionParser();
|
||||
StandardEvaluationContext context = new StandardEvaluationContext();
|
||||
@@ -994,7 +994,7 @@ public class SpelReproTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void SPR9486_floatEqFloatUnaryMinus() {
|
||||
void SPR9486_floatEqFloatUnaryMinus() {
|
||||
Boolean expectedResult = -10.21f == -10.2f;
|
||||
ExpressionParser parser = new SpelExpressionParser();
|
||||
StandardEvaluationContext context = new StandardEvaluationContext();
|
||||
@@ -1004,7 +1004,7 @@ public class SpelReproTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void SPR9486_floatEqDoubleUnaryMinus() {
|
||||
void SPR9486_floatEqDoubleUnaryMinus() {
|
||||
Boolean expectedResult = -10.21f == -10.2;
|
||||
ExpressionParser parser = new SpelExpressionParser();
|
||||
StandardEvaluationContext context = new StandardEvaluationContext();
|
||||
@@ -1014,7 +1014,7 @@ public class SpelReproTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void SPR9486_floatEqFloat() {
|
||||
void SPR9486_floatEqFloat() {
|
||||
Boolean expectedResult = 10.215f == 10.2109f;
|
||||
ExpressionParser parser = new SpelExpressionParser();
|
||||
StandardEvaluationContext context = new StandardEvaluationContext();
|
||||
@@ -1024,7 +1024,7 @@ public class SpelReproTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void SPR9486_floatEqDouble() {
|
||||
void SPR9486_floatEqDouble() {
|
||||
Boolean expectedResult = 10.215f == 10.2109;
|
||||
ExpressionParser parser = new SpelExpressionParser();
|
||||
StandardEvaluationContext context = new StandardEvaluationContext();
|
||||
@@ -1034,7 +1034,7 @@ public class SpelReproTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void SPR9486_floatNotEqFloat() {
|
||||
void SPR9486_floatNotEqFloat() {
|
||||
Boolean expectedResult = 10.215f != 10.2109f;
|
||||
ExpressionParser parser = new SpelExpressionParser();
|
||||
StandardEvaluationContext context = new StandardEvaluationContext();
|
||||
@@ -1044,7 +1044,7 @@ public class SpelReproTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void SPR9486_floatNotEqDouble() {
|
||||
void SPR9486_floatNotEqDouble() {
|
||||
Boolean expectedResult = 10.215f != 10.2109;
|
||||
ExpressionParser parser = new SpelExpressionParser();
|
||||
StandardEvaluationContext context = new StandardEvaluationContext();
|
||||
@@ -1054,7 +1054,7 @@ public class SpelReproTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void SPR9486_floatLessThanFloat() {
|
||||
void SPR9486_floatLessThanFloat() {
|
||||
Boolean expectedNumber = -10.21f < -10.2f;
|
||||
ExpressionParser parser = new SpelExpressionParser();
|
||||
StandardEvaluationContext context = new StandardEvaluationContext();
|
||||
@@ -1064,7 +1064,7 @@ public class SpelReproTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void SPR9486_floatLessThanDouble() {
|
||||
void SPR9486_floatLessThanDouble() {
|
||||
Boolean expectedNumber = -10.21f < -10.2;
|
||||
ExpressionParser parser = new SpelExpressionParser();
|
||||
StandardEvaluationContext context = new StandardEvaluationContext();
|
||||
@@ -1074,7 +1074,7 @@ public class SpelReproTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void SPR9486_floatLessThanOrEqualFloat() {
|
||||
void SPR9486_floatLessThanOrEqualFloat() {
|
||||
Boolean expectedNumber = -10.21f <= -10.22f;
|
||||
ExpressionParser parser = new SpelExpressionParser();
|
||||
StandardEvaluationContext context = new StandardEvaluationContext();
|
||||
@@ -1084,7 +1084,7 @@ public class SpelReproTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void SPR9486_floatLessThanOrEqualDouble() {
|
||||
void SPR9486_floatLessThanOrEqualDouble() {
|
||||
Boolean expectedNumber = -10.21f <= -10.2;
|
||||
ExpressionParser parser = new SpelExpressionParser();
|
||||
StandardEvaluationContext context = new StandardEvaluationContext();
|
||||
@@ -1094,7 +1094,7 @@ public class SpelReproTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void SPR9486_floatGreaterThanFloat() {
|
||||
void SPR9486_floatGreaterThanFloat() {
|
||||
Boolean expectedNumber = -10.21f > -10.2f;
|
||||
ExpressionParser parser = new SpelExpressionParser();
|
||||
StandardEvaluationContext context = new StandardEvaluationContext();
|
||||
@@ -1104,7 +1104,7 @@ public class SpelReproTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void SPR9486_floatGreaterThanDouble() {
|
||||
void SPR9486_floatGreaterThanDouble() {
|
||||
Boolean expectedResult = -10.21f > -10.2;
|
||||
ExpressionParser parser = new SpelExpressionParser();
|
||||
StandardEvaluationContext context = new StandardEvaluationContext();
|
||||
@@ -1114,7 +1114,7 @@ public class SpelReproTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void SPR9486_floatGreaterThanOrEqualFloat() {
|
||||
void SPR9486_floatGreaterThanOrEqualFloat() {
|
||||
Boolean expectedNumber = -10.21f >= -10.2f;
|
||||
ExpressionParser parser = new SpelExpressionParser();
|
||||
StandardEvaluationContext context = new StandardEvaluationContext();
|
||||
@@ -1124,7 +1124,7 @@ public class SpelReproTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void SPR9486_floatGreaterThanEqualDouble() {
|
||||
void SPR9486_floatGreaterThanEqualDouble() {
|
||||
Boolean expectedResult = -10.21f >= -10.2;
|
||||
ExpressionParser parser = new SpelExpressionParser();
|
||||
StandardEvaluationContext context = new StandardEvaluationContext();
|
||||
@@ -1134,7 +1134,7 @@ public class SpelReproTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void SPR9486_floatModulusFloat() {
|
||||
void SPR9486_floatModulusFloat() {
|
||||
Number expectedResult = 10.21f % 10.2f;
|
||||
ExpressionParser parser = new SpelExpressionParser();
|
||||
StandardEvaluationContext context = new StandardEvaluationContext();
|
||||
@@ -1144,7 +1144,7 @@ public class SpelReproTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void SPR9486_floatModulusDouble() {
|
||||
void SPR9486_floatModulusDouble() {
|
||||
Number expectedResult = 10.21f % 10.2;
|
||||
ExpressionParser parser = new SpelExpressionParser();
|
||||
StandardEvaluationContext context = new StandardEvaluationContext();
|
||||
@@ -1154,7 +1154,7 @@ public class SpelReproTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void SPR9486_floatPowerFloat() {
|
||||
void SPR9486_floatPowerFloat() {
|
||||
Number expectedResult = Math.pow(10.21f, -10.2f);
|
||||
ExpressionParser parser = new SpelExpressionParser();
|
||||
StandardEvaluationContext context = new StandardEvaluationContext();
|
||||
@@ -1164,7 +1164,7 @@ public class SpelReproTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void SPR9486_floatPowerDouble() {
|
||||
void SPR9486_floatPowerDouble() {
|
||||
Number expectedResult = Math.pow(10.21f, 10.2);
|
||||
ExpressionParser parser = new SpelExpressionParser();
|
||||
StandardEvaluationContext context = new StandardEvaluationContext();
|
||||
@@ -1174,7 +1174,7 @@ public class SpelReproTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void SPR9994_bridgeMethods() throws Exception {
|
||||
void SPR9994_bridgeMethods() throws Exception {
|
||||
ReflectivePropertyAccessor accessor = new ReflectivePropertyAccessor();
|
||||
StandardEvaluationContext context = new StandardEvaluationContext();
|
||||
GenericImplementation target = new GenericImplementation();
|
||||
@@ -1187,7 +1187,7 @@ public class SpelReproTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void SPR10162_onlyBridgeMethod() throws Exception {
|
||||
void SPR10162_onlyBridgeMethod() throws Exception {
|
||||
ReflectivePropertyAccessor accessor = new ReflectivePropertyAccessor();
|
||||
StandardEvaluationContext context = new StandardEvaluationContext();
|
||||
Object target = new OnlyBridgeMethod();
|
||||
@@ -1197,7 +1197,7 @@ public class SpelReproTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void SPR10091_simpleTestValueType() {
|
||||
void SPR10091_simpleTestValueType() {
|
||||
ExpressionParser parser = new SpelExpressionParser();
|
||||
StandardEvaluationContext evaluationContext = new StandardEvaluationContext(new BooleanHolder());
|
||||
Class<?> valueType = parser.parseExpression("simpleProperty").getValueType(evaluationContext);
|
||||
@@ -1205,7 +1205,7 @@ public class SpelReproTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void SPR10091_simpleTestValue() {
|
||||
void SPR10091_simpleTestValue() {
|
||||
ExpressionParser parser = new SpelExpressionParser();
|
||||
StandardEvaluationContext evaluationContext = new StandardEvaluationContext(new BooleanHolder());
|
||||
Object value = parser.parseExpression("simpleProperty").getValue(evaluationContext);
|
||||
@@ -1213,7 +1213,7 @@ public class SpelReproTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void SPR10091_primitiveTestValueType() {
|
||||
void SPR10091_primitiveTestValueType() {
|
||||
ExpressionParser parser = new SpelExpressionParser();
|
||||
StandardEvaluationContext evaluationContext = new StandardEvaluationContext(new BooleanHolder());
|
||||
Class<?> valueType = parser.parseExpression("primitiveProperty").getValueType(evaluationContext);
|
||||
@@ -1221,7 +1221,7 @@ public class SpelReproTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void SPR10091_primitiveTestValue() {
|
||||
void SPR10091_primitiveTestValue() {
|
||||
ExpressionParser parser = new SpelExpressionParser();
|
||||
StandardEvaluationContext evaluationContext = new StandardEvaluationContext(new BooleanHolder());
|
||||
Object value = parser.parseExpression("primitiveProperty").getValue(evaluationContext);
|
||||
@@ -1229,7 +1229,7 @@ public class SpelReproTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void SPR16123() {
|
||||
void SPR16123() {
|
||||
ExpressionParser parser = new SpelExpressionParser();
|
||||
parser.parseExpression("simpleProperty").setValue(new BooleanHolder(), null);
|
||||
assertThatExceptionOfType(EvaluationException.class).isThrownBy(() ->
|
||||
@@ -1237,7 +1237,7 @@ public class SpelReproTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void SPR10146_malformedExpressions() {
|
||||
void SPR10146_malformedExpressions() {
|
||||
doTestSpr10146("/foo", "EL1070E: Problem parsing left operand");
|
||||
doTestSpr10146("*foo", "EL1070E: Problem parsing left operand");
|
||||
doTestSpr10146("%foo", "EL1070E: Problem parsing left operand");
|
||||
@@ -1255,7 +1255,7 @@ public class SpelReproTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void SPR10125() {
|
||||
void SPR10125() {
|
||||
StandardEvaluationContext context = new StandardEvaluationContext();
|
||||
String fromInterface = parser.parseExpression("T(" + StaticFinalImpl1.class.getName() + ").VALUE").getValue(
|
||||
context, String.class);
|
||||
@@ -1266,7 +1266,7 @@ public class SpelReproTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void SPR10210() {
|
||||
void SPR10210() {
|
||||
StandardEvaluationContext context = new StandardEvaluationContext();
|
||||
context.setVariable("bridgeExample", new org.springframework.expression.spel.spr10210.D());
|
||||
Expression parseExpression = parser.parseExpression("#bridgeExample.bridgeMethod()");
|
||||
@@ -1274,14 +1274,14 @@ public class SpelReproTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void SPR10328() {
|
||||
void SPR10328() {
|
||||
assertThatExceptionOfType(SpelParseException.class).isThrownBy(() ->
|
||||
parser.parseExpression("$[]"))
|
||||
.withMessageContaining("EL1071E: A required selection expression has not been specified");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void SPR10452() {
|
||||
void SPR10452() {
|
||||
SpelParserConfiguration configuration = new SpelParserConfiguration(false, false);
|
||||
ExpressionParser parser = new SpelExpressionParser(configuration);
|
||||
|
||||
@@ -1306,7 +1306,7 @@ public class SpelReproTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void SPR9495() {
|
||||
void SPR9495() {
|
||||
SpelParserConfiguration configuration = new SpelParserConfiguration(false, false);
|
||||
ExpressionParser parser = new SpelExpressionParser(configuration);
|
||||
|
||||
@@ -1347,7 +1347,7 @@ public class SpelReproTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void SPR10486() {
|
||||
void SPR10486() {
|
||||
SpelExpressionParser parser = new SpelExpressionParser();
|
||||
StandardEvaluationContext context = new StandardEvaluationContext();
|
||||
Spr10486 rootObject = new Spr10486();
|
||||
@@ -1358,7 +1358,7 @@ public class SpelReproTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void SPR11142() {
|
||||
void SPR11142() {
|
||||
SpelExpressionParser parser = new SpelExpressionParser();
|
||||
StandardEvaluationContext context = new StandardEvaluationContext();
|
||||
Spr11142 rootObject = new Spr11142();
|
||||
@@ -1369,7 +1369,7 @@ public class SpelReproTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void SPR9194() {
|
||||
void SPR9194() {
|
||||
TestClass2 one = new TestClass2("abc");
|
||||
TestClass2 two = new TestClass2("abc");
|
||||
Map<String, TestClass2> map = new HashMap<>();
|
||||
@@ -1382,7 +1382,7 @@ public class SpelReproTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void SPR11348() {
|
||||
void SPR11348() {
|
||||
Collection<String> coll = new LinkedHashSet<>();
|
||||
coll.add("one");
|
||||
coll.add("two");
|
||||
@@ -1399,14 +1399,14 @@ public class SpelReproTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void SPR11445_simple() {
|
||||
void SPR11445_simple() {
|
||||
StandardEvaluationContext context = new StandardEvaluationContext(new Spr11445Class());
|
||||
Expression expr = new SpelExpressionParser().parseRaw("echo(parameter())");
|
||||
assertThat(expr.getValue(context)).isEqualTo(1);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void SPR11445_beanReference() {
|
||||
void SPR11445_beanReference() {
|
||||
StandardEvaluationContext context = new StandardEvaluationContext();
|
||||
context.setBeanResolver(new Spr11445Class());
|
||||
Expression expr = new SpelExpressionParser().parseRaw("@bean.echo(@bean.parameter())");
|
||||
@@ -1415,14 +1415,14 @@ public class SpelReproTests extends AbstractExpressionTests {
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("unchecked")
|
||||
public void SPR11494() {
|
||||
void SPR11494() {
|
||||
Expression exp = new SpelExpressionParser().parseExpression("T(java.util.Arrays).asList('a','b')");
|
||||
List<String> list = (List<String>) exp.getValue();
|
||||
assertThat(list).hasSize(2);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void SPR11609() {
|
||||
void SPR11609() {
|
||||
StandardEvaluationContext sec = new StandardEvaluationContext();
|
||||
sec.addPropertyAccessor(new MapAccessor());
|
||||
Expression exp = new SpelExpressionParser().parseExpression(
|
||||
@@ -1431,7 +1431,7 @@ public class SpelReproTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void SPR9735() {
|
||||
void SPR9735() {
|
||||
Item item = new Item();
|
||||
item.setName("parent");
|
||||
|
||||
@@ -1453,7 +1453,7 @@ public class SpelReproTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void SPR12502() {
|
||||
void SPR12502() {
|
||||
SpelExpressionParser parser = new SpelExpressionParser();
|
||||
Expression expression = parser.parseExpression("#root.getClass().getName()");
|
||||
assertThat(expression.getValue(new UnnamedUser())).isEqualTo(UnnamedUser.class.getName());
|
||||
@@ -1462,7 +1462,7 @@ public class SpelReproTests extends AbstractExpressionTests {
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("rawtypes")
|
||||
public void SPR12522() {
|
||||
void SPR12522() {
|
||||
SpelExpressionParser parser = new SpelExpressionParser();
|
||||
Expression expression = parser.parseExpression("T(java.util.Arrays).asList('')");
|
||||
Object value = expression.getValue();
|
||||
@@ -1471,7 +1471,7 @@ public class SpelReproTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void SPR12803() {
|
||||
void SPR12803() {
|
||||
StandardEvaluationContext sec = new StandardEvaluationContext();
|
||||
sec.setVariable("iterable", Collections.emptyList());
|
||||
SpelExpressionParser parser = new SpelExpressionParser();
|
||||
@@ -1480,7 +1480,7 @@ public class SpelReproTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void SPR12808() {
|
||||
void SPR12808() {
|
||||
SpelExpressionParser parser = new SpelExpressionParser();
|
||||
Expression expression = parser.parseExpression("T(org.springframework.expression.spel.SpelReproTests.DistanceEnforcer).from(#no)");
|
||||
StandardEvaluationContext sec = new StandardEvaluationContext();
|
||||
@@ -1496,7 +1496,7 @@ public class SpelReproTests extends AbstractExpressionTests {
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("rawtypes")
|
||||
public void SPR13055() {
|
||||
void SPR13055() {
|
||||
List<Map<String, Object>> myPayload = new ArrayList<>();
|
||||
|
||||
Map<String, Object> v1 = new HashMap<>();
|
||||
@@ -1527,7 +1527,7 @@ public class SpelReproTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void AccessingFactoryBean_spr9511() {
|
||||
void AccessingFactoryBean_spr9511() {
|
||||
StandardEvaluationContext context = new StandardEvaluationContext();
|
||||
context.setBeanResolver(new MyBeanResolver());
|
||||
Expression expr = new SpelExpressionParser().parseRaw("@foo");
|
||||
@@ -1551,7 +1551,7 @@ public class SpelReproTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void SPR12035() {
|
||||
void SPR12035() {
|
||||
ExpressionParser parser = new SpelExpressionParser();
|
||||
|
||||
Expression expression1 = parser.parseExpression("list.?[ value>2 ].size()!=0");
|
||||
@@ -1562,7 +1562,7 @@ public class SpelReproTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void SPR13055_maps() {
|
||||
void SPR13055_maps() {
|
||||
EvaluationContext context = new StandardEvaluationContext();
|
||||
ExpressionParser parser = new SpelExpressionParser();
|
||||
|
||||
@@ -1578,7 +1578,7 @@ public class SpelReproTests extends AbstractExpressionTests {
|
||||
|
||||
@Test
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
public void SPR10417() {
|
||||
void SPR10417() {
|
||||
List list1 = new ArrayList();
|
||||
list1.add("a");
|
||||
list1.add("b");
|
||||
@@ -1619,7 +1619,7 @@ public class SpelReproTests extends AbstractExpressionTests {
|
||||
|
||||
@Test
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
public void SPR10417_maps() {
|
||||
void SPR10417_maps() {
|
||||
Map map1 = new HashMap();
|
||||
map1.put("A", 65);
|
||||
map1.put("B", 66);
|
||||
@@ -1642,7 +1642,7 @@ public class SpelReproTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void SPR13918() {
|
||||
void SPR13918() {
|
||||
EvaluationContext context = new StandardEvaluationContext();
|
||||
context.setVariable("encoding", "UTF-8");
|
||||
|
||||
@@ -1652,7 +1652,7 @@ public class SpelReproTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void SPR16032() {
|
||||
void SPR16032() {
|
||||
EvaluationContext context = new StandardEvaluationContext();
|
||||
context.setVariable("str", "a\0b");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user