Package javax.validation.metadata

Examples of javax.validation.metadata.MethodDescriptor


  }

  @Test
  @SpecAssertion(section = "6.7", id = "e")
  public void testAreParametersConstrainedForNotConstrainedMethod() {
    MethodDescriptor descriptor = Executables.cascadedReturnValueMethod();
    assertFalse(
        descriptor.hasConstrainedParameters(),
        "Should not be constrained on parameters"
    );
  }
View Full Code Here


  }

  @Test
  @SpecAssertion(section = "6.7", id = "e")
  public void testAreParametersConstrainedForParameterlessMethod() {
    MethodDescriptor descriptor = Executables.returnValueConstrainedMethod();
    assertFalse(
        descriptor.hasConstrainedParameters(),
        "Should not be constrained on parameters"
    );
  }
View Full Code Here

  }

  @Test
  @SpecAssertion(section = "6.7", id = "f")
  public void testIsReturnValueConstrainedForConstrainedMethod() {
    MethodDescriptor descriptor = Executables.returnValueConstrainedMethod();
    assertTrue(
        descriptor.hasConstrainedReturnValue(),
        "Should be constrained on return value"
    );
  }
View Full Code Here

  }

  @Test
  @SpecAssertion(section = "6.7", id = "f")
  public void testIsReturnValueConstrainedForCascadedMethod() {
    MethodDescriptor descriptor = Executables.cascadedReturnValueMethod();
    assertTrue(
        descriptor.hasConstrainedReturnValue(),
        "Should be constrained on return value"
    );
  }
View Full Code Here

  }

  @Test
  @SpecAssertion(section = "6.7", id = "f")
  public void testIsReturnValueConstrainedForNotConstrainedMethod() {
    MethodDescriptor descriptor = Executables.cascadedParameterMethod();
    assertFalse(
        descriptor.hasConstrainedReturnValue(),
        "Should not be constrained on return value"
    );
  }
View Full Code Here

  }

  @Test
  @SpecAssertion(section = "6.7", id = "f")
  public void testIsReturnValueConstrainedForVoidMethod() {
    MethodDescriptor descriptor = Executables.crossParameterConstrainedMethod();
    assertFalse(
        descriptor.hasConstrainedReturnValue(),
        "Should not be constrained on return value"
    );
  }
View Full Code Here

  }

  @Test
  @SpecAssertion(section = "6.7", id = "g")
  public void testHasConstraintsForMethod() {
    MethodDescriptor parameterConstrainedDescriptor = Executables.parameterConstrainedMethod();
    assertFalse(
        parameterConstrainedDescriptor.hasConstraints(),
        "Should have no constraints"
    );

    MethodDescriptor returnValueConstrainedDescriptor = Executables.returnValueConstrainedMethod();
    assertFalse(
        returnValueConstrainedDescriptor.hasConstraints(),
        "Should have no constraints"
    );
    MethodDescriptor crossParameterConstrainedDescriptor = Executables.crossParameterConstrainedMethod();
    assertFalse(
        crossParameterConstrainedDescriptor.hasConstraints(),
        "Should have no constraints"
    );
  }
View Full Code Here

  }

  @Test
  @SpecAssertion(section = "6.7", id = "g")
  public void testGetConstraintsForMethod() {
    MethodDescriptor parameterConstrainedDescriptor = Executables.parameterConstrainedMethod();
    assertTrue(
        parameterConstrainedDescriptor.getConstraintDescriptors().isEmpty(),
        "Should have no constraints"
    );

    MethodDescriptor returnValueConstrainedDescriptor = Executables.returnValueConstrainedMethod();
    assertTrue(
        returnValueConstrainedDescriptor.getConstraintDescriptors().isEmpty(),
        "Should have no constraints"
    );
    MethodDescriptor crossParameterConstrainedDescriptor = Executables.crossParameterConstrainedMethod();
    assertTrue(
        crossParameterConstrainedDescriptor.getConstraintDescriptors().isEmpty(),
        "Should have no constraints"
    );
  }
View Full Code Here

  @SpecAssertions({
      @SpecAssertion(section = "6.2", id = "d"),
      @SpecAssertion(section = "6.7", id = "g")
  })
  public void testFindConstraintsForMethod() {
    MethodDescriptor parameterConstrainedDescriptor = Executables.parameterConstrainedMethod();
    assertTrue(
        parameterConstrainedDescriptor.findConstraints()
            .getConstraintDescriptors()
            .isEmpty(),
        "Should have no constraints"
    );

    MethodDescriptor returnValueConstrainedDescriptor = Executables.returnValueConstrainedMethod();
    assertTrue(
        returnValueConstrainedDescriptor.findConstraints()
            .getConstraintDescriptors()
            .isEmpty(),
        "Should have no constraints"
    );
    MethodDescriptor crossParameterConstrainedDescriptor = Executables.crossParameterConstrainedMethod();
    assertTrue(
        crossParameterConstrainedDescriptor.findConstraints()
            .getConstraintDescriptors()
            .isEmpty(),
        "Should have no constraints"
    );
  }
View Full Code Here

      @SpecAssertion(section = "6.2", id = "d"),
      @SpecAssertion(section = "6.2", id = "g"),
      @SpecAssertion(section = "6.7", id = "g")
  })
  public void testFindConstraintsForMethodLookingAt() {
    MethodDescriptor crossParameterConstrainedDescriptor = Executables.methodOverridingCrossParameterConstrainedMethod();
    assertEquals(
        crossParameterConstrainedDescriptor.findConstraints()
            .lookingAt( Scope.LOCAL_ELEMENT )
            .getConstraintDescriptors()
            .size(),
        0,
        "Should have no local constraints"
    );

    assertTrue(
        crossParameterConstrainedDescriptor.findConstraints().lookingAt( Scope.HIERARCHY )
            .getConstraintDescriptors()
            .isEmpty(),
        "Should have no hierarchy constraints"
    );
  }
View Full Code Here

TOP

Related Classes of javax.validation.metadata.MethodDescriptor

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.