use of org.hibernate.validator.testutil.TestForIssue in project hibernate-validator by hibernate.
the class AnnotationTypeValidationTest method testMixDirectAnnotationAndListContainer.
@Test
@TestForIssue(jiraKey = "HV-1275")
public void testMixDirectAnnotationAndListContainer() {
boolean compilationResult = compilerHelper.compile(new ConstraintValidationProcessor(), diagnostics, compilerHelper.getSourceFile(MixDirectAnnotationAndListContainerAnnotation.class));
assertFalse(compilationResult);
assertThatDiagnosticsMatch(diagnostics, new DiagnosticExpectation(Kind.ERROR, 32));
}
use of org.hibernate.validator.testutil.TestForIssue in project hibernate-validator by hibernate.
the class ConstraintValidationProcessorTest method constraintsAllowedAtJavaMoneyTypes.
@Test
@TestForIssue(jiraKey = "HV-1252")
public void constraintsAllowedAtJavaMoneyTypes() {
File sourceFile = compilerHelper.getSourceFile(ModelWithJavaMoneyTypes.class);
EnumSet<Library> libraries = EnumSet.of(Library.VALIDATION_API, Library.HIBERNATE_VALIDATOR, Library.JAVA_MONEY_API);
boolean compilationResult = compilerHelper.compile(new ConstraintValidationProcessor(), diagnostics, libraries, sourceFile);
assertTrue(compilationResult, "Java Money API types (MonetaryAmount) fails with constraints annotations.");
}
use of org.hibernate.validator.testutil.TestForIssue in project hibernate-validator by hibernate.
the class ConstraintValidationProcessorTest method hibernateValidatorProvidedCustomConstraints.
@Test
@TestForIssue(jiraKey = "HV-567")
public void hibernateValidatorProvidedCustomConstraints() {
File sourceFile = compilerHelper.getSourceFile(HibernateValidatorProvidedCustomConstraints.class);
boolean compilationResult = compilerHelper.compile(new ConstraintValidationProcessor(), diagnostics, sourceFile);
assertFalse(compilationResult);
assertThatDiagnosticsMatch(diagnostics, new DiagnosticExpectation(Kind.ERROR, 66), new DiagnosticExpectation(Kind.ERROR, 67), new DiagnosticExpectation(Kind.ERROR, 68), new DiagnosticExpectation(Kind.ERROR, 69), new DiagnosticExpectation(Kind.ERROR, 70), new DiagnosticExpectation(Kind.ERROR, 71), new DiagnosticExpectation(Kind.ERROR, 72), new DiagnosticExpectation(Kind.ERROR, 73), new DiagnosticExpectation(Kind.ERROR, 74), new DiagnosticExpectation(Kind.ERROR, 75), new DiagnosticExpectation(Kind.ERROR, 76), new DiagnosticExpectation(Kind.ERROR, 77), new DiagnosticExpectation(Kind.ERROR, 78), new DiagnosticExpectation(Kind.ERROR, 79), new DiagnosticExpectation(Kind.ERROR, 80), new DiagnosticExpectation(Kind.ERROR, 81), new DiagnosticExpectation(Kind.ERROR, 82), new DiagnosticExpectation(Kind.ERROR, 83), new DiagnosticExpectation(Kind.ERROR, 84));
}
use of org.hibernate.validator.testutil.TestForIssue in project hibernate-validator by hibernate.
the class ConstraintValidationProcessorTest method beanValidationConstraints.
@Test
@TestForIssue(jiraKey = "HV-1297")
public void beanValidationConstraints() {
File sourceFile = compilerHelper.getSourceFile(BeanValidationConstraints.class);
boolean compilationResult = compilerHelper.compile(new ConstraintValidationProcessor(), diagnostics, sourceFile);
assertFalse(compilationResult);
assertThatDiagnosticsMatch(diagnostics, new DiagnosticExpectation(Kind.ERROR, 43), new DiagnosticExpectation(Kind.ERROR, 44), new DiagnosticExpectation(Kind.ERROR, 45), new DiagnosticExpectation(Kind.ERROR, 46), new DiagnosticExpectation(Kind.ERROR, 47), new DiagnosticExpectation(Kind.ERROR, 50), new DiagnosticExpectation(Kind.ERROR, 51), new DiagnosticExpectation(Kind.ERROR, 52), new DiagnosticExpectation(Kind.ERROR, 55), new DiagnosticExpectation(Kind.ERROR, 56));
}
use of org.hibernate.validator.testutil.TestForIssue in project hibernate-validator by hibernate.
the class ConstraintValidationProcessorTest method uniqueElementsConstraints.
@Test
@TestForIssue(jiraKey = "HV-1466")
public void uniqueElementsConstraints() {
File[] sourceFiles = new File[] { compilerHelper.getSourceFile(ModelWithUniqueElementsConstraints.class) };
boolean compilationResult = compilerHelper.compile(new ConstraintValidationProcessor(), diagnostics, false, true, sourceFiles);
assertFalse(compilationResult);
assertThatDiagnosticsMatch(diagnostics, new DiagnosticExpectation(Kind.ERROR, 26));
}
Aggregations