removed valueOf convention b/c of unwanted side effects

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@2118 50f2f4bb-b051-0410-bef5-90022cba6387
This commit is contained in:
Keith Donald
2009-10-14 21:37:57 +00:00
parent 2263ed07d7
commit c460d97e2c
3 changed files with 5 additions and 46 deletions
@@ -17,6 +17,7 @@
package org.springframework.ui.format;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
@@ -104,10 +105,8 @@ public class GenericFormatterRegistryTests {
}
@Test
public void testGetDefaultFormatterForTypeValueOfMethod() throws ParseException {
Formatter formatter = registry.getFormatter(TypeDescriptor.valueOf(Integer.class));
assertEquals("3", formatter.format(new Integer(3), null));
assertEquals(new Integer(3), formatter.parse("3", null));
public void testGetDefaultFormatterNull() throws ParseException {
assertNull(registry.getFormatter(TypeDescriptor.valueOf(Integer.class)));
}
@Test(expected = IllegalArgumentException.class)