119120121122123124125126127128129
LongTranslator t = new LongTranslator("min=5,max=200"); try { t.translate(null, null, "3", null); unreachable(); } catch (ApplicationRuntimeException ex) {
137138139140141142143144145146147
LongTranslator t = new LongTranslator("min=5,max=200"); try { t.translate(null, null, "50900", null); unreachable(); } catch (ApplicationRuntimeException ex) {
151152153154155156157158159160161
public void testLongDefaultValue() { LongTranslator t = new LongTranslator("default=7"); assertEquals(new Long(7), t.translate(null, null, null, null)); } public void testLongInvalid() { LongTranslator t = new LongTranslator("default=13");
161162163164165166167168169170171
LongTranslator t = new LongTranslator("default=13"); try { t.translate(null, null, "qbert", null); unreachable(); } catch (ApplicationRuntimeException ex) { assertExceptionSubstring(ex, "'qbert' is not a long value.");