found hotspot; added ConverisonServiceFactoryBean

This commit is contained in:
Keith Donald
2009-11-20 14:43:12 +00:00
parent 4024b67926
commit 692b1ef636
8 changed files with 149 additions and 52 deletions

View File

@@ -48,25 +48,7 @@ import org.springframework.core.convert.converter.Converter;
public class DefaultConversionTests {
private ConversionService conversionService = ConversionServiceFactory.getDefault();
@Test
@SuppressWarnings("unchecked")
public void testUnmodifiableListConversion() {
List<String> stringList = new ArrayList<String>();
stringList.add("foo");
stringList.add("bar");
List<String> frozenList = Collections.unmodifiableList(stringList);
List<String> converted = conversionService.convert(frozenList, List.class);
// The converted list should contain all the elements in the original list
Assert.assertEquals(frozenList, converted);
// Looks like it was supposed to be a copy (but CollectionToCollectionConverter
// doesn't work that way right now). Commented out (DS).
// Assert.assertNotSame(frozenList, converted);
}
private ConversionService conversionService = ConversionServiceFactory.createDefaultConversionService();
@Test
public void testStringToCharacter() {
@@ -740,4 +722,22 @@ public class DefaultConversionTests {
}
}
@Test
@SuppressWarnings("unchecked")
public void testUnmodifiableListConversion() {
List<String> stringList = new ArrayList<String>();
stringList.add("foo");
stringList.add("bar");
List<String> frozenList = Collections.unmodifiableList(stringList);
List<String> converted = conversionService.convert(frozenList, List.class);
// The converted list should contain all the elements in the original list
Assert.assertEquals(frozenList, converted);
// TODO Looks like it was supposed to be a copy (but CollectionToCollectionConverter
// doesn't work that way right now). Commented out (DS).
// Assert.assertNotSame(frozenList, converted);
}
}