added further conversion tests (triggered by 3.0.6 backports)
This commit is contained in:
parent
6c3cc786d0
commit
878ff89014
|
|
@ -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;
|
|||
|
||||
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;
|
|||
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 {
|
|||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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…
Reference in New Issue