Package javax.validation

Examples of javax.validation.ValidationProviderResolver


  @SpecAssertions({
      @SpecAssertion(section = "5.5.5", id = "b"),
      @SpecAssertion(section = "5.5.5", id = "e")
  })
  public void testCustomValidationProviderResolution() {
    ValidationProviderResolver resolver = new ValidationProviderResolver() {

      public List<ValidationProvider<?>> getValidationProviders() {
        List<ValidationProvider<?>> list = new ArrayList<ValidationProvider<?>>();
        list.add( new TCKValidationProvider() );
        return list;
View Full Code Here


  @SpecAssertions({
      @SpecAssertion(section = "5.5.5", id = "c"),
      @SpecAssertion(section = "5.5.5", id = "e")
  })
  public void testSpecificValidationProvider() {
    ValidationProviderResolver resolver = new ValidationProviderResolver() {

      public List<ValidationProvider<?>> getValidationProviders() {
        List<ValidationProvider<?>> list = new ArrayList<ValidationProvider<?>>();
        list.add( new TCKValidationProvider() );
        return list;
View Full Code Here

      @SpecAssertion(section = "5.5.3", id = "l"),
      @SpecAssertion(section = "5.5.4.2", id = "a")
  })
  public void testGetFactoryByProviderSpecifiedInValidationXml() {

    ValidationProviderResolver resolver = new ValidationProviderResolver() {

      @Override
      public List<ValidationProvider<?>> getValidationProviders() {
        List<ValidationProvider<?>> list = new ArrayList<ValidationProvider<?>>();
        list.add( TestUtil.getValidationProviderUnderTest() );
View Full Code Here

  @SpecAssertions({
      @SpecAssertion(section = "5.5.6", id = "f"),
      @SpecAssertion(section = "5.5.6", id = "s")
  })
  public void testProviderSpecifiedInValidationXml() {
    ValidationProviderResolver resolver = new ValidationProviderResolver() {

      @Override
      public List<ValidationProvider<?>> getValidationProviders() {
        List<ValidationProvider<?>> list = new ArrayList<ValidationProvider<?>>();
        list.add( TestUtil.getValidationProviderUnderTest() );
View Full Code Here

  }

  @Test
  @SpecAssertion(section = "5.5.4.2", id = "b")
  public void testFirstMatchingValidationProviderResolverIsReturned() {
    ValidationProviderResolver resolver = new ValidationProviderResolver() {

      public List<ValidationProvider<?>> getValidationProviders() {
        List<ValidationProvider<?>> list = new ArrayList<ValidationProvider<?>>();
        list.add( TestUtil.getValidationProviderUnderTest() );
        list.add( new TCKValidationProvider() );
View Full Code Here

  }

  @Test
  @SpecAssertion(section = "5.5.4.2", id = "c")
  public void testByDefaultProviderUsesTheFirstProviderReturnedByValidationProviderResolver() {
    ValidationProviderResolver resolver = new ValidationProviderResolver() {

      public List<ValidationProvider<?>> getValidationProviders() {
        List<ValidationProvider<?>> list = new ArrayList<ValidationProvider<?>>();
        list.add( new TCKValidationProvider() );
        list.add( TestUtil.getValidationProviderUnderTest() );
View Full Code Here

  @SpecAssertions({
      @SpecAssertion(section = "5.5.5", id = "f"),
      @SpecAssertion(section = "5.5.4.2", id = "e")
  })
  public void testValidationExceptionIsThrownInCaseValidatorFactoryCreationFails() {
    ValidationProviderResolver resolver = new ValidationProviderResolver() {

      public List<ValidationProvider<?>> getValidationProviders() {
        throw new RuntimeException( "ValidationProviderResolver failed!" );
      }
    };
View Full Code Here

                                                         ValidationProviderResolver validationProviderResolver,
                                                         MessageInterpolator messageInterpolator,
                                                         TraversableResolver traversableResolver,
                                                         ConstraintValidatorFactory constraintValidatorFactory) {

        ValidationProviderResolver resolvedValidationProviderResolver =
                resolveValidationProviderResolver(osgi, validationProviderResolver);

        GenericBootstrap bootstrap = Validation.byDefaultProvider();
        if (resolvedValidationProviderResolver != null) {
            bootstrap.providerResolver(resolvedValidationProviderResolver);
View Full Code Here

  @SpecAssertions({
      @SpecAssertion(section = "4.4.5", id = "b"),
      @SpecAssertion(section = "4.4.5", id = "e")
  })
  public void testCustomValidationProviderResolution() {
    ValidationProviderResolver resolver = new ValidationProviderResolver() {

      public List<ValidationProvider<?>> getValidationProviders() {
        List<ValidationProvider<?>> list = new ArrayList<ValidationProvider<?>>();
        list.add( new TCKValidationProvider() );
        return list;
View Full Code Here

  @SpecAssertions({
      @SpecAssertion(section = "4.4.5", id = "c"),
      @SpecAssertion(section = "4.4.5", id = "e")
  })
  public void testSpecificValidationProvider() {
    ValidationProviderResolver resolver = new ValidationProviderResolver() {

      public List<ValidationProvider<?>> getValidationProviders() {
        List<ValidationProvider<?>> list = new ArrayList<ValidationProvider<?>>();
        list.add( new TCKValidationProvider() );
        return list;
View Full Code Here

TOP

Related Classes of javax.validation.ValidationProviderResolver

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.