diff --git a/spring-expression/src/test/java/org/springframework/expression/spel/AbstractExpressionTests.java b/spring-expression/src/test/java/org/springframework/expression/spel/AbstractExpressionTests.java index b54bd54138e..a7c1a23c786 100644 --- a/spring-expression/src/test/java/org/springframework/expression/spel/AbstractExpressionTests.java +++ b/spring-expression/src/test/java/org/springframework/expression/spel/AbstractExpressionTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2015 the original author or authors. + * Copyright 2002-2018 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. @@ -142,7 +142,7 @@ public abstract class AbstractExpressionTests { else { assertEquals("Did not get expected value for expression '" + expression + "'.", expectedValue, value); } - assertNull("Type of the result was not as expected. Expected '" + expectedClassOfResult + + assertTrue("Type of the result was not as expected. Expected '" + expectedClassOfResult + "' but result was of type '" + resultType + "'", expectedClassOfResult.equals(resultType)); boolean isWritable = expr.isWritable(eContext); diff --git a/spring-expression/src/test/java/org/springframework/expression/spel/BooleanExpressionTests.java b/spring-expression/src/test/java/org/springframework/expression/spel/BooleanExpressionTests.java index f9c63b58148..73b0bd740fc 100644 --- a/spring-expression/src/test/java/org/springframework/expression/spel/BooleanExpressionTests.java +++ b/spring-expression/src/test/java/org/springframework/expression/spel/BooleanExpressionTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2018 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. @@ -111,4 +111,5 @@ public class BooleanExpressionTests extends AbstractExpressionTests { evaluate("!null", Boolean.TRUE, Boolean.class, false); evaluate("null ? 'foo' : 'bar'", "bar", String.class, false); } + } diff --git a/spring-expression/src/test/java/org/springframework/expression/spel/EvaluationTests.java b/spring-expression/src/test/java/org/springframework/expression/spel/EvaluationTests.java index bc45bdd823f..2c39c949274 100644 --- a/spring-expression/src/test/java/org/springframework/expression/spel/EvaluationTests.java +++ b/spring-expression/src/test/java/org/springframework/expression/spel/EvaluationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2016 the original author or authors. + * Copyright 2002-2018 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. @@ -111,30 +111,6 @@ public class EvaluationTests extends AbstractExpressionTests { o = parser.parseExpression("wibble2.bar").getValue(ctx); } - - @SuppressWarnings("rawtypes") - static class TestClass { - public Foo wibble; - private Foo wibble2; - public Map map; - public Map mapStringToInteger; - public List list; - public List list2; - private Map map2; - private List foo; - - public Map getMap2() { return this.map2; } - public Foo getWibble2() { return this.wibble2; } - public List getFoo() { return this.foo; } - public void setFoo(List newfoo) { this.foo = newfoo; } - } - - public static class Foo { - public Foo() {} - public String bar = "hello"; - } - - @Test public void testElvis01() { evaluate("'Andy'?:'Dave'", "Andy", String.class); @@ -1477,6 +1453,32 @@ public class EvaluationTests extends AbstractExpressionTests { } + @SuppressWarnings("rawtypes") + static class TestClass { + + public Foo wibble; + private Foo wibble2; + public Map map; + public Map mapStringToInteger; + public List list; + public List list2; + private Map map2; + private List foo; + + public Map getMap2() { return this.map2; } + public Foo getWibble2() { return this.wibble2; } + public List getFoo() { return this.foo; } + public void setFoo(List newfoo) { this.foo = newfoo; } + } + + public static class Foo { + + public String bar = "hello"; + + public Foo() {} + } + + static class MyBeanResolver implements BeanResolver { @Override @@ -1487,7 +1489,6 @@ public class EvaluationTests extends AbstractExpressionTests { } throw new AccessException("not heard of "+beanName); } - } }