100101102103104105106107108
} } public void testLongTranslator() { LongTranslator t = new LongTranslator(); assertEquals(new Long(10), t.translate(null, null, "10")); }
107108109110111112113114115
assertEquals(new Long(10), t.translate(null, null, "10")); } public void testLongDefault() { LongTranslator t = new LongTranslator(); assertEquals(new Long(0), t.translate(null, null, null)); }
114115116117118119120121122123124125126127128129
assertEquals(new Long(0), t.translate(null, null, null)); } public void testLongLow() { LongTranslator t = new LongTranslator("min=5,max=200"); try { t.translate(null, null, "3"); unreachable(); } catch (ApplicationRuntimeException ex) {
132133134135136137138139140141142143144145146147
} public void testLongHigh() { LongTranslator t = new LongTranslator("min=5,max=200"); try { t.translate(null, null, "50900"); unreachable(); } catch (ApplicationRuntimeException ex) {
149150151152153154155156157
} } public void testLongDefaultValue() { LongTranslator t = new LongTranslator("default=7"); assertEquals(new Long(7), t.translate(null, null, null)); }
156157158159160161162163164165166167168169170171
assertEquals(new Long(7), t.translate(null, null, null)); } public void testLongInvalid() { LongTranslator t = new LongTranslator("default=13"); try { t.translate(null, null, "qbert"); unreachable(); } catch (ApplicationRuntimeException ex) { assertExceptionSubstring(
101102103104105106107108109
} } public void testLongTranslator() { LongTranslator t = new LongTranslator(); assertEquals(new Long(10), t.translate(null, null, "10", null)); }
108109110111112113114115116
assertEquals(new Long(10), t.translate(null, null, "10", null)); } public void testLongDefault() { LongTranslator t = new LongTranslator(); assertEquals(new Long(0), t.translate(null, null, null, null)); }
115116117118119120121122123124125126127128129130
assertEquals(new Long(0), t.translate(null, null, null, null)); } public void testLongLow() { LongTranslator t = new LongTranslator("min=5,max=200"); try { t.translate(null, null, "3", null); unreachable(); } catch (ApplicationRuntimeException ex) {
133134135136137138139140141142143144145146147148
} public void testLongHigh() { LongTranslator t = new LongTranslator("min=5,max=200"); try { t.translate(null, null, "50900", null); unreachable(); } catch (ApplicationRuntimeException ex) {