ValidationException extends SoftwareManagementPluginException { public final static ValidationException VALIDATION_FAIL(String item, List<String> failedMsgList, List<String> warningMsgList) { StringBuilder detailsBuilder = new StringBuilder(); detailsBuilder.append(failedMsgList != null ? Arrays.toString(failedMsgList.toArray()) : ""); detailsBuilder.append(";"); detailsBuilder.append(warningMsgList != null ? Arrays.toString(warningMsgList.toArray()) : ""); ValidationException exception = new ValidationException("APP_MANAGER.VALIDATION_FAIL", null, item, detailsBuilder.toString()); exception.failedMsgList = failedMsgList; exception.warningMsgList = warningMsgList; return exception; } ValidationException(String errCode, Throwable cause, Object... details); List<String> getFailedMsgList(); List<String> getWarningMsgList(); final static ValidationException VALIDATION_FAIL(String item, List<String> failedMsgList, List<String> warningMsgList);  }
@Test public void testLoadMsg() { ArrayList<ValidationException> exs = new ArrayList<ValidationException>(); exs.add(ValidationException.VALIDATION_FAIL("item", failedMsgList, warningMsgList)); for(ValidationException ex : exs) { assertException(ex); } }