Package javax.validation.metadata

Examples of javax.validation.metadata.CrossParameterDescriptor


      @SpecAssertion(section = "6.11", id = "a"),
      @SpecAssertion(section = "6.2", id = "b"),
      @SpecAssertion(section = "6.7", id = "c")
  })
  public void testGetConstraintsForMethod() {
    CrossParameterDescriptor descriptor = Executables.crossParameterConstrainedMethod()
        .getCrossParameterDescriptor();

    Set<ConstraintDescriptor<?>> constraints = descriptor.getConstraintDescriptors();
    assertEquals( constraints.size(), 1, "Should have constraints" );

    ConstraintDescriptor<?> constraint = constraints.iterator().next();
    assertEquals(
        constraint.getAnnotation().annotationType(),
View Full Code Here


  @SpecAssertions({
      @SpecAssertion(section = "6.2", id = "b"),
      @SpecAssertion(section = "6.7", id = "c")
  })
  public void testGetConstraintsForMethodWithoutCrossParameterConstraints() {
    CrossParameterDescriptor descriptor = Executables.returnValueConstrainedMethod()
        .getCrossParameterDescriptor();

    Set<ConstraintDescriptor<?>> constraints = descriptor.getConstraintDescriptors();
    assertEquals( constraints.size(), 0, "Should have no constraints" );
  }
View Full Code Here

  @SpecAssertions({
      @SpecAssertion(section = "6.2", id = "b"),
      @SpecAssertion(section = "6.7", id = "c")
  })
  public void testGetConstraintsForConstructor() {
    CrossParameterDescriptor descriptor = Executables.crossParameterConstrainedConstructor()
        .getCrossParameterDescriptor();

    Set<ConstraintDescriptor<?>> constraints = descriptor.getConstraintDescriptors();
    assertEquals( constraints.size(), 1, "Should have constraints" );

    ConstraintDescriptor<?> constraint = constraints.iterator().next();
    assertEquals(
        constraint.getAnnotation().annotationType(),
View Full Code Here

  @SpecAssertions({
      @SpecAssertion(section = "6.2", id = "b"),
      @SpecAssertion(section = "6.7", id = "c")
  })
  public void testGetConstraintsForConstructorWithoutCrossParameterConstraints() {
    CrossParameterDescriptor descriptor = Executables.returnValueConstrainedConstructor()
        .getCrossParameterDescriptor();

    Set<ConstraintDescriptor<?>> constraints = descriptor.getConstraintDescriptors();
    assertEquals( constraints.size(), 0, "Should have no constraints" );
  }
View Full Code Here

  @SpecAssertions({
      @SpecAssertion(section = "6.2", id = "d"),
      @SpecAssertion(section = "6.7", id = "c")
  })
  public void testFindConstraintsForMethod() {
    CrossParameterDescriptor descriptor = Executables.crossParameterConstrainedMethod()
        .getCrossParameterDescriptor();

    Set<ConstraintDescriptor<?>> constraints = descriptor.findConstraints().getConstraintDescriptors();
    assertEquals( constraints.size(), 1, "Should have constraints" );

    ConstraintDescriptor<?> constraint = constraints.iterator().next();
    assertEquals(
        constraint.getAnnotation().annotationType(),
View Full Code Here

  @SpecAssertions({
      @SpecAssertion(section = "6.2", id = "g"),
      @SpecAssertion(section = "6.7", id = "c")
  })
  public void testFindConstraintsForMethodLookingAt() {
    CrossParameterDescriptor descriptor = Executables.methodOverridingCrossParameterConstrainedMethod()
        .getCrossParameterDescriptor();

    Set<ConstraintDescriptor<?>> constraints = descriptor.findConstraints()
        .lookingAt( Scope.LOCAL_ELEMENT )
        .getConstraintDescriptors();
    assertEquals(
        constraints.size(),
        0,
        "Should have no local constraints"
    );

    constraints = descriptor.findConstraints()
        .lookingAt( Scope.HIERARCHY )
        .getConstraintDescriptors();
    assertEquals( constraints.size(), 1, "Should have constraints" );

    ConstraintDescriptor<?> constraint = constraints.iterator().next();
View Full Code Here

  @SpecAssertions({
      @SpecAssertion(section = "6.2", id = "g"),
      @SpecAssertion(section = "6.7", id = "c")
  })
  public void testFindConstraintsForMethodDefinedOnSuperTypeLookingAt() {
    CrossParameterDescriptor descriptor = Executables.crossParameterConstrainedMethodFromSuperType()
        .getCrossParameterDescriptor();

    Set<ConstraintDescriptor<?>> constraints = descriptor.findConstraints()
        .lookingAt( Scope.LOCAL_ELEMENT )
        .getConstraintDescriptors();
    assertEquals(
        constraints.size(),
        0,
        "Should have no local constraints"
    );

    constraints = descriptor.findConstraints()
        .lookingAt( Scope.HIERARCHY )
        .getConstraintDescriptors();
    assertEquals( constraints.size(), 1, "Should have constraints" );

    ConstraintDescriptor<?> constraint = constraints.iterator().next();
View Full Code Here

  @SpecAssertions({
      @SpecAssertion(section = "6.2", id = "d"),
      @SpecAssertion(section = "6.7", id = "c")
  })
  public void testFindConstraintsForMethodWithoutCrossParameterConstraints() {
    CrossParameterDescriptor descriptor = Executables.returnValueConstrainedMethod()
        .getCrossParameterDescriptor();

    Set<ConstraintDescriptor<?>> constraints = descriptor.findConstraints().getConstraintDescriptors();
    assertEquals( constraints.size(), 0, "Should have no constraints" );
  }
View Full Code Here

  @SpecAssertions({
      @SpecAssertion(section = "6.2", id = "d"),
      @SpecAssertion(section = "6.7", id = "c")
  })
  public void testFindConstraintsForConstructor() {
    CrossParameterDescriptor descriptor = Executables.crossParameterConstrainedConstructor()
        .getCrossParameterDescriptor();

    Set<ConstraintDescriptor<?>> constraints = descriptor.findConstraints().getConstraintDescriptors();
    assertEquals( constraints.size(), 1, "Should have constraints" );

    ConstraintDescriptor<?> constraint = constraints.iterator().next();
    assertEquals(
        constraint.getAnnotation().annotationType(),
View Full Code Here

  @SpecAssertions({
      @SpecAssertion(section = "6.2", id = "d"),
      @SpecAssertion(section = "6.7", id = "c")
  })
  public void testFindConstraintsForConstructorWithoutCrossParameterConstraints() {
    CrossParameterDescriptor descriptor = Executables.returnValueConstrainedConstructor()
        .getCrossParameterDescriptor();

    Set<ConstraintDescriptor<?>> constraints = descriptor.findConstraints().getConstraintDescriptors();
    assertEquals( constraints.size(), 0, "Should have no constraints" );
  }
View Full Code Here

TOP

Related Classes of javax.validation.metadata.CrossParameterDescriptor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.