Refactored package structure and made some getValue() methods generic

This commit is contained in:
Andy Clement
2008-12-12 23:07:08 +00:00
parent 4c88488c5a
commit 5ff4008423
46 changed files with 237 additions and 212 deletions

View File

@@ -24,6 +24,8 @@ import org.springframework.expression.spel.standard.StandardEvaluationContext;
*/
public class ConstructorInvocationTests extends ExpressionTestCase {
// Some tests commented out as language support has been removed for now
// public void testPrimitiveTypeArrayConstructors() {
// evaluate("new int[]{1,2,3,4}.count()", 4, Integer.class);
// evaluate("new boolean[]{true,false,true}.count()", 3, Integer.class);
@@ -46,11 +48,6 @@ public class ConstructorInvocationTests extends ExpressionTestCase {
// evaluate("new byte[]{1,2,3,4}[0]", (byte) 1, Byte.class);
// }
public void testTypeConstructors() {
evaluate("new String('hello world')", "hello world", String.class);
// evaluate("new String(new char[]{'h','e','l','l','o'})", "hello", String.class);
}
// public void testErrorCases() {
// evaluateAndCheckError("new char[7]{'a','c','d','e'}", SpelMessages.INITIALIZER_LENGTH_INCORRECT);
// evaluateAndCheckError("new char[3]{'a','c','d','e'}", SpelMessages.INITIALIZER_LENGTH_INCORRECT);
@@ -75,6 +72,11 @@ public class ConstructorInvocationTests extends ExpressionTestCase {
// new String[3][4].getClass());
// }
public void testTypeConstructors() {
evaluate("new String('hello world')", "hello world", String.class);
// evaluate("new String(new char[]{'h','e','l','l','o'})", "hello", String.class);
}
/*
* These tests are attempting to call constructors where we need to widen or convert the argument in order to
* satisfy a suitable constructor.

View File

@@ -18,6 +18,8 @@ package org.springframework.expression.spel;
/**
* Tests the evaluation of real expressions in a real context.
*
* Node: Some tests commented out as language support has been removed
*
* @author Andy Clement
*/
public class EvaluationTests extends ExpressionTestCase {