jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From resc...@apache.org
Subject svn commit: r1225191 - in /jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query: ./ qom/
Date Wed, 28 Dec 2011 14:29:19 GMT
Author: reschke
Date: Wed Dec 28 14:29:18 2011
New Revision: 1225191

URL: http://svn.apache.org/viewvc?rev=1225191&view=rev
Log:
JCR-3196: reduce deprecation warning noise in TCK testsReduce warning noise

avoid use of Query.SQL and Query.XPATH constants

Modified:
    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/AbstractQueryTest.java
    jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/GetLanguageTest.java
    jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/GetPersistentQueryPathLevel1Test.java
    jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/GetPersistentQueryPathTest.java
    jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/GetPropertyNamesTest.java
    jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/GetStatementTest.java
    jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/GetSupportedQueryLanguagesTest.java
    jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/OrderByMultiTypeTest.java
    jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/PredicatesTest.java
    jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/QueryResultNodeIteratorTest.java
    jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/SQLJcrPathTest.java
    jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/SQLOrderByTest.java
    jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/SQLQueryLevel2Test.java
    jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/SimpleSelectionTest.java
    jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/XPathDocOrderTest.java
    jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/XPathJcrPathTest.java
    jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/XPathOrderByTest.java
    jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/XPathPosIndexTest.java
    jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/XPathQueryLevel2Test.java
    jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/qom/GetQueryTest.java

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=1225191&r1=1225190&r2=1225191&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 Dec 28 14:29:18 2011
@@ -149,13 +149,13 @@ class AbstractOrderByTest extends Abstra
         Query q;
         QueryResult result;
         if (sql != null) {
-            q = superuser.getWorkspace().getQueryManager().createQuery(sql, Query.SQL);
+            q = superuser.getWorkspace().getQueryManager().createQuery(sql, qsSQL);
             result = q.execute();
             checkResultOrder(result, nodeNames);
         }
 
         if (xpath != null) {
-            q = superuser.getWorkspace().getQueryManager().createQuery(xpath, Query.XPATH);
+            q = superuser.getWorkspace().getQueryManager().createQuery(xpath, qsXPATH);
             result = q.execute();
             checkResultOrder(result, nodeNames);
         }
@@ -168,13 +168,13 @@ class AbstractOrderByTest extends Abstra
         Collections.reverse(Arrays.asList(nodeNames));
 
         if (sql != null) {
-            q = superuser.getWorkspace().getQueryManager().createQuery(sql + " DESC", Query.SQL);
+            q = superuser.getWorkspace().getQueryManager().createQuery(sql + " DESC", qsSQL);
             result = q.execute();
             checkResultOrder(result, nodeNames);
         }
 
         if (xpath != null) {
-            q = superuser.getWorkspace().getQueryManager().createQuery(xpath + " descending",
Query.XPATH);
+            q = superuser.getWorkspace().getQueryManager().createQuery(xpath + " descending",
qsXPATH);
             result = q.execute();
             checkResultOrder(result, nodeNames);
         }
@@ -257,7 +257,7 @@ class AbstractOrderByTest extends Abstra
      */
     protected String createXPath() throws RepositoryException {
         List<String> languages = Arrays.asList(superuser.getWorkspace().getQueryManager().getSupportedQueryLanguages());
-        if (languages.contains(Query.XPATH)) {
+        if (languages.contains(qsXPATH)) {
             return xpathRoot + "/*[@jcr:primaryType='" + testNodeType + "'] order by @" +
propertyName1;
         } else {
             return null;

Modified: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/AbstractQueryTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/AbstractQueryTest.java?rev=1225191&r1=1225190&r2=1225191&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/AbstractQueryTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/AbstractQueryTest.java
Wed Dec 28 14:29:18 2011
@@ -93,6 +93,18 @@ public abstract class AbstractQueryTest 
     protected QueryManager qm;
 
     /**
+     * The identifier for the "XPATH" query syntax
+     */
+    @SuppressWarnings("deprecation")
+	protected String qsXPATH = Query.XPATH;
+
+    /**
+     * The identifier for the "SQL" query syntax
+     */
+    @SuppressWarnings("deprecation")
+	protected String qsSQL = Query.SQL;
+
+    /**
      * Set-up the configuration values used for the test. Per default retrieves
      * a session, configures testRoot, and nodetype and checks if the query
      * language for the current language is available.<br>
@@ -301,7 +313,7 @@ public abstract class AbstractQueryTest 
      */
     protected void executeXPathQuery(Session session, String xpath, Node[] nodes)
             throws RepositoryException, NotExecutableException {
-        QueryResult res = createQuery(session, xpath, Query.XPATH).execute();
+        QueryResult res = createQuery(session, xpath, qsXPATH).execute();
         checkResult(res, nodes);
     }
 
@@ -315,7 +327,7 @@ public abstract class AbstractQueryTest 
      */
     protected void executeSqlQuery(Session session, String sql, Node[] nodes)
             throws RepositoryException, NotExecutableException {
-        QueryResult res = createQuery(session, sql, Query.SQL).execute();
+        QueryResult res = createQuery(session, sql, qsSQL).execute();
         checkResult(res, nodes);
     }
 

Modified: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/GetLanguageTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/GetLanguageTest.java?rev=1225191&r1=1225190&r2=1225191&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/GetLanguageTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/GetLanguageTest.java
Wed Dec 28 14:29:18 2011
@@ -63,8 +63,8 @@ public class GetLanguageTest extends Abs
      */
     public void testGetLanguage() throws RepositoryException {
         String statement = "/" + jcrRoot;
-        Query q = session.getWorkspace().getQueryManager().createQuery(statement, Query.XPATH);
-        assertEquals("Query returns wrong language.", Query.XPATH, q.getLanguage());
+        Query q = session.getWorkspace().getQueryManager().createQuery(statement, qsXPATH);
+        assertEquals("Query returns wrong language.", qsXPATH, q.getLanguage());
     }
 
     /**
@@ -72,10 +72,10 @@ public class GetLanguageTest extends Abs
      * {@link Query#getLanguage()}.
      */
     public void testSQL() throws RepositoryException, NotExecutableException {
-        if (isSupportedLanguage(Query.SQL)) {
+        if (isSupportedLanguage(qsSQL)) {
             String stmt = "select * from " + testNodeType;
-            Query q = session.getWorkspace().getQueryManager().createQuery(stmt, Query.SQL);
-            assertEquals("Query returns wrong language.", Query.SQL, q.getLanguage());
+            Query q = session.getWorkspace().getQueryManager().createQuery(stmt, qsSQL);
+            assertEquals("Query returns wrong language.", qsSQL, q.getLanguage());
         } else {
             throw new NotExecutableException("SQL not supported");
         }

Modified: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/GetPersistentQueryPathLevel1Test.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/GetPersistentQueryPathLevel1Test.java?rev=1225191&r1=1225190&r2=1225191&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/GetPersistentQueryPathLevel1Test.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/GetPersistentQueryPathLevel1Test.java
Wed Dec 28 14:29:18 2011
@@ -61,7 +61,7 @@ public class GetPersistentQueryPathLevel
      */
     public void testGetStoredQueryPath() throws RepositoryException {
         String statement = "/" + jcrRoot;
-        Query q = session.getWorkspace().getQueryManager().createQuery(statement, Query.XPATH);
+        Query q = session.getWorkspace().getQueryManager().createQuery(statement, qsXPATH);
         try {
             q.getStoredQueryPath();
             fail("Query.getStoredQueryPath() on a transient query must throw an ItemNotFoundException.");

Modified: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/GetPersistentQueryPathTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/GetPersistentQueryPathTest.java?rev=1225191&r1=1225190&r2=1225191&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/GetPersistentQueryPathTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/GetPersistentQueryPathTest.java
Wed Dec 28 14:29:18 2011
@@ -51,7 +51,7 @@ public class GetPersistentQueryPathTest 
             throw new NotExecutableException("repository does not support nt:query");
         }
         String statement = "/" + jcrRoot;
-        Query q = superuser.getWorkspace().getQueryManager().createQuery(statement, Query.XPATH);
+        Query q = superuser.getWorkspace().getQueryManager().createQuery(statement, qsXPATH);
         String path = testRoot + "/" + nodeName1;
         q.storeAsNode(path);
         assertEquals("Query.getPersistentQueryPath() does not return the correct path.",

Modified: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/GetPropertyNamesTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/GetPropertyNamesTest.java?rev=1225191&r1=1225190&r2=1225191&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/GetPropertyNamesTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/GetPropertyNamesTest.java
Wed Dec 28 14:29:18 2011
@@ -68,7 +68,7 @@ public class GetPropertyNamesTest extend
         String queryStatement = "/" + jcrRoot;
 
         // build and execute search query
-        Query query = superuser.getWorkspace().getQueryManager().createQuery(queryStatement,
Query.XPATH);
+        Query query = superuser.getWorkspace().getQueryManager().createQuery(queryStatement,
qsXPATH);
         QueryResult result = query.execute();
 
         // Get the node's non-residual properties

Modified: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/GetStatementTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/GetStatementTest.java?rev=1225191&r1=1225190&r2=1225191&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/GetStatementTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/GetStatementTest.java
Wed Dec 28 14:29:18 2011
@@ -60,7 +60,7 @@ public class GetStatementTest extends Ab
      */
     public void testGetStatement() throws RepositoryException {
         String statement = "/" + jcrRoot + "/foo";
-        Query q = session.getWorkspace().getQueryManager().createQuery(statement, Query.XPATH);
+        Query q = session.getWorkspace().getQueryManager().createQuery(statement, qsXPATH);
         assertEquals("Statement returned by Query.getStatement() is not equal to the initial
statement.",
                 statement,
                 q.getStatement());

Modified: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/GetSupportedQueryLanguagesTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/GetSupportedQueryLanguagesTest.java?rev=1225191&r1=1225190&r2=1225191&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/GetSupportedQueryLanguagesTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/GetSupportedQueryLanguagesTest.java
Wed Dec 28 14:29:18 2011
@@ -72,7 +72,7 @@ public class GetSupportedQueryLanguagesT
         // if repository descriptor for sql is present also sql must be returned
         if (isSupported(Repository.OPTION_QUERY_SQL_SUPPORTED)) {
             assertTrue("SQL not returned with QueryManager.getSupportedQueryLanguages()",
-                    langs.contains(Query.SQL));
+                    langs.contains(qsSQL));
         }
 
     }

Modified: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/OrderByMultiTypeTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/OrderByMultiTypeTest.java?rev=1225191&r1=1225190&r2=1225191&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/OrderByMultiTypeTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/OrderByMultiTypeTest.java
Wed Dec 28 14:29:18 2011
@@ -62,14 +62,14 @@ public class OrderByMultiTypeTest extend
         Query q;
         QueryResult result;
         if (checkSQL) {
-            q = superuser.getWorkspace().getQueryManager().createQuery(sql, Query.SQL);
+            q = superuser.getWorkspace().getQueryManager().createQuery(sql, qsSQL);
             result = q.execute();
             checkResultOrder(result, new String[]{nodeName2, nodeName3, nodeName1});
         }
 
         String xpath = "/" + testRoot + "/*[@" + jcrPrimaryType + "='" + testNodeType +
                 "'] order by @" + propertyName2 + ", @" + propertyName1;
-        q = superuser.getWorkspace().getQueryManager().createQuery(xpath, Query.XPATH);
+        q = superuser.getWorkspace().getQueryManager().createQuery(xpath, qsXPATH);
         result = q.execute();
         checkResultOrder(result, new String[]{nodeName2, nodeName3, nodeName1});
 
@@ -79,7 +79,7 @@ public class OrderByMultiTypeTest extend
                 propertyName2 + " DESC, " +
                 propertyName1 + " DESC";
         if (checkSQL) {
-            q = superuser.getWorkspace().getQueryManager().createQuery(sql, Query.SQL);
+            q = superuser.getWorkspace().getQueryManager().createQuery(sql, qsSQL);
             result = q.execute();
             checkResultOrder(result, new String[]{nodeName1, nodeName3, nodeName2});
         }
@@ -88,7 +88,7 @@ public class OrderByMultiTypeTest extend
                 testNodeType + "'] order by @" +
                 propertyName2 + " descending, @" +
                 propertyName1 + " descending";
-        q = superuser.getWorkspace().getQueryManager().createQuery(xpath, Query.XPATH);
+        q = superuser.getWorkspace().getQueryManager().createQuery(xpath, qsXPATH);
         result = q.execute();
         checkResultOrder(result, new String[]{nodeName1, nodeName3, nodeName2});
 
@@ -97,7 +97,7 @@ public class OrderByMultiTypeTest extend
                 jcrPath + " LIKE '" + testRoot + "/%' ORDER BY " +
                 propertyName2 + " DESC, " + propertyName1;
         if (checkSQL) {
-            q = superuser.getWorkspace().getQueryManager().createQuery(sql, Query.SQL);
+            q = superuser.getWorkspace().getQueryManager().createQuery(sql, qsSQL);
             result = q.execute();
             checkResultOrder(result, new String[]{nodeName1, nodeName2, nodeName3});
         }
@@ -105,7 +105,7 @@ public class OrderByMultiTypeTest extend
         xpath = "/" + jcrRoot + testRoot + "/*[@" + jcrPrimaryType + "='" +
                 testNodeType + "'] order by @" + propertyName2 +
                 " descending, @" + propertyName1;
-        q = superuser.getWorkspace().getQueryManager().createQuery(xpath, Query.XPATH);
+        q = superuser.getWorkspace().getQueryManager().createQuery(xpath, qsXPATH);
         result = q.execute();
         checkResultOrder(result, new String[]{nodeName1, nodeName2, nodeName3});
     }

Modified: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/PredicatesTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/PredicatesTest.java?rev=1225191&r1=1225190&r2=1225191&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/PredicatesTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/PredicatesTest.java
Wed Dec 28 14:29:18 2011
@@ -16,7 +16,6 @@
  */
 package org.apache.jackrabbit.test.api.query;
 
-import javax.jcr.query.Query;
 import javax.jcr.query.InvalidQueryException;
 import javax.jcr.query.QueryManager;
 import javax.jcr.RepositoryException;
@@ -84,7 +83,7 @@ public class PredicatesTest extends Abst
             xpathRoot + "/*[@" + jcrPrimaryType + "='" + nodeTypeName + "']";
 
         try {
-            qm.createQuery(stmt, Query.XPATH);
+            qm.createQuery(stmt, qsXPATH);
         } catch (InvalidQueryException e) {
             fail("invalid statement syntax for '" + stmt + "'");
         }
@@ -101,7 +100,7 @@ public class PredicatesTest extends Abst
             + "' or @" + jcrPrimaryType + "='" + ntBase + "']";
 
         try {
-            qm.createQuery(stmt, Query.XPATH);
+            qm.createQuery(stmt, qsXPATH);
         } catch (InvalidQueryException e) {
             fail("invalid statement syntax for '" + stmt + "'");
         }
@@ -117,7 +116,7 @@ public class PredicatesTest extends Abst
             xpathRoot + "/*[@" + jcrPrimaryType + " or @" + jcrMixinTypes + "]";
 
         try {
-            qm.createQuery(stmt, Query.XPATH);
+            qm.createQuery(stmt, qsXPATH);
         } catch (InvalidQueryException e) {
             fail("invalid statement syntax for '" + stmt + "'");
         }
@@ -133,7 +132,7 @@ public class PredicatesTest extends Abst
             xpathRoot + "/*[@" + jcrPrimaryType + " and @" + jcrMixinTypes + "]";
 
         try {
-            qm.createQuery(stmt, Query.XPATH);
+            qm.createQuery(stmt, qsXPATH);
         } catch (InvalidQueryException e) {
             fail("invalid statement syntax for '" + stmt + "'");
         }
@@ -150,7 +149,7 @@ public class PredicatesTest extends Abst
             + "' and @" + jcrPrimaryType + "='" + ntBase + "']";
 
         try {
-            qm.createQuery(stmt, Query.XPATH);
+            qm.createQuery(stmt, qsXPATH);
         } catch (InvalidQueryException e) {
             fail("invalid statement syntax for '" + stmt + "'");
         }

Modified: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/QueryResultNodeIteratorTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/QueryResultNodeIteratorTest.java?rev=1225191&r1=1225190&r2=1225191&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/QueryResultNodeIteratorTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/QueryResultNodeIteratorTest.java
Wed Dec 28 14:29:18 2011
@@ -20,7 +20,6 @@ import org.apache.jackrabbit.test.NotExe
 
 import javax.jcr.RepositoryException;
 import javax.jcr.NodeIterator;
-import javax.jcr.query.Query;
 import javax.jcr.query.QueryResult;
 import java.util.NoSuchElementException;
 
@@ -54,7 +53,7 @@ public class QueryResultNodeIteratorTest
      *          if getSize() returns -1 (unavailable).
      */
     public void testGetSize() throws RepositoryException, NotExecutableException {
-        NodeIterator it = execute(xpathRoot + "//*", Query.XPATH).getNodes();
+        NodeIterator it = execute(xpathRoot + "//*", qsXPATH).getNodes();
         long size = testRootNode.getNodes().getSize();
         if (size != -1) {
             long count = 0;
@@ -72,7 +71,7 @@ public class QueryResultNodeIteratorTest
      * Tests the method <code>NodeIterator.getPosition()</code>.
      */
     public void testGetPosition() throws RepositoryException, NotExecutableException {
-        QueryResult rs = execute(xpathRoot + "//*", Query.XPATH);
+        QueryResult rs = execute(xpathRoot + "//*", qsXPATH);
 
         // getPosition initially returns 0
         NodeIterator it = rs.getNodes();
@@ -92,7 +91,7 @@ public class QueryResultNodeIteratorTest
      * @throws NotExecutableException 
      */
     public void testGetPositionEmptyIterator() throws RepositoryException, NotExecutableException
{
-        QueryResult rs = execute(xpathRoot + "/" + nodeName4, Query.XPATH);
+        QueryResult rs = execute(xpathRoot + "/" + nodeName4, qsXPATH);
 
         NodeIterator it = rs.getNodes();
         assertFalse("NodeIterator must be empty.", it.hasNext());
@@ -107,7 +106,7 @@ public class QueryResultNodeIteratorTest
      * @throws NotExecutableException 
      */
     public void testNoSuchElementException() throws RepositoryException, NotExecutableException
{
-        NodeIterator it = execute(xpathRoot + "//*", Query.XPATH).getNodes();
+        NodeIterator it = execute(xpathRoot + "//*", qsXPATH).getNodes();
         while (it.hasNext()) {
             it.nextNode();
         }
@@ -125,7 +124,7 @@ public class QueryResultNodeIteratorTest
      */
     public void testSkip() throws RepositoryException, NotExecutableException {
         String query = xpathRoot + "//*";
-        QueryResult rs = execute(query, Query.XPATH);
+        QueryResult rs = execute(query, qsXPATH);
         NodeIterator it = rs.getNodes();
 
         // find out if there is anything we can skip
@@ -136,7 +135,7 @@ public class QueryResultNodeIteratorTest
         }
         if (count > 1) {
             // re-execute the query
-            rs = execute(query, Query.XPATH);
+            rs = execute(query, qsXPATH);
             it = rs.getNodes();
             // skip all but one
             it.skip(count - 1);
@@ -150,7 +149,7 @@ public class QueryResultNodeIteratorTest
             }
 
             // re-execute the query
-            rs = execute(query, Query.XPATH);
+            rs = execute(query, qsXPATH);
             it = rs.getNodes();
             try {
                 it.skip(count + 1);

Modified: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/SQLJcrPathTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/SQLJcrPathTest.java?rev=1225191&r1=1225190&r2=1225191&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/SQLJcrPathTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/SQLJcrPathTest.java
Wed Dec 28 14:29:18 2011
@@ -66,7 +66,7 @@ public class SQLJcrPathTest extends Abst
         String queryStatement = "select * from " + nodeTypeName;
 
         // execute the search query
-        Query query = super.createQuery(queryStatement, Query.SQL);
+        Query query = super.createQuery(queryStatement, qsSQL);
         QueryResult result = query.execute();
 
         assertTrue("jcr:path must be present in query result row",

Modified: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/SQLOrderByTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/SQLOrderByTest.java?rev=1225191&r1=1225190&r2=1225191&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/SQLOrderByTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/SQLOrderByTest.java
Wed Dec 28 14:29:18 2011
@@ -16,9 +16,6 @@
  */
 package org.apache.jackrabbit.test.api.query;
 
-import javax.jcr.query.Query;
-
-
 /**
  * This test searches for all nodes of a specific node type and orders them by
  * the property with name configured as {@link #propertyName1}.
@@ -61,7 +58,7 @@ public class SQLOrderByTest extends Abst
      * For configuration description see {@link SQLOrderByTest}.
      */
     public void testOrderByAscending() throws Exception {
-        Statement stmt = new Statement(baseStatement + " ASC", Query.SQL);
+        Statement stmt = new Statement(baseStatement + " ASC", qsSQL);
         evaluateResultOrder(execute(stmt), propertyName1, false);
     }
 
@@ -71,7 +68,7 @@ public class SQLOrderByTest extends Abst
      * For configuration description see {@link SQLOrderByTest}.
      */
     public void testOrderByDescending() throws Exception {
-        Statement stmt = new Statement(baseStatement + " DESC", Query.SQL);
+        Statement stmt = new Statement(baseStatement + " DESC", qsSQL);
         evaluateResultOrder(execute(stmt), propertyName1, true);
     }
 
@@ -82,7 +79,7 @@ public class SQLOrderByTest extends Abst
      * For configuration description see {@link SQLOrderByTest}.
      */
     public void testOrderByDefault() throws Exception {
-        Statement stmt = new Statement(baseStatement, Query.SQL);
+        Statement stmt = new Statement(baseStatement, qsSQL);
         evaluateResultOrder(execute(stmt), propertyName1, false);
     }
 }
\ No newline at end of file

Modified: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/SQLQueryLevel2Test.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/SQLQueryLevel2Test.java?rev=1225191&r1=1225190&r2=1225191&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/SQLQueryLevel2Test.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/SQLQueryLevel2Test.java
Wed Dec 28 14:29:18 2011
@@ -16,7 +16,6 @@
  */
 package org.apache.jackrabbit.test.api.query;
 
-import javax.jcr.query.Query;
 import javax.jcr.query.QueryResult;
 import javax.jcr.query.RowIterator;
 import javax.jcr.query.Row;
@@ -137,7 +136,7 @@ public class SQLQueryLevel2Test extends 
         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);
+        return new Statement(tmp.toString(), qsSQL);
     }
 
     /**
@@ -154,7 +153,7 @@ public class SQLQueryLevel2Test extends 
         tmp.append(escapeIdentifierForSQL(propertyName1));
         tmp.append(" AND ").append(jcrPath).append(" LIKE '");
         tmp.append(testRoot).append("/%'");
-        return new Statement(tmp.toString(), Query.SQL);
+        return new Statement(tmp.toString(), qsSQL);
     }
 
     /**
@@ -171,6 +170,6 @@ public class SQLQueryLevel2Test extends 
         tmp.append(" > 'a'");
         tmp.append(" AND ").append(jcrPath).append(" LIKE '");
         tmp.append(testRoot).append("/%'");
-        return new Statement(tmp.toString(), Query.SQL);
+        return new Statement(tmp.toString(), qsSQL);
     }
 }
\ No newline at end of file

Modified: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/SimpleSelectionTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/SimpleSelectionTest.java?rev=1225191&r1=1225190&r2=1225191&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/SimpleSelectionTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/SimpleSelectionTest.java
Wed Dec 28 14:29:18 2011
@@ -78,7 +78,7 @@ public class SimpleSelectionTest extends
         String propQuery = "/" + jcrRoot + firstChildpath + "[@" + jcrPrimaryType + "]";
 
         // execute search query
-        Query query = session.getWorkspace().getQueryManager().createQuery(propQuery, Query.XPATH);
+        Query query = session.getWorkspace().getQueryManager().createQuery(propQuery, qsXPATH);
         QueryResult result = query.execute();
 
         assertEquals("Should have only 1 result", 1, getSize(result.getRows()));

Modified: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/XPathDocOrderTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/XPathDocOrderTest.java?rev=1225191&r1=1225190&r2=1225191&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/XPathDocOrderTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/XPathDocOrderTest.java
Wed Dec 28 14:29:18 2011
@@ -21,7 +21,6 @@ import org.apache.jackrabbit.test.NotExe
 import javax.jcr.RepositoryException;
 import javax.jcr.NodeIterator;
 import javax.jcr.Repository;
-import javax.jcr.query.Query;
 import javax.jcr.query.QueryResult;
 
 /**
@@ -58,7 +57,7 @@ public class XPathDocOrderTest extends A
         for (NodeIterator nodes = testRootNode.getNodes(); nodes.hasNext() && nodes.getPosition()
< 2;) {
             resultPath = nodes.nextNode().getPath();
         }
-        docOrderTest(new Statement(xpath, Query.XPATH), resultPath);
+        docOrderTest(new Statement(xpath, qsXPATH), resultPath);
     }
 
     /**
@@ -73,7 +72,7 @@ public class XPathDocOrderTest extends A
         for (NodeIterator nodes = testRootNode.getNodes(); nodes.hasNext() && nodes.getPosition()
< 2;) {
             resultPath = nodes.nextNode().getPath();
         }
-        docOrderTest(new Statement(xpath, Query.XPATH), resultPath);
+        docOrderTest(new Statement(xpath, qsXPATH), resultPath);
     }
 
     /**
@@ -87,7 +86,7 @@ public class XPathDocOrderTest extends A
         for (NodeIterator nodes = testRootNode.getNodes(); nodes.hasNext();) {
             resultPath = nodes.nextNode().getPath();
         }
-        docOrderTest(new Statement(xpath, Query.XPATH), resultPath);
+        docOrderTest(new Statement(xpath, qsXPATH), resultPath);
     }
 
     /**
@@ -98,7 +97,7 @@ public class XPathDocOrderTest extends A
     public void testDocOrderFirstFunction() throws Exception {
         String xpath = xpathRoot + "/*[first()]";
         String resultPath = testRootNode.getNodes().nextNode().getPath();
-        docOrderTest(new Statement(xpath, Query.XPATH), resultPath);
+        docOrderTest(new Statement(xpath, qsXPATH), resultPath);
     }
 
     //-----------------------------< internal >---------------------------------

Modified: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/XPathJcrPathTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/XPathJcrPathTest.java?rev=1225191&r1=1225190&r2=1225191&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/XPathJcrPathTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/XPathJcrPathTest.java
Wed Dec 28 14:29:18 2011
@@ -66,7 +66,7 @@ public class XPathJcrPathTest extends Ab
         String queryStatement = "//element(*, " + nodeTypeName + ")";
 
         // execute the search query
-        Query query = session.getWorkspace().getQueryManager().createQuery(queryStatement,
Query.XPATH);
+        Query query = session.getWorkspace().getQueryManager().createQuery(queryStatement,
qsXPATH);
         QueryResult result = query.execute();
 
         assertTrue("jcr:path must be present in query result row",

Modified: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/XPathOrderByTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/XPathOrderByTest.java?rev=1225191&r1=1225190&r2=1225191&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/XPathOrderByTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/XPathOrderByTest.java
Wed Dec 28 14:29:18 2011
@@ -16,8 +16,6 @@
  */
 package org.apache.jackrabbit.test.api.query;
 
-import javax.jcr.query.Query;
-
 /**
  * This test searches for all nodes of a specific node type and orders them by
  * the property with name configured as {@link #propertyName1}.
@@ -54,7 +52,7 @@ public class XPathOrderByTest extends Ab
      * For configuration description see {@link XPathOrderByTest}.
      */
     public void testOrderByAscending() throws Exception {
-        Statement stmt = new Statement(baseStatement + " ascending", Query.XPATH);
+        Statement stmt = new Statement(baseStatement + " ascending", qsXPATH);
         evaluateResultOrder(execute(stmt), propertyName1, false);
     }
 
@@ -64,7 +62,7 @@ public class XPathOrderByTest extends Ab
      * For configuration description see {@link XPathOrderByTest}.
      */
     public void testOrderByDescending() throws Exception {
-        Statement stmt = new Statement(baseStatement + " descending", Query.XPATH);
+        Statement stmt = new Statement(baseStatement + " descending", qsXPATH);
         evaluateResultOrder(execute(stmt), propertyName1, true);
     }
 
@@ -74,7 +72,7 @@ public class XPathOrderByTest extends Ab
      * For configuration description see {@link XPathOrderByTest}.
      */
     public void testOrderBy() throws Exception {
-        Statement stmt = new Statement(baseStatement, Query.XPATH);
+        Statement stmt = new Statement(baseStatement, qsXPATH);
         evaluateResultOrder(execute(stmt), propertyName1, false);
     }
 

Modified: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/XPathPosIndexTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/XPathPosIndexTest.java?rev=1225191&r1=1225190&r2=1225191&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/XPathPosIndexTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/XPathPosIndexTest.java
Wed Dec 28 14:29:18 2011
@@ -21,7 +21,6 @@ import org.apache.jackrabbit.test.NotExe
 import javax.jcr.RepositoryException;
 import javax.jcr.NodeIterator;
 import javax.jcr.Repository;
-import javax.jcr.query.Query;
 import javax.jcr.query.QueryResult;
 
 /**
@@ -57,7 +56,7 @@ public class XPathPosIndexTest extends A
         String path = testRoot + "/" + nodeName1 + "[2]";
         StringBuffer tmp = new StringBuffer("/");
         tmp.append(jcrRoot).append(path);
-        docOrderTest(new Statement(tmp.toString(), Query.XPATH), path);
+        docOrderTest(new Statement(tmp.toString(), qsXPATH), path);
     }
 
     //-----------------------------< internal >---------------------------------

Modified: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/XPathQueryLevel2Test.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/XPathQueryLevel2Test.java?rev=1225191&r1=1225190&r2=1225191&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/XPathQueryLevel2Test.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/XPathQueryLevel2Test.java
Wed Dec 28 14:29:18 2011
@@ -16,7 +16,6 @@
  */
 package org.apache.jackrabbit.test.api.query;
 
-import javax.jcr.query.Query;
 import javax.jcr.query.QueryResult;
 import javax.jcr.query.RowIterator;
 import javax.jcr.Value;
@@ -131,7 +130,7 @@ public class XPathQueryLevel2Test extend
     private Statement getFullTextStatement() {
         String xpath =
             xpathRoot + "/*[" + jcrContains + "(., '\"quick brown\" -cat')]";
-        return new Statement(xpath, Query.XPATH);
+        return new Statement(xpath, qsXPATH);
     }
 
     /**
@@ -142,7 +141,7 @@ public class XPathQueryLevel2Test extend
         String xpath =
             xpathRoot + "/*[@" + propertyName2 + " = 'two' and @"
             + propertyName1 + " = 'existence']";
-        return new Statement(xpath, Query.XPATH);
+        return new Statement(xpath, qsXPATH);
     }
 
     /**
@@ -152,7 +151,7 @@ public class XPathQueryLevel2Test extend
         String xpath =
             xpathRoot + "/*[@" + propertyName1 + " <= 'b' and @"
             + propertyName1 + " > 'a']";
-        return new Statement(xpath, Query.XPATH);
+        return new Statement(xpath, qsXPATH);
     }
 
 }

Modified: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/qom/GetQueryTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/qom/GetQueryTest.java?rev=1225191&r1=1225190&r2=1225191&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/qom/GetQueryTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/qom/GetQueryTest.java
Wed Dec 28 14:29:18 2011
@@ -49,13 +49,13 @@ public class GetQueryTest extends Abstra
         );
         queries.add(qom);
         queries.add(qm.createQuery(qom.getStatement(), Query.JCR_SQL2));
-        if (isSupportedLanguage(Query.XPATH)) {
+        if (isSupportedLanguage(qsXPATH)) {
             String xpath = testPath + "/element(*, " + testNodeType + ")";
-            queries.add(qm.createQuery(xpath, Query.XPATH));
+            queries.add(qm.createQuery(xpath, qsXPATH));
         }
-        if (isSupportedLanguage(Query.SQL)) {
+        if (isSupportedLanguage(qsSQL)) {
             String sql = "select * from " + testNodeType + " where jcr:path like '" + testRoot
+ "/%'";
-            queries.add(qm.createQuery(sql, Query.SQL));
+            queries.add(qm.createQuery(sql, qsSQL));
         }
         for (Iterator<Query> it = queries.iterator(); it.hasNext(); ) {
             Query q = it.next();



Mime
View raw message