jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r149237 - in incubator/jackrabbit/trunk/src: java/org/apache/jackrabbit/core/search/ java/org/apache/jackrabbit/core/search/lucene/ test/org/apache/jackrabbit/test/search/
Date Mon, 31 Jan 2005 10:32:10 GMT
Author: mreutegg
Date: Mon Jan 31 02:31:59 2005
New Revision: 149237

URL: http://svn.apache.org/viewcvs?view=rev&rev=149237
Log:
Implemented RowIterator and Row interfaces. Adapted test queries to latest jcr version. jcr:score and jcr:path as select properties are not yet implemented!

Added:
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/search/DefaultQueryNodeVisitor.java   (with props)
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/search/lucene/RowIteratorImpl.java   (with props)
Modified:
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/search/lucene/NodeIteratorImpl.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/search/lucene/QueryImpl.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/search/lucene/QueryResultImpl.java
    incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/search/AbstractQueryTest.java
    incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/search/FulltextQueryTest.java
    incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/search/OrderByTest.java
    incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/search/SQLTest.java
    incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/search/SelectClauseTest.java
    incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/search/SimpleQueryTest.java

Added: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/search/DefaultQueryNodeVisitor.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/search/DefaultQueryNodeVisitor.java?view=auto&rev=149237
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/search/DefaultQueryNodeVisitor.java (added)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/search/DefaultQueryNodeVisitor.java Mon Jan 31 02:31:59 2005
@@ -0,0 +1,72 @@
+/*
+ * Copyright 2004-2005 The Apache Software Foundation or its licensors,
+ *                     as applicable.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.core.search;
+
+/**
+ * Implements the <code>QueryNodeVisitor</code> interface with default behaviour.
+ * All methods are no-ops and return the <code>data</code> argument.
+ */
+public class DefaultQueryNodeVisitor implements QueryNodeVisitor {
+
+    public Object visit(QueryRootNode node, Object data) {
+        return data;
+    }
+
+    public Object visit(OrQueryNode node, Object data) {
+        return data;
+    }
+
+    public Object visit(AndQueryNode node, Object data) {
+        return data;
+    }
+
+    public Object visit(NotQueryNode node, Object data) {
+        return data;
+    }
+
+    public Object visit(ExactQueryNode node, Object data) {
+        return data;
+    }
+
+    public Object visit(NodeTypeQueryNode node, Object data) {
+        return data;
+    }
+
+    public Object visit(RangeQueryNode node, Object data) {
+        return data;
+    }
+
+    public Object visit(TextsearchQueryNode node, Object data) {
+        return data;
+    }
+
+    public Object visit(PathQueryNode node, Object data) {
+        return data;
+    }
+
+    public Object visit(LocationStepQueryNode node, Object data) {
+        return data;
+    }
+
+    public Object visit(RelationQueryNode node, Object data) {
+        return data;
+    }
+
+    public Object visit(OrderQueryNode node, Object data) {
+        return data;
+    }
+}

Propchange: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/search/DefaultQueryNodeVisitor.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/search/lucene/NodeIteratorImpl.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/search/lucene/NodeIteratorImpl.java?view=diff&r1=149236&r2=149237
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/search/lucene/NodeIteratorImpl.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/search/lucene/NodeIteratorImpl.java Mon Jan 31 02:31:59 2005
@@ -18,6 +18,7 @@
 
 import org.apache.jackrabbit.core.ItemManager;
 import org.apache.jackrabbit.core.NodeId;
+import org.apache.jackrabbit.core.NodeImpl;
 import org.apache.log4j.Logger;
 
 import javax.jcr.Node;
@@ -26,62 +27,122 @@
 import java.util.NoSuchElementException;
 
 /**
+ * Implements a {@link javax.jcr.NodeIterator} returned by
+ * {@link javax.jcr.query.QueryResult#getNodes()}.
  */
 class NodeIteratorImpl implements NodeIterator {
 
+    /** Logger instance for this class */
     private static final Logger log = Logger.getLogger(NodeIteratorImpl.class);
 
+    /** The UUIDs of the nodes in the result set */
     private final String[] uuids;
 
+    /** ItemManager to turn UUIDs into Node instances */
     private final ItemManager itemMgr;
 
+    /** Current position in the UUID array */
     private int pos = 0;
 
+    /**
+     * Creates a new <code>NodeIteratorImpl</code> instance.
+     * @param itemMgr the <code>ItemManager</code> to turn UUIDs into
+     *   <code>Node</code> instances.
+     * @param uuids the UUIDs of the result nodes.
+     */
     NodeIteratorImpl(ItemManager itemMgr,
                      String[] uuids) {
         this.itemMgr = itemMgr;
         this.uuids = uuids;
     }
 
+    /**
+     * Returns the next <code>Node</code> in the result set.
+     * @return the next <code>Node</code> in the result set.
+     * @throws java.util.NoSuchElementException if iteration has no more
+     *   <code>Node</code>s.
+     */
     public Node nextNode() {
-        if (pos >= uuids.length) {
-            throw new NoSuchElementException();
-        }
-        try {
-            return (Node) itemMgr.getItem(new NodeId(uuids[pos++]));
-        } catch (RepositoryException e) {
-            log.error("Exception retrieving Node with UUID: "
-                    + uuids[pos] + ": " + e.toString());
-            // FIXME this is bad error handling!
-            throw new NoSuchElementException();
-        }
+        return nextNodeImpl();
     }
 
+    /**
+     * Returns the next <code>Node</code> in the result set.
+     * @return the next <code>Node</code> in the result set.
+     * @throws java.util.NoSuchElementException if iteration has no more
+     *   <code>Node</code>s.
+     */
     public Object next() {
         return nextNode();
     }
 
+    /**
+     * Skip a number of <code>Node</code>s in this iterator.
+     * @param skipNum the non-negative number of <code>Node</code>s to skip
+     * @throws java.util.NoSuchElementException
+     *          if skipped past the last <code>Node</code> in this iterator.
+     */
     public void skip(long skipNum) {
+        if (skipNum < 0) {
+            throw new IllegalArgumentException("skipNum must not be negative");
+        }
         if ((pos + skipNum) > uuids.length) {
             throw new NoSuchElementException();
         }
         pos += skipNum;
     }
 
+    /**
+     * Returns the number of <code>Node</code>s in this
+     * <code>NodeIterator</code>.
+     * @return the number of <code>Node</code>s in this
+     *   <code>NodeIterator</code>.
+     */
     public long getSize() {
         return uuids.length;
     }
 
+    /**
+     * Returns the current position in this <code>NodeIterator</code>.
+     * @return the current position in this <code>NodeIterator</code>.
+     */
     public long getPos() {
         return pos;
     }
 
+    /**
+     * Returns <code>true</code> if there is another <code>Node</code>
+     * available; <code>false</code> otherwise.
+     * @return <code>true</code> if there is another <code>Node</code>
+     *  available; <code>false</code> otherwise.
+     */
     public boolean hasNext() {
         return pos < uuids.length;
     }
 
+    /**
+     * @throws UnsupportedOperationException always.
+     */
     public void remove() {
         throw new UnsupportedOperationException("remove");
     }
 
+    /**
+     * Returns the next <code>Node</code> in the result set.
+     * @return the next <code>Node</code> in the result set.
+     * @throws java.util.NoSuchElementException if iteration has no more
+     *   <code>Node</code>s.
+     */
+    NodeImpl nextNodeImpl() {
+        if (pos >= uuids.length) {
+            throw new NoSuchElementException();
+        }
+        try {
+            return (NodeImpl) itemMgr.getItem(new NodeId(uuids[pos++]));
+        } catch (RepositoryException e) {
+            log.error("Exception retrieving Node with UUID: "
+                    + uuids[pos] + ": " + e.toString());
+            throw new NoSuchElementException();
+        }
+    }
 }

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/search/lucene/QueryImpl.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/search/lucene/QueryImpl.java?view=diff&r1=149236&r2=149237
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/search/lucene/QueryImpl.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/search/lucene/QueryImpl.java Mon Jan 31 02:31:59 2005
@@ -17,9 +17,15 @@
 package org.apache.jackrabbit.core.search.lucene;
 
 import org.apache.jackrabbit.core.nodetype.NodeTypeRegistry;
+import org.apache.jackrabbit.core.nodetype.NodeTypeImpl;
+import org.apache.jackrabbit.core.nodetype.PropertyDefImpl;
 import org.apache.jackrabbit.core.search.QueryParser;
 import org.apache.jackrabbit.core.search.QueryRootNode;
 import org.apache.jackrabbit.core.search.OrderQueryNode;
+import org.apache.jackrabbit.core.search.LocationStepQueryNode;
+import org.apache.jackrabbit.core.search.QueryNode;
+import org.apache.jackrabbit.core.search.NodeTypeQueryNode;
+import org.apache.jackrabbit.core.search.DefaultQueryNodeVisitor;
 import org.apache.jackrabbit.core.QName;
 import org.apache.jackrabbit.core.NamespaceRegistryImpl;
 import org.apache.jackrabbit.core.SessionImpl;
@@ -37,6 +43,7 @@
 import javax.jcr.nodetype.ConstraintViolationException;
 import javax.jcr.nodetype.NodeType;
 import javax.jcr.nodetype.NodeTypeManager;
+import javax.jcr.nodetype.PropertyDef;
 import javax.jcr.query.InvalidQueryException;
 import javax.jcr.query.QueryResult;
 import javax.jcr.*;
@@ -173,10 +180,36 @@
             uuids = Collections.EMPTY_LIST;
         }
 
+        // get select properties
+        QName[] selectProps = root.getSelectProperties();
+        if (selectProps.length == 0) {
+            // use node type constraint
+            LocationStepQueryNode[] steps = root.getLocationNode().getPathSteps();
+            final QName[] ntName = new QName[1];
+            steps[steps.length - 1].acceptOperands(new DefaultQueryNodeVisitor() {
+                public Object visit(NodeTypeQueryNode node, Object data) {
+                    ntName[0] = node.getValue();
+                    return data;
+                }
+            }, null);
+            if (ntName[0] == null) {
+                ntName[0] = NodeTypeRegistry.NT_BASE;
+            }
+            NodeTypeImpl nt = session.getNodeTypeManager().getNodeType(ntName[0]);
+            PropertyDef[] propDefs = (PropertyDef[]) nt.getPropertyDefs();
+            List tmp = new ArrayList();
+            for (int i = 0; i < propDefs.length; i++) {
+                if (!propDefs[i].isMultiple()) {
+                    tmp.add(((PropertyDefImpl) propDefs[i]).getQName());
+                }
+            }
+            selectProps = (QName[]) tmp.toArray(new QName[tmp.size()]);
+        }
+
         // return QueryResult
         return new QueryResultImpl(itemMgr,
                 (String[]) uuids.toArray(new String[uuids.size()]),
-                root.getSelectProperties(),
+                selectProps,
                 session.getNamespaceResolver());
     }
 

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/search/lucene/QueryResultImpl.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/search/lucene/QueryResultImpl.java?view=diff&r1=149236&r2=149237
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/search/lucene/QueryResultImpl.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/search/lucene/QueryResultImpl.java Mon Jan 31 02:31:59 2005
@@ -82,7 +82,6 @@
      * @see QueryResult#getRows()
      */
     public RowIterator getRows() throws RepositoryException {
-        // @todo implement QueryResult#getRows()
-        throw new RepositoryException("not yet implemented");
+        return new RowIteratorImpl(new NodeIteratorImpl(itemMgr, uuids), selectProps, resolver);
     }
 }

Added: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/search/lucene/RowIteratorImpl.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/search/lucene/RowIteratorImpl.java?view=auto&rev=149237
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/search/lucene/RowIteratorImpl.java (added)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/search/lucene/RowIteratorImpl.java Mon Jan 31 02:31:59 2005
@@ -0,0 +1,230 @@
+/*
+ * Copyright 2004-2005 The Apache Software Foundation or its licensors,
+ *                     as applicable.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.core.search.lucene;
+
+import org.apache.jackrabbit.core.QName;
+import org.apache.jackrabbit.core.NamespaceResolver;
+import org.apache.jackrabbit.core.NodeImpl;
+import org.apache.jackrabbit.core.PropertyImpl;
+import org.apache.jackrabbit.core.IllegalNameException;
+import org.apache.jackrabbit.core.UnknownPrefixException;
+
+import javax.jcr.query.RowIterator;
+import javax.jcr.query.Row;
+import javax.jcr.Value;
+import javax.jcr.RepositoryException;
+import javax.jcr.ItemNotFoundException;
+import java.util.Arrays;
+import java.util.Set;
+import java.util.HashSet;
+
+/**
+ * Implements the {@link javax.jcr.query.RowIterator} interface returned by
+ * a {@link javax.jcr.query.QueryResult}.
+ */
+class RowIteratorImpl implements RowIterator {
+
+    /** Iterator over nodes, that constitute the result set. */
+    private final NodeIteratorImpl nodes;
+
+    /** Array of select property names */
+    private final QName[] properties;
+
+    /** The <code>NamespaceResolver</code> of the user <code>Session</code>. */
+    private final NamespaceResolver resolver;
+
+    /**
+     * Creates a new <code>RowIteratorImpl</code> that iterates over the result
+     * nodes.
+     * @param nodes a <code>NodeIteratorImpl</code> that contains the nodes of
+     * the query result.
+     * @param properties <code>QName</code> of the select properties.
+     * @param resolver <code>NamespaceResolver</code> of the user
+     *   <code>Session</code>.
+     */
+    RowIteratorImpl(NodeIteratorImpl nodes, QName[] properties, NamespaceResolver resolver) {
+        this.nodes = nodes;
+        this.properties = properties;
+        this.resolver = resolver;
+    }
+
+    /**
+     * Returns the next <code>Row</code> in the iteration.
+     *
+     * @return the next <code>Row</code> in the iteration.
+     * @throws java.util.NoSuchElementException if iteration has no more
+     *   <code>Row</code>s.
+    */
+    public Row nextRow() {
+        return new RowImpl(nodes.nextNodeImpl());
+    }
+
+    /**
+     * Skip a number of <code>Row</code>s in this iterator.
+     *
+     * @param skipNum the non-negative number of <code>Row</code>s to skip
+     * @throws java.util.NoSuchElementException
+     *          if skipped past the last <code>Row</code> in this iterator.
+     */
+    public void skip(long skipNum) {
+        nodes.skip(skipNum);
+    }
+
+    /**
+     * Returns the number of <code>Row</code>s in this iterator.
+     * @return the number of <code>Row</code>s in this iterator.
+     */
+    public long getSize() {
+        return nodes.getSize();
+    }
+
+    /**
+     * Returns the current position within this iterator. The number
+     * returned is the 0-based index of the next <code>Row</code> in the iterator,
+     * i.e. the one that will be returned on the subsequent <code>next</code> call.
+     * <p/>
+     * Note that this method does not check if there is a next element,
+     * i.e. an empty iterator will always return 0.
+     *
+     * @return the current position withing this iterator.
+     */
+    public long getPos() {
+        return nodes.getPos();
+    }
+
+    /**
+     * @throws UnsupportedOperationException always.
+     */
+    public void remove() {
+        throw new UnsupportedOperationException("remove");
+    }
+
+    /**
+     * Returns <code>true</code> if the iteration has more <code>Row</code>s.
+     * (In other words, returns <code>true</code> if <code>next</code> would
+     * return an <code>Row</code> rather than throwing an exception.)
+     *
+     * @return <code>true</code> if the iterator has more elements.
+     */
+    public boolean hasNext() {
+        return nodes.hasNext();
+    }
+
+    /**
+     * Returns the next <code>Row</code> in the iteration.
+     *
+     * @return the next <code>Row</code> in the iteration.
+     * @throws java.util.NoSuchElementException if iteration has no more
+     *   <code>Row</code>s.
+    */
+    public Object next() {
+        return nextRow();
+    }
+
+    //---------------------< class RowImpl >------------------------------------
+
+    /**
+     * Implements the {@link javax.jcr.query.Row} interface, which represents
+     * a row in the query result.
+     */
+    class RowImpl implements Row {
+
+        /** The underlying <code>Node</code> of this result row. */
+        private final NodeImpl node;
+
+        /** Cached value array for returned by {@link #getValues()}. */
+        private Value[] values;
+
+        /** Set of select property <code>QName</code>s. */
+        private Set valueSet;
+
+        /**
+         * Creates a new <code>RowImpl</code> instance based on <code>node</code>.
+         * @param node the underlying <code>Node</code> for this <code>Row</code>.
+         */
+        RowImpl(NodeImpl node) {
+            this.node = node;
+        }
+
+        /**
+         * Returns an array of all the values in the same order as the property
+         * names (column names) returned by
+         * {@link javax.jcr.query.QueryResult#getPropertyNames()}.
+         *
+         * @return a <code>Value</code> array.
+         * @throws RepositoryException if an error occurs while retrieving the
+         *  values from the <code>Node</code>.
+         */
+        public Value[] getValues() throws RepositoryException {
+            if (values == null) {
+                Value[] tmp = new Value[properties.length];
+                for (int i = 0; i < properties.length; i++) {
+                    if (node.hasProperty(properties[i])) {
+                        PropertyImpl prop = node.getProperty(properties[i]);
+                        if (!prop.getDefinition().isMultiple()) {
+                            tmp[i] = prop.getValue();
+                        } else {
+                            // mvp values cannot be returned
+                            tmp[i] = null;
+                        }
+                    } else {
+                        // property not set
+                        tmp[i] = null;
+                    }
+                }
+                values = tmp;
+            }
+            return values;
+        }
+
+        /**
+         * Returns the value of the indicated  property in this <code>Row</code>.
+         * <p/>
+         * If <code>propertyName</code> is not among the column names of the
+         * query result table, an <code>ItemNotFoundException</code> is thrown.
+         *
+         * @return a <code>Value</code>
+         * @throws ItemNotFoundException if <code>propertyName</code> is not
+         * among the column names of the query result table.
+         * @throws RepositoryException if <code>propertyName</code> is not a
+         *  valid property name.
+         */
+        public Value getValue(String propertyName) throws ItemNotFoundException, RepositoryException {
+            if (valueSet == null) {
+                // create the set first
+                Set tmp = new HashSet();
+                tmp.addAll(Arrays.asList(values));
+                valueSet = tmp;
+            }
+            try {
+                QName prop = QName.fromJCRName(propertyName, resolver);
+                if (!valueSet.contains(prop)) {
+                    throw new ItemNotFoundException(propertyName);
+                }
+                if (node.hasProperty(prop)) {
+                    return node.getProperty(prop).getValue();
+                } else {
+                    return null;
+                }
+            } catch (IllegalNameException e) {
+                throw new RepositoryException(e.getMessage(), e);
+            } catch (UnknownPrefixException e) {
+                throw new RepositoryException(e.getMessage(), e);
+            }
+        }
+    }
+}

Propchange: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/search/lucene/RowIteratorImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/search/AbstractQueryTest.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/search/AbstractQueryTest.java?view=diff&r1=149236&r2=149237
==============================================================================
--- incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/search/AbstractQueryTest.java (original)
+++ incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/search/AbstractQueryTest.java Mon Jan 31 02:31:59 2005
@@ -20,6 +20,8 @@
 
 import javax.jcr.*;
 import javax.jcr.query.QueryResult;
+import javax.jcr.query.RowIterator;
+import javax.jcr.query.Row;
 
 /**
  * Abstract base class for query test cases.
@@ -73,26 +75,21 @@
      */
     protected void checkResult(QueryResult result, int hits, int properties)
             throws RepositoryException {
-/*
         checkResult(result, hits);
         // now check property count
         int count = 0;
         log.println("Properties:");
-        for (PropertyIterator it = result.getProperties(); it.hasNext(); count++) {
+        String[] propNames = result.getPropertyNames();
+        for (RowIterator it = result.getRows(); it.hasNext();) {
             StringBuffer msg = new StringBuffer();
-            Property p = it.nextProperty();
-            msg.append("  ").append(p.getName()).append(": ");
-            Value[] values = null;
-            if (p.getDefinition().isMultiple()) {
-                values = p.getValues();
-            } else {
-                values = new Value[]{p.getValue()};
-            }
-            String sep = "";
-            for (int i = 0; i < values.length; i++) {
-                msg.append(sep);
-                msg.append(values[i].getString());
-                sep = " | ";
+            Value[] values = it.nextRow().getValues();
+            for (int i = 0; i < propNames.length; i++, count++) {
+                msg.append("  ").append(propNames[i]).append(": ");
+                if (values[i] == null) {
+                    msg.append("null");
+                } else {
+                    msg.append(values[i].getString());
+                }
             }
             log.println(msg);
         }
@@ -100,9 +97,6 @@
             log.println("  NONE");
         }
         assertEquals("Wrong property count.", properties, count);
-*/
-        //@todo rewrite test case
-        fail("need to rewrite test case according to interface change");
     }
 
 }

Modified: incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/search/FulltextQueryTest.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/search/FulltextQueryTest.java?view=diff&r1=149236&r2=149237
==============================================================================
--- incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/search/FulltextQueryTest.java (original)
+++ incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/search/FulltextQueryTest.java Mon Jan 31 02:31:59 2005
@@ -34,7 +34,7 @@
         String sql = "SELECT * FROM \"" + NT_UNSTRUCTURED
                 + "\" WHERE \"jcr:path\" LIKE '" + testRoot + "/%"
                 + "' AND CONTAINS('fox')";
-        Query q = superuser.getWorkspace().getQueryManager().createQuery(sql, "sql");
+        Query q = superuser.getWorkspace().getQueryManager().createQuery(sql, Query.SQL);
         QueryResult result = q.execute();
         checkResult(result, 1);
     }
@@ -48,7 +48,7 @@
         String sql = "SELECT * FROM \"" + NT_UNSTRUCTURED
                 + "\" WHERE \"jcr:path\" = '" + testRoot + "/foo"
                 + "' AND CONTAINS('fox')";
-        Query q = superuser.getWorkspace().getQueryManager().createQuery(sql, "sql");
+        Query q = superuser.getWorkspace().getQueryManager().createQuery(sql, Query.SQL);
         QueryResult result = q.execute();
         checkResult(result, 1);
     }
@@ -67,7 +67,7 @@
         String sql = "SELECT * FROM \"" + NT_UNSTRUCTURED
                 + "\" WHERE \"jcr:path\" LIKE '" + testRoot + "/%"
                 + "' AND CONTAINS('fox test')";
-        Query q = superuser.getWorkspace().getQueryManager().createQuery(sql, "sql");
+        Query q = superuser.getWorkspace().getQueryManager().createQuery(sql, Query.SQL);
         QueryResult result = q.execute();
         checkResult(result, 1);
     }
@@ -86,7 +86,7 @@
         String sql = "SELECT * FROM \"" + NT_UNSTRUCTURED
                 + "\" WHERE \"jcr:path\" LIKE '" + testRoot + "/%"
                 + "' AND CONTAINS('text ''fox jumps''')";
-        Query q = superuser.getWorkspace().getQueryManager().createQuery(sql, "sql");
+        Query q = superuser.getWorkspace().getQueryManager().createQuery(sql, Query.SQL);
         QueryResult result = q.execute();
         checkResult(result, 1);
     }
@@ -105,7 +105,7 @@
         String sql = "SELECT * FROM \"" + NT_UNSTRUCTURED
                 + "\" WHERE \"jcr:path\" LIKE '" + testRoot + "/%"
                 + "' AND CONTAINS('text ''fox jumps'' -other')";
-        Query q = superuser.getWorkspace().getQueryManager().createQuery(sql, "sql");
+        Query q = superuser.getWorkspace().getQueryManager().createQuery(sql, Query.SQL);
         QueryResult result = q.execute();
         checkResult(result, 1);
     }
@@ -124,7 +124,7 @@
         String sql = "SELECT * FROM \"" + NT_UNSTRUCTURED
                 + "\" WHERE \"jcr:path\" LIKE '" + testRoot + "/%"
                 + "' AND CONTAINS('''fox jumps'' test OR other')";
-        Query q = superuser.getWorkspace().getQueryManager().createQuery(sql, "sql");
+        Query q = superuser.getWorkspace().getQueryManager().createQuery(sql, Query.SQL);
         QueryResult result = q.execute();
         checkResult(result, 2);
     }
@@ -143,7 +143,7 @@
         String sql = "SELECT * FROM \"" + NT_UNSTRUCTURED
                 + "\" WHERE \"jcr:path\" LIKE '" + testRoot + "/%"
                 + "' AND CONTAINS('''fox juMps'' Test OR otheR')";
-        Query q = superuser.getWorkspace().getQueryManager().createQuery(sql, "sql");
+        Query q = superuser.getWorkspace().getQueryManager().createQuery(sql, Query.SQL);
         QueryResult result = q.execute();
         checkResult(result, 2);
     }

Modified: incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/search/OrderByTest.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/search/OrderByTest.java?view=diff&r1=149236&r2=149237
==============================================================================
--- incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/search/OrderByTest.java (original)
+++ incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/search/OrderByTest.java Mon Jan 31 02:31:59 2005
@@ -123,7 +123,7 @@
         // both ascending
         String sql = "SELECT value FROM nt:unstructured WHERE " +
                 "jcr:path LIKE '/" + testRoot + "/%' ORDER BY value, text";
-        Query q = superuser.getWorkspace().getQueryManager().createQuery(sql, "sql");
+        Query q = superuser.getWorkspace().getQueryManager().createQuery(sql, Query.SQL);
         QueryResult result = q.execute();
         checkResultOrder(result, new String[]{"node2", "node3", "node1"});
 
@@ -135,7 +135,7 @@
         // both descending
         sql = "SELECT value FROM nt:unstructured WHERE " +
                 "jcr:path LIKE '/" + testRoot + "/%' ORDER BY value DESC, text DESC";
-        q = superuser.getWorkspace().getQueryManager().createQuery(sql, "sql");
+        q = superuser.getWorkspace().getQueryManager().createQuery(sql, Query.SQL);
         result = q.execute();
         checkResultOrder(result, new String[]{"node1", "node3", "node2"});
 
@@ -147,7 +147,7 @@
         // mixed ascending and descending
         sql = "SELECT value FROM nt:unstructured WHERE " +
                 "jcr:path LIKE '/" + testRoot + "/%' ORDER BY value DESC, text";
-        q = superuser.getWorkspace().getQueryManager().createQuery(sql, "sql");
+        q = superuser.getWorkspace().getQueryManager().createQuery(sql, Query.SQL);
         result = q.execute();
         checkResultOrder(result, new String[]{"node1", "node2", "node3"});
 
@@ -199,7 +199,7 @@
         // first check ascending
         String sql = "SELECT value FROM nt:unstructured WHERE " +
                 "jcr:path LIKE '/" + testRoot + "/%' ORDER BY value";
-        Query q = superuser.getWorkspace().getQueryManager().createQuery(sql, "sql");
+        Query q = superuser.getWorkspace().getQueryManager().createQuery(sql, Query.SQL);
         QueryResult result = q.execute();
         checkResultOrder(result, nodeNames);
 
@@ -213,7 +213,7 @@
 
         sql = "SELECT value FROM nt:unstructured WHERE " +
                 "jcr:path LIKE '/" + testRoot + "/%' ORDER BY value DESC";
-        q = superuser.getWorkspace().getQueryManager().createQuery(sql, "sql");
+        q = superuser.getWorkspace().getQueryManager().createQuery(sql, Query.SQL);
         result = q.execute();
         checkResultOrder(result, nodeNames);
 

Modified: incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/search/SQLTest.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/search/SQLTest.java?view=diff&r1=149236&r2=149237
==============================================================================
--- incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/search/SQLTest.java (original)
+++ incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/search/SQLTest.java Mon Jan 31 02:31:59 2005
@@ -32,7 +32,7 @@
         testRootNode.save();
 
         String sql = "SELECT * FROM \"nt:unstructured\" WHERE bla='bla'";
-        Query q = superuser.getWorkspace().getQueryManager().createQuery(sql, "sql");
+        Query q = superuser.getWorkspace().getQueryManager().createQuery(sql, Query.SQL);
         QueryResult result = q.execute();
         checkResult(result, 1);
     }
@@ -44,7 +44,7 @@
         testRootNode.save();
 
         String sql = "SELECT * FROM \"nt:unstructured\" WHERE contains('fox')";
-        Query q = superuser.getWorkspace().getQueryManager().createQuery(sql, "sql");
+        Query q = superuser.getWorkspace().getQueryManager().createQuery(sql, Query.SQL);
         QueryResult result = q.execute();
         checkResult(result, 1);
     }
@@ -56,7 +56,7 @@
         testRootNode.save();
 
         String sql = "SELECT * FROM \"nt:unstructured\" WHERE contains('fox') AND NOT contains('bla')";
-        Query q = superuser.getWorkspace().getQueryManager().createQuery(sql, "sql");
+        Query q = superuser.getWorkspace().getQueryManager().createQuery(sql, Query.SQL);
         QueryResult result = q.execute();
         checkResult(result, 1);
     }

Modified: incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/search/SelectClauseTest.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/search/SelectClauseTest.java?view=diff&r1=149236&r2=149237
==============================================================================
--- incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/search/SelectClauseTest.java (original)
+++ incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/search/SelectClauseTest.java Mon Jan 31 02:31:59 2005
@@ -28,82 +28,82 @@
 
     public void testSelectSQL() throws RepositoryException {
         Node n = testRootNode.addNode("node1", NT_UNSTRUCTURED);
-        n.setProperty("myvalue", new String[]{"foo"});
+        n.setProperty("myvalue", "foo");
         n = testRootNode.addNode("node2", NT_UNSTRUCTURED);
-        n.setProperty("myvalue", new String[]{"bar"});
+        n.setProperty("myvalue", "bar");
         n = testRootNode.addNode("node3", NT_UNSTRUCTURED);
-        n.setProperty("yourvalue", new String[]{"foo"});
+        n.setProperty("yourvalue", "foo");
 
         testRootNode.save();
 
         String sql = "SELECT myvalue FROM \"" + NT_BASE
                 + "\" WHERE \"jcr:path\" LIKE '" + testRoot + "/%'";
-        Query q = superuser.getWorkspace().getQueryManager().createQuery(sql, "sql");
+        Query q = superuser.getWorkspace().getQueryManager().createQuery(sql, Query.SQL);
         QueryResult result = q.execute();
         checkResult(result, 2);
 
         sql = "SELECT myvalue FROM \"" + NT_BASE
                 + "\" WHERE \"jcr:path\" LIKE '" + testRoot + "/%'"
                 + " AND yourvalue = 'foo'";
-        q = superuser.getWorkspace().getQueryManager().createQuery(sql, "sql");
+        q = superuser.getWorkspace().getQueryManager().createQuery(sql, Query.SQL);
         result = q.execute();
         checkResult(result, 0);
 
         sql = "SELECT myvalue FROM \"" + NT_BASE + "\"";
-        q = superuser.getWorkspace().getQueryManager().createQuery(sql, "sql");
+        q = superuser.getWorkspace().getQueryManager().createQuery(sql, Query.SQL);
         result = q.execute();
         checkResult(result, 2);
     }
 
     public void testPropertyCountSQL() throws RepositoryException {
         Node n = testRootNode.addNode("node1", NT_UNSTRUCTURED);
-        n.setProperty("myvalue", new String[]{"foo"});
+        n.setProperty("myvalue", "foo");
         n = testRootNode.addNode("node2", NT_UNSTRUCTURED);
-        n.setProperty("myvalue", new String[]{"bar"});
+        n.setProperty("myvalue", "bar");
         n = testRootNode.addNode("node3", NT_UNSTRUCTURED);
-        n.setProperty("yourvalue", new String[]{"foo"});
+        n.setProperty("yourvalue", "foo");
 
         testRootNode.save();
 
         String sql = "SELECT myvalue FROM \"" + NT_BASE
                 + "\" WHERE \"jcr:path\" LIKE '" + testRoot + "/%'";
-        Query q = superuser.getWorkspace().getQueryManager().createQuery(sql, "sql");
+        Query q = superuser.getWorkspace().getQueryManager().createQuery(sql, Query.SQL);
         QueryResult result = q.execute();
         checkResult(result, 2, 2);
 
         sql = "SELECT myvalue FROM \"" + NT_BASE
                 + "\" WHERE \"jcr:path\" LIKE '" + testRoot + "/%'"
                 + " AND yourvalue = 'foo'";
-        q = superuser.getWorkspace().getQueryManager().createQuery(sql, "sql");
+        q = superuser.getWorkspace().getQueryManager().createQuery(sql, Query.SQL);
         result = q.execute();
         checkResult(result, 0, 0);
 
         sql = "SELECT myvalue FROM \"" + NT_BASE + "\"";
-        q = superuser.getWorkspace().getQueryManager().createQuery(sql, "sql");
+        q = superuser.getWorkspace().getQueryManager().createQuery(sql, Query.SQL);
         result = q.execute();
         checkResult(result, 2, 2);
 
         sql = "SELECT * FROM \"" + NT_BASE
                 + "\" WHERE \"jcr:path\" LIKE '" + testRoot + "/%'"
                 + " AND myvalue LIKE '%'";
-        q = superuser.getWorkspace().getQueryManager().createQuery(sql, "sql");
+        q = superuser.getWorkspace().getQueryManager().createQuery(sql, Query.SQL);
         result = q.execute();
-        checkResult(result, 2, 4);
+        checkResult(result, 2, 2);
     }
 
     public void testSameNameSiblingSQL() throws RepositoryException {
         Node n = testRootNode.addNode("node", NT_UNSTRUCTURED);
-        n.setProperty("myvalue", new String[]{"foo"});
+        n.setProperty("myvalue", "foo");
         n = testRootNode.addNode("node", NT_UNSTRUCTURED);
-        n.setProperty("myvalue", new String[]{"bar"});
+        n.setProperty("myvalue", "bar");
         n = testRootNode.addNode("node", NT_UNSTRUCTURED);
-        n.setProperty("yourvalue", new String[]{"foo"});
+        n.setProperty("yourvalue", "foo");
 
         testRootNode.save();
 
         String sql = "SELECT myvalue FROM \"" + NT_BASE
                 + "\" WHERE \"jcr:path\" LIKE '" + testRoot + "/node'";
-        Query q = superuser.getWorkspace().getQueryManager().createQuery(sql, "sql");
+        Query q = superuser.getWorkspace().getQueryManager().createQuery(sql, Query.SQL);
         QueryResult result = q.execute();
         checkResult(result, 2, 2);
 

Modified: incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/search/SimpleQueryTest.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/search/SimpleQueryTest.java?view=diff&r1=149236&r2=149237
==============================================================================
--- incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/search/SimpleQueryTest.java (original)
+++ incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/search/SimpleQueryTest.java Mon Jan 31 02:31:59 2005
@@ -36,7 +36,7 @@
         String sql = "SELECT * FROM nt:base"
                 + " WHERE jcr:path LIKE '" + testRoot + "/foo'"
                 + " AND bla = 'bla'";
-        Query q = superuser.getWorkspace().getQueryManager().createQuery(sql, "sql");
+        Query q = superuser.getWorkspace().getQueryManager().createQuery(sql, Query.SQL);
         QueryResult result = q.execute();
         checkResult(result, 1);
     }
@@ -52,7 +52,7 @@
         String sql = "SELECT * FROM nt:file" +
                 " WHERE jcr:path LIKE '" + testRoot + "/%'"
                 + " AND bla = 'bla'";
-        Query q = superuser.getWorkspace().getQueryManager().createQuery(sql, "sql");
+        Query q = superuser.getWorkspace().getQueryManager().createQuery(sql, Query.SQL);
         QueryResult result = q.execute();
         checkResult(result, 0);
     }
@@ -68,7 +68,7 @@
         String sql = "SELECT * FROM nt:unstructured" +
                 " WHERE jcr:path LIKE '" + testRoot + "/%'"
                 + " AND bla = 'bla'";
-        Query q = superuser.getWorkspace().getQueryManager().createQuery(sql, "sql");
+        Query q = superuser.getWorkspace().getQueryManager().createQuery(sql, Query.SQL);
         QueryResult result = q.execute();
         checkResult(result, 2);
     }
@@ -82,7 +82,7 @@
         testRootNode.save();
 
         String sql = "SELECT * FROM nt:unstructured WHERE jcr:path LIKE '" + testRoot + "/%'";
-        Query q = superuser.getWorkspace().getQueryManager().createQuery(sql, "sql");
+        Query q = superuser.getWorkspace().getQueryManager().createQuery(sql, Query.SQL);
         QueryResult result = q.execute();
         checkResult(result, 2);
     }
@@ -101,12 +101,12 @@
         testRootNode.save();
 
         String sql = "SELECT * FROM nt:base WHERE jcr:path LIKE '" + testRoot + "/%' AND birth > TIMESTAMP '1976-01-01T00:00:00.000+01:00'";
-        Query q = superuser.getWorkspace().getQueryManager().createQuery(sql, "sql");
+        Query q = superuser.getWorkspace().getQueryManager().createQuery(sql, Query.SQL);
         QueryResult result = q.execute();
         checkResult(result, 1);
 
         sql = "SELECT * FROM nt:base WHERE jcr:path LIKE '" + testRoot + "/%' AND birth > TIMESTAMP '1975-01-01T00:00:00.000+01:00'";
-        q = superuser.getWorkspace().getQueryManager().createQuery(sql, "sql");
+        q = superuser.getWorkspace().getQueryManager().createQuery(sql, Query.SQL);
         result = q.execute();
         checkResult(result, 2);
     }
@@ -122,17 +122,17 @@
         testRootNode.save();
 
         String sql = "SELECT * FROM nt:base WHERE jcr:path LIKE '" + testRoot + "/%' AND value > 0.1e-0";
-        Query q = superuser.getWorkspace().getQueryManager().createQuery(sql, "sql");
+        Query q = superuser.getWorkspace().getQueryManager().createQuery(sql, Query.SQL);
         QueryResult result = q.execute();
         checkResult(result, 1);
 
         sql = "SELECT * FROM nt:base WHERE jcr:path LIKE '" + testRoot + "/%' AND value > -0.1";
-        q = superuser.getWorkspace().getQueryManager().createQuery(sql, "sql");
+        q = superuser.getWorkspace().getQueryManager().createQuery(sql, Query.SQL);
         result = q.execute();
         checkResult(result, 2);
 
         sql = "SELECT * FROM nt:base WHERE jcr:path LIKE '" + testRoot + "/%' AND value > -1.5";
-        q = superuser.getWorkspace().getQueryManager().createQuery(sql, "sql");
+        q = superuser.getWorkspace().getQueryManager().createQuery(sql, Query.SQL);
         result = q.execute();
         checkResult(result, 3);
     }
@@ -148,17 +148,17 @@
         testRootNode.save();
 
         String sql = "SELECT * FROM nt:base WHERE jcr:path LIKE '" + testRoot + "/%' AND value > 0";
-        Query q = superuser.getWorkspace().getQueryManager().createQuery(sql, "sql");
+        Query q = superuser.getWorkspace().getQueryManager().createQuery(sql, Query.SQL);
         QueryResult result = q.execute();
         checkResult(result, 1);
 
         sql = "SELECT * FROM nt:base WHERE jcr:path LIKE '" + testRoot + "/%' AND value > -1";
-        q = superuser.getWorkspace().getQueryManager().createQuery(sql, "sql");
+        q = superuser.getWorkspace().getQueryManager().createQuery(sql, Query.SQL);
         result = q.execute();
         checkResult(result, 2);
 
         sql = "SELECT * FROM nt:base WHERE jcr:path LIKE '" + testRoot + "/%' AND value > -2";
-        q = superuser.getWorkspace().getQueryManager().createQuery(sql, "sql");
+        q = superuser.getWorkspace().getQueryManager().createQuery(sql, Query.SQL);
         result = q.execute();
         checkResult(result, 3);
     }
@@ -174,17 +174,17 @@
         testRootNode.save();
 
         String sql = "SELECT * FROM nt:base WHERE jcr:path LIKE '" + testRoot + "/%' AND value LIKE 'ping'";
-        Query q = superuser.getWorkspace().getQueryManager().createQuery(sql, "sql");
+        Query q = superuser.getWorkspace().getQueryManager().createQuery(sql, Query.SQL);
         QueryResult result = q.execute();
         checkResult(result, 1);
 
         sql = "SELECT * FROM nt:base WHERE jcr:path LIKE '" + testRoot + "/%' AND value LIKE '_ing'";
-        q = superuser.getWorkspace().getQueryManager().createQuery(sql, "sql");
+        q = superuser.getWorkspace().getQueryManager().createQuery(sql, Query.SQL);
         result = q.execute();
         checkResult(result, 2);
 
         sql = "SELECT * FROM nt:base WHERE jcr:path LIKE '" + testRoot + "/%' AND value LIKE '%ing'";
-        q = superuser.getWorkspace().getQueryManager().createQuery(sql, "sql");
+        q = superuser.getWorkspace().getQueryManager().createQuery(sql, Query.SQL);
         result = q.execute();
         checkResult(result, 3);
     }
@@ -200,17 +200,17 @@
         testRootNode.save();
 
         String sql = "SELECT * FROM nt:base WHERE jcr:path LIKE '" + testRoot + "/%' AND value LIKE 'ping'";
-        Query q = superuser.getWorkspace().getQueryManager().createQuery(sql, "sql");
+        Query q = superuser.getWorkspace().getQueryManager().createQuery(sql, Query.SQL);
         QueryResult result = q.execute();
         checkResult(result, 1);
 
         sql = "SELECT * FROM nt:base WHERE jcr:path LIKE '" + testRoot + "/%' AND value LIKE 'p_ng'";
-        q = superuser.getWorkspace().getQueryManager().createQuery(sql, "sql");
+        q = superuser.getWorkspace().getQueryManager().createQuery(sql, Query.SQL);
         result = q.execute();
         checkResult(result, 2);
 
         sql = "SELECT * FROM nt:base WHERE jcr:path LIKE '" + testRoot + "/%' AND value LIKE 'p%ng'";
-        q = superuser.getWorkspace().getQueryManager().createQuery(sql, "sql");
+        q = superuser.getWorkspace().getQueryManager().createQuery(sql, Query.SQL);
         result = q.execute();
         checkResult(result, 3);
     }
@@ -226,17 +226,17 @@
         testRootNode.save();
 
         String sql = "SELECT * FROM nt:base WHERE jcr:path LIKE '" + testRoot + "/%' AND value LIKE 'bli'";
-        Query q = superuser.getWorkspace().getQueryManager().createQuery(sql, "sql");
+        Query q = superuser.getWorkspace().getQueryManager().createQuery(sql, Query.SQL);
         QueryResult result = q.execute();
         checkResult(result, 1);
 
         sql = "SELECT * FROM nt:base WHERE jcr:path LIKE '" + testRoot + "/%' AND value LIKE 'bl_'";
-        q = superuser.getWorkspace().getQueryManager().createQuery(sql, "sql");
+        q = superuser.getWorkspace().getQueryManager().createQuery(sql, Query.SQL);
         result = q.execute();
         checkResult(result, 2);
 
         sql = "SELECT * FROM nt:base WHERE jcr:path LIKE '" + testRoot + "/%' AND value LIKE 'bl%'";
-        q = superuser.getWorkspace().getQueryManager().createQuery(sql, "sql");
+        q = superuser.getWorkspace().getQueryManager().createQuery(sql, Query.SQL);
         result = q.execute();
         checkResult(result, 3);
     }
@@ -254,27 +254,27 @@
         testRootNode.save();
 
         String sql = "SELECT * FROM nt:base WHERE jcr:path LIKE '" + testRoot + "/%' AND value LIKE 'foo\\_bar' ESCAPE '\\'"; // matches node3
-        Query q = superuser.getWorkspace().getQueryManager().createQuery(sql, "sql");
+        Query q = superuser.getWorkspace().getQueryManager().createQuery(sql, Query.SQL);
         QueryResult result = q.execute();
         checkResult(result, 1);
 
         sql = "SELECT * FROM nt:base WHERE jcr:path LIKE '" + testRoot + "/%' AND value LIKE 'foo_bar'";    // matches node3 and node4
-        q = superuser.getWorkspace().getQueryManager().createQuery(sql, "sql");
+        q = superuser.getWorkspace().getQueryManager().createQuery(sql, Query.SQL);
         result = q.execute();
         checkResult(result, 2);
 
         sql = "SELECT * FROM nt:base WHERE jcr:path LIKE '" + testRoot + "/%' AND value LIKE 'foo%bar'";  // matches all nodes
-        q = superuser.getWorkspace().getQueryManager().createQuery(sql, "sql");
+        q = superuser.getWorkspace().getQueryManager().createQuery(sql, Query.SQL);
         result = q.execute();
         checkResult(result, 4);
 
         sql = "SELECT * FROM nt:base WHERE jcr:path LIKE '" + testRoot + "/%' AND value LIKE 'foo\\\\\\_bar' ESCAPE '\\'";  // matches node1
-        q = superuser.getWorkspace().getQueryManager().createQuery(sql, "sql");
+        q = superuser.getWorkspace().getQueryManager().createQuery(sql, Query.SQL);
         result = q.execute();
         checkResult(result, 1);
 
         sql = "SELECT * FROM nt:base WHERE jcr:path LIKE '" + testRoot + "/%' AND value LIKE 'foo\\_bar'";  // matches node1
-        q = superuser.getWorkspace().getQueryManager().createQuery(sql, "sql");
+        q = superuser.getWorkspace().getQueryManager().createQuery(sql, Query.SQL);
         result = q.execute();
         checkResult(result, 1);
     }
@@ -290,7 +290,7 @@
         testRootNode.save();
 
         String jcrql = "SELECT * FROM nt:base WHERE jcr:path LIKE '" + testRoot + "/%' AND value <> 'bar'";
-        Query q = superuser.getWorkspace().getQueryManager().createQuery(jcrql, "sql");
+        Query q = superuser.getWorkspace().getQueryManager().createQuery(jcrql, Query.SQL);
         QueryResult result = q.execute();
         checkResult(result, 2);
 
@@ -306,7 +306,7 @@
 
         String sql = "SELECT * FROM nt:unstructured WHERE mytext is null and jcr:path LIKE '/"
                 + testRoot + "/%'";
-        Query q = superuser.getWorkspace().getQueryManager().createQuery(sql, "sql");
+        Query q = superuser.getWorkspace().getQueryManager().createQuery(sql, Query.SQL);
         QueryResult result = q.execute();
         checkResult(result, 1);
 
@@ -326,7 +326,7 @@
         testRootNode.save();
 
         String sql = "SELECT * FROM nt:unstructured WHERE mytext is not null";
-        Query q = superuser.getWorkspace().getQueryManager().createQuery(sql, "sql");
+        Query q = superuser.getWorkspace().getQueryManager().createQuery(sql, Query.SQL);
         QueryResult result = q.execute();
         checkResult(result, 1);
 
@@ -350,7 +350,7 @@
 
         String sql = "SELECT * FROM nt:unstructured WHERE 'foo' IN text " +
                 "and jcr:path LIKE '/" + testRoot + "/%'";
-        Query q = superuser.getWorkspace().getQueryManager().createQuery(sql, "sql");
+        Query q = superuser.getWorkspace().getQueryManager().createQuery(sql, Query.SQL);
         QueryResult result = q.execute();
         checkResult(result, 3); // foo, bar, bla
 
@@ -361,7 +361,7 @@
 
         sql = "SELECT * FROM nt:unstructured WHERE text = 'foo' " +
                 "and jcr:path LIKE '/" + testRoot + "/%'";
-        q = superuser.getWorkspace().getQueryManager().createQuery(sql, "sql");
+        q = superuser.getWorkspace().getQueryManager().createQuery(sql, Query.SQL);
         result = q.execute();
         checkResult(result, 2); // bar, bla
 
@@ -372,7 +372,7 @@
 
         sql = "SELECT * FROM nt:unstructured WHERE 'bar' NOT IN text " +
                 "and jcr:path LIKE '/" + testRoot + "/%'";
-        q = superuser.getWorkspace().getQueryManager().createQuery(sql, "sql");
+        q = superuser.getWorkspace().getQueryManager().createQuery(sql, Query.SQL);
         result = q.execute();
         checkResult(result, 2); // bar, bla
 



Mime
View raw message