jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r164198 - in /incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit: core/query/SQLTest.java test/api/query/SQLQueryLevel2Test.java test/api/query/XPathQueryLevel2Test.java
Date Fri, 22 Apr 2005 08:47:19 GMT
Author: mreutegg
Date: Fri Apr 22 01:47:17 2005
New Revision: 164198

URL: http://svn.apache.org/viewcvs?rev=164198&view=rev
Log:
Fix test cases: SQL statements are missing path constraint.

Modified:
    incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/core/query/SQLTest.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/XPathQueryLevel2Test.java

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?rev=164198&r1=164197&r2=164198&view=diff
==============================================================================
--- 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 22 01:47:17 2005
@@ -31,7 +31,8 @@
 
         testRootNode.save();
 
-        String sql = "SELECT * FROM nt:unstructured WHERE bla='bla'";
+        String sql = "SELECT * FROM nt:unstructured WHERE bla='bla' " +
+                "AND jcr:path LIKE '" + testRoot + "/%'";
         Query q = superuser.getWorkspace().getQueryManager().createQuery(sql, Query.SQL);
         QueryResult result = q.execute();
         checkResult(result, 1);
@@ -43,7 +44,8 @@
 
         testRootNode.save();
 
-        String sql = "SELECT * FROM nt:unstructured WHERE contains(*, 'fox')";
+        String sql = "SELECT * FROM nt:unstructured WHERE contains(*, 'fox') " +
+                "AND jcr:path LIKE '" + testRoot + "/%'";
         Query q = superuser.getWorkspace().getQueryManager().createQuery(sql, Query.SQL);
         QueryResult result = q.execute();
         checkResult(result, 1);
@@ -55,7 +57,9 @@
 
         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') " +
+                "AND jcr:path LIKE '" + testRoot + "/%'";
         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/SQLQueryLevel2Test.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/query/SQLQueryLevel2Test.java?rev=164198&r1=164197&r2=164198&view=diff
==============================================================================
--- 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 22 01:47:17 2005
@@ -16,13 +16,10 @@
  */
 package org.apache.jackrabbit.test.api.query;
 
-import org.apache.jackrabbit.test.NotExecutableException;
-
 import javax.jcr.query.Query;
 import javax.jcr.query.QueryResult;
 import javax.jcr.query.RowIterator;
 import javax.jcr.query.Row;
-import javax.jcr.Repository;
 import javax.jcr.Value;
 
 /**
@@ -137,8 +134,9 @@
         StringBuffer tmp = new StringBuffer("SELECT ");
         tmp.append(propertyName1);
         tmp.append(" FROM ").append(testNodeType);
-        tmp.append(" WHERE CONTAINS(*, ");
-        tmp.append("'''quick brown'' -cat')");
+        tmp.append(" WHERE CONTAINS(*, '''quick brown'' -cat')");
+        tmp.append(" AND ").append(jcrPath).append(" LIKE '");
+        tmp.append(testRoot).append("/%'");
         return new Statement(tmp.toString(), Query.SQL);
     }
 
@@ -154,6 +152,8 @@
         tmp.append(propertyName2);
         tmp.append(" AND 'existence' IN ");
         tmp.append(propertyName1);
+        tmp.append(" AND ").append(jcrPath).append(" LIKE '");
+        tmp.append(testRoot).append("/%'");
         return new Statement(tmp.toString(), Query.SQL);
     }
 
@@ -169,6 +169,8 @@
         tmp.append(" <= 'b' AND ");
         tmp.append(propertyName1);
         tmp.append(" > 'a'");
+        tmp.append(" AND ").append(jcrPath).append(" LIKE '");
+        tmp.append(testRoot).append("/%'");
         return new Statement(tmp.toString(), Query.SQL);
     }
 }

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?rev=164198&r1=164197&r2=164198&view=diff
==============================================================================
--- 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 22 01:47:17 2005
@@ -16,13 +16,10 @@
  */
 package org.apache.jackrabbit.test.api.query;
 
-import org.apache.jackrabbit.test.NotExecutableException;
-
 import javax.jcr.query.Query;
 import javax.jcr.query.QueryResult;
 import javax.jcr.query.RowIterator;
 import javax.jcr.query.Row;
-import javax.jcr.Repository;
 import javax.jcr.Value;
 
 /**



Mime
View raw message