@Test public void parseShort_valueIsNaN_IllegalArgumentException() { final String value = "not a number"; try { InputParser.parseShort(value, INPUT_NAME); fail(); } catch (IllegalArgumentException ex) { assertTrue(ex.getMessage().contains(INPUT_NAME)); } }
public static short parseShort(String value, String inputName) { try { return Short.parseShort(value); } catch (NumberFormatException ex) { throw new IllegalArgumentException(String.format(ExceptionMsgs.INVALID_VALUE_FOR_INPUT, value, inputName)); } }
InputParser { public static short parseShort(String value, String inputName) { try { return Short.parseShort(value); } catch (NumberFormatException ex) { throw new IllegalArgumentException(String.format(ExceptionMsgs.INVALID_VALUE_FOR_INPUT, value, inputName)); } } }
InputParser { public static short parseShort(String value, String inputName) { try { return Short.parseShort(value); } catch (NumberFormatException ex) { throw new IllegalArgumentException(String.format(ExceptionMsgs.INVALID_VALUE_FOR_INPUT, value, inputName)); } } private  InputParser(); }
InputParser { public static short parseShort(String value, String inputName) { try { return Short.parseShort(value); } catch (NumberFormatException ex) { throw new IllegalArgumentException(String.format(ExceptionMsgs.INVALID_VALUE_FOR_INPUT, value, inputName)); } } private  InputParser(); static String parseDescription(String descr); static short parseShort(String value, String inputName); static int parseInt(String value, String inputName); static boolean parseBoolean(String value, String inputName); static Region parseRegion(String value); static T parseEnum(String value, Class<T> clazz, String inputName); }
InputParser { public static short parseShort(String value, String inputName) { try { return Short.parseShort(value); } catch (NumberFormatException ex) { throw new IllegalArgumentException(String.format(ExceptionMsgs.INVALID_VALUE_FOR_INPUT, value, inputName)); } } private  InputParser(); static String parseDescription(String descr); static short parseShort(String value, String inputName); static int parseInt(String value, String inputName); static boolean parseBoolean(String value, String inputName); static Region parseRegion(String value); static T parseEnum(String value, Class<T> clazz, String inputName);  }