improved conversion system logging, collection converter simplification/polish, several optimizations, annotation-driven formatting caching

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@3255 50f2f4bb-b051-0410-bef5-90022cba6387
This commit is contained in:
Keith Donald
2010-04-17 04:43:28 +00:00
parent efc8a513d1
commit eca3e5d0b8
23 changed files with 263 additions and 379 deletions
@@ -56,7 +56,7 @@ public class TypeDescriptorTests {
assertTrue(typeDescriptor.isArray());
assertEquals(Integer.TYPE,typeDescriptor.getElementType());
}
@Test
public void complexTypeDescriptors() throws Exception {
TypeDescriptor typeDescriptor = new TypeDescriptor(TypeDescriptorTests.class.getDeclaredField("arrayOfListOfString"));
@@ -39,19 +39,20 @@ public class GenericConversionServiceTests {
private GenericConversionService conversionService = new GenericConversionService();
@Test
public void executeConversion() {
public void convert() {
conversionService.addConverterFactory(new StringToNumberConverterFactory());
assertEquals(new Integer(3), conversionService.convert("3", Integer.class));
}
@Test
public void executeConversionNullSource() {
public void convertNullSource() {
assertEquals(null, conversionService.convert(null, Integer.class));
}
@Test
public void executeCompatibleSource() {
public void convertAssignableSource() {
assertEquals(Boolean.FALSE, conversionService.convert(false, boolean.class));
assertEquals(Boolean.FALSE, conversionService.convert(false, Boolean.class));
}
@Test
@@ -189,7 +190,7 @@ public class GenericConversionServiceTests {
input.put("key", "value");
Object converted = conversionService.convert(input, TypeDescriptor.forObject(input),
new TypeDescriptor(getClass().getField("wildcardMap")));
assertSame(input, converted);
assertEquals(input, converted);
}