JUnit을 사용하고 있으며 사용자 정의 예외 클래스를 테스트하는 방법을 잘 모르고 있습니다. 나는 창조했다,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);
나는 테스트 클래스를 작성하는 방법을 잘 모르겠다. 도움이 감사하겠습니다.
감사합니다.
무언가를 테스트하는 방법을 알기 위해서는 무엇을해야할 지에 대한 사양이 필요합니다. 이러한 사양을 제공하지 않았으므로이 질문에 답할 수 없습니다. – Raedwald