/** * Check count of violations in ResteasyViolationException. */ public static void countViolations(ResteasyViolationException e, int totalCount, int fieldCount, int propertyCount, int classCount, int parameterCount, int returnValueCount) { Assert.assertEquals("Different total count of violations expected", totalCount, e.getViolations().size()); Assert.assertEquals("Different count of field violations expected", fieldCount, e.getFieldViolations().size()); Assert.assertEquals("Different count of property violations expected", propertyCount, e.getPropertyViolations().size()); Assert.assertEquals("Different count of class violations expected", classCount, e.getClassViolations().size()); Assert.assertEquals("Different count of parameter violations expected", parameterCount, e.getParameterViolations().size()); Assert.assertEquals("Different count of return value violations expected", returnValueCount, e.getReturnValueViolations().size()); }
public ViolationReport(final ResteasyViolationException exception) { Exception e = exception.getException(); if (e != null) { this.exception = e.toString(); } this.fieldViolations = (ArrayList<ResteasyConstraintViolation>) exception.getFieldViolations(); this.propertyViolations = (ArrayList<ResteasyConstraintViolation>) exception.getPropertyViolations(); this.classViolations = (ArrayList<ResteasyConstraintViolation>) exception.getClassViolations(); this.parameterViolations = (ArrayList<ResteasyConstraintViolation>) exception.getParameterViolations(); this.returnValueViolations = (ArrayList<ResteasyConstraintViolation>) exception.getReturnValueViolations(); }
public ViolationReport(ResteasyViolationException exception) { Exception e = exception.getException(); if (e != null) { this.exception = e.toString(); } this.fieldViolations = (ArrayList<ResteasyConstraintViolation>) exception.getFieldViolations(); this.propertyViolations = (ArrayList<ResteasyConstraintViolation>) exception.getPropertyViolations(); this.classViolations = (ArrayList<ResteasyConstraintViolation>) exception.getClassViolations(); this.parameterViolations = (ArrayList<ResteasyConstraintViolation>) exception.getParameterViolations(); this.returnValueViolations = (ArrayList<ResteasyConstraintViolation>) exception.getReturnValueViolations(); }
public ViolationReport(final ResteasyViolationException exception) { Exception e = exception.getException(); if (e != null) { this.exception = e.toString(); } this.fieldViolations = (ArrayList<ResteasyConstraintViolation>) exception.getFieldViolations(); this.propertyViolations = (ArrayList<ResteasyConstraintViolation>) exception.getPropertyViolations(); this.classViolations = (ArrayList<ResteasyConstraintViolation>) exception.getClassViolations(); this.parameterViolations = (ArrayList<ResteasyConstraintViolation>) exception.getParameterViolations(); this.returnValueViolations = (ArrayList<ResteasyConstraintViolation>) exception.getReturnValueViolations(); }