This is an automated email from the ASF dual-hosted git repository. rombert pushed a commit to annotated tag org.apache.sling.testing.jcr-mock-1.1.10 in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-jcr-mock.git
commit ed1a43bf4006245065668ef9b1b01186e33e6c17 Author: Julian Sedding <[email protected]> AuthorDate: Fri Dec 12 08:43:42 2014 +0000 SLING-4237 - JCR Mock implementation should have "throws RepositoryException" - add exceptions also to MockQuery* classes git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/mocks/jcr-mock@1644845 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/sling/testing/mock/jcr/MockQuery.java | 17 +++++++++-------- .../apache/sling/testing/mock/jcr/MockQueryManager.java | 7 ++++--- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/src/main/java/org/apache/sling/testing/mock/jcr/MockQuery.java b/src/main/java/org/apache/sling/testing/mock/jcr/MockQuery.java index 3e9faa4..e7f3ff8 100644 --- a/src/main/java/org/apache/sling/testing/mock/jcr/MockQuery.java +++ b/src/main/java/org/apache/sling/testing/mock/jcr/MockQuery.java @@ -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 Query { } @Override - public QueryResult execute() { + public QueryResult execute() throws RepositoryException { return queryManager.executeQuery(this); } @@ -61,7 +62,7 @@ public final class MockQuery implements Query { this.limit = limit; } - public long getLimit() { + public long getLimit() throws RepositoryException { return limit; } @@ -70,7 +71,7 @@ public final class MockQuery implements Query { this.offset = offset; } - public long getOffset() { + public long getOffset() throws RepositoryException { return offset; } @@ -85,17 +86,17 @@ public final class MockQuery implements Query { } @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 Query { // --- 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(); } diff --git a/src/main/java/org/apache/sling/testing/mock/jcr/MockQueryManager.java b/src/main/java/org/apache/sling/testing/mock/jcr/MockQueryManager.java index 02f1eca..ddf2c12 100644 --- a/src/main/java/org/apache/sling/testing/mock/jcr/MockQueryManager.java +++ b/src/main/java/org/apache/sling/testing/mock/jcr/MockQueryManager.java @@ -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 QueryManager { ); @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 QueryManager { } @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 QueryManager { } @Override - public Query getQuery(Node node) { + public Query getQuery(Node node) throws RepositoryException { throw new UnsupportedOperationException(); } -- To stop receiving notification emails like this one, please contact "[email protected]" <[email protected]>.
