Exemplo n.º 1
0
  /**
   * Asserts that two objects are equal. If they are not, an AssertionError, with the given message,
   * is thrown if haultonfailure.
   *
   * @param actual the actual value
   * @param expected the expected value
   * @param message the assertion error message
   */
  public static void assertEquals(Object actual, Object expected, String message) {

    if ((expected == null) && (actual == null)) {
      return;
    } else if ((expected != null && actual == null) || (expected == null && actual != null)) {
      //			log.error(message(message, expected.toString(), actual.toString()));
      failnotequals(actual, expected, message);
    } else {
      if (expected.getClass().isArray()) {
        assertArrayEquals(actual, expected, message);
        return;
      } else if (expected.equals(actual)) {
        return;
      }
    }

    failnotequals(actual, expected, message);
  }