You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Marcel Reutegger (JIRA)" <ji...@apache.org> on 2006/08/03 15:57:14 UTC

[jira] Resolved: (JCR-526) TCK: XPathQueryLevel2Test uses optional column specifier syntax

     [ http://issues.apache.org/jira/browse/JCR-526?page=all ]

Marcel Reutegger resolved JCR-526.
----------------------------------

    Fix Version/s: 1.1
       Resolution: Fixed

Fixed as proposed.

svn revision: 428405

Thank you for reporting this issue.

> TCK: XPathQueryLevel2Test uses optional column specifier syntax
> ---------------------------------------------------------------
>
>                 Key: JCR-526
>                 URL: http://issues.apache.org/jira/browse/JCR-526
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: test
>            Reporter: David Pitfield
>             Fix For: 1.1
>
>
> Test assumes the implementation uses a terminal attribute step as the column specifier.  This is allowed, but not required, by JCR.
> Proposal: remove column specifier and process results using getNodes instead of getRows.
> --- XPathQueryLevel2Test.java   (revision 422074)
> +++ XPathQueryLevel2Test.java   (working copy)
> @@ -85,7 +85,7 @@
>          checkResult(result, 1);
>   
>          // evaluate result
> -        checkValue(result.getRows(), propertyName1, "b");
> +        checkValue(result.getNodes(), propertyName1, "b");
>      }
>   
>      /**
> @@ -101,7 +101,7 @@
>          checkResult(result, 1);
>   
>          // evaluate result
> -        checkValue(result.getRows(), propertyName1, "existence");
> +        checkValue(result.getNodes(), propertyName1, "existence");
>      }
>   
>      /**
> @@ -147,7 +147,6 @@
>          tmp.append(jcrRoot).append(testRoot);
>          tmp.append("/*[@").append(propertyName2).append(" = 'two'");
>          tmp.append(" and @").append(propertyName1).append(" = 'existence']");
> -        tmp.append("/@").append(propertyName1);
>          return new Statement(tmp.toString(), Query.XPATH);
>      }
>   
> @@ -161,7 +160,7 @@
>          tmp.append(propertyName1);
>          tmp.append(" <= 'b' and @");
>          tmp.append(propertyName1);
> -        tmp.append(" > 'a']/@").append(propertyName1);
> +        tmp.append(" > 'a']");
>          return new Statement(tmp.toString(), Query.XPATH);
>      }
>  }
> --- AbstractQueryLevel2Test.java        (revision 422074)
> +++ AbstractQueryLevel2Test.java        (working copy)
> @@ -19,6 +19,7 @@
>  import org.apache.jackrabbit.test.NotExecutableException;
>   
>  import javax.jcr.nodetype.NodeType;
> +import javax.jcr.NodeIterator;
>  import javax.jcr.query.RowIterator;
>  import javax.jcr.query.Row;
>  import javax.jcr.Value;
> @@ -115,4 +116,16 @@
>                      expectedValue, value.getString());
>          }
>      }
> +
> +    protected void checkValue(NodeIterator itr,
> +                              String propertyName,
> +                              String expectedValue) throws RepositoryException {
> +        while (itr.hasNext()) {
> +            Node node = itr.nextNode();
> +            // check fullText
> +            Value value = node.getProperty(propertyName).getValue();
> +            assertEquals("Value in query result row does not match expected value",
> +                    expectedValue, value.getString());
> +        }
> +    }
>  }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira