8081828384858687888990
public void testIntDefaultValue() { IntTranslator t = new IntTranslator("default=7"); assertEquals(new Integer(7), t.translate(null, null, null, null)); } public void testIntInvalid() { IntTranslator t = new IntTranslator("default=13");
8990919293949596979899
{ IntTranslator t = new IntTranslator("default=13"); try { t.translate(null, null, "qbert", null); unreachable(); } catch (ApplicationRuntimeException ex) {
3435363738394041424344
*/ public void testIntTranslator() { IntTranslator t = new IntTranslator(); assertEquals(new Integer(10), t.translate(null, null, "10", null)); } public void testIntDefault() { IntTranslator t = new IntTranslator();
4142434445464748495051
public void testIntDefault() { IntTranslator t = new IntTranslator(); assertEquals(new Integer(0), t.translate(null, null, null, null)); } public void testIntLow() { IntTranslator t = new IntTranslator("min=5,max=200");
5051525354555657585960
{ IntTranslator t = new IntTranslator("min=5,max=200"); try { t.translate(null, null, "3", null); unreachable(); } catch (ApplicationRuntimeException ex) { assertExceptionSubstring(ex, RulesMessages.minIntValue("3", 5));
6566676869707172737475
{ IntTranslator t = new IntTranslator("min=5,max=200"); try { t.translate(null, null, "50900", null); unreachable(); } catch (ApplicationRuntimeException ex) { assertExceptionSubstring(ex, RulesMessages.maxIntValue("50900", 200));
7980818283848586878889
8889909192939495969798