documented hooks

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@1956 50f2f4bb-b051-0410-bef5-90022cba6387
This commit is contained in:
Keith Donald
2009-09-21 22:24:36 +00:00
parent ad1798ac6d
commit ec1e1fca12
11 changed files with 97 additions and 4 deletions
@@ -19,6 +19,8 @@ package org.springframework.core.convert.support;
import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.assertNull;
import static junit.framework.Assert.fail;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import java.util.AbstractList;
import java.util.ArrayList;
@@ -265,6 +267,27 @@ public class GenericConversionServiceTests {
assertEquals(new Integer(3), result[2]);
}
@Test
public void genericConverterDelegatingBackToConversionServiceConverterNotFound() {
try {
converter.convert("1", Integer[].class);
} catch (ConversionFailedException e) {
assertTrue(e.getCause() instanceof ConverterNotFoundException);
}
}
@Test
public void parent() {
GenericConversionService parent = new GenericConversionService();
converter.setParent(parent);
assertFalse(converter.canConvert(String.class, Integer.class));
try {
converter.convert("3", Integer.class);
} catch (ConverterNotFoundException e) {
}
}
public static enum FooEnum {
BAR, BAZ
}