jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From resc...@apache.org
Subject svn commit: r805447 - /jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/AbstractQueryTest.java
Date Tue, 18 Aug 2009 15:24:54 GMT
Author: reschke
Date: Tue Aug 18 15:24:49 2009
New Revision: 805447

URL: http://svn.apache.org/viewvc?rev=805447&view=rev
Log:
JCR-2208: always check supported query languages first so that a non-XPath supporting repository
can be emulated by Jackrabbit.

Modified:
    jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/AbstractQueryTest.java

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=805447&r1=805446&r2=805447&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
Tue Aug 18 15:24:49 2009
@@ -148,18 +148,13 @@
      */
     protected Query createQuery(Session session, String statement, String language) throws
RepositoryException, NotExecutableException {
         log.println("Creating query: " + statement);
-        try {
+        
+        // check for unsupported query languages early
+        if (! isSupportedLanguage(language) && !Query.JCR_SQL2.equals(language))
{
+            throw new NotExecutableException("Repository does not support " + language +
" query syntax");
+        }
+        else {
             return session.getWorkspace().getQueryManager().createQuery(statement, language);
-        } catch (InvalidQueryException ex) {
-
-            // if language is optional and not reported as "supported" ->
-            // demote to NotExecutableException
-
-            if (!isSupportedLanguage(language) && !Query.JCR_SQL2.equals(language))
{
-                throw new NotExecutableException("Repository does not support " + language
+ " query syntax");
-            } else {
-                throw ex;
-            }
         }
     }
 



Mime
View raw message