Browse Source

polish

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@1524 50f2f4bb-b051-0410-bef5-90022cba6387
pull/1/head
Keith Donald 17 years ago
parent
commit
d7d8bacc59
  1. 16
      org.springframework.core/src/test/java/org/springframework/core/convert/support/GenericTypeConverterTests.java

16
org.springframework.core/src/test/java/org/springframework/core/convert/support/GenericTypeConverterTests.java

@ -231,20 +231,22 @@ public class GenericTypeConverterTests { @@ -231,20 +231,22 @@ public class GenericTypeConverterTests {
}
@Test
public void convertObjectToArray() {
public void convertStringToArray() {
String[] result = (String[]) converter.convert("1,2,3", String[].class);
assertEquals(3, result.length);
assertEquals("1", result[0]);
assertEquals("2", result[1]);
assertEquals("3", result[2]);
}
@Test
public void convertObjectToArrayWithElementConversion() {
converter.add(new StringToInteger());
Integer[] result = converter.convert("123", Integer[].class);
assertEquals(1, result.length);
assertEquals(new Integer(123), result[0]);
public void convertStringToArrayWithElementConversion() {
converter.add(new StringToInteger());
Integer[] result = (Integer[]) converter.convert("1,2,3", Integer[].class);
assertEquals(3, result.length);
assertEquals(new Integer(1), result[0]);
assertEquals(new Integer(2), result[1]);
assertEquals(new Integer(3), result[2]);
}
public static enum FooEnum {

Loading…
Cancel
Save