added further conversion tests (triggered by 3.0.6 backports)

This commit is contained in:
Juergen Hoeller 2011-06-13 23:57:53 +00:00
parent 6c3cc786d0
commit 878ff89014
3 changed files with 30 additions and 2 deletions

View File

@ -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);
}
}
}

View File

@ -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>

View File

@ -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>