doc updates

This commit is contained in:
Keith Donald
2009-11-20 05:00:28 +00:00
parent 3b9605bc57
commit b896457586
2 changed files with 111 additions and 24 deletions

View File

@@ -36,6 +36,8 @@ import java.util.Locale;
import java.util.Map;
import java.util.Set;
import junit.framework.Assert;
import org.junit.Test;
import org.springframework.core.convert.ConversionFailedException;
import org.springframework.core.convert.ConversionService;
@@ -47,6 +49,22 @@ 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);
Assert.assertNotSame(frozenList, converted);
}
@Test
public void testStringToCharacter() {
assertEquals(Character.valueOf('1'), conversionService.convert("1", Character.class));