Browse Source

restored original GenericConversionService behavior with respect to empty collections/maps; restored original FormattingConversionService behavior with respect to the use of subtypes; fixed collection element resolution when using a ConversionService with a DataBinder

3.0.x
Juergen Hoeller 15 years ago
parent
commit
59fda2dbab
  1. 16
      org.springframework.context/src/test/java/org/springframework/context/support/ConversionServiceFactoryBeanTests.java
  2. 8
      org.springframework.context/src/test/java/org/springframework/context/support/conversionService.xml
  3. 8
      org.springframework.context/src/test/java/org/springframework/context/support/conversionServiceWithResourceOverriding.xml

16
org.springframework.context/src/test/java/org/springframework/context/support/ConversionServiceFactoryBeanTests.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2010 the original author or authors.
* Copyright 2002-2011 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -18,9 +18,9 @@ package org.springframework.context.support; @@ -18,9 +18,9 @@ package org.springframework.context.support;
import java.util.Collections;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import static org.junit.Assert.*;
import org.junit.Test;
import org.springframework.beans.ResourceTestBean;
@ -33,6 +33,8 @@ import org.springframework.core.convert.converter.GenericConverter; @@ -33,6 +33,8 @@ import org.springframework.core.convert.converter.GenericConverter;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.FileSystemResource;
import static org.junit.Assert.*;
/**
* @author Keith Donald
* @author Juergen Hoeller
@ -123,4 +125,14 @@ public class ConversionServiceFactoryBeanTests { @@ -123,4 +125,14 @@ public class ConversionServiceFactoryBeanTests {
public static class Baz {
}
public static class ComplexConstructorArgument {
public ComplexConstructorArgument(Map<String, Class> map) {
assertTrue(!map.isEmpty());
assertTrue(map.keySet().iterator().next() instanceof String);
assertTrue(map.values().iterator().next() instanceof Class);
}
}
}

8
org.springframework.context/src/test/java/org/springframework/context/support/conversionService.xml

@ -20,4 +20,12 @@ @@ -20,4 +20,12 @@
</property>
</bean>
<bean class="org.springframework.context.support.ConversionServiceFactoryBeanTests$ComplexConstructorArgument">
<constructor-arg>
<map>
<entry key="mykey" value="java.util.Date"/>
</map>
</constructor-arg>
</bean>
</beans>

8
org.springframework.context/src/test/java/org/springframework/context/support/conversionServiceWithResourceOverriding.xml

@ -24,4 +24,12 @@ @@ -24,4 +24,12 @@
</property>
</bean>
<bean class="org.springframework.context.support.ConversionServiceFactoryBeanTests$ComplexConstructorArgument">
<constructor-arg>
<map>
<entry key="mykey" value="java.util.Date"/>
</map>
</constructor-arg>
</bean>
</beans>

Loading…
Cancel
Save