diff --git a/org.springframework.core/src/test/java/org/springframework/core/convert/TypeDescriptorTests.java b/org.springframework.core/src/test/java/org/springframework/core/convert/TypeDescriptorTests.java index 3408a4497c..a4447fedc3 100644 --- a/org.springframework.core/src/test/java/org/springframework/core/convert/TypeDescriptorTests.java +++ b/org.springframework.core/src/test/java/org/springframework/core/convert/TypeDescriptorTests.java @@ -15,17 +15,14 @@ */ package org.springframework.core.convert; -import java.util.List; - -import org.junit.Test; - import static junit.framework.Assert.assertEquals; -import static junit.framework.Assert.assertNull; -import static junit.framework.Assert.assertSame; import static junit.framework.Assert.assertTrue; -import static junit.framework.Assert.fail; import static org.junit.Assert.assertFalse; +import java.util.List; + +import org.junit.Test; + /** * @author Andy Clement */ @@ -35,6 +32,12 @@ public class TypeDescriptorTests { int[] intArray; List[] arrayOfListOfString; + @Test + public void testWrapperType() { + TypeDescriptor desc = TypeDescriptor.valueOf(int.class); + assertEquals(Integer.class, desc.getType()); + } + @Test public void listDescriptors() throws Exception { TypeDescriptor typeDescriptor = new TypeDescriptor(TypeDescriptorTests.class.getDeclaredField("listOfString")); diff --git a/org.springframework.core/src/test/java/org/springframework/core/convert/service/GenericConversionServiceTests.java b/org.springframework.core/src/test/java/org/springframework/core/convert/service/GenericConversionServiceTests.java index 879726c333..dd96160956 100644 --- a/org.springframework.core/src/test/java/org/springframework/core/convert/service/GenericConversionServiceTests.java +++ b/org.springframework.core/src/test/java/org/springframework/core/convert/service/GenericConversionServiceTests.java @@ -53,7 +53,18 @@ public class GenericConversionServiceTests { public void executeConversionNullSource() { assertEquals(null, service.executeConversion(null, type(Integer.class))); } + + @Test + public void executeCompatibleSource() { + assertEquals(false, service.executeConversion(false, type(boolean.class))); + } + @Test + public void executeCompatibleSource2() { + assertEquals(3, service.getConversionExecutor(Integer.class, TypeDescriptor.valueOf(int.class)).execute(new Integer(3))); + assertEquals(3, service.getConversionExecutor(int.class, TypeDescriptor.valueOf(Integer.class)).execute(3)); + } + @Test public void converterConvertForwardIndex() { service.addConverter(new StringToInteger());