sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jsedd...@apache.org
Subject svn commit: r1644845 - in /sling/trunk/testing/mocks/jcr-mock/src/main/java/org/apache/sling/testing/mock/jcr: MockQuery.java MockQueryManager.java
Date Fri, 12 Dec 2014 08:43:42 GMT
Author: jsedding
Date: Fri Dec 12 08:43:42 2014
New Revision: 1644845

URL: http://svn.apache.org/r1644845
Log:
SLING-4237 - JCR Mock implementation should have "throws RepositoryException"
- add exceptions also to MockQuery* classes

Modified:
    sling/trunk/testing/mocks/jcr-mock/src/main/java/org/apache/sling/testing/mock/jcr/MockQuery.java
    sling/trunk/testing/mocks/jcr-mock/src/main/java/org/apache/sling/testing/mock/jcr/MockQueryManager.java

Modified: sling/trunk/testing/mocks/jcr-mock/src/main/java/org/apache/sling/testing/mock/jcr/MockQuery.java
URL: http://svn.apache.org/viewvc/sling/trunk/testing/mocks/jcr-mock/src/main/java/org/apache/sling/testing/mock/jcr/MockQuery.java?rev=1644845&r1=1644844&r2=1644845&view=diff
==============================================================================
--- sling/trunk/testing/mocks/jcr-mock/src/main/java/org/apache/sling/testing/mock/jcr/MockQuery.java
(original)
+++ sling/trunk/testing/mocks/jcr-mock/src/main/java/org/apache/sling/testing/mock/jcr/MockQuery.java
Fri Dec 12 08:43:42 2014
@@ -23,6 +23,7 @@ import java.util.Map;
 import java.util.Set;
 
 import javax.jcr.Node;
+import javax.jcr.RepositoryException;
 import javax.jcr.Value;
 import javax.jcr.query.Query;
 import javax.jcr.query.QueryResult;
@@ -52,7 +53,7 @@ public final class MockQuery implements
     }
 
     @Override
-    public QueryResult execute() {
+    public QueryResult execute() throws RepositoryException {
         return queryManager.executeQuery(this);
     }
 
@@ -61,7 +62,7 @@ public final class MockQuery implements
         this.limit = limit;
     }
 
-    public long getLimit() {
+    public long getLimit() throws RepositoryException {
         return limit;
     }
 
@@ -70,7 +71,7 @@ public final class MockQuery implements
         this.offset = offset;
     }
 
-    public long getOffset() {
+    public long getOffset() throws RepositoryException {
         return offset;
     }
 
@@ -85,17 +86,17 @@ public final class MockQuery implements
     }
 
     @Override
-    public void bindValue(String varName, Value value) {
+    public void bindValue(String varName, Value value) throws RepositoryException {
         variables.put(varName,  value);
     }
 
     @Override
-    public String[] getBindVariableNames() {
+    public String[] getBindVariableNames() throws RepositoryException {
         Set<String> variableNames = variables.keySet();
         return variableNames.toArray(new String[variableNames.size()]);
     }
     
-    public Map<String, Value> getBindVariables() {
+    public Map<String, Value> getBindVariables() throws RepositoryException {
         return ImmutableMap.copyOf(variables);
     }
     
@@ -103,12 +104,12 @@ public final class MockQuery implements
     // --- unsupported operations ---
 
     @Override
-    public String getStoredQueryPath() {
+    public String getStoredQueryPath() throws RepositoryException {
         throw new UnsupportedOperationException();
     }
 
     @Override
-    public Node storeAsNode(String absPath) {
+    public Node storeAsNode(String absPath) throws RepositoryException {
         throw new UnsupportedOperationException();
     }
 

Modified: sling/trunk/testing/mocks/jcr-mock/src/main/java/org/apache/sling/testing/mock/jcr/MockQueryManager.java
URL: http://svn.apache.org/viewvc/sling/trunk/testing/mocks/jcr-mock/src/main/java/org/apache/sling/testing/mock/jcr/MockQueryManager.java?rev=1644845&r1=1644844&r2=1644845&view=diff
==============================================================================
--- sling/trunk/testing/mocks/jcr-mock/src/main/java/org/apache/sling/testing/mock/jcr/MockQueryManager.java
(original)
+++ sling/trunk/testing/mocks/jcr-mock/src/main/java/org/apache/sling/testing/mock/jcr/MockQueryManager.java
Fri Dec 12 08:43:42 2014
@@ -22,6 +22,7 @@ import java.util.ArrayList;
 import java.util.List;
 
 import javax.jcr.Node;
+import javax.jcr.RepositoryException;
 import javax.jcr.query.InvalidQueryException;
 import javax.jcr.query.Query;
 import javax.jcr.query.QueryManager;
@@ -48,7 +49,7 @@ class MockQueryManager implements QueryM
     );
     
     @Override
-    public Query createQuery(String statement, String language) throws InvalidQueryException
{
+    public Query createQuery(String statement, String language) throws RepositoryException
{
         if (!SUPPORTED_QUERY_LANGUAGES.contains(StringUtils.defaultString(language))) {
             throw new InvalidQueryException("Unsupported query language: " + language);
         }
@@ -56,7 +57,7 @@ class MockQueryManager implements QueryM
     }
 
     @Override
-    public String[] getSupportedQueryLanguages() {
+    public String[] getSupportedQueryLanguages() throws RepositoryException {
         return SUPPORTED_QUERY_LANGUAGES.toArray(new String[SUPPORTED_QUERY_LANGUAGES.size()]);
     }
     
@@ -83,7 +84,7 @@ class MockQueryManager implements QueryM
     }
 
     @Override
-    public Query getQuery(Node node) {
+    public Query getQuery(Node node) throws RepositoryException {
         throw new UnsupportedOperationException();
     }
 



Mime
View raw message