Package javax.validation

Examples of javax.validation.Path$CrossParameterNode


        Field[] declaredFields = object.getClass().getDeclaredFields();
        for (Field field : declaredFields) {
           
            for (ConstraintViolation<T> constraintViolation: violations) {
               
                Path propertyPath = constraintViolation.getPropertyPath();
                Node node = propertyPath.iterator().next();
               
                if (node.getName().equals(field.getName()) && !nodesValidados.contains(node.getName())) {
                    violationsPropertiesOrder.add(constraintViolation);
                    nodesValidados.add(node.getName());
                    break;
View Full Code Here


      return false;
    }

    boolean isReachable;

    Path pathToObject = localContext.getPropertyPath().getPathWithoutLeafNode();
    if ( pathToObject == null ) {
      pathToObject = PathImpl.createNewPath( null );
    }

    try {
View Full Code Here

  private boolean isCascadeRequired(GlobalExecutionContext globalContext, LocalExecutionContext localContext, Member member) {
    final ElementType type = member instanceof Field ? ElementType.FIELD : ElementType.METHOD;
    boolean isReachable;
    boolean isCascadable;

    Path pathToObject = localContext.getPropertyPath().getPathWithoutLeafNode();
    if ( pathToObject == null ) {
      pathToObject = PathImpl.createNewPath( null );
    }

    try {
View Full Code Here

        propertyPaths.length,
        "Wrong number of property paths."
    );

    for ( String propertyPath : propertyPaths ) {
      Path expectedPath = PathImpl.createPathFromString( propertyPath );
      boolean containsPath = false;
      for ( Path actualPath : propertyPathsOfViolations ) {
        if ( assertEqualPaths( expectedPath, actualPath ) ) {
          containsPath = true;
          break;
View Full Code Here

        String.format( "Expected path node names %s, but found %s.", expectedNodeNames, actualNodeNames )
    );
  }

  public static <T> void assertConstraintViolation(ConstraintViolation<T> violation, Class<?> rootBean, Object invalidValue, String propertyPath) {
    Path expectedPath = PathImpl.createPathFromString( propertyPath );
    if ( !assertEqualPaths( violation.getPropertyPath(), expectedPath ) ) {
      fail( "Property paths differ. Actual: " + violation.getPropertyPath() + " Expected: " + expectedPath );
    }

    assertEquals(
View Full Code Here

        .validateReturnValue( user, method, returnValue );

    //then
    assertCorrectNumberOfViolations( constraintViolations, 1 );

    Path propertyPath = constraintViolations.iterator().next().getPropertyPath();

    assertDescriptorKinds( propertyPath, ElementKind.METHOD, ElementKind.RETURN_VALUE, ElementKind.PROPERTY );
    assertNodeNames( propertyPath, "retrieveMainAddress", TestUtil.RETURN_VALUE_NODE_NAME, "street1" );
  }
View Full Code Here

        .validateReturnValue( user, method, returnValue );

    //then
    assertCorrectNumberOfViolations( constraintViolations, 1 );

    Path propertyPath = constraintViolations.iterator().next().getPropertyPath();

    assertDescriptorKinds( propertyPath, ElementKind.METHOD, ElementKind.RETURN_VALUE, ElementKind.PROPERTY );
    assertNodeNames( propertyPath, "retrieveWeekendAddress", TestUtil.RETURN_VALUE_NODE_NAME, "street1" );
  }
View Full Code Here

        .validateReturnValue( user, method, returnValue );

    //then
    assertCorrectNumberOfViolations( constraintViolations, 1 );

    Path propertyPath = constraintViolations.iterator().next().getPropertyPath();

    assertDescriptorKinds( propertyPath, ElementKind.METHOD, ElementKind.RETURN_VALUE, ElementKind.PROPERTY );
    assertNodeNames( propertyPath, "retrieveFallbackAddress", TestUtil.RETURN_VALUE_NODE_NAME, "street1" );
  }
View Full Code Here

        .validateParameters( user, method, arguments );

    //then
    assertCorrectNumberOfViolations( constraintViolations, 1 );

    Path propertyPath = constraintViolations.iterator().next().getPropertyPath();

    assertDescriptorKinds( propertyPath, ElementKind.METHOD, ElementKind.PARAMETER, ElementKind.PROPERTY );
    assertNodeNames( propertyPath, "setMainAddress", "arg0", "street1" );
  }
View Full Code Here

        .validateConstructorReturnValue( constructor, createdObject );

    //then
    assertCorrectNumberOfViolations( constraintViolations, 1 );

    Path propertyPath = constraintViolations.iterator().next().getPropertyPath();

    assertDescriptorKinds(
        propertyPath,
        ElementKind.CONSTRUCTOR,
        ElementKind.RETURN_VALUE,
View Full Code Here

TOP

Related Classes of javax.validation.Path$CrossParameterNode

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.