mirror of
https://github.com/spring-projects/spring-framework.git
synced 2026-10-05 22:49:02 +00:00
activated DefaultConversionService in EL, linking convert and EL
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@974 50f2f4bb-b051-0410-bef5-90022cba6387
This commit is contained in:
+15
@@ -8,7 +8,9 @@ import java.math.BigInteger;
|
||||
import java.util.Locale;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.springframework.core.convert.converter.NumberToCharacter;
|
||||
import org.springframework.core.convert.converter.NumberToNumber;
|
||||
import org.springframework.core.convert.converter.ObjectToString;
|
||||
import org.springframework.core.convert.converter.StringToBigDecimal;
|
||||
import org.springframework.core.convert.converter.StringToBigInteger;
|
||||
import org.springframework.core.convert.converter.StringToBoolean;
|
||||
@@ -154,6 +156,19 @@ public class DefaultConverterTests {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testNumberToCharacter() {
|
||||
NumberToCharacter n = new NumberToCharacter();
|
||||
assertEquals(Character.valueOf('A'), n.convert(Integer.valueOf(65), Character.class));
|
||||
assertEquals(Integer.valueOf(65), n.convertBack(Character.valueOf('A'), Integer.class));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testObjectToString() {
|
||||
ObjectToString o = new ObjectToString();
|
||||
assertEquals("3", o.convert(3, String.class));
|
||||
}
|
||||
|
||||
public static class CustomNumber extends Number {
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user