8283848586878889909192
public void testString() { Translator t = new SmartTranslator(); Object result = t.translate(null, String.class, "Fluffy Puppies", null); assertEquals("Fluffy Puppies", result); } public void testNoEditor()
949596979899100101102103104
Translator t = new SmartTranslator(); Location l = fabricateLocation(22); try { t.translate(null, Registry.class, "fred", l); unreachable(); } catch (ApplicationRuntimeException ex) {
3637383940414243444546
*/ public void testInt() { Translator t = new SmartTranslator(); Object result = t.translate(null, int.class, "-37", null); assertEquals(new Integer(-37), result); } public void testNullInput()
4546474849505152535455
public void testNullInput() { Translator t = new SmartTranslator(); assertNull(t.translate(null, int.class, null, null)); } public void testBlankInput() { Translator t = new SmartTranslator();
5253545556575859606162
public void testBlankInput() { Translator t = new SmartTranslator(); assertEquals("", t.translate(null, String.class, "", null)); } public void testDefault() { Translator t = new SmartTranslator("default=100");
5960616263646566676869
public void testDefault() { Translator t = new SmartTranslator("default=100"); Object result = t.translate(null, int.class, null, null); assertEquals(new Integer(100), result); } /**
7172737475767778798081
*/ public void testDouble() { Translator t = new SmartTranslator(); Object result = t.translate(null, Double.class, "3.14", null); assertEquals(new Double("3.14"), result); } /**
8485868788899091929394
*/ public void testString() { Translator t = new SmartTranslator(); Object result = t.translate(null, String.class, "Fluffy Puppies", null); assertEquals("Fluffy Puppies", result); } /**
979899100101102103104105106107
*/ public void testObjectAsString() { Translator t = new SmartTranslator(); Object result = t.translate(null, Object.class, "Fluffy Puppies", null); assertEquals("Fluffy Puppies", result); } public void testStringWithNoEditor()
111112113114115116117118119120121
try { PropertyEditorManager.setEditorSearchPath(new String[] { "bogus.package" }); Translator t = new SmartTranslator(); Object result = t.translate(null, String.class, "Fluffy Puppies", null); assertEquals("Fluffy Puppies", result); } finally {