You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Nicolas Pombourcq (JIRA)" <ji...@apache.org> on 2006/07/28 00:08:13 UTC

[jira] Created: (JCR-518) TCK: XPath order by test uses non-standard column specifier mechanism

TCK: XPath order by test uses non-standard column specifier mechanism
---------------------------------------------------------------------

                 Key: JCR-518
                 URL: http://issues.apache.org/jira/browse/JCR-518
             Project: Jackrabbit
          Issue Type: Bug
          Components: test
            Reporter: Nicolas Pombourcq


org.apache.jackrabbit.test.api.QueryXPathOrderByTest generates a queries of the following form: /jcr:root/*[@proname]/@propname order by @propname

This syntax for column specifiers is not mandated by the JCR specification and will fail on any implementation that does not support it.

Instead the tests should use the following query: /jcr:root/*[@proname] order by @propname and then read the results using QueryResults.getNodes and not QueryResults.getRows.

-- 
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

        

[jira] Commented: (JCR-518) TCK: XPath order by test uses non-standard column specifier mechanism

Posted by "David Pitfield (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/JCR-518?page=comments#action_12424591 ] 
            
David Pitfield commented on JCR-518:
------------------------------------

Proposed patch:

--- XPathOrderByTest.java       (revision 422074)
+++ XPathOrderByTest.java       (working copy)
@@ -48,7 +48,7 @@
         tmp.append(jcrRoot).append(testRoot);
         tmp.append("/*[@");
         tmp.append(propertyName1);
-        tmp.append("]/@").append(propertyName1).append(" order by @");
+        tmp.append("] order by @");
         tmp.append(propertyName1);
         baseStatement = tmp.toString();
     }

--- AbstractQueryTest.java      (revision 422074)
+++ AbstractQueryTest.java      (working copy)
@@ -205,16 +205,16 @@
     protected void evaluateResultOrder(QueryResult queryResult, String propName,
                                        boolean descending)
             throws RepositoryException, NotExecutableException {
-        RowIterator rows = queryResult.getRows();
-        if (getSize(rows) < 2) {
+        NodeIterator nodes = queryResult.getNodes();
+        if (getSize(nodes) < 2) {
             fail("Workspace does not contain sufficient content to test ordering on result nodes.");
         }
         // need to re-aquire rows, {@link #getSize} may consume elements.
-        rows = queryResult.getRows();
+        nodes = queryResult.getNodes();
         int changeCnt = 0;
         String last = descending ? "\uFFFF" : "";
-        while (rows.hasNext()) {
-            String value = rows.nextRow().getValue(propName).getString();
+        while (nodes.hasNext()) {
+            String value = nodes.nextNode().getProperty(propName).getString();
             int cp = value.compareTo(last);
             // if value changed evaluate if the ordering is correct
             if (cp != 0) {


> TCK: XPath order by test uses non-standard column specifier mechanism
> ---------------------------------------------------------------------
>
>                 Key: JCR-518
>                 URL: http://issues.apache.org/jira/browse/JCR-518
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: test
>            Reporter: Nicolas Pombourcq
>
> org.apache.jackrabbit.test.api.QueryXPathOrderByTest generates a queries of the following form: /jcr:root/*[@proname]/@propname order by @propname
> This syntax for column specifiers is not mandated by the JCR specification and will fail on any implementation that does not support it.
> Instead the tests should use the following query: /jcr:root/*[@proname] order by @propname and then read the results using QueryResults.getNodes and not QueryResults.getRows.

-- 
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

        

[jira] Resolved: (JCR-518) TCK: XPath order by test uses non-standard column specifier mechanism

Posted by "Marcel Reutegger (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/JCR-518?page=all ]

Marcel Reutegger resolved JCR-518.
----------------------------------

    Fix Version/s: 1.1
       Resolution: Fixed

Fixed as proposed.

svn revision: 428306

Thank you for reporting this issue and providing the patch.

> TCK: XPath order by test uses non-standard column specifier mechanism
> ---------------------------------------------------------------------
>
>                 Key: JCR-518
>                 URL: http://issues.apache.org/jira/browse/JCR-518
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: test
>            Reporter: Nicolas Pombourcq
>             Fix For: 1.1
>
>
> org.apache.jackrabbit.test.api.QueryXPathOrderByTest generates a queries of the following form: /jcr:root/*[@proname]/@propname order by @propname
> This syntax for column specifiers is not mandated by the JCR specification and will fail on any implementation that does not support it.
> Instead the tests should use the following query: /jcr:root/*[@proname] order by @propname and then read the results using QueryResults.getNodes and not QueryResults.getRows.

-- 
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