jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r161484 - in incubator/jackrabbit/trunk/src: grammar/sql/ java/org/apache/jackrabbit/core/ java/org/apache/jackrabbit/core/query/sql/ java/org/apache/jackrabbit/core/query/xpath/ test/org/apache/jackrabbit/core/query/ test/org/apache/jackrabbit/test/api/query/
Date Fri, 15 Apr 2005 15:21:35 GMT
Author: mreutegg
Date: Fri Apr 15 08:21:32 2005
New Revision: 161484

URL: http://svn.apache.org/viewcvs?view=rev&rev=161484
Log:
Update to spec 0.16.4:
- Change prefix for xpath functions. Use jcr (which maps to the jcr namespace) instead of
jcrfn.
- Contains function now has two required parameters. Implementations must at least support:
XPath: jcr:contains(., 'text'), SQL: CONTAINS(*, 'text')

Modified:
    incubator/jackrabbit/trunk/src/grammar/sql/JCRSQL.jjt
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/SearchManager.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/sql/QueryFormat.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/xpath/QueryFormat.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/xpath/XPathQueryBuilder.java
    incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/core/query/FulltextQueryTest.java
    incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/core/query/SQLTest.java
    incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/query/AbstractQueryTest.java
    incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/query/DerefQueryLevel1Test.java
    incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/query/SQLQueryLevel2Test.java
    incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/query/TextNodeTest.java
    incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/query/XPathQueryLevel2Test.java

Modified: incubator/jackrabbit/trunk/src/grammar/sql/JCRSQL.jjt
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/grammar/sql/JCRSQL.jjt?view=diff&r1=161483&r2=161484
==============================================================================
--- incubator/jackrabbit/trunk/src/grammar/sql/JCRSQL.jjt (original)
+++ incubator/jackrabbit/trunk/src/grammar/sql/JCRSQL.jjt Fri Apr 15 08:21:32 2005
@@ -433,8 +433,7 @@
 {
   <CONTAINS>
   <LEFT_PAREN>
-  // currently optional
-  ( ( <ASTERISK> | (name = Identifier() { jjtThis.setPropertyName(name); }) ) "," )?
+  ( <ASTERISK> | (name = Identifier() { jjtThis.setPropertyName(name); }) ) ","
   t = <CHAR_STRING_LITERAL> { jjtThis.setQuery(t.image.substring(1, t.image.length()
- 1).replaceAll("''", "'")); }
   <RIGHT_PAREN>
 }

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/SearchManager.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/SearchManager.java?view=diff&r1=161483&r2=161484
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/SearchManager.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/SearchManager.java Fri
Apr 15 08:21:32 2005
@@ -69,11 +69,6 @@
     private static final String NS_XS_PREFIX = "xs";
     public static final String NS_XS_URI = "http://www.w3.org/2001/XMLSchema";
 
-    /** Namespace URI for JCR functions */
-    // @todo check if consistent with spec
-    private static final String NS_JCRFN_PREFIX = "jcrfn";
-    public static final String NS_JCRFN_URI = "http://www.jcp.org/jcr/xpath-functions/1.0";
-
     /**
      * The shared item state manager instance for the workspace.
      */
@@ -116,12 +111,6 @@
         } catch (RepositoryException e) {
             // not yet known
             nsReg.registerNamespace(NS_FN_PREFIX, NS_FN_URI);
-        }
-        try {
-            nsReg.getPrefix(NS_JCRFN_URI);
-        } catch (RepositoryException e) {
-            // not yet known
-            nsReg.registerNamespace(NS_JCRFN_PREFIX, NS_JCRFN_URI);
         }
 
         // initialize query handler

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/sql/QueryFormat.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/sql/QueryFormat.java?view=diff&r1=161483&r2=161484
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/sql/QueryFormat.java
(original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/sql/QueryFormat.java
Fri Apr 15 08:21:32 2005
@@ -365,7 +365,7 @@
     }
 
     public Object visit(DerefQueryNode node, Object data) {
-        exceptions.add(new InvalidQueryException("jcrfn:deref() function not supported in
SQL"));
+        exceptions.add(new InvalidQueryException("jcr:deref() function not supported in SQL"));
         return data;
     }
 

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/xpath/QueryFormat.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/xpath/QueryFormat.java?view=diff&r1=161483&r2=161484
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/xpath/QueryFormat.java
(original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/xpath/QueryFormat.java
Fri Apr 15 08:21:32 2005
@@ -210,7 +210,7 @@
     public Object visit(TextsearchQueryNode node, Object data) {
         StringBuffer sb = (StringBuffer) data;
         try {
-            sb.append(XPathQueryBuilder.JCRFN_CONTAINS.toJCRName(resolver));
+            sb.append(XPathQueryBuilder.JCR_CONTAINS.toJCRName(resolver));
             sb.append("(");
             if (node.getPropertyName() == null) {
                 sb.append(".");
@@ -274,7 +274,7 @@
     public Object visit(DerefQueryNode node, Object data) {
         StringBuffer sb = (StringBuffer) data;
         try {
-            sb.append(XPathQueryBuilder.JCRFN_DEREF.toJCRName(resolver));
+            sb.append(XPathQueryBuilder.JCR_DEREF.toJCRName(resolver));
             sb.append("(@");
             sb.append(ISO9075.encode(node.getRefProperty()).toJCRName(resolver));
             sb.append(", '");
@@ -318,7 +318,7 @@
                 sb.append(propName).append(" le ");
                 appendValue(node, sb);
             } else if (node.getOperation() == OPERATION_LIKE) {
-                sb.append(XPathQueryBuilder.JCRFN_LIKE.toJCRName(resolver));
+                sb.append(XPathQueryBuilder.JCR_LIKE.toJCRName(resolver));
                 sb.append("(").append(propName).append(", ");
                 appendValue(node, sb);
                 sb.append(")");

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/xpath/XPathQueryBuilder.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/xpath/XPathQueryBuilder.java?view=diff&r1=161483&r2=161484
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/xpath/XPathQueryBuilder.java
(original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/xpath/XPathQueryBuilder.java
Fri Apr 15 08:21:32 2005
@@ -18,7 +18,6 @@
 
 import org.apache.jackrabbit.core.Constants;
 import org.apache.jackrabbit.core.IllegalNameException;
-import org.apache.jackrabbit.core.NamespaceRegistryImpl;
 import org.apache.jackrabbit.core.NamespaceResolver;
 import org.apache.jackrabbit.core.NoPrefixDeclaredException;
 import org.apache.jackrabbit.core.QName;
@@ -90,7 +89,7 @@
     /**
      * QName for jcr:xmltext
      */
-    static final QName JCR_XMLTEXT = new QName(NamespaceRegistryImpl.NS_JCR_URI, "xmltext");
+    static final QName JCR_XMLTEXT = new QName(Constants.NS_JCR_URI, "xmltext");
 
     /**
      * QName for last function.
@@ -108,24 +107,24 @@
     static final QName XS_DATETIME = new QName(SearchManager.NS_XS_URI, "dateTime");
 
     /**
-     * QName for jcrfn:like
+     * QName for jcr:like
      */
-    static final QName JCRFN_LIKE = new QName(SearchManager.NS_JCRFN_URI, "like");
+    static final QName JCR_LIKE = new QName(Constants.NS_JCR_URI, "like");
 
     /**
-     * QName for jcrfn:deref
+     * QName for jcr:deref
      */
-    static final QName JCRFN_DEREF = new QName(SearchManager.NS_JCRFN_URI, "deref");
+    static final QName JCR_DEREF = new QName(Constants.NS_JCR_URI, "deref");
 
     /**
-     * QName for jcrfn:contains
+     * QName for jcr:contains
      */
-    static final QName JCRFN_CONTAINS = new QName(SearchManager.NS_JCRFN_URI, "contains");
+    static final QName JCR_CONTAINS = new QName(Constants.NS_JCR_URI, "contains");
 
     /**
      * QName for jcr:root
      */
-    static final QName JCR_ROOT = new QName(NamespaceRegistryImpl.NS_JCR_URI, "root");
+    static final QName JCR_ROOT = new QName(Constants.NS_JCR_URI, "root");
 
     /**
      * String constant for operator 'eq'
@@ -680,7 +679,7 @@
                     // wrong number of arguments
                     exceptions.add(new InvalidQueryException("Wrong number of arguments for
xs:dateTime"));
                 }
-            } else if (JCRFN_CONTAINS.toJCRName(resolver).equals(fName)) {
+            } else if (JCR_CONTAINS.toJCRName(resolver).equals(fName)) {
                 // check number of arguments
                 if (node.jjtGetNumChildren() == 3) {
                     if (queryNode instanceof NAryQueryNode) {
@@ -700,35 +699,14 @@
                             path.jjtAccept(this, contains);
                             ((NAryQueryNode) queryNode).addOperand(contains);
                         } else {
-                            exceptions.add(new InvalidQueryException("Wrong argument type
for jcrfn:contains"));
+                            exceptions.add(new InvalidQueryException("Wrong argument type
for jcr:contains"));
                         }
                     }
-                // todo first parameter is currently optional -> remove later
-                } else if (node.jjtGetNumChildren() == 2) {
-                    SimpleNode literal = (SimpleNode) node.jjtGetChild(1).jjtGetChild(0);
-                    if (queryNode instanceof NAryQueryNode) {
-                        if (literal.getId() == JJTSTRINGLITERAL) {
-                            String value = literal.getValue();
-                            if (value.charAt(0) == '"') {
-                                value = value.replaceAll("\"\"", "\"");
-                            } else {
-                                value = value.replaceAll("''", "'");
-                            }
-                            // strip quotes
-                            value = value.substring(1, value.length() - 1);
-                            TextsearchQueryNode contains = new TextsearchQueryNode(queryNode,
value);
-                            ((NAryQueryNode) queryNode).addOperand(contains);
-                        } else {
-                            exceptions.add(new InvalidQueryException("Wrong argument type
for jcrfn:contains"));
-                        }
-                    } else {
-                        exceptions.add(new InvalidQueryException("Unsupported location for
function jcrfn:contains"));
-                    }
                 } else {
                     // wrong number of arguments
-                    exceptions.add(new InvalidQueryException("Wrong number of arguments for
jcrfn:contains"));
+                    exceptions.add(new InvalidQueryException("Wrong number of arguments for
jcr:contains"));
                 }
-            } else if (JCRFN_LIKE.toJCRName(resolver).equals(fName)) {
+            } else if (JCR_LIKE.toJCRName(resolver).equals(fName)) {
                 // check number of arguments
                 if (node.jjtGetNumChildren() == 3) {
                     if (queryNode instanceof NAryQueryNode) {
@@ -739,7 +717,7 @@
                         node.jjtGetChild(1).jjtAccept(this, like);
                         // check property name
                         if (like.getProperty() == null) {
-                            exceptions.add(new InvalidQueryException("Wrong first argument
type for jcrfn:like"));
+                            exceptions.add(new InvalidQueryException("Wrong first argument
type for jcr:like"));
                         }
 
                         SimpleNode literal = (SimpleNode) node.jjtGetChild(2).jjtGetChild(0);
@@ -749,14 +727,14 @@
                             value = value.substring(1, value.length() - 1);
                             like.setStringValue(value);
                         } else {
-                            exceptions.add(new InvalidQueryException("Wrong second argument
type for jcrfn:like"));
+                            exceptions.add(new InvalidQueryException("Wrong second argument
type for jcr:like"));
                         }
                     } else {
-                        exceptions.add(new InvalidQueryException("Unsupported location for
function jcrfn:like"));
+                        exceptions.add(new InvalidQueryException("Unsupported location for
function jcr:like"));
                     }
                 } else {
                     // wrong number of arguments
-                    exceptions.add(new InvalidQueryException("Wrong number of arguments for
jcrfn:like"));
+                    exceptions.add(new InvalidQueryException("Wrong number of arguments for
jcr:like"));
                 }
             } else if (FN_TRUE.toJCRName(resolver).equals(fName)) {
                 if (queryNode.getType() == QueryNode.TYPE_RELATION) {
@@ -802,7 +780,7 @@
                 } else {
                     exceptions.add(new InvalidQueryException("Unsupported location for last()"));
                 }
-            } else if (JCRFN_DEREF.toJCRName(resolver).equals(fName)) {
+            } else if (JCR_DEREF.toJCRName(resolver).equals(fName)) {
                 // check number of arguments
                 if (node.jjtGetNumChildren() == 3) {
                     if (queryNode.getType() == QueryNode.TYPE_PATH) {
@@ -813,7 +791,7 @@
                         node.jjtGetChild(1).jjtAccept(this, derefNode);
                         // check property name
                         if (derefNode.getRefProperty() == null) {
-                            exceptions.add(new InvalidQueryException("Wrong first argument
type for jcrfn:deref"));
+                            exceptions.add(new InvalidQueryException("Wrong first argument
type for jcr:deref"));
                         }
 
                         SimpleNode literal = (SimpleNode) node.jjtGetChild(2).jjtGetChild(0);
@@ -833,11 +811,11 @@
                                 derefNode.setNameTest(name);
                             }
                         } else {
-                            exceptions.add(new InvalidQueryException("Wrong second argument
type for jcrfn:like"));
+                            exceptions.add(new InvalidQueryException("Wrong second argument
type for jcr:like"));
                         }
                         pathNode.addPathStep(derefNode);
                     } else {
-                        exceptions.add(new InvalidQueryException("Unsupported location for
jcrfn:deref()"));
+                        exceptions.add(new InvalidQueryException("Unsupported location for
jcr:deref()"));
                     }
                 }
             } else {

Modified: incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/core/query/FulltextQueryTest.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/core/query/FulltextQueryTest.java?view=diff&r1=161483&r2=161484
==============================================================================
--- incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/core/query/FulltextQueryTest.java
(original)
+++ incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/core/query/FulltextQueryTest.java
Fri Apr 15 08:21:32 2005
@@ -34,7 +34,7 @@
 
         String sql = "SELECT * FROM nt:unstructured"
                 + " WHERE jcr:path LIKE '" + testRoot + "/%"
-                + "' AND CONTAINS('fox')";
+                + "' AND CONTAINS(*, 'fox')";
         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')";
+                + "' AND CONTAINS(*, 'fox')";
         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')";
+                + "' AND CONTAINS(*, 'fox test')";
         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''')";
+                + "' AND CONTAINS(*, 'text ''fox jumps''')";
         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')";
+                + "' AND CONTAINS(*, 'text ''fox jumps'' -other')";
         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')";
+                + "' AND CONTAINS(*, '''fox jumps'' test OR other')";
         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')";
+                + "' AND CONTAINS(*, '''fox juMps'' Test OR otheR')";
         Query q = superuser.getWorkspace().getQueryManager().createQuery(sql, Query.SQL);
         QueryResult result = q.execute();
         checkResult(result, 2);
@@ -179,7 +179,7 @@
         testRootNode.save();
 
         String sql = "/jcr:root" + testRoot + "/element(*, nt:unstructured)"
-                + "[jcrfn:contains(., 'quick fox')]";
+                + "[jcr:contains(., 'quick fox')]";
         Query q = superuser.getWorkspace().getQueryManager().createQuery(sql, Query.XPATH);
         checkResult(q.execute(), 2);
     }
@@ -214,7 +214,7 @@
         testRootNode.save();
 
         String sql = "/jcr:root" + testRoot + "/element(*, nt:unstructured)"
-                + "[jcrfn:contains(@title, 'quick fox')]";
+                + "[jcr:contains(@title, 'quick fox')]";
         Query q = superuser.getWorkspace().getQueryManager().createQuery(sql, Query.XPATH);
         checkResult(q.execute(), 1);
     }

Modified: incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/core/query/SQLTest.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/core/query/SQLTest.java?view=diff&r1=161483&r2=161484
==============================================================================
--- incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/core/query/SQLTest.java (original)
+++ incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/core/query/SQLTest.java Fri
Apr 15 08:21:32 2005
@@ -43,7 +43,7 @@
 
         testRootNode.save();
 
-        String sql = "SELECT * FROM nt:unstructured WHERE contains('fox')";
+        String sql = "SELECT * FROM nt:unstructured WHERE contains(*, 'fox')";
         Query q = superuser.getWorkspace().getQueryManager().createQuery(sql, Query.SQL);
         QueryResult result = q.execute();
         checkResult(result, 1);
@@ -55,7 +55,7 @@
 
         testRootNode.save();
 
-        String sql = "SELECT foo.mytext, bla.foo FROM nt:unstructured WHERE contains('fox')
AND NOT contains('bla')";
+        String sql = "SELECT foo.mytext, bla.foo FROM nt:unstructured WHERE contains(*, 'fox')
AND NOT contains(*, 'bla')";
         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/api/query/AbstractQueryTest.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/query/AbstractQueryTest.java?view=diff&r1=161483&r2=161484
==============================================================================
--- incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/query/AbstractQueryTest.java
(original)
+++ incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/query/AbstractQueryTest.java
Fri Apr 15 08:21:32 2005
@@ -39,11 +39,6 @@
 public abstract class AbstractQueryTest extends AbstractJCRTest {
 
     /**
-     * Namespace URI for jcr functions in XPath
-     */
-    protected static final String NS_JCRFN_URI = "http://www.jcp.org/jcr/xpath-functions/1.0";
-
-    /**
      * Resolved QName for jcr:score
      */
     protected String jcrScore;
@@ -59,14 +54,14 @@
     protected String jcrRoot;
 
     /**
-     * Resolved QName for jcrfn:contains
+     * Resolved QName for jcr:contains
      */
-    protected String jcrfnContains;
+    protected String jcrContains;
 
     /**
-     * Resolved QName for jcrfn:deref
+     * Resolved QName for jcr:deref
      */
-    protected String jcrfnDeref;
+    protected String jcrDeref;
 
     /**
      * Set-up the configuration values used for the test. Per default retrieves
@@ -78,8 +73,8 @@
         jcrScore = superuser.getNamespacePrefix(NS_JCR_URI) + ":score";
         jcrPath = superuser.getNamespacePrefix(NS_JCR_URI) + ":path";
         jcrRoot = superuser.getNamespacePrefix(NS_JCR_URI) + ":root";
-        jcrfnContains = superuser.getNamespacePrefix(NS_JCRFN_URI) + ":contains";
-        jcrfnDeref = superuser.getNamespacePrefix(NS_JCRFN_URI) + ":deref";
+        jcrContains = superuser.getNamespacePrefix(NS_JCR_URI) + ":contains";
+        jcrDeref = superuser.getNamespacePrefix(NS_JCR_URI) + ":deref";
     }
 
     /**

Modified: incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/query/DerefQueryLevel1Test.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/query/DerefQueryLevel1Test.java?view=diff&r1=161483&r2=161484
==============================================================================
--- incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/query/DerefQueryLevel1Test.java
(original)
+++ incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/query/DerefQueryLevel1Test.java
Fri Apr 15 08:21:32 2005
@@ -29,7 +29,7 @@
 import java.util.ArrayList;
 
 /**
- * Tests the XPath function jcrfn:deref() in a level 1 repository.
+ * Tests the XPath function jcr:deref() in a level 1 repository.
  *
  * @test
  * @sources DerefQueryLevel1Test.java
@@ -160,7 +160,7 @@
             throws RepositoryException {
         StringBuffer stmt = new StringBuffer();
         stmt.append("/").append(jcrRoot).append(refProperty.getParent().getPath());
-        stmt.append("/").append(jcrfnDeref).append("(@");
+        stmt.append("/").append(jcrDeref).append("(@");
         stmt.append(refProperty.getName()).append(", '");
         stmt.append(nameTest).append("')");
         return stmt.toString();

Modified: incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/query/SQLQueryLevel2Test.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/query/SQLQueryLevel2Test.java?view=diff&r1=161483&r2=161484
==============================================================================
--- incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/query/SQLQueryLevel2Test.java
(original)
+++ incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/query/SQLQueryLevel2Test.java
Fri Apr 15 08:21:32 2005
@@ -139,7 +139,7 @@
         tmp.append(jcrScore).append(", ");
         tmp.append(propertyName1);
         tmp.append(" FROM ").append(testNodeType);
-        tmp.append(" WHERE CONTAINS(");
+        tmp.append(" WHERE CONTAINS(*, ");
         tmp.append("'''quick brown'' -cat')");
         return new Statement(tmp.toString(), Query.SQL);
     }

Modified: incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/query/TextNodeTest.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/query/TextNodeTest.java?view=diff&r1=161483&r2=161484
==============================================================================
--- incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/query/TextNodeTest.java
(original)
+++ incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/query/TextNodeTest.java
Fri Apr 15 08:21:32 2005
@@ -80,7 +80,7 @@
     }
 
     /**
-     * Tests if text() node test is equivalent with jcr:xmltext and jcrfn:contains
+     * Tests if text() node test is equivalent with jcr:xmltext and jcr:contains
      * matches content in jcr:xmlcharacters property.
      */
     public void testTextNodeTestContains() throws RepositoryException {
@@ -89,7 +89,7 @@
         Node text2 = testRootNode.addNode(nodeName1, testNodeType).addNode(jcrXMLText);
         text2.setProperty(jcrXMLCharacters, "java content repository");
         testRootNode.save();
-        String xpath = "/" + jcrRoot + testRoot + "//text()[jcrfn:contains('fox')]";
+        String xpath = "/" + jcrRoot + testRoot + "//text()[" + jcrContains + "(., 'fox')]";
         executeXPathQuery(superuser, xpath, new Node[]{text1});
     }
 

Modified: incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/query/XPathQueryLevel2Test.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/query/XPathQueryLevel2Test.java?view=diff&r1=161483&r2=161484
==============================================================================
--- incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/query/XPathQueryLevel2Test.java
(original)
+++ incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/query/XPathQueryLevel2Test.java
Fri Apr 15 08:21:32 2005
@@ -135,8 +135,8 @@
     private Statement getFullTextStatement() {
         StringBuffer tmp = new StringBuffer("/");
         tmp.append(jcrRoot).append(testRoot);
-        tmp.append("/*[").append(jcrfnContains);
-        tmp.append("(\"'quick brown' -cat\")]");
+        tmp.append("/*[").append(jcrContains);
+        tmp.append("(., \"'quick brown' -cat\")]");
         tmp.append("/(@").append(jcrPath).append("|@").append(propertyName1);
         tmp.append("|@").append(jcrScore).append(")");
         return new Statement(tmp.toString(), Query.XPATH);



Mime
View raw message