Package javax.validation.metadata

Examples of javax.validation.metadata.ReturnValueDescriptor


  }

  @Test
  @SpecAssertion(section = "6.4", id = "b")
  public void testGetGroupConversionsReturnsEmptySetForMethodReturnValue() {
    ReturnValueDescriptor returnValueDescriptor = Executables.cascadedReturnValueConstructor()
        .getReturnValueDescriptor();
    Set<GroupConversionDescriptor> groupConversions = returnValueDescriptor.getGroupConversions();

    assertNotNull( groupConversions );
    assertTrue( groupConversions.isEmpty() );
  }
View Full Code Here


        String.class
    );
    CrossParameterDescriptor crossParameterDescriptor = descriptor.getCrossParameterDescriptor();
    assertFalse( crossParameterDescriptor.hasConstraints(), "Cross parameter constraints should be ignored." );

    ReturnValueDescriptor returnValueDescriptor = descriptor.getReturnValueDescriptor();
    assertFalse( returnValueDescriptor.hasConstraints(), "Return value constraints should be ignored." );

    ParameterDescriptor parameterDescriptor = descriptor.getParameterDescriptors().get( 0 );
    assertFalse( parameterDescriptor.hasConstraints(), "First parameter constraints should be ignored." );

    parameterDescriptor = descriptor.getParameterDescriptors().get( 1 );
View Full Code Here

        Customer.class,
        String.class
    );
    assertNotNull( descriptor, "the specified method should be configured in xml" );

    ReturnValueDescriptor returnValueDescriptor = descriptor.getReturnValueDescriptor();
    Set<ConstraintDescriptor<?>> constraintDescriptors = returnValueDescriptor.getConstraintDescriptors();
    assertTrue( constraintDescriptors.size() == 1 );

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

        "findByExample",
        Customer.class
    );
    assertNotNull( descriptor, "the specified method should be configured in xml" );

    ReturnValueDescriptor returnValueDescriptor = descriptor.getReturnValueDescriptor();
    assertTrue( returnValueDescriptor.isCascaded(), "<valid/> is used to configure cascading" );

    List<ParameterDescriptor> parameterDescriptors = descriptor.getParameterDescriptors();
    assertTrue( parameterDescriptors.size() == 1 );

    ParameterDescriptor parameterDescriptor = parameterDescriptors.get( 0 );
View Full Code Here

        "findByExample",
        Customer.class
    );
    assertNotNull( descriptor, "the specified method should be configured in xml" );

    ReturnValueDescriptor returnValueDescriptor = descriptor.getReturnValueDescriptor();
    Set<GroupConversionDescriptor> groupConversionDescriptors = returnValueDescriptor.getGroupConversions();
    assertTrue( groupConversionDescriptors.size() == 1 );

    GroupConversionDescriptor groupConversionDescriptor = groupConversionDescriptors.iterator().next();
    assertEquals( groupConversionDescriptor.getFrom(), Default.class, "Wrong from class for group conversion" );
View Full Code Here

        String.class
    );
    CrossParameterDescriptor crossParameterDescriptor = descriptor.getCrossParameterDescriptor();
    assertFalse( crossParameterDescriptor.hasConstraints(), "Cross parameter constraints should be ignored." );

    ReturnValueDescriptor returnValueDescriptor = descriptor.getReturnValueDescriptor();
    assertFalse( returnValueDescriptor.hasConstraints(), "Return value constraints should be ignored." );

    ParameterDescriptor parameterDescriptor = descriptor.getParameterDescriptors().get( 0 );
    assertFalse( parameterDescriptor.hasConstraints(), "First parameter constraints should be ignored." );

    parameterDescriptor = descriptor.getParameterDescriptors().get( 1 );
View Full Code Here

        String.class
    );
    CrossParameterDescriptor crossParameterDescriptor = descriptor.getCrossParameterDescriptor();
    assertFalse( crossParameterDescriptor.hasConstraints(), "Cross parameter constraints should be ignored." );

    ReturnValueDescriptor returnValueDescriptor = descriptor.getReturnValueDescriptor();
    assertFalse( returnValueDescriptor.hasConstraints(), "Return value constraints should be ignored." );
    assertTrue( returnValueDescriptor.getGroupConversions().isEmpty(), "Group conversions should be ignored" );

    ParameterDescriptor parameterDescriptor = descriptor.getParameterDescriptors().get( 0 );
    assertFalse( parameterDescriptor.hasConstraints(), "First parameter constraints should be ignored." );
    assertTrue( parameterDescriptor.getGroupConversions().isEmpty(), "Group conversions should be ignored" );
View Full Code Here

  public void testGroupConversionsAppliedOnConstructor() throws Exception {
    ConstructorDescriptor constructorDescriptor = TestUtil.getConstructorDescriptor(
        Groups.class
    );
    assertNotNull( constructorDescriptor, "the specified constructor should be configured in xml" );
    ReturnValueDescriptor returnValueDescriptor = constructorDescriptor.getReturnValueDescriptor();
    Set<GroupConversionDescriptor> groupConversionDescriptors = returnValueDescriptor.getGroupConversions();
    assertTrue( groupConversionDescriptors.size() == 1 );
  }
View Full Code Here

        String.class
    );
    CrossParameterDescriptor crossParameterDescriptor = descriptor.getCrossParameterDescriptor();
    assertFalse( crossParameterDescriptor.hasConstraints(), "Cross parameter constraints should be ignored." );

    ReturnValueDescriptor returnValueDescriptor = descriptor.getReturnValueDescriptor();
    assertFalse( returnValueDescriptor.hasConstraints(), "Return value constraints should be ignored." );
    assertTrue( returnValueDescriptor.getGroupConversions().isEmpty(), "Group conversions should be ignored" );

    ParameterDescriptor parameterDescriptor = descriptor.getParameterDescriptors().get( 0 );
    assertFalse( parameterDescriptor.hasConstraints(), "First parameter constraints should be ignored." );
    assertTrue( parameterDescriptor.getGroupConversions().isEmpty(), "Group conversions should be ignored" );
View Full Code Here

  @SpecAssertion(section = "8.1.1.4", id = "n")
  public void testValidAnnotationIsIgnored() throws Exception {
    ConstructorDescriptor descriptor = TestUtil.getConstructorDescriptor( Cascaded.class, String.class );
    assertNotNull( descriptor, "the specified constructor should be configured in xml" );

    ReturnValueDescriptor returnValueDescriptor = descriptor.getReturnValueDescriptor();
    assertFalse( returnValueDescriptor.isCascaded(), "Cascaded validation should disabled" );

    ParameterDescriptor parameterDescriptor = descriptor.getParameterDescriptors().get( 0 );
    assertFalse( parameterDescriptor.isCascaded(), "Cascaded validation should disabled" );
  }
View Full Code Here

TOP

Related Classes of javax.validation.metadata.ReturnValueDescriptor

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.