Java Assert assertNotMatches(String name, String regExp, String actual)

Here you can find the source of assertNotMatches(String name, String regExp, String actual)

Description

assert Not Matches

License

Apache License

Declaration

public static void assertNotMatches(String name, String regExp, String actual) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static void assertNotMatches(String name, String regExp, String actual) {
        if (matches(regExp, actual)) {
            throw new AssertionError(name + ": " + actual + " is matching " + regExp + " when it shouldn't!");
        }// w  ww .j a v  a  2 s  . c  om
    }

    public static boolean matches(String regularExpression, String text) {
        if (text == null || regularExpression == null) {
            return false;
        }
        return text.matches(regularExpression);
    }
}

Related

  1. assertNotEmpty(final String str)
  2. assertNotEmpty(String string, String exceptionMessageTitle)
  3. assertNotEmpty(String value, String message)
  4. assertNotEmptyString(final String s)
  5. assertNotEquals(final Object actual, final Object expected, final String name)
  6. assertNotTrue(boolean conditionThatMustNotBeTrue, String msgWhenTrue)
  7. assertNotTrue(boolean value, String message)
  8. assertObjectEmpty(Object value)
  9. assertObjEquals(Object expected, Object actual)