@Test public void testCheckForValidEmailAddress() { for (String item : validEmails) { try { ValidateUtil.checkForValidEmailAddress(item); } catch (VmidcBrokerInvalidEntryException e) { fail("Error in checkForValidEmailAddress. " + item + " Is a valid email address."); } } for (String item : invalidEmails) { try { ValidateUtil.checkForValidEmailAddress(item); fail("Error in checkForValidEmailAddress. " + item + " Is a not a valid email address."); } catch (VmidcBrokerInvalidEntryException e) { } } }
public static void checkForValidEmailAddress(String email) throws VmidcBrokerInvalidEntryException { String pattern = "^([a-zA-Z0-9_\\.\\-+])+@(([a-zA-Z0-9-])+\\.)+([a-zA-Z0-9]{2,4})+$"; if (!email.matches(pattern)) { throw new VmidcBrokerInvalidEntryException("Email: " + email + " has invalid format."); } }
ValidateUtil implements ValidationApi { public static void checkForValidEmailAddress(String email) throws VmidcBrokerInvalidEntryException { String pattern = "^([a-zA-Z0-9_\\.\\-+])+@(([a-zA-Z0-9-])+\\.)+([a-zA-Z0-9]{2,4})+$"; if (!email.matches(pattern)) { throw new VmidcBrokerInvalidEntryException("Email: " + email + " has invalid format."); } } }
ValidateUtil implements ValidationApi { public static void checkForValidEmailAddress(String email) throws VmidcBrokerInvalidEntryException { String pattern = "^([a-zA-Z0-9_\\.\\-+])+@(([a-zA-Z0-9-])+\\.)+([a-zA-Z0-9]{2,4})+$"; if (!email.matches(pattern)) { throw new VmidcBrokerInvalidEntryException("Email: " + email + " has invalid format."); } }  }
ValidateUtil implements ValidationApi { public static void checkForValidEmailAddress(String email) throws VmidcBrokerInvalidEntryException { String pattern = "^([a-zA-Z0-9_\\.\\-+])+@(([a-zA-Z0-9-])+\\.)+([a-zA-Z0-9]{2,4})+$"; if (!email.matches(pattern)) { throw new VmidcBrokerInvalidEntryException("Email: " + email + " has invalid format."); } }  static void checkForNullFields(Map<String, Object> map); static void validateFieldsAreNull(Map<String, Object> map); static void checkForValidIpAddressFormat(String ipAddress); static boolean validateDaName(String name); static void validateFieldLength(Map<String, String> map, int maxLen); static void checkForValidEmailAddress(String email); static void checkForValidUsername(String username); static void checkForValidPassword(String password); static void checkForValidFqdn(String smtpServer); static void checkForValidPortNumber(String port); static void checkMarkedForDeletion(IscEntity entity, String name); static boolean isEmpty(Collection<?> collection); @Override void checkValidIpAddress(String value); @Override void checkValidPassword(String value); @Override boolean isValidDaName(String string); }
ValidateUtil implements ValidationApi { public static void checkForValidEmailAddress(String email) throws VmidcBrokerInvalidEntryException { String pattern = "^([a-zA-Z0-9_\\.\\-+])+@(([a-zA-Z0-9-])+\\.)+([a-zA-Z0-9]{2,4})+$"; if (!email.matches(pattern)) { throw new VmidcBrokerInvalidEntryException("Email: " + email + " has invalid format."); } }  static void checkForNullFields(Map<String, Object> map); static void validateFieldsAreNull(Map<String, Object> map); static void checkForValidIpAddressFormat(String ipAddress); static boolean validateDaName(String name); static void validateFieldLength(Map<String, String> map, int maxLen); static void checkForValidEmailAddress(String email); static void checkForValidUsername(String username); static void checkForValidPassword(String password); static void checkForValidFqdn(String smtpServer); static void checkForValidPortNumber(String port); static void checkMarkedForDeletion(IscEntity entity, String name); static boolean isEmpty(Collection<?> collection); @Override void checkValidIpAddress(String value); @Override void checkValidPassword(String value); @Override boolean isValidDaName(String string); static final int DEFAULT_MAX_LEN; }