This commit is contained in:
Keith Donald
2009-04-09 14:09:10 +00:00
parent a0cab10ccc
commit 3e4810f670
3 changed files with 12 additions and 2 deletions

View File

@@ -1,6 +1,7 @@
package org.springframework.core.convert.service;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import java.util.ArrayList;
import java.util.Collection;
@@ -70,6 +71,15 @@ public class CollectionToCollectionTests {
assertEquals(null, result.get(3));
assertEquals(new Integer(3), result.get(4));
}
@Test
public void testCollectionToCollectionConversionNoGenericInfoSourceEmpty() throws Exception {
DefaultConversionService service = new DefaultConversionService();
CollectionToCollection c = new CollectionToCollection(TypeDescriptor.valueOf(Collection.class),
new TypeDescriptor(getClass().getField("integerTarget")), service);
List result = (List) c.execute(bindTarget);
assertTrue(result.isEmpty());
}
public Collection<String> bindTarget = new ArrayList<String>();