Search in sources :

Example 21 with ConstructorDescriptor

use of jakarta.validation.metadata.ConstructorDescriptor in project beanvalidation-tck by eclipse-ee4j.

the class ExecutableDescriptorTest method testGetParameterDescriptorsForParameterlessConstructor.

@Test
@SpecAssertion(section = Sections.CONSTRAINTMETADATA_EXECUTABLEDESCRIPTOR, id = "b")
public void testGetParameterDescriptorsForParameterlessConstructor() {
    ConstructorDescriptor descriptor = Executables.returnValueConstrainedConstructor();
    assertEquals(descriptor.getParameterDescriptors().size(), 0, "Size of parameter descriptor list doesn't match constructor parameter count");
}
Also used : ConstructorDescriptor(jakarta.validation.metadata.ConstructorDescriptor) AbstractTCKTest(org.hibernate.beanvalidation.tck.tests.AbstractTCKTest) Test(org.testng.annotations.Test) SpecAssertion(org.jboss.test.audit.annotations.SpecAssertion)

Example 22 with ConstructorDescriptor

use of jakarta.validation.metadata.ConstructorDescriptor in project beanvalidation-tck by eclipse-ee4j.

the class ExecutableDescriptorTest method testAreParametersConstrainedForCrossParameterConstrainedConstructor.

@Test
@SpecAssertion(section = Sections.CONSTRAINTMETADATA_EXECUTABLEDESCRIPTOR, id = "e")
public void testAreParametersConstrainedForCrossParameterConstrainedConstructor() {
    ConstructorDescriptor descriptor = Executables.crossParameterConstrainedConstructor();
    assertTrue(descriptor.hasConstrainedParameters(), "Should be constrained on parameters");
}
Also used : ConstructorDescriptor(jakarta.validation.metadata.ConstructorDescriptor) AbstractTCKTest(org.hibernate.beanvalidation.tck.tests.AbstractTCKTest) Test(org.testng.annotations.Test) SpecAssertion(org.jboss.test.audit.annotations.SpecAssertion)

Example 23 with ConstructorDescriptor

use of jakarta.validation.metadata.ConstructorDescriptor in project beanvalidation-tck by eclipse-ee4j.

the class ExecutableDescriptorTest method testGetUnconstrainedReturnValueDescriptorForConstructor.

@Test
@SpecAssertion(section = Sections.CONSTRAINTMETADATA_EXECUTABLEDESCRIPTOR, id = "d")
public void testGetUnconstrainedReturnValueDescriptorForConstructor() {
    ConstructorDescriptor descriptor = Executables.cascadedParameterConstructor();
    assertNotNull(descriptor.getReturnValueDescriptor(), "Return value descriptor should not be null");
}
Also used : ConstructorDescriptor(jakarta.validation.metadata.ConstructorDescriptor) AbstractTCKTest(org.hibernate.beanvalidation.tck.tests.AbstractTCKTest) Test(org.testng.annotations.Test) SpecAssertion(org.jboss.test.audit.annotations.SpecAssertion)

Example 24 with ConstructorDescriptor

use of jakarta.validation.metadata.ConstructorDescriptor in project beanvalidation-tck by eclipse-ee4j.

the class ExecutableDescriptorTest method testGetCrossParameterDescriptorForConstructor.

@Test
@SpecAssertion(section = Sections.CONSTRAINTMETADATA_EXECUTABLEDESCRIPTOR, id = "c")
public void testGetCrossParameterDescriptorForConstructor() {
    ConstructorDescriptor descriptor = Executables.crossParameterConstrainedConstructor();
    assertNotNull(descriptor.getCrossParameterDescriptor(), "Cross-parameter descriptor should not be null");
}
Also used : ConstructorDescriptor(jakarta.validation.metadata.ConstructorDescriptor) AbstractTCKTest(org.hibernate.beanvalidation.tck.tests.AbstractTCKTest) Test(org.testng.annotations.Test) SpecAssertion(org.jboss.test.audit.annotations.SpecAssertion)

Example 25 with ConstructorDescriptor

use of jakarta.validation.metadata.ConstructorDescriptor in project beanvalidation-tck by eclipse-ee4j.

the class BeanDescriptorTest method testGetConstraintsForUnconstrainedConstructor.

@Test
@SpecAssertion(section = Sections.CONSTRAINTMETADATA_BEANDESCRIPTOR, id = "g")
public void testGetConstraintsForUnconstrainedConstructor() {
    ConstructorDescriptor constructorDescriptor = Executables.unconstrainedConstructor();
    assertNull(constructorDescriptor, "Descriptor should be null");
}
Also used : ConstructorDescriptor(jakarta.validation.metadata.ConstructorDescriptor) AbstractTCKTest(org.hibernate.beanvalidation.tck.tests.AbstractTCKTest) Test(org.testng.annotations.Test) SpecAssertion(org.jboss.test.audit.annotations.SpecAssertion)

Aggregations

ConstructorDescriptor (jakarta.validation.metadata.ConstructorDescriptor)64 Test (org.testng.annotations.Test)59 AbstractTCKTest (org.hibernate.beanvalidation.tck.tests.AbstractTCKTest)43 SpecAssertion (org.jboss.test.audit.annotations.SpecAssertion)38 ParameterDescriptor (jakarta.validation.metadata.ParameterDescriptor)12 ReturnValueDescriptor (jakarta.validation.metadata.ReturnValueDescriptor)11 BeanDescriptor (jakarta.validation.metadata.BeanDescriptor)10 CrossParameterDescriptor (jakarta.validation.metadata.CrossParameterDescriptor)10 ConstraintMapping (org.hibernate.validator.cfg.ConstraintMapping)8 SpecAssertions (org.jboss.test.audit.annotations.SpecAssertions)5 ConstraintDescriptor (jakarta.validation.metadata.ConstraintDescriptor)4 MethodDescriptor (jakarta.validation.metadata.MethodDescriptor)4 List (java.util.List)3 TestUtil.getConstructorDescriptor (org.hibernate.beanvalidation.tck.util.TestUtil.getConstructorDescriptor)3 ValidatorUtil.getBeanDescriptor (org.hibernate.validator.testutils.ValidatorUtil.getBeanDescriptor)3 ValidatorUtil.getConstructorDescriptor (org.hibernate.validator.testutils.ValidatorUtil.getConstructorDescriptor)3 ConstraintValidator (jakarta.validation.ConstraintValidator)2 Validator (jakarta.validation.Validator)2 GroupConversionDescriptor (jakarta.validation.metadata.GroupConversionDescriptor)2 ArrayList (java.util.ArrayList)2