001package junit.framework; 002 003/** 004 * Thrown when an assertion failed. 005 */ 006public class AssertionFailedError extends AssertionError { 007 008 private static final long serialVersionUID = 1L; 009 010 /** 011 * Constructs a new AssertionFailedError without a detail message. 012 */ 013 public AssertionFailedError() { 014 } 015 016 /** 017 * Constructs a new AssertionFailedError with the specified detail message. 018 * A null message is replaced by an empty String. 019 * @param message the detail message. The detail message is saved for later 020 * retrieval by the {@code Throwable.getMessage()} method. 021 */ 022 public AssertionFailedError(String message) { 023 super(defaultString(message)); 024 } 025 026 private static String defaultString(String message) { 027 return message == null ? "" : message; 028 } 029}