jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r783337 - in /jackrabbit/trunk: ./ jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/ jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/ jackrabbit-spi2jcr/
Date Wed, 10 Jun 2009 12:56:34 GMT
Author: mreutegg
Date: Wed Jun 10 12:56:33 2009
New Revision: 783337

URL: http://svn.apache.org/viewvc?rev=783337&view=rev
Log:
JCR-2076: JSR 283: Joins
- orderings (work in progress)

Added:
    jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/OrderByLengthTest.java
  (with props)
    jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/OrderByLocalNameTest.java
  (with props)
    jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/OrderByLowerCaseTest.java
  (with props)
    jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/OrderByNameTest.java
  (with props)
    jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/OrderByUpperCaseTest.java
  (with props)
Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/LengthSortComparator.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/SearchIndex.java
    jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/AbstractOrderByTest.java
    jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/TestAll.java
    jackrabbit/trunk/jackrabbit-spi2jcr/pom.xml
    jackrabbit/trunk/pom.xml

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/LengthSortComparator.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/LengthSortComparator.java?rev=783337&r1=783336&r2=783337&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/LengthSortComparator.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/LengthSortComparator.java
Wed Jun 10 12:56:33 2009
@@ -22,6 +22,9 @@
 import org.apache.lucene.search.ScoreDocComparator;
 import org.apache.lucene.search.ScoreDoc;
 import org.apache.lucene.index.IndexReader;
+import org.apache.jackrabbit.spi.NameFactory;
+import org.apache.jackrabbit.spi.commons.name.NameFactoryImpl;
+import org.apache.jackrabbit.spi.commons.conversion.IllegalNameException;
 
 /**
  * <code>LengthSortComparator</code> implements a sort comparator source that
@@ -32,6 +35,15 @@
     private static final long serialVersionUID = 2513564768671391632L;
 
     /**
+     * The index internal namespace mappings.
+     */
+    private final NamespaceMappings nsMappings;
+
+    public LengthSortComparator(NamespaceMappings nsMappings) {
+        this.nsMappings = nsMappings;
+    }
+
+    /**
      * Creates a new comparator.
      *
      * @param reader    the current index reader.
@@ -44,7 +56,13 @@
     public ScoreDocComparator newComparator(IndexReader reader,
                                             String fieldname)
             throws IOException {
-        return new Comparator(reader, fieldname);
+        NameFactory factory = NameFactoryImpl.getInstance();
+        try {
+            return new Comparator(reader,
+                    nsMappings.translateName(factory.create(fieldname)));
+        } catch (IllegalNameException e) {
+            throw Util.createIOException(e);
+        }
     }
 
     private final class Comparator extends AbstractScoreDocComparator {
@@ -59,7 +77,7 @@
             super(reader);
             this.indexes = new SharedFieldCache.ValueIndex[readers.size()];
 
-            String namedLength = FieldNames.createNamedLength(propertyName, 0);
+            String namedLength = FieldNames.createNamedValue(propertyName, "");
             for (int i = 0; i < readers.size(); i++) {
                 IndexReader r = readers.get(i);
                 indexes[i] = SharedFieldCache.INSTANCE.getValueIndex(

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/SearchIndex.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/SearchIndex.java?rev=783337&r1=783336&r2=783337&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/SearchIndex.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/SearchIndex.java
Wed Jun 10 12:56:33 2009
@@ -1011,24 +1011,24 @@
                 public Object visit(LengthImpl node, Object data) throws Exception {
                     PropertyValueImpl propValue = (PropertyValueImpl) node.getPropertyValue();
                     return new SortField(propValue.getPropertyQName().toString(),
-                            new LengthSortComparator(),
+                            new LengthSortComparator(nsMappings),
                             !ordering.isAscending());
                 }
 
                 public Object visit(LowerCaseImpl node, Object data)
                         throws Exception {
-                    SortField sf = (SortField) super.visit(node, data);
+                    SortField sf = (SortField) ((DynamicOperandImpl) node.getOperand()).accept(this,
data);
                     return new SortField(sf.getField(),
                             new LowerCaseSortComparator(sf.getFactory()),
-                            sf.getReverse());
+                            !ordering.isAscending());
                 }
 
                 public Object visit(UpperCaseImpl node, Object data)
                         throws Exception {
-                    SortField sf = (SortField) super.visit(node, data);
+                    SortField sf = (SortField) ((DynamicOperandImpl) node.getOperand()).accept(this,
data);
                     return new SortField(sf.getField(),
                             new UpperCaseSortComparator(sf.getFactory()),
-                            sf.getReverse());
+                            !ordering.isAscending());
                 }
 
                 public Object visit(FullTextSearchScoreImpl node, Object data)

Modified: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/AbstractOrderByTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/AbstractOrderByTest.java?rev=783337&r1=783336&r2=783337&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/AbstractOrderByTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/AbstractOrderByTest.java
Wed Jun 10 12:56:33 2009
@@ -25,7 +25,7 @@
 import javax.jcr.query.qom.QueryObjectModel;
 import javax.jcr.query.qom.QueryObjectModelFactory;
 import javax.jcr.query.qom.Ordering;
-import javax.jcr.query.qom.PropertyValue;
+import javax.jcr.query.qom.DynamicOperand;
 
 import java.util.Calendar;
 import java.util.Collections;
@@ -41,12 +41,15 @@
     /** If <code>true</code> this repository supports sql queries */
     protected boolean checkSQL;
 
+    protected QueryObjectModelFactory qf;
+
     private String[] nodeNames;
 
     protected void setUp() throws Exception {
         super.setUp();
         checkSQL = isSupported(Repository.OPTION_QUERY_SQL_SUPPORTED);
         nodeNames = new String[]{nodeName1, nodeName2, nodeName3, nodeName4};
+        qf = superuser.getWorkspace().getQueryManager().getQOMFactory();
     }
 
     /**
@@ -113,20 +116,21 @@
     protected void checkOrder(String[] nodeNames) throws RepositoryException {
         // first check ascending
 
-        String sql = "SELECT " + escapeIdentifierForSQL(propertyName1) + " FROM " + escapeIdentifierForSQL(testNodeType)
+ " WHERE " +
-                    jcrPath + " LIKE '" + testRoot + "/%' ORDER BY " + escapeIdentifierForSQL(propertyName1);
-        String xpath = "/" + jcrRoot + testRoot + "/*[@jcr:primaryType='" + testNodeType
+ "'] order by @" + propertyName1;
+        String sql = createSQL();
+        String xpath = createXPath();
         Query q;
         QueryResult result;
-        if (checkSQL) {
+        if (sql != null) {
             q = superuser.getWorkspace().getQueryManager().createQuery(sql, Query.SQL);
             result = q.execute();
             checkResultOrder(result, nodeNames);
         }
 
-        q = superuser.getWorkspace().getQueryManager().createQuery(xpath, Query.XPATH);
-        result = q.execute();
-        checkResultOrder(result, nodeNames);
+        if (xpath != null) {
+            q = superuser.getWorkspace().getQueryManager().createQuery(xpath, Query.XPATH);
+            result = q.execute();
+            checkResultOrder(result, nodeNames);
+        }
 
         q = createQOM(true);
         result = q.execute();
@@ -135,15 +139,17 @@
         // then check descending
         Collections.reverse(Arrays.asList(nodeNames));
 
-        if (checkSQL) {
+        if (sql != null) {
             q = superuser.getWorkspace().getQueryManager().createQuery(sql + " DESC", Query.SQL);
             result = q.execute();
             checkResultOrder(result, nodeNames);
         }
 
-        q = superuser.getWorkspace().getQueryManager().createQuery(xpath + " descending",
Query.XPATH);
-        result = q.execute();
-        checkResultOrder(result, nodeNames);
+        if (xpath != null) {
+            q = superuser.getWorkspace().getQueryManager().createQuery(xpath + " descending",
Query.XPATH);
+            result = q.execute();
+            checkResultOrder(result, nodeNames);
+        }
 
         q = createQOM(false);
         result = q.execute();
@@ -170,15 +176,18 @@
         }
     }
 
+    /**
+     * @return a basic QOM to test order by queries.
+     * @throws RepositoryException if an error occurs.
+     */
     protected QueryObjectModel createQOM(boolean ascending)
             throws RepositoryException {
-        QueryObjectModelFactory qf = superuser.getWorkspace().getQueryManager().getQOMFactory();
-        PropertyValue pv = qf.propertyValue("s", propertyName1);
+        DynamicOperand op = createOrderingOperand();
         Ordering ordering;
         if (ascending) {
-            ordering = qf.ascending(pv);
+            ordering = qf.ascending(op);
         } else {
-            ordering = qf.descending(pv);
+            ordering = qf.descending(op);
         }
         return qf.createQuery(
                 qf.selector(testNodeType, "s"),
@@ -187,4 +196,43 @@
                 null
         );
     }
+
+    /**
+     * @return a dynamic operand that is used in the QOM created by
+     *         {@link #createQOM(boolean)}.
+     * @throws RepositoryException if an error occurs.
+     */
+    protected DynamicOperand createOrderingOperand()
+            throws RepositoryException {
+        return qf.propertyValue("s", propertyName1);
+    }
+
+    /**
+     * @return a basic SQL statement to test order by queries. Returns
+     *         <code>null</code> if SQL is not supported.
+     */
+    protected String createSQL() {
+        if (checkSQL) {
+            return "SELECT " + escapeIdentifierForSQL(propertyName1) +
+                    " FROM "+ escapeIdentifierForSQL(testNodeType) + " WHERE " +
+                    jcrPath + " LIKE '" + testRoot + "/%' ORDER BY " +
+                    escapeIdentifierForSQL(propertyName1);
+        } else {
+            return null;
+        }
+    }
+
+    /**
+     * @return a basic XPath statement to test order by queries. Returns
+     *         <code>null</code> is XPath is not supported.
+     * @throws RepositoryException if an error occurs.
+     */
+    protected String createXPath() throws RepositoryException {
+        List languages = Arrays.asList(superuser.getWorkspace().getQueryManager().getSupportedQueryLanguages());
+        if (languages.contains(Query.XPATH)) {
+            return "/" + jcrRoot + testRoot + "/*[@jcr:primaryType='" + testNodeType + "']
order by @" + propertyName1;
+        } else {
+            return null;
+        }
+    }
 }

Added: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/OrderByLengthTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/OrderByLengthTest.java?rev=783337&view=auto
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/OrderByLengthTest.java
(added)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/OrderByLengthTest.java
Wed Jun 10 12:56:33 2009
@@ -0,0 +1,50 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.test.api.query;
+
+import javax.jcr.RepositoryException;
+import javax.jcr.query.qom.QueryObjectModel;
+import javax.jcr.query.qom.QueryObjectModelFactory;
+import javax.jcr.query.qom.Ordering;
+import javax.jcr.query.qom.DynamicOperand;
+
+/**
+ * <code>OrderByLengthTest</code> contains test cases for order by queries on
+ * property lengths.
+ */
+public class OrderByLengthTest extends AbstractOrderByTest {
+
+    public void testLength() throws RepositoryException {
+        populate(new String[]{"abc", "d", "efgh", "ij"});
+        checkOrder(new String[]{nodeName2, nodeName4, nodeName1, nodeName3});
+    }
+
+    protected DynamicOperand createOrderingOperand()
+            throws RepositoryException {
+        return qf.length(qf.propertyValue("s", propertyName1));
+    }
+
+    protected String createSQL() {
+        // no SQL equivalent
+        return null;
+    }
+
+    protected String createXPath() throws RepositoryException {
+        // no SQL equivalent
+        return null;
+    }
+}

Propchange: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/OrderByLengthTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/OrderByLocalNameTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/OrderByLocalNameTest.java?rev=783337&view=auto
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/OrderByLocalNameTest.java
(added)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/OrderByLocalNameTest.java
Wed Jun 10 12:56:33 2009
@@ -0,0 +1,67 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.test.api.query;
+
+import java.util.Arrays;
+import java.util.Comparator;
+
+import javax.jcr.RepositoryException;
+import javax.jcr.query.qom.DynamicOperand;
+
+/**
+ * <code>OrderByLocalNameTest</code> contains test cases for order by queries
+ * on local node names.
+ */
+public class OrderByLocalNameTest extends AbstractOrderByTest {
+
+    public void testLocalName() throws RepositoryException {
+        populate(new String[]{"a", "a", "a", "a"}); // dummy values
+        String[] names = new String[]{nodeName1, nodeName2, nodeName3, nodeName4};
+        Arrays.sort(names, new Comparator() {
+            public int compare(Object o1, Object o2) {
+                String s1 = getLocalName((String) o1);
+                String s2 = getLocalName((String) o2);
+                return s1.compareTo(s2);
+            }
+        });
+        checkOrder(names);
+    }
+
+    protected DynamicOperand createOrderingOperand()
+            throws RepositoryException {
+        return qf.nodeLocalName("s");
+    }
+
+    protected String createSQL() {
+        // no SQL equivalent
+        return null;
+    }
+
+    protected String createXPath() throws RepositoryException {
+        // no SQL equivalent
+        return null;
+    }
+
+    private static String getLocalName(String name) {
+        int idx = name.indexOf(':');
+        if (idx != -1) {
+            return name.substring(idx + 1);
+        } else {
+            return name;
+        }
+    }
+}

Propchange: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/OrderByLocalNameTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/OrderByLowerCaseTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/OrderByLowerCaseTest.java?rev=783337&view=auto
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/OrderByLowerCaseTest.java
(added)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/OrderByLowerCaseTest.java
Wed Jun 10 12:56:33 2009
@@ -0,0 +1,47 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.test.api.query;
+
+import javax.jcr.RepositoryException;
+import javax.jcr.query.qom.DynamicOperand;
+
+/**
+ * <code>OrderByLowerCaseTest</code> contains test cases for order by queries
+ * on lower cased property values.
+ */
+public class OrderByLowerCaseTest extends AbstractOrderByTest {
+
+    public void testLowerCase() throws RepositoryException {
+        populate(new String[]{"a", "AB", "abc", "aBCd"});
+        checkOrder(new String[]{nodeName1, nodeName2, nodeName3, nodeName4});
+    }
+
+    protected DynamicOperand createOrderingOperand()
+            throws RepositoryException {
+        return qf.lowerCase(super.createOrderingOperand());
+    }
+
+    protected String createSQL() {
+        // no SQL equivalent
+        return null;
+    }
+
+    protected String createXPath() throws RepositoryException {
+        // no SQL equivalent
+        return null;
+    }
+}

Propchange: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/OrderByLowerCaseTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/OrderByNameTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/OrderByNameTest.java?rev=783337&view=auto
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/OrderByNameTest.java
(added)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/OrderByNameTest.java
Wed Jun 10 12:56:33 2009
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.test.api.query;
+
+import java.util.Arrays;
+
+import javax.jcr.RepositoryException;
+import javax.jcr.query.qom.DynamicOperand;
+
+/**
+ * <code>OrderByNameTest</code> contains test cases for order by queries on node
+ * names.
+ */
+public class OrderByNameTest extends AbstractOrderByTest {
+
+    public void testName() throws RepositoryException {
+        populate(new String[]{"a", "a", "a", "a"}); // dummy values
+        String[] names = new String[]{nodeName1, nodeName2, nodeName3, nodeName4};
+        Arrays.sort(names);
+        checkOrder(names);
+    }
+
+    protected DynamicOperand createOrderingOperand()
+            throws RepositoryException {
+        return qf.nodeName("s");
+    }
+
+    protected String createSQL() {
+        // no SQL equivalent
+        return null;
+    }
+
+    protected String createXPath() throws RepositoryException {
+        // no SQL equivalent
+        return null;
+    }
+}
\ No newline at end of file

Propchange: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/OrderByNameTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/OrderByUpperCaseTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/OrderByUpperCaseTest.java?rev=783337&view=auto
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/OrderByUpperCaseTest.java
(added)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/OrderByUpperCaseTest.java
Wed Jun 10 12:56:33 2009
@@ -0,0 +1,47 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.test.api.query;
+
+import javax.jcr.RepositoryException;
+import javax.jcr.query.qom.DynamicOperand;
+
+/**
+ * <code>OrderByUpperCaseTest</code> contains test cases for order by queries
+ * on upper cased property values.
+ */
+public class OrderByUpperCaseTest extends AbstractOrderByTest {
+
+    public void testLowerCase() throws RepositoryException {
+        populate(new String[]{"a", "AB", "abc", "aBCd"});
+        checkOrder(new String[]{nodeName1, nodeName2, nodeName3, nodeName4});
+    }
+
+    protected DynamicOperand createOrderingOperand()
+            throws RepositoryException {
+        return qf.upperCase(super.createOrderingOperand());
+    }
+
+    protected String createSQL() {
+        // no SQL equivalent
+        return null;
+    }
+
+    protected String createXPath() throws RepositoryException {
+        // no SQL equivalent
+        return null;
+    }
+}
\ No newline at end of file

Propchange: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/OrderByUpperCaseTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/TestAll.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/TestAll.java?rev=783337&r1=783336&r2=783337&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/TestAll.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/TestAll.java
Wed Jun 10 12:56:33 2009
@@ -68,6 +68,11 @@
         suite.addTestSuite(OrderByLongTest.class);
         suite.addTestSuite(OrderByMultiTypeTest.class);
         suite.addTestSuite(OrderByStringTest.class);
+        suite.addTestSuite(OrderByLengthTest.class);
+        suite.addTestSuite(OrderByLocalNameTest.class);
+        suite.addTestSuite(OrderByNameTest.class);
+        suite.addTestSuite(OrderByLowerCaseTest.class);
+        suite.addTestSuite(OrderByUpperCaseTest.class);
 
         return suite;
     }

Modified: jackrabbit/trunk/jackrabbit-spi2jcr/pom.xml
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi2jcr/pom.xml?rev=783337&r1=783336&r2=783337&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi2jcr/pom.xml (original)
+++ jackrabbit/trunk/jackrabbit-spi2jcr/pom.xml Wed Jun 10 12:56:33 2009
@@ -74,6 +74,11 @@
                 org.apache.jackrabbit.test.api.query.OrderByDoubleTest
                 org.apache.jackrabbit.test.api.query.OrderByLongTest
                 org.apache.jackrabbit.test.api.query.OrderByStringTest
+                org.apache.jackrabbit.test.api.query.OrderByLengthTest
+                org.apache.jackrabbit.test.api.query.OrderByLocalNameTest
+                org.apache.jackrabbit.test.api.query.OrderByLowerCaseTest
+                org.apache.jackrabbit.test.api.query.OrderByNameTest
+                org.apache.jackrabbit.test.api.query.OrderByUpperCaseTest
               </value>
             </property>
           </systemProperties>

Modified: jackrabbit/trunk/pom.xml
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/pom.xml?rev=783337&r1=783336&r2=783337&view=diff
==============================================================================
--- jackrabbit/trunk/pom.xml (original)
+++ jackrabbit/trunk/pom.xml Wed Jun 10 12:56:33 2009
@@ -43,7 +43,7 @@
     <module>jackrabbit-api</module>
     <module>jackrabbit-jcr-commons</module>
     <module>jackrabbit-jcr-tests</module>
-    <module>jackrabbit-core</module>
+    <!--module>jackrabbit-core</module-->
     <module>jackrabbit-text-extractors</module>
     <module>jackrabbit-webdav</module>
     <module>jackrabbit-jcr-server</module>
@@ -54,7 +54,7 @@
     <module>jackrabbit-jcr2spi</module>
     <module>jackrabbit-spi2jcr</module>
     <module>jackrabbit-spi2dav</module>
-    <module>jackrabbit-standalone</module>
+    <!--module>jackrabbit-standalone</module-->
   </modules>
 
   <scm>



Mime
View raw message