jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r770304 - /jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/query/qom/
Date Thu, 30 Apr 2009 15:59:35 GMT
Author: jukka
Date: Thu Apr 30 15:59:34 2009
New Revision: 770304

URL: http://svn.apache.org/viewvc?rev=770304&view=rev
Log:
JCR-2092: make spi query code compatible with JCR 2.0

Update jackrabbit-core to use JCR 2.0 interfaces instead of the SPI versions

Modified:
    jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/query/qom/AbstractJoinTest.java
    jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/query/qom/AbstractQOMTest.java
    jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/query/qom/BindVariableValueTest.java
    jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/query/qom/ChildNodeJoinConditionTest.java
    jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/query/qom/DescendantNodeJoinConditionTest.java
    jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/query/qom/EquiJoinConditionTest.java
    jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/query/qom/LengthTest.java
    jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/query/qom/NodeLocalNameTest.java
    jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/query/qom/NodeNameTest.java
    jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/query/qom/QueryObjectModelFactoryTest.java
    jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/query/qom/SameNodeJoinConditionTest.java
    jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/query/qom/UpperLowerCaseTest.java

Modified: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/query/qom/AbstractJoinTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/query/qom/AbstractJoinTest.java?rev=770304&r1=770303&r2=770304&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/query/qom/AbstractJoinTest.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/query/qom/AbstractJoinTest.java Thu Apr 30 15:59:34 2009
@@ -16,13 +16,12 @@
  */
 package org.apache.jackrabbit.api.jsr283.query.qom;
 
-import javax.jcr.query.QueryResult;
 import javax.jcr.Node;
 import javax.jcr.RepositoryException;
-
-import org.apache.jackrabbit.spi.commons.query.jsr283.qom.QueryObjectModel;
-import org.apache.jackrabbit.spi.commons.query.jsr283.qom.Constraint;
-import org.apache.jackrabbit.spi.commons.query.jsr283.qom.JoinCondition;
+import javax.jcr.query.QueryResult;
+import javax.jcr.query.qom.Constraint;
+import javax.jcr.query.qom.JoinCondition;
+import javax.jcr.query.qom.QueryObjectModel;
 
 /**
  * <code>AbstractJoinTest</code> provides utility methods for join related
@@ -52,20 +51,20 @@
         checkResult(result, SELECTOR_NAMES, nodes);
     }
 
-    protected QueryObjectModel createQuery(int joinType,
+    protected QueryObjectModel createQuery(String joinType,
                                            JoinCondition condition)
             throws RepositoryException {
         return createQuery(joinType, condition, null, null);
     }
 
-    protected QueryObjectModel createQuery(int joinType,
+    protected QueryObjectModel createQuery(String joinType,
                                            JoinCondition condition,
                                            Constraint left,
                                            Constraint right)
             throws RepositoryException {
         // only consider nodes under test root
         Constraint constraint;
-        if (joinType == JOIN_TYPE_LEFT_OUTER) {
+        if (JCR_JOIN_TYPE_LEFT_OUTER.equals(joinType)) {
             constraint = qomFactory.descendantNode(LEFT, testRoot);
         } else {
             constraint = qomFactory.descendantNode(RIGHT, testRoot);

Modified: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/query/qom/AbstractQOMTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/query/qom/AbstractQOMTest.java?rev=770304&r1=770303&r2=770304&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/query/qom/AbstractQOMTest.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/query/qom/AbstractQOMTest.java Thu Apr 30 15:59:34 2009
@@ -16,24 +16,23 @@
  */
 package org.apache.jackrabbit.api.jsr283.query.qom;
 
-import java.util.Set;
 import java.util.HashSet;
 import java.util.Iterator;
+import java.util.Set;
 
-import org.apache.jackrabbit.test.api.query.AbstractQueryTest;
-
-import org.apache.jackrabbit.spi.commons.query.jsr283.qom.QueryObjectModelFactory;
-import org.apache.jackrabbit.spi.commons.query.jsr283.qom.QueryObjectModelConstants;
-import org.apache.jackrabbit.core.query.QueryManagerImpl;
-import org.apache.jackrabbit.core.query.QueryImpl;
-import javax.jcr.query.Row;
-
+import javax.jcr.Node;
+import javax.jcr.RepositoryException;
+import javax.jcr.Value;
 import javax.jcr.query.Query;
 import javax.jcr.query.QueryResult;
+import javax.jcr.query.Row;
 import javax.jcr.query.RowIterator;
-import javax.jcr.RepositoryException;
-import javax.jcr.Value;
-import javax.jcr.Node;
+import javax.jcr.query.qom.QueryObjectModelConstants;
+import javax.jcr.query.qom.QueryObjectModelFactory;
+
+import org.apache.jackrabbit.core.query.QueryImpl;
+import org.apache.jackrabbit.core.query.QueryManagerImpl;
+import org.apache.jackrabbit.test.api.query.AbstractQueryTest;
 
 /**
  * <code>AbstractQOMTest</code> is a base class for test cases on the JQOM.

Modified: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/query/qom/BindVariableValueTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/query/qom/BindVariableValueTest.java?rev=770304&r1=770303&r2=770304&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/query/qom/BindVariableValueTest.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/query/qom/BindVariableValueTest.java Thu Apr 30 15:59:34 2009
@@ -51,7 +51,7 @@
                         qomFactory.childNode("s", testRoot),
                         qomFactory.comparison(
                                 qomFactory.propertyValue(propertyName1),
-                                OPERATOR_EQUAL_TO,
+                                JCR_OPERATOR_EQUAL_TO,
                                 qomFactory.bindVariable("v")
                         )
                 ), null, null);

Modified: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/query/qom/ChildNodeJoinConditionTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/query/qom/ChildNodeJoinConditionTest.java?rev=770304&r1=770303&r2=770304&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/query/qom/ChildNodeJoinConditionTest.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/query/qom/ChildNodeJoinConditionTest.java Thu Apr 30 15:59:34 2009
@@ -16,14 +16,13 @@
  */
 package org.apache.jackrabbit.api.jsr283.query.qom;
 
-import java.util.List;
 import java.util.ArrayList;
+import java.util.List;
 
-import javax.jcr.RepositoryException;
 import javax.jcr.Node;
-
-import org.apache.jackrabbit.spi.commons.query.jsr283.qom.JoinCondition;
-import org.apache.jackrabbit.spi.commons.query.jsr283.qom.QueryObjectModel;
+import javax.jcr.RepositoryException;
+import javax.jcr.query.qom.JoinCondition;
+import javax.jcr.query.qom.QueryObjectModel;
 
 /**
  * <code>ChildNodeJoinConditionTest</code> contains test cases that cover
@@ -45,19 +44,19 @@
 
     public void testInnerJoin() throws RepositoryException {
         JoinCondition c = qomFactory.childNodeJoinCondition(LEFT, RIGHT);
-        QueryObjectModel qom = createQuery(JOIN_TYPE_INNER, c);
+        QueryObjectModel qom = createQuery(JCR_JOIN_TYPE_INNER, c);
         checkResult(qom.execute(), new Node[][]{{n2, n1}});
     }
 
     public void testRightOuterJoin() throws RepositoryException {
         JoinCondition c = qomFactory.childNodeJoinCondition(LEFT, RIGHT);
-        QueryObjectModel qom = createQuery(JOIN_TYPE_RIGHT_OUTER, c);
+        QueryObjectModel qom = createQuery(JCR_JOIN_TYPE_RIGHT_OUTER, c);
         checkResult(qom.execute(), new Node[][]{{n2, n1}, {null, n2}});
     }
 
     public void testLeftOuterJoin() throws RepositoryException {
         JoinCondition c = qomFactory.childNodeJoinCondition(LEFT, RIGHT);
-        QueryObjectModel qom = createQuery(JOIN_TYPE_LEFT_OUTER, c);
+        QueryObjectModel qom = createQuery(JCR_JOIN_TYPE_LEFT_OUTER, c);
         List result = new ArrayList();
         result.add(new Node[]{n2, n1});
         if (testRootNode.isNodeType(testNodeType)) {

Modified: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/query/qom/DescendantNodeJoinConditionTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/query/qom/DescendantNodeJoinConditionTest.java?rev=770304&r1=770303&r2=770304&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/query/qom/DescendantNodeJoinConditionTest.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/query/qom/DescendantNodeJoinConditionTest.java Thu Apr 30 15:59:34 2009
@@ -16,14 +16,13 @@
  */
 package org.apache.jackrabbit.api.jsr283.query.qom;
 
-import java.util.List;
 import java.util.ArrayList;
+import java.util.List;
 
 import javax.jcr.Node;
 import javax.jcr.RepositoryException;
-
-import org.apache.jackrabbit.spi.commons.query.jsr283.qom.JoinCondition;
-import org.apache.jackrabbit.spi.commons.query.jsr283.qom.QueryObjectModel;
+import javax.jcr.query.qom.JoinCondition;
+import javax.jcr.query.qom.QueryObjectModel;
 
 /**
  * <code>DescendantNodeJoinConditionTest</code> contains test cases that cover
@@ -45,19 +44,19 @@
 
     public void testInnerJoin() throws RepositoryException {
         JoinCondition c = qomFactory.descendantNodeJoinCondition(LEFT, RIGHT);
-        QueryObjectModel qom = createQuery(JOIN_TYPE_INNER, c);
+        QueryObjectModel qom = createQuery(JCR_JOIN_TYPE_INNER, c);
         checkResult(qom.execute(), new Node[][]{{n2, n1}});
     }
 
     public void testRightOuterJoin() throws RepositoryException {
         JoinCondition c = qomFactory.descendantNodeJoinCondition(LEFT, RIGHT);
-        QueryObjectModel qom = createQuery(JOIN_TYPE_RIGHT_OUTER, c);
+        QueryObjectModel qom = createQuery(JCR_JOIN_TYPE_RIGHT_OUTER, c);
         checkResult(qom.execute(), new Node[][]{{n2, n1}, {null, n2}});
     }
 
     public void testLeftOuterJoin() throws RepositoryException {
         JoinCondition c = qomFactory.descendantNodeJoinCondition(LEFT, RIGHT);
-        QueryObjectModel qom = createQuery(JOIN_TYPE_LEFT_OUTER, c);
+        QueryObjectModel qom = createQuery(JCR_JOIN_TYPE_LEFT_OUTER, c);
         List result = new ArrayList();
         result.add(new Node[]{n2, n1});
         // for each ancestor-or-self of testRootNode check

Modified: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/query/qom/EquiJoinConditionTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/query/qom/EquiJoinConditionTest.java?rev=770304&r1=770303&r2=770304&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/query/qom/EquiJoinConditionTest.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/query/qom/EquiJoinConditionTest.java Thu Apr 30 15:59:34 2009
@@ -18,9 +18,8 @@
 
 import javax.jcr.Node;
 import javax.jcr.RepositoryException;
-
-import org.apache.jackrabbit.spi.commons.query.jsr283.qom.QueryObjectModel;
-import org.apache.jackrabbit.spi.commons.query.jsr283.qom.JoinCondition;
+import javax.jcr.query.qom.JoinCondition;
+import javax.jcr.query.qom.QueryObjectModel;
 
 /**
  * <code>EquiJoinConditionTest</code> contains test cases that cover
@@ -48,35 +47,35 @@
     public void testInnerJoin1() throws RepositoryException {
         JoinCondition c = qomFactory.equiJoinCondition(
                 LEFT, propertyName1, RIGHT, propertyName2);
-        QueryObjectModel qom = createQuery(JOIN_TYPE_INNER, c);
+        QueryObjectModel qom = createQuery(JCR_JOIN_TYPE_INNER, c);
         checkResult(qom.execute(), new Node[][]{{n1, n2}, {n2, n2}});
     }
 
     public void testInnerJoin2() throws RepositoryException {
         JoinCondition c = qomFactory.equiJoinCondition(
                 LEFT, propertyName2, RIGHT, propertyName1);
-        QueryObjectModel qom = createQuery(JOIN_TYPE_INNER, c);
+        QueryObjectModel qom = createQuery(JCR_JOIN_TYPE_INNER, c);
         checkResult(qom.execute(), new Node[][]{{n2, n1}, {n2, n2}});
     }
 
     public void testRightOuterJoin1() throws RepositoryException {
         JoinCondition c = qomFactory.equiJoinCondition(
                 LEFT, propertyName1, RIGHT, propertyName2);
-        QueryObjectModel qom = createQuery(JOIN_TYPE_RIGHT_OUTER, c);
+        QueryObjectModel qom = createQuery(JCR_JOIN_TYPE_RIGHT_OUTER, c);
         checkResult(qom.execute(), new Node[][]{{null, n1}, {n1, n2}, {n2, n2}});
     }
 
     public void testRightOuterJoin2() throws RepositoryException {
         JoinCondition c = qomFactory.equiJoinCondition(
                 LEFT, propertyName2, RIGHT, propertyName1);
-        QueryObjectModel qom = createQuery(JOIN_TYPE_RIGHT_OUTER, c);
+        QueryObjectModel qom = createQuery(JCR_JOIN_TYPE_RIGHT_OUTER, c);
         checkResult(qom.execute(), new Node[][]{{n2, n1}, {n2, n2}});
     }
 
     public void testLeftOuterJoin1() throws RepositoryException {
         JoinCondition c = qomFactory.equiJoinCondition(
                 LEFT, propertyName1, RIGHT, propertyName2);
-        QueryObjectModel qom = createQuery(JOIN_TYPE_LEFT_OUTER, c);
+        QueryObjectModel qom = createQuery(JCR_JOIN_TYPE_LEFT_OUTER, c);
         checkResult(qom.execute(), new Node[][]{{n1, n2}, {n2, n2}});
     }
 
@@ -84,7 +83,7 @@
     public void testLeftOuterJoin2() throws RepositoryException {
         JoinCondition c = qomFactory.equiJoinCondition(
                 LEFT, propertyName2, RIGHT, propertyName1);
-        QueryObjectModel qom = createQuery(JOIN_TYPE_LEFT_OUTER, c);
+        QueryObjectModel qom = createQuery(JCR_JOIN_TYPE_LEFT_OUTER, c);
         checkResult(qom.execute(), new Node[][]{{n1, null}, {n2, n1}, {n2, n2}});
     }
 }

Modified: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/query/qom/LengthTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/query/qom/LengthTest.java?rev=770304&r1=770303&r2=770304&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/query/qom/LengthTest.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/query/qom/LengthTest.java Thu Apr 30 15:59:34 2009
@@ -130,7 +130,7 @@
         node.save();
 
         String length = String.valueOf(node.getProperty(propertyName1).getLength());
-        executeQuery(propertyName1, OPERATOR_EQUAL_TO, vf.createValue(length));
+        executeQuery(propertyName1, JCR_OPERATOR_EQUAL_TO, vf.createValue(length));
     }
 
     public void testLengthBinaryLiteral() throws RepositoryException {
@@ -139,7 +139,7 @@
 
         String length = String.valueOf(node.getProperty(propertyName1).getLength());
         InputStream in = new ByteArrayInputStream(length.getBytes());
-        executeQuery(propertyName1, OPERATOR_EQUAL_TO, vf.createValue(in));
+        executeQuery(propertyName1, JCR_OPERATOR_EQUAL_TO, vf.createValue(in));
     }
 
     public void testLengthDoubleLiteral() throws RepositoryException {
@@ -147,7 +147,7 @@
         node.save();
 
         double length = node.getProperty(propertyName1).getLength();
-        executeQuery(propertyName1, OPERATOR_EQUAL_TO, vf.createValue(length));
+        executeQuery(propertyName1, JCR_OPERATOR_EQUAL_TO, vf.createValue(length));
     }
 
     public void testLengthDateLiteral() throws RepositoryException {

Modified: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/query/qom/NodeLocalNameTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/query/qom/NodeLocalNameTest.java?rev=770304&r1=770303&r2=770304&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/query/qom/NodeLocalNameTest.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/query/qom/NodeLocalNameTest.java Thu Apr 30 15:59:34 2009
@@ -53,32 +53,32 @@
 
     public void testStringLiteral() throws RepositoryException {
         Value literal = superuser.getValueFactory().createValue(nodeLocalName);
-        Query q = createQuery(OPERATOR_EQUAL_TO, literal);
+        Query q = createQuery(JCR_OPERATOR_EQUAL_TO, literal);
         checkResult(q.execute(), new Node[]{node1});
     }
 
     public void testStringLiteralInvalidName() throws RepositoryException {
         Value literal = superuser.getValueFactory().createValue("[" + nodeLocalName);
-        Query q = createQuery(OPERATOR_EQUAL_TO, literal);
+        Query q = createQuery(JCR_OPERATOR_EQUAL_TO, literal);
         checkResult(q.execute(), new Node[]{});
     }
 
     public void testBinaryLiteral() throws RepositoryException {
         Value literal = superuser.getValueFactory().createValue(
                 nodeLocalName, PropertyType.BINARY);
-        Query q = createQuery(OPERATOR_EQUAL_TO, literal);
+        Query q = createQuery(JCR_OPERATOR_EQUAL_TO, literal);
         checkResult(q.execute(), new Node[]{node1});
     }
 
     public void testDateLiteral() throws RepositoryException {
         Value literal = superuser.getValueFactory().createValue(Calendar.getInstance());
-        Query q = createQuery(OPERATOR_EQUAL_TO, literal);
+        Query q = createQuery(JCR_OPERATOR_EQUAL_TO, literal);
         checkResult(q.execute(), new Node[]{});
     }
 
     public void testDoubleLiteral() throws RepositoryException {
         Value literal = superuser.getValueFactory().createValue(Math.PI);
-        Query q = createQuery(OPERATOR_EQUAL_TO, literal);
+        Query q = createQuery(JCR_OPERATOR_EQUAL_TO, literal);
         checkResult(q.execute(), new Node[]{});
     }
 
@@ -88,37 +88,37 @@
 
     public void testLongLiteral() throws RepositoryException {
         Value literal = superuser.getValueFactory().createValue(283);
-        Query q = createQuery(OPERATOR_EQUAL_TO, literal);
+        Query q = createQuery(JCR_OPERATOR_EQUAL_TO, literal);
         checkResult(q.execute(), new Node[]{});
     }
 
     public void testBooleanLiteral() throws RepositoryException {
         Value literal = superuser.getValueFactory().createValue(true);
-        Query q = createQuery(OPERATOR_EQUAL_TO, literal);
+        Query q = createQuery(JCR_OPERATOR_EQUAL_TO, literal);
         checkResult(q.execute(), new Node[]{});
     }
 
     public void testNameLiteral() throws RepositoryException {
         Value literal = superuser.getValueFactory().createValue(
                 nodeLocalName, PropertyType.NAME);
-        Query q = createQuery(OPERATOR_EQUAL_TO, literal);
+        Query q = createQuery(JCR_OPERATOR_EQUAL_TO, literal);
         checkResult(q.execute(), new Node[]{node1});
     }
 
     public void testPathLiteral() throws RepositoryException {
         Value literal = superuser.getValueFactory().createValue(
                 nodeLocalName, PropertyType.PATH);
-        Query q = createQuery(OPERATOR_EQUAL_TO, literal);
+        Query q = createQuery(JCR_OPERATOR_EQUAL_TO, literal);
         checkResult(q.execute(), new Node[]{node1});
 
         literal = superuser.getValueFactory().createValue(
                 node1.getPath(), PropertyType.PATH);
-        q = createQuery(OPERATOR_EQUAL_TO, literal);
+        q = createQuery(JCR_OPERATOR_EQUAL_TO, literal);
         checkResult(q.execute(), new Node[]{});
 
         literal = superuser.getValueFactory().createValue(
                 nodeName1 + "/" + nodeName1, PropertyType.PATH);
-        q = createQuery(OPERATOR_EQUAL_TO, literal);
+        q = createQuery(JCR_OPERATOR_EQUAL_TO, literal);
         checkResult(q.execute(), new Node[]{});
     }
 
@@ -128,7 +128,7 @@
         }
         node1.save();
         Value literal = superuser.getValueFactory().createValue(node1);
-        Query q = createQuery(OPERATOR_EQUAL_TO, literal);
+        Query q = createQuery(JCR_OPERATOR_EQUAL_TO, literal);
         checkResult(q.execute(), new Node[]{});
     }
 
@@ -141,36 +141,36 @@
     }
 
     public void testEqualTo() throws RepositoryException {
-        checkOperator(OPERATOR_EQUAL_TO, false, true, false);
+        checkOperator(JCR_OPERATOR_EQUAL_TO, false, true, false);
     }
 
     public void testGreaterThan() throws RepositoryException {
-        checkOperator(OPERATOR_GREATER_THAN, true, false, false);
+        checkOperator(JCR_OPERATOR_GREATER_THAN, true, false, false);
     }
 
     public void testGreaterThanOrEqualTo() throws RepositoryException {
-        checkOperator(OPERATOR_GREATER_THAN_OR_EQUAL_TO, true, true, false);
+        checkOperator(JCR_OPERATOR_GREATER_THAN_OR_EQUAL_TO, true, true, false);
     }
 
     public void testLessThan() throws RepositoryException {
-        checkOperator(OPERATOR_LESS_THAN, false, false, true);
+        checkOperator(JCR_OPERATOR_LESS_THAN, false, false, true);
     }
 
     public void testLessThanOrEqualTo() throws RepositoryException {
-        checkOperator(OPERATOR_LESS_THAN_OR_EQUAL_TO, false, true, true);
+        checkOperator(JCR_OPERATOR_LESS_THAN_OR_EQUAL_TO, false, true, true);
     }
 
     public void testLike() throws RepositoryException {
-        checkOperator(OPERATOR_LIKE, false, true, false);
+        checkOperator(JCR_OPERATOR_LIKE, false, true, false);
     }
 
     public void testNotEqualTo() throws RepositoryException {
-        checkOperator(OPERATOR_NOT_EQUAL_TO, true, false, true);
+        checkOperator(JCR_OPERATOR_NOT_EQUAL_TO, true, false, true);
     }
 
     //------------------------------< helper >----------------------------------
 
-    private void checkOperator(int operator,
+    private void checkOperator(String operator,
                                boolean matchesLesser,
                                boolean matchesEqual,
                                boolean matchesGreater)
@@ -181,7 +181,7 @@
     }
 
     private void checkOperatorSingleLiteral(String literal,
-                                            int operator,
+                                            String operator,
                                             boolean matches)
             throws RepositoryException {
         Value value = superuser.getValueFactory().createValue(literal);
@@ -201,7 +201,8 @@
         return tmp.toString();
     }
 
-    private Query createQuery(int operator, Value literal) throws RepositoryException {
+    private Query createQuery(String operator, Value literal)
+            throws RepositoryException {
         return qomFactory.createQuery(
                 qomFactory.selector(testNodeType, "s"),
                 qomFactory.and(

Modified: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/query/qom/NodeNameTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/query/qom/NodeNameTest.java?rev=770304&r1=770303&r2=770304&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/query/qom/NodeNameTest.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/query/qom/NodeNameTest.java Thu Apr 30 15:59:34 2009
@@ -45,14 +45,14 @@
 
     public void testStringLiteral() throws RepositoryException {
         Value literal = superuser.getValueFactory().createValue(nodeName1);
-        Query q = createQuery(OPERATOR_EQUAL_TO, literal);
+        Query q = createQuery(JCR_OPERATOR_EQUAL_TO, literal);
         checkResult(q.execute(), new Node[]{node1});
     }
 
     public void testStringLiteralInvalidName() throws RepositoryException {
         Value literal = superuser.getValueFactory().createValue("[" + nodeName1);
         try {
-            createQuery(OPERATOR_EQUAL_TO, literal).execute();
+            createQuery(JCR_OPERATOR_EQUAL_TO, literal).execute();
             fail("NodeName comparison with STRING that cannot be converted to NAME must fail with InvalidQueryException");
         } catch (InvalidQueryException e) {
             // expected
@@ -62,14 +62,14 @@
     public void testBinaryLiteral() throws RepositoryException {
         Value literal = superuser.getValueFactory().createValue(
                 nodeName1, PropertyType.BINARY);
-        Query q = createQuery(OPERATOR_EQUAL_TO, literal);
+        Query q = createQuery(JCR_OPERATOR_EQUAL_TO, literal);
         checkResult(q.execute(), new Node[]{node1});
     }
 
     public void testDateLiteral() throws RepositoryException {
         Value literal = superuser.getValueFactory().createValue(Calendar.getInstance());
         try {
-            createQuery(OPERATOR_EQUAL_TO, literal).execute();
+            createQuery(JCR_OPERATOR_EQUAL_TO, literal).execute();
             fail("NodeName comparison with DATE must fail with InvalidQueryException");
         } catch (InvalidQueryException e) {
             // expected
@@ -79,7 +79,7 @@
     public void testDoubleLiteral() throws RepositoryException {
         Value literal = superuser.getValueFactory().createValue(Math.PI);
         try {
-            createQuery(OPERATOR_EQUAL_TO, literal).execute();
+            createQuery(JCR_OPERATOR_EQUAL_TO, literal).execute();
             fail("NodeName comparison with DOUBLE must fail with InvalidQueryException");
         } catch (InvalidQueryException e) {
             // expected
@@ -93,7 +93,7 @@
     public void testLongLiteral() throws RepositoryException {
         Value literal = superuser.getValueFactory().createValue(283);
         try {
-            createQuery(OPERATOR_EQUAL_TO, literal).execute();
+            createQuery(JCR_OPERATOR_EQUAL_TO, literal).execute();
             fail("NodeName comparison with LONG must fail with InvalidQueryException");
         } catch (InvalidQueryException e) {
             // expected
@@ -103,7 +103,7 @@
     public void testBooleanLiteral() throws RepositoryException {
         Value literal = superuser.getValueFactory().createValue(true);
         try {
-            createQuery(OPERATOR_EQUAL_TO, literal).execute();
+            createQuery(JCR_OPERATOR_EQUAL_TO, literal).execute();
             fail("NodeName comparison with BOOLEAN must fail with InvalidQueryException");
         } catch (InvalidQueryException e) {
             // expected
@@ -113,20 +113,20 @@
     public void testNameLiteral() throws RepositoryException {
         Value literal = superuser.getValueFactory().createValue(
                 nodeName1, PropertyType.NAME);
-        Query q = createQuery(OPERATOR_EQUAL_TO, literal);
+        Query q = createQuery(JCR_OPERATOR_EQUAL_TO, literal);
         checkResult(q.execute(), new Node[]{node1});
     }
 
     public void testPathLiteral() throws RepositoryException {
         Value literal = superuser.getValueFactory().createValue(
                 nodeName1, PropertyType.PATH);
-        Query q = createQuery(OPERATOR_EQUAL_TO, literal);
+        Query q = createQuery(JCR_OPERATOR_EQUAL_TO, literal);
         checkResult(q.execute(), new Node[]{node1});
 
         literal = superuser.getValueFactory().createValue(
                 node1.getPath(), PropertyType.PATH);
         try {
-            createQuery(OPERATOR_EQUAL_TO, literal).execute();
+            createQuery(JCR_OPERATOR_EQUAL_TO, literal).execute();
             fail("NodeName comparison with absolute PATH must fail with InvalidQueryException");
         } catch (InvalidQueryException e) {
             // expected
@@ -135,7 +135,7 @@
         literal = superuser.getValueFactory().createValue(
                 nodeName1 + "/" + nodeName1, PropertyType.PATH);
         try {
-            createQuery(OPERATOR_EQUAL_TO, literal).execute();
+            createQuery(JCR_OPERATOR_EQUAL_TO, literal).execute();
             fail("NodeName comparison with PATH length >1 must fail with InvalidQueryException");
         } catch (InvalidQueryException e) {
             // expected
@@ -149,7 +149,7 @@
         node1.save();
         Value literal = superuser.getValueFactory().createValue(node1);
         try {
-            createQuery(OPERATOR_EQUAL_TO, literal).execute();
+            createQuery(JCR_OPERATOR_EQUAL_TO, literal).execute();
             fail("NodeName comparison with REFERENCE must fail with InvalidQueryException");
         } catch (InvalidQueryException e) {
             // expected
@@ -174,16 +174,16 @@
     }
 
     public void testEqualTo() throws RepositoryException {
-        checkOperator(OPERATOR_EQUAL_TO, false, true, false);
+        checkOperator(JCR_OPERATOR_EQUAL_TO, false, true, false);
     }
 
     public void testNotEqualTo() throws RepositoryException {
-        checkOperator(OPERATOR_NOT_EQUAL_TO, true, false, true);
+        checkOperator(JCR_OPERATOR_NOT_EQUAL_TO, true, false, true);
     }
 
     //------------------------------< helper >----------------------------------
 
-    private void checkOperator(int operator,
+    private void checkOperator(String operator,
                                boolean matchesLesser,
                                boolean matchesEqual,
                                boolean matchesGreater)
@@ -194,7 +194,7 @@
     }
 
     private void checkOperatorSingleLiteral(String literal,
-                                            int operator,
+                                            String operator,
                                             boolean matches)
             throws RepositoryException {
         Value value = superuser.getValueFactory().createValue(literal);
@@ -214,7 +214,7 @@
         return tmp.toString();
     }
 
-    private Query createQuery(int operator, Value literal) throws RepositoryException {
+    private Query createQuery(String operator, Value literal) throws RepositoryException {
         return qomFactory.createQuery(
                 qomFactory.selector(testNodeType, "s"),
                 qomFactory.and(

Modified: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/query/qom/QueryObjectModelFactoryTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/query/qom/QueryObjectModelFactoryTest.java?rev=770304&r1=770303&r2=770304&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/query/qom/QueryObjectModelFactoryTest.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/query/qom/QueryObjectModelFactoryTest.java Thu Apr 30 15:59:34 2009
@@ -16,44 +16,44 @@
  */
 package org.apache.jackrabbit.api.jsr283.query.qom;
 
-import org.apache.jackrabbit.spi.commons.query.jsr283.qom.And;
-import org.apache.jackrabbit.spi.commons.query.jsr283.qom.PropertyExistence;
-import org.apache.jackrabbit.spi.commons.query.jsr283.qom.PropertyValue;
-import org.apache.jackrabbit.spi.commons.query.jsr283.qom.Ordering;
-import org.apache.jackrabbit.spi.commons.query.jsr283.qom.QueryObjectModelConstants;
-import org.apache.jackrabbit.spi.commons.query.jsr283.qom.BindVariableValue;
-import org.apache.jackrabbit.spi.commons.query.jsr283.qom.ChildNode;
-import org.apache.jackrabbit.spi.commons.query.jsr283.qom.ChildNodeJoinCondition;
-import org.apache.jackrabbit.spi.commons.query.jsr283.qom.Column;
-import org.apache.jackrabbit.spi.commons.query.jsr283.qom.Comparison;
-import org.apache.jackrabbit.spi.commons.query.jsr283.qom.DescendantNode;
-import org.apache.jackrabbit.spi.commons.query.jsr283.qom.DescendantNodeJoinCondition;
-import org.apache.jackrabbit.spi.commons.query.jsr283.qom.EquiJoinCondition;
-import org.apache.jackrabbit.spi.commons.query.jsr283.qom.FullTextSearch;
-import org.apache.jackrabbit.spi.commons.query.jsr283.qom.FullTextSearchScore;
-import org.apache.jackrabbit.spi.commons.query.jsr283.qom.Join;
-import org.apache.jackrabbit.spi.commons.query.jsr283.qom.Selector;
-import org.apache.jackrabbit.spi.commons.query.jsr283.qom.JoinCondition;
-import org.apache.jackrabbit.spi.commons.query.jsr283.qom.Length;
-import org.apache.jackrabbit.spi.commons.query.jsr283.qom.LowerCase;
-import org.apache.jackrabbit.spi.commons.query.jsr283.qom.NodeLocalName;
-import org.apache.jackrabbit.spi.commons.query.jsr283.qom.NodeName;
-import org.apache.jackrabbit.spi.commons.query.jsr283.qom.Not;
-import org.apache.jackrabbit.spi.commons.query.jsr283.qom.Or;
-import org.apache.jackrabbit.spi.commons.query.jsr283.qom.SameNode;
-import org.apache.jackrabbit.spi.commons.query.jsr283.qom.SameNodeJoinCondition;
-import org.apache.jackrabbit.spi.commons.query.jsr283.qom.UpperCase;
-import org.apache.jackrabbit.spi.commons.query.jsr283.qom.QueryObjectModelFactory;
-import org.apache.jackrabbit.spi.commons.query.jsr283.qom.Constraint;
-import org.apache.jackrabbit.spi.commons.query.jsr283.qom.DynamicOperand;
-import org.apache.jackrabbit.spi.commons.query.jsr283.qom.StaticOperand;
-import org.apache.jackrabbit.spi.commons.query.jsr283.qom.Source;
-import org.apache.jackrabbit.spi.commons.query.jsr283.qom.QueryObjectModel;
-
-import javax.jcr.RepositoryException;
-import java.util.Set;
 import java.util.HashSet;
 import java.util.Iterator;
+import java.util.Set;
+
+import javax.jcr.RepositoryException;
+import javax.jcr.query.qom.And;
+import javax.jcr.query.qom.BindVariableValue;
+import javax.jcr.query.qom.ChildNode;
+import javax.jcr.query.qom.ChildNodeJoinCondition;
+import javax.jcr.query.qom.Column;
+import javax.jcr.query.qom.Comparison;
+import javax.jcr.query.qom.Constraint;
+import javax.jcr.query.qom.DescendantNode;
+import javax.jcr.query.qom.DescendantNodeJoinCondition;
+import javax.jcr.query.qom.DynamicOperand;
+import javax.jcr.query.qom.EquiJoinCondition;
+import javax.jcr.query.qom.FullTextSearch;
+import javax.jcr.query.qom.FullTextSearchScore;
+import javax.jcr.query.qom.Join;
+import javax.jcr.query.qom.JoinCondition;
+import javax.jcr.query.qom.Length;
+import javax.jcr.query.qom.LowerCase;
+import javax.jcr.query.qom.NodeLocalName;
+import javax.jcr.query.qom.NodeName;
+import javax.jcr.query.qom.Not;
+import javax.jcr.query.qom.Or;
+import javax.jcr.query.qom.Ordering;
+import javax.jcr.query.qom.PropertyExistence;
+import javax.jcr.query.qom.PropertyValue;
+import javax.jcr.query.qom.QueryObjectModel;
+import javax.jcr.query.qom.QueryObjectModelConstants;
+import javax.jcr.query.qom.QueryObjectModelFactory;
+import javax.jcr.query.qom.SameNode;
+import javax.jcr.query.qom.SameNodeJoinCondition;
+import javax.jcr.query.qom.Selector;
+import javax.jcr.query.qom.Source;
+import javax.jcr.query.qom.StaticOperand;
+import javax.jcr.query.qom.UpperCase;
 
 /**
  * <code>QueryObjectModelFactoryTest</code> tests all methods on the
@@ -97,17 +97,17 @@
     private static final Set JOIN_TYPES = new HashSet();
 
     static {
-        OPERATORS.add(new Integer(QueryObjectModelConstants.OPERATOR_EQUAL_TO));
-        OPERATORS.add(new Integer(QueryObjectModelConstants.OPERATOR_GREATER_THAN));
-        OPERATORS.add(new Integer(QueryObjectModelConstants.OPERATOR_GREATER_THAN_OR_EQUAL_TO));
-        OPERATORS.add(new Integer(QueryObjectModelConstants.OPERATOR_LESS_THAN));
-        OPERATORS.add(new Integer(QueryObjectModelConstants.OPERATOR_LESS_THAN_OR_EQUAL_TO));
-        OPERATORS.add(new Integer(QueryObjectModelConstants.OPERATOR_LIKE));
-        OPERATORS.add(new Integer(QueryObjectModelConstants.OPERATOR_NOT_EQUAL_TO));
-
-        JOIN_TYPES.add(new Integer(QueryObjectModelConstants.JOIN_TYPE_INNER));
-        JOIN_TYPES.add(new Integer(QueryObjectModelConstants.JOIN_TYPE_LEFT_OUTER));
-        JOIN_TYPES.add(new Integer(QueryObjectModelConstants.JOIN_TYPE_RIGHT_OUTER));
+        OPERATORS.add(new Integer(QueryObjectModelConstants.JCR_OPERATOR_EQUAL_TO));
+        OPERATORS.add(new Integer(QueryObjectModelConstants.JCR_OPERATOR_GREATER_THAN));
+        OPERATORS.add(new Integer(QueryObjectModelConstants.JCR_OPERATOR_GREATER_THAN_OR_EQUAL_TO));
+        OPERATORS.add(new Integer(QueryObjectModelConstants.JCR_OPERATOR_LESS_THAN));
+        OPERATORS.add(new Integer(QueryObjectModelConstants.JCR_OPERATOR_LESS_THAN_OR_EQUAL_TO));
+        OPERATORS.add(new Integer(QueryObjectModelConstants.JCR_OPERATOR_LIKE));
+        OPERATORS.add(new Integer(QueryObjectModelConstants.JCR_OPERATOR_NOT_EQUAL_TO));
+
+        JOIN_TYPES.add(new Integer(QueryObjectModelConstants.JCR_JOIN_TYPE_INNER));
+        JOIN_TYPES.add(new Integer(QueryObjectModelConstants.JCR_JOIN_TYPE_LEFT_OUTER));
+        JOIN_TYPES.add(new Integer(QueryObjectModelConstants.JCR_JOIN_TYPE_RIGHT_OUTER));
     }
 
     /**
@@ -130,7 +130,7 @@
         PropertyValue op = qomFactory.propertyValue(propertyName1);
         Ordering asc = qomFactory.ascending(op);
         assertEquals("Ordering.getOrder() must return QueryObjectModelConstants.ORDER_ASCENDING",
-                QueryObjectModelConstants.ORDER_ASCENDING, asc.getOrder());
+                QueryObjectModelConstants.JCR_ORDER_ASCENDING, asc.getOrder());
         assertTrue("Not a PropertyValue operand", asc.getOperand() instanceof PropertyValue);
     }
 

Modified: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/query/qom/SameNodeJoinConditionTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/query/qom/SameNodeJoinConditionTest.java?rev=770304&r1=770303&r2=770304&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/query/qom/SameNodeJoinConditionTest.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/query/qom/SameNodeJoinConditionTest.java Thu Apr 30 15:59:34 2009
@@ -16,12 +16,11 @@
  */
 package org.apache.jackrabbit.api.jsr283.query.qom;
 
-import javax.jcr.RepositoryException;
 import javax.jcr.Node;
+import javax.jcr.RepositoryException;
 import javax.jcr.query.QueryResult;
-
-import org.apache.jackrabbit.spi.commons.query.jsr283.qom.QueryObjectModel;
-import org.apache.jackrabbit.spi.commons.query.jsr283.qom.JoinCondition;
+import javax.jcr.query.qom.JoinCondition;
+import javax.jcr.query.qom.QueryObjectModel;
 
 /**
  * <code>SameNodeJoinConditionTest</code> contains test cases that cover
@@ -42,13 +41,13 @@
     }
 
     public void testInnerJoin() throws RepositoryException {
-        QueryObjectModel qom = createQuery(JOIN_TYPE_INNER, (String) null);
+        QueryObjectModel qom = createQueryX(JCR_JOIN_TYPE_INNER, (String) null);
         QueryResult result = qom.execute();
         checkResult(result, new Node[][]{{n1, n1}, {n2, n2}});
     }
 
     public void testInnerJoinWithPath() throws RepositoryException {
-        QueryObjectModel qom = createQuery(JOIN_TYPE_INNER, nodeName2);
+        QueryObjectModel qom = createQueryX(JCR_JOIN_TYPE_INNER, nodeName2);
         QueryResult result = qom.execute();
         checkResult(result, new Node[][]{{n2, n1}});
     }
@@ -58,7 +57,7 @@
                qomFactory.join(
                         qomFactory.selector(testNodeType, LEFT),
                         qomFactory.selector(mixReferenceable, RIGHT),
-                        JOIN_TYPE_LEFT_OUTER,
+                        JCR_JOIN_TYPE_LEFT_OUTER,
                         qomFactory.sameNodeJoinCondition(LEFT, RIGHT)
                 ),
                qomFactory.descendantNode(LEFT, testRoot),
@@ -69,7 +68,7 @@
     }
 
     public void testLeftOuterJoinWithPath() throws RepositoryException {
-        QueryObjectModel qom = createQuery(JOIN_TYPE_LEFT_OUTER, nodeName2);
+        QueryObjectModel qom = createQueryX(JCR_JOIN_TYPE_LEFT_OUTER, nodeName2);
         QueryResult result = qom.execute();
         checkResult(result, new Node[][]{{n1, null}, {n2, n1}});
     }
@@ -79,7 +78,7 @@
                 qomFactory.join(
                          qomFactory.selector(mixReferenceable, LEFT),
                          qomFactory.selector(testNodeType, RIGHT),
-                         JOIN_TYPE_RIGHT_OUTER,
+                         JCR_JOIN_TYPE_RIGHT_OUTER,
                          qomFactory.sameNodeJoinCondition(LEFT, RIGHT)
                  ),
                 qomFactory.descendantNode(RIGHT, testRoot),
@@ -94,7 +93,7 @@
                 qomFactory.join(
                          qomFactory.selector(mixReferenceable, LEFT),
                          qomFactory.selector(testNodeType, RIGHT),
-                         JOIN_TYPE_RIGHT_OUTER,
+                         JCR_JOIN_TYPE_RIGHT_OUTER,
                          qomFactory.sameNodeJoinCondition(LEFT, RIGHT, nodeName2)
                  ),
                 qomFactory.descendantNode(RIGHT, testRoot),
@@ -106,7 +105,7 @@
 
     //-----------------------------< utilities >--------------------------------
 
-    private QueryObjectModel createQuery(int joinType, String relPath)
+    private QueryObjectModel createQueryX(String joinType, String relPath)
             throws RepositoryException {
         JoinCondition c;
         if (relPath != null) {

Modified: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/query/qom/UpperLowerCaseTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/query/qom/UpperLowerCaseTest.java?rev=770304&r1=770303&r2=770304&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/query/qom/UpperLowerCaseTest.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/query/qom/UpperLowerCaseTest.java Thu Apr 30 15:59:34 2009
@@ -16,14 +16,13 @@
  */
 package org.apache.jackrabbit.api.jsr283.query.qom;
 
-import org.apache.jackrabbit.spi.commons.query.jsr283.qom.DynamicOperand;
-
+import javax.jcr.Node;
+import javax.jcr.PropertyType;
 import javax.jcr.RepositoryException;
 import javax.jcr.Value;
-import javax.jcr.Node;
 import javax.jcr.ValueFactory;
-import javax.jcr.PropertyType;
 import javax.jcr.query.Query;
+import javax.jcr.query.qom.DynamicOperand;
 
 /**
  * <code>UpperLowerCaseTest</code> performs tests with upper- and lower-case
@@ -69,26 +68,26 @@
 
         // upper case
         checkQueries(qomFactory.propertyValue("s", propertyName1),
-                true, OPERATOR_EQUAL_TO,
+                true, JCR_OPERATOR_EQUAL_TO,
                 new String[]{"abc", "Abc", "aBc", "abC", "ABC"},
                 PropertyType.NAME,
                 new boolean[]{false, false, false, false, true});
 
         checkQueries(qomFactory.propertyValue("s", propertyName2),
-                true, OPERATOR_EQUAL_TO,
+                true, JCR_OPERATOR_EQUAL_TO,
                 new String[]{"abc", "Abc", "aBc", "abC", "ABC"},
                 PropertyType.NAME,
                 new boolean[]{false, false, false, false, true});
 
         // lower case
         checkQueries(qomFactory.propertyValue("s", propertyName1),
-                false, OPERATOR_EQUAL_TO,
+                false, JCR_OPERATOR_EQUAL_TO,
                 new String[]{"abc", "Abc", "aBc", "abC", "ABC"},
                 PropertyType.NAME,
                 new boolean[]{true, false, false, false, false});
 
         checkQueries(qomFactory.propertyValue("s", propertyName2),
-                false, OPERATOR_EQUAL_TO,
+                false, JCR_OPERATOR_EQUAL_TO,
                 new String[]{"abc", "Abc", "aBc", "abC", "ABC"},
                 PropertyType.NAME,
                 new boolean[]{true, false, false, false, false});
@@ -97,26 +96,26 @@
     public void testPropertyValue() throws RepositoryException {
         // upper case
         checkQueries(qomFactory.propertyValue("s", propertyName1),
-                true, OPERATOR_EQUAL_TO,
+                true, JCR_OPERATOR_EQUAL_TO,
                 new String[]{"abc", "Abc", "aBc", "abC", "ABC"},
                 PropertyType.STRING,
                 new boolean[]{false, false, false, false, true});
 
         checkQueries(qomFactory.propertyValue("s", propertyName2),
-                true, OPERATOR_EQUAL_TO,
+                true, JCR_OPERATOR_EQUAL_TO,
                 new String[]{"abc", "Abc", "aBc", "abC", "ABC"},
                 PropertyType.STRING,
                 new boolean[]{false, false, false, false, true});
 
         // lower case
         checkQueries(qomFactory.propertyValue("s", propertyName1),
-                false, OPERATOR_EQUAL_TO,
+                false, JCR_OPERATOR_EQUAL_TO,
                 new String[]{"abc", "Abc", "aBc", "abC", "ABC"},
                 PropertyType.STRING,
                 new boolean[]{true, false, false, false, false});
 
         checkQueries(qomFactory.propertyValue("s", propertyName2),
-                false, OPERATOR_EQUAL_TO,
+                false, JCR_OPERATOR_EQUAL_TO,
                 new String[]{"abc", "Abc", "aBc", "abC", "ABC"},
                 PropertyType.STRING,
                 new boolean[]{true, false, false, false, false});
@@ -125,7 +124,7 @@
     public void testUpperLowerCase() throws RepositoryException {
         // first upper case, then lower case again
         checkQueries(qomFactory.upperCase(qomFactory.propertyValue("s", propertyName1)),
-                false, OPERATOR_EQUAL_TO,
+                false, JCR_OPERATOR_EQUAL_TO,
                 new String[]{"abc", "Abc", "aBc", "abC", "ABC"},
                 PropertyType.STRING,
                 new boolean[]{true, false, false, false, false});
@@ -134,7 +133,7 @@
     public void testUpperCaseTwice() throws RepositoryException {
         // upper case twice
         checkQueries(qomFactory.upperCase(qomFactory.propertyValue("s", propertyName1)),
-                true, OPERATOR_EQUAL_TO,
+                true, JCR_OPERATOR_EQUAL_TO,
                 new String[]{"abc", "Abc", "aBc", "abC", "ABC"},
                 PropertyType.STRING,
                 new boolean[]{false, false, false, false, true});
@@ -143,7 +142,7 @@
     public void testLowerUpperCase() throws RepositoryException {
         // first lower case, then upper case again
         checkQueries(qomFactory.lowerCase(qomFactory.propertyValue("s", propertyName1)),
-                true, OPERATOR_EQUAL_TO,
+                true, JCR_OPERATOR_EQUAL_TO,
                 new String[]{"abc", "Abc", "aBc", "abC", "ABC"},
                 PropertyType.STRING,
                 new boolean[]{false, false, false, false, true});
@@ -152,7 +151,7 @@
     public void testLowerCaseTwice() throws RepositoryException {
         // lower case twice
         checkQueries(qomFactory.lowerCase(qomFactory.propertyValue("s", propertyName1)),
-                false, OPERATOR_EQUAL_TO,
+                false, JCR_OPERATOR_EQUAL_TO,
                 new String[]{"abc", "Abc", "aBc", "abC", "ABC"},
                 PropertyType.STRING,
                 new boolean[]{true, false, false, false, false});
@@ -162,7 +161,7 @@
 
     private void checkQueries(DynamicOperand operand,
                               boolean toUpper,
-                              int operator,
+                              String operator,
                               String[] literals,
                               int type,
                               boolean[] matches) throws RepositoryException {
@@ -174,7 +173,7 @@
     
     private Query createQuery(DynamicOperand operand,
                               boolean toUpper,
-                              int operator,
+                              String operator,
                               Value literal) throws RepositoryException {
         if (toUpper) {
             operand = qomFactory.upperCase(operand);



Mime
View raw message