我正在使用 JUnit,但不太确定如何测试自定义异常类。我创造了,
public class CustomException extends Exception {
    //@param message is the exception message
    public CustomException(final String message) {
        super(message);
    }
    //@param message is the exception message
    //@param cause is the cause of the original exception
    public CustomException(final String message, final Throwable cause) {
        super(message, cause);
    }
}
主类会有很多尝试捕获,例如:
catch (ParseException e) {
    throw new CustomException("Date format incorerect", e);
而且我不确定如何为它编写测试类。