@Test public void testCheckStringArgument() { assertCheckStringArgumentThrowsNPE(null, "aVariableName", "000001: A String argument was not specified but is required. " + "{ variableName=[aVariableName] }"); assertCheckStringArgumentThrowsIllegalArgException("", "aVariableName", "000001: A String argument was not specified but is required. " + "{ variableName=[aVariableName] }"); assertCheckStringArgumentIsValid("str", "SomeVarName"); }
public static void checkStringArgument(String str, String variableName) { if (null == str) { throw new NullPointerException(ExceptionMessageMap.getMessage("000001") + " { variableName=[" + variableName + "] }"); } if (str.length() == 0) { throw new IllegalArgumentException(ExceptionMessageMap.getMessage("000001") + " { variableName=[" + variableName + "] }"); } }
CheckUtilities { public static void checkStringArgument(String str, String variableName) { if (null == str) { throw new NullPointerException(ExceptionMessageMap.getMessage("000001") + " { variableName=[" + variableName + "] }"); } if (str.length() == 0) { throw new IllegalArgumentException(ExceptionMessageMap.getMessage("000001") + " { variableName=[" + variableName + "] }"); } } }
CheckUtilities { public static void checkStringArgument(String str, String variableName) { if (null == str) { throw new NullPointerException(ExceptionMessageMap.getMessage("000001") + " { variableName=[" + variableName + "] }"); } if (str.length() == 0) { throw new IllegalArgumentException(ExceptionMessageMap.getMessage("000001") + " { variableName=[" + variableName + "] }"); } }  }
CheckUtilities { public static void checkStringArgument(String str, String variableName) { if (null == str) { throw new NullPointerException(ExceptionMessageMap.getMessage("000001") + " { variableName=[" + variableName + "] }"); } if (str.length() == 0) { throw new IllegalArgumentException(ExceptionMessageMap.getMessage("000001") + " { variableName=[" + variableName + "] }"); } }  static void checkFileValidity(String filename); static void checkFileValidity(File file); static void checkIntArgumentGreaterThan(int toCheck, int lowerBound, String variableName); static void checkNullArgument(Object obj, String variableName); static void checkNullListArgument(List<?> list, String variableName); static boolean checkListsEqual(List<?> l1, List<?> l2); static boolean checkObjectsEqual(Object o1, Object o2); static void checkStringArgument(String str, String variableName); static void checkStringListArgument(List<String> str, String variableName); static boolean checkUnorderedListsEqual(List<?> l1, List<?> l2); static void checkIntIndexInListRange(List<?> list, int index); static void checkIntInRange(int index, int start, int end); static void validateListRefType(List<Ref> list, Ref.RefType type, String variableName); static void validateArgumentRefType(Ref name, Ref.RefType type, String variableName); static void checkDirectoryArgument(File fileName, String variableName); }
CheckUtilities { public static void checkStringArgument(String str, String variableName) { if (null == str) { throw new NullPointerException(ExceptionMessageMap.getMessage("000001") + " { variableName=[" + variableName + "] }"); } if (str.length() == 0) { throw new IllegalArgumentException(ExceptionMessageMap.getMessage("000001") + " { variableName=[" + variableName + "] }"); } }  static void checkFileValidity(String filename); static void checkFileValidity(File file); static void checkIntArgumentGreaterThan(int toCheck, int lowerBound, String variableName); static void checkNullArgument(Object obj, String variableName); static void checkNullListArgument(List<?> list, String variableName); static boolean checkListsEqual(List<?> l1, List<?> l2); static boolean checkObjectsEqual(Object o1, Object o2); static void checkStringArgument(String str, String variableName); static void checkStringListArgument(List<String> str, String variableName); static boolean checkUnorderedListsEqual(List<?> l1, List<?> l2); static void checkIntIndexInListRange(List<?> list, int index); static void checkIntInRange(int index, int start, int end); static void validateListRefType(List<Ref> list, Ref.RefType type, String variableName); static void validateArgumentRefType(Ref name, Ref.RefType type, String variableName); static void checkDirectoryArgument(File fileName, String variableName);  }