Polishing

This commit is contained in:
Juergen Hoeller
2018-09-07 12:56:53 +02:00
parent c803ad7998
commit 90a4740279
3 changed files with 50 additions and 52 deletions

View File

@@ -692,7 +692,7 @@ public class SpelCompilationCoverageTests extends AbstractExpressionTests {
}
@Test
public void ternaryWithBooleanReturn() { // SPR-12271
public void ternaryWithBooleanReturn_SPR12271() {
expression = parser.parseExpression("T(Boolean).TRUE?'abc':'def'");
assertEquals("abc", expression.getValue());
assertCanCompile(expression);
@@ -4199,7 +4199,7 @@ public class SpelCompilationCoverageTests extends AbstractExpressionTests {
}
@Test
public void propertyReferenceVisibility() { // SPR-12771
public void propertyReferenceVisibility_SPR12771() {
StandardEvaluationContext ctx = new StandardEvaluationContext();
ctx.setVariable("httpServletRequest", HttpServlet3RequestFactory.getOne());
// Without a fix compilation was inserting a checkcast to a private type
@@ -4898,7 +4898,6 @@ public class SpelCompilationCoverageTests extends AbstractExpressionTests {
assertIsCompiled(exp);
}
@Test
public void elvisOperator_SPR17214() throws Exception {
SpelParserConfiguration spc = new SpelParserConfiguration(SpelCompilerMode.IMMEDIATE, null);
@@ -4947,22 +4946,6 @@ public class SpelCompilationCoverageTests extends AbstractExpressionTests {
assertNull(expression.getValue(rh));
}
public static class RecordHolder {
public void add(String key, Long value) {
record.put(key, value);
}
public long get(String key) {
return record.get(key);
}
public Map<String,Long> record = new HashMap<>();
public LongHolder expression = new LongHolder();
}
public static class LongHolder {
public Long someLong = 3L;
}
@Test
public void ternaryOperator_SPR15192() {
SpelParserConfiguration configuration = new SpelParserConfiguration(SpelCompilerMode.IMMEDIATE, null);
@@ -6125,4 +6108,26 @@ public class SpelCompilationCoverageTests extends AbstractExpressionTests {
}
}
public static class RecordHolder {
public Map<String,Long> record = new HashMap<>();
public LongHolder expression = new LongHolder();
public void add(String key, Long value) {
record.put(key, value);
}
public long get(String key) {
return record.get(key);
}
}
public static class LongHolder {
public Long someLong = 3L;
}
}