jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Pitfield (JIRA)" <j...@apache.org>
Subject [jira] Commented: (JCR-518) TCK: XPath order by test uses non-standard column specifier mechanism
Date Mon, 31 Jul 2006 18:06:14 GMT
    [ 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

        

Mime
View raw message