Favor convertValue(Object, TypeDescriptor) where possible and TypedValue(Object); check with Andy on Selection and Projection TypedValue usage

This commit is contained in:
Keith Donald
2011-01-07 06:32:21 +00:00
parent 0fb631348e
commit 71e60f4551
12 changed files with 32 additions and 47 deletions

View File

@@ -121,8 +121,7 @@ public class ExpressionTestsUsingCoreConversionService extends ExpressionTestCas
assertTrue(evaluationContext.getTypeConverter()
.canConvert(TypeDescriptor.valueOf(String.class), collectionType));
// ... and it can be done successfully
assertEquals("[1, 2, 3, 4]", evaluationContext.getTypeConverter().convertValue("1,2,3,4",
TypeDescriptor.valueOf(String.class), collectionType).toString());
assertEquals("[1, 2, 3, 4]", evaluationContext.getTypeConverter().convertValue("1,2,3,4", collectionType).toString());
evaluationContext.setVariable("target", new TestTarget());
@@ -153,6 +152,7 @@ public class ExpressionTestsUsingCoreConversionService extends ExpressionTestCas
public Object convertValue(Object value, TypeDescriptor sourceType, TypeDescriptor targetType) throws EvaluationException {
return this.service.convert(value, sourceType, targetType);
}
}
}