You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by jo...@apache.org on 2022/09/04 08:39:18 UTC

[sling-org-apache-sling-testing-clients] 01/01: SLING-11552 fix javadoc generation

This is an automated email from the ASF dual-hosted git repository.

joerghoh pushed a commit to branch SLING-11552-fix-javadoc
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-clients.git

commit afd1f8e0adf3b9b24ed9bc46df79daa86491b71d
Author: Joerg Hoh <jo...@apache.org>
AuthorDate: Sun Sep 4 10:39:05 2022 +0200

    SLING-11552 fix javadoc generation
---
 .../sling/testing/clients/AbstractSlingClient.java |  2 +-
 .../sling/testing/clients/ClientException.java     | 30 +++++++++++-----------
 .../apache/sling/testing/clients/SlingClient.java  |  4 ++-
 .../sling/testing/clients/SlingHttpResponse.java   | 10 +++++---
 .../testing/clients/SystemPropertiesConfig.java    |  5 ++++
 .../testing/clients/indexing/IndexingClient.java   |  2 +-
 .../sling/testing/clients/osgi/BundlesInfo.java    |  4 +--
 .../sling/testing/clients/osgi/ComponentsInfo.java |  9 +++----
 .../testing/clients/osgi/OsgiConsoleClient.java    |  2 +-
 .../sling/testing/clients/osgi/ServicesInfo.java   |  6 ++---
 .../sling/testing/clients/util/HttpUtils.java      |  7 +++--
 .../sling/testing/clients/util/JsonUtils.java      |  2 +-
 .../sling/testing/clients/util/poller/Polling.java |  4 +--
 13 files changed, 47 insertions(+), 40 deletions(-)

diff --git a/src/main/java/org/apache/sling/testing/clients/AbstractSlingClient.java b/src/main/java/org/apache/sling/testing/clients/AbstractSlingClient.java
index 1f39545..e895af4 100644
--- a/src/main/java/org/apache/sling/testing/clients/AbstractSlingClient.java
+++ b/src/main/java/org/apache/sling/testing/clients/AbstractSlingClient.java
@@ -223,7 +223,7 @@ public class AbstractSlingClient implements HttpClient, Closeable {
      * @param clientClass the type of client requested, identified by its Class
      * @param <T>         any class extending the AbstractSlingClient
      * @return instance of a class extending the AbstractSlingClient
-     * @throws ClientException if client can't be instantiated
+     * @throws TestingValidationException if client can't be instantiated
      */
     @SuppressWarnings("unchecked")
     public <T extends AbstractSlingClient> T adaptTo(Class<T> clientClass) throws TestingValidationException {
diff --git a/src/main/java/org/apache/sling/testing/clients/ClientException.java b/src/main/java/org/apache/sling/testing/clients/ClientException.java
index b267561..fa55529 100644
--- a/src/main/java/org/apache/sling/testing/clients/ClientException.java
+++ b/src/main/java/org/apache/sling/testing/clients/ClientException.java
@@ -25,7 +25,7 @@ import org.apache.http.client.methods.HttpUriRequest;
  * sub-classes instead:
  * <ul>
  *   <li>TestingIOException to indicate network and IO problems</li>
- *   <li>TestingValidationException to indicate a mismatch between expecation and result</li>
+ *   <li>TestingValidationException to indicate a mismatch between expectation and result</li>
  *   <li>TestingSetupException to indicate problems in the test setup (incorrect parameters etc)</li>
  * </ul>
  * 
@@ -40,7 +40,7 @@ public class ClientException extends Exception {
 
     /**
      * @deprecated use a constructor of one of the subclasses
-     * @param message
+     * @param message message
      */
     @Deprecated
     public ClientException(String message) {
@@ -49,8 +49,8 @@ public class ClientException extends Exception {
 
     /**
      * @deprecated use a constructor of one of the subclasses
-     * @param message
-     * @param throwable
+     * @param message message
+     * @param throwable a throwable
      */
     @Deprecated
     public ClientException(String message, Throwable throwable) {
@@ -59,8 +59,8 @@ public class ClientException extends Exception {
 
     /**
      * @deprecated use a constructor of one of the subclasses
-     * @param message
-     * @param httpStatusCode
+     * @param message message
+     * @param httpStatusCode statuscode
      */
     @Deprecated
     public ClientException(String message, int httpStatusCode) {
@@ -69,9 +69,9 @@ public class ClientException extends Exception {
 
     /**
      * @deprecated use a constructor of one of the subclasses
-     * @param message
-     * @param httpStatusCode
-     * @param throwable
+     * @param message message
+     * @param httpStatusCode statuscode
+     * @param throwable throwable
      */
     @Deprecated
     public ClientException(String message, int httpStatusCode, Throwable throwable) {
@@ -81,10 +81,10 @@ public class ClientException extends Exception {
 
     /**
      * @deprecated use a constructor of one of the subclasses
-     * @param message
-     * @param throwable
-     * @param request
-     * @param response
+     * @param message message
+     * @param throwable throwable
+     * @param request request
+     * @param response response
      */
     @Deprecated
     public ClientException(String message, Throwable throwable, HttpUriRequest request, SlingHttpResponse response) {
@@ -105,7 +105,7 @@ public class ClientException extends Exception {
 
     /**
      * Set the request associated with this exception
-     * @param request
+     * @param request request
      */
     public void setRequest(HttpUriRequest request) {
         this.request = request;
@@ -120,7 +120,7 @@ public class ClientException extends Exception {
 
     /**
      * Set the response associated with this exception or {{null}}
-     * @param response
+     * @param response response
      */
     public void setResponse(SlingHttpResponse response) {
         this.response = response;
diff --git a/src/main/java/org/apache/sling/testing/clients/SlingClient.java b/src/main/java/org/apache/sling/testing/clients/SlingClient.java
index 6230857..5287f09 100644
--- a/src/main/java/org/apache/sling/testing/clients/SlingClient.java
+++ b/src/main/java/org/apache/sling/testing/clients/SlingClient.java
@@ -185,6 +185,7 @@ public class SlingClient extends AbstractSlingClient {
 
     /**
      * End the impersonation of the current user.
+     * @return the SlingClient
      */
     public SlingClient endImpersonation() {
         BasicClientCookie c = new BasicClientCookie(getSudoCookieName(), "");
@@ -245,7 +246,7 @@ public class SlingClient extends AbstractSlingClient {
      * @param path path to be checked
      * @param waitMillis time to wait between retries
      * @param retryCount number of retries before throwing an exception
-     * @throws ClientException if the path was not found
+     * @throws TestingValidationException if the path was not found
      * @throws InterruptedException to mark this operation as "waiting"
      */
     @Deprecated
@@ -621,6 +622,7 @@ public class SlingClient extends AbstractSlingClient {
      *Passing a <code>null</code> will clear impersonation.
      *
      * @param userId   the user to impersonate. A <code>null</code> value clears impersonation
+     * @return the slingClient with the impersonation applied
      */
     public SlingClient impersonate(String userId) {
         if(userId == null){
diff --git a/src/main/java/org/apache/sling/testing/clients/SlingHttpResponse.java b/src/main/java/org/apache/sling/testing/clients/SlingHttpResponse.java
index 6bb813b..d30a5d8 100644
--- a/src/main/java/org/apache/sling/testing/clients/SlingHttpResponse.java
+++ b/src/main/java/org/apache/sling/testing/clients/SlingHttpResponse.java
@@ -78,7 +78,7 @@ public class SlingHttpResponse implements CloseableHttpResponse {
      * <p>Assert that response matches supplied status</p>
      *
      * @param expected the expected http status
-     * @throws ClientException if the response does not match the expected
+     * @throws TestingValidationException if the response does not match the expected
      */
     public void checkStatus(int expected) throws TestingValidationException {
         if (this.getStatusLine().getStatusCode() != expected) {
@@ -91,7 +91,7 @@ public class SlingHttpResponse implements CloseableHttpResponse {
      * <p>Assert that response matches supplied content type (from Content-Type header)</p>
      *
      * @param expected the expected content type
-     * @throws ClientException if the response content type does not match the expected
+     * @throws TestingValidationException if the response content type does not match the expected
      */
     public void checkContentType(String expected) throws TestingValidationException {
         // Remove whatever follows semicolon in content-type
@@ -111,7 +111,7 @@ public class SlingHttpResponse implements CloseableHttpResponse {
      * <p>The regular expressions are automatically prefixed and suffixed with .* it order to partial-match the lines</p>
      *
      * @param regexp list of regular expressions
-     * @throws ClientException if the response content does not match one of the regexp
+     * @throws TestingValidationException if the response content does not match one of the regexp
      */
     public void checkContentRegexp(String... regexp) throws TestingValidationException {
         for(String expr : regexp) {
@@ -137,7 +137,9 @@ public class SlingHttpResponse implements CloseableHttpResponse {
      * <p>Assert that all the provided {@code Strings} are contained in the response</p>
      *
      * @param expected list of expected strings
-     * @throws ClientException @throws ClientException if the response content does not match one of the strings
+     * @throws TestingValidationException 
+     * @throws TestingValidationException if the response content does not match one of the strings
+     * 
      */
     public void checkContentContains(String... expected) throws TestingValidationException {
         for (String s : expected) {
diff --git a/src/main/java/org/apache/sling/testing/clients/SystemPropertiesConfig.java b/src/main/java/org/apache/sling/testing/clients/SystemPropertiesConfig.java
index a1f6d09..e9e9862 100644
--- a/src/main/java/org/apache/sling/testing/clients/SystemPropertiesConfig.java
+++ b/src/main/java/org/apache/sling/testing/clients/SystemPropertiesConfig.java
@@ -66,6 +66,7 @@ public class SystemPropertiesConfig {
     /**
      * Custom delay in milliseconds before an HTTP request goes through.
      * Used by {@link org.apache.sling.testing.clients.interceptors.DelayRequestInterceptor}
+     * @return the delay in muliseconds
      */
     public static long getHttpDelay() {
         try {
@@ -77,6 +78,7 @@ public class SystemPropertiesConfig {
 
     /**
      * Number of http call retries in case of a 5XX response code
+     * @return the number of retries to be made
      */
     public static int getHttpRetries() {
         try {
@@ -88,6 +90,7 @@ public class SystemPropertiesConfig {
 
     /**
      * The delay in milliseconds between http retries
+     * @return the delay between http retries
      */
     public static int getHttpRetriesDelay() {
         try {
@@ -99,6 +102,7 @@ public class SystemPropertiesConfig {
 
     /**
      * Whether to log or not http request retries
+     * @return true if retries should be logged
      */
     public static boolean isHttpLogRetries() {
         try {
@@ -111,6 +115,7 @@ public class SystemPropertiesConfig {
     /**
      * Comma-separated list of http response codes for which to retry the request
      * If empty, all 5XX error codes will be retried
+     * @return a non-null collection with the http resonse codes
      */
     public static Collection<Integer> getHttpRetriesErrorCodes() {
         try {
diff --git a/src/main/java/org/apache/sling/testing/clients/indexing/IndexingClient.java b/src/main/java/org/apache/sling/testing/clients/indexing/IndexingClient.java
index ad7e211..e1bb003 100644
--- a/src/main/java/org/apache/sling/testing/clients/indexing/IndexingClient.java
+++ b/src/main/java/org/apache/sling/testing/clients/indexing/IndexingClient.java
@@ -191,7 +191,7 @@ public class IndexingClient extends SlingClient {
      * Else, retrieves configured lanes on the instance
      *
      * @return list of lane names
-     * @throws ClientException 
+     * @throws ClientException in case of problems
      */
     public List<String> getLaneNames() throws ClientException {
         List<String> configuredLanes = getConfiguredLaneNames();
diff --git a/src/main/java/org/apache/sling/testing/clients/osgi/BundlesInfo.java b/src/main/java/org/apache/sling/testing/clients/osgi/BundlesInfo.java
index 23e802e..6ca4be7 100644
--- a/src/main/java/org/apache/sling/testing/clients/osgi/BundlesInfo.java
+++ b/src/main/java/org/apache/sling/testing/clients/osgi/BundlesInfo.java
@@ -36,7 +36,7 @@ public class BundlesInfo {
      * The only constructor.
      *
      * @param root the root JSON node of the bundles info.
-     * @throws ClientException if the json does not contain the proper info
+     * @throws TestingValidationException if the json does not contain the proper info
      */
     public BundlesInfo(JsonNode root) throws TestingValidationException {
         this.root = root;
@@ -50,7 +50,7 @@ public class BundlesInfo {
 
     /**
      * @return the status message of the bundle context
-     * @throws ClientException if the request cannot be completed
+     * @throws TestingValidationException if the request cannot be completed
      */
     public String getStatusMessage() throws TestingValidationException {
         if (root.get("status") == null)
diff --git a/src/main/java/org/apache/sling/testing/clients/osgi/ComponentsInfo.java b/src/main/java/org/apache/sling/testing/clients/osgi/ComponentsInfo.java
index 20420f7..4865315 100644
--- a/src/main/java/org/apache/sling/testing/clients/osgi/ComponentsInfo.java
+++ b/src/main/java/org/apache/sling/testing/clients/osgi/ComponentsInfo.java
@@ -35,7 +35,6 @@ public class ComponentsInfo {
      * The only constructor.
      *
      * @param rootNode the root JSON node of the components info.
-     * @throws ClientException if the info cannot be retrieved
      */
     public ComponentsInfo(JsonNode rootNode) {
         this.root = rootNode;
@@ -43,7 +42,7 @@ public class ComponentsInfo {
 
     /**
      * @return the number of installed components
-     * @throws ClientException if the info cannot be retrieved
+     * @throws TestingValidationException if the info cannot be retrieved
      */
     public int getNumberOfInstalledComponents() throws TestingValidationException {
         if (root.get("status") == null)
@@ -54,7 +53,7 @@ public class ComponentsInfo {
     /**
      * @param id the id of the component
      * @return the ComponentInfo for a component with the identifier {@code id}
-     * @throws ClientException if the info cannot be retrieved
+     * @throws TestingValidationException if the info cannot be retrieved
      */
     public ComponentInfo forId(String id) throws TestingValidationException {
         JsonNode component = findBy("id", id);
@@ -64,7 +63,7 @@ public class ComponentsInfo {
     /**
      * @param name the name of the component
      * @return the ComponentInfo for a component with the name {@code name}
-     * @throws ClientException if the info cannot be retrieved
+     * @throws TestingValidationException if the info cannot be retrieved
      */
     public ComponentInfo forName(String name) throws TestingValidationException {
         JsonNode component = findBy("name", name);
@@ -74,7 +73,7 @@ public class ComponentsInfo {
     /**
      * @param pid the pid of the component
      * @return the ComponentInfo for a component with the pid {@code pid}
-     * @throws ClientException if the info cannot be retrieved
+     * @throws TestingValidationException if the info cannot be retrieved
      */
     public ComponentInfo forPid(String pid) throws TestingValidationException {
         JsonNode component = findBy("pid", pid);
diff --git a/src/main/java/org/apache/sling/testing/clients/osgi/OsgiConsoleClient.java b/src/main/java/org/apache/sling/testing/clients/osgi/OsgiConsoleClient.java
index 303bf20..a7dc26b 100644
--- a/src/main/java/org/apache/sling/testing/clients/osgi/OsgiConsoleClient.java
+++ b/src/main/java/org/apache/sling/testing/clients/osgi/OsgiConsoleClient.java
@@ -385,7 +385,7 @@ public class OsgiConsoleClient extends SlingClient {
      * @param pid pid
      * @param expectedStatus expected response status
      * @return the config properties
-     * @throws ClientException if the response status does not match any of the expectedStatus
+     * @throws TestingValidationException if the response status does not match any of the expectedStatus
      * @throws InterruptedException to mark this operation as "waiting"
      */
     @Deprecated
diff --git a/src/main/java/org/apache/sling/testing/clients/osgi/ServicesInfo.java b/src/main/java/org/apache/sling/testing/clients/osgi/ServicesInfo.java
index e99f329..03869f0 100644
--- a/src/main/java/org/apache/sling/testing/clients/osgi/ServicesInfo.java
+++ b/src/main/java/org/apache/sling/testing/clients/osgi/ServicesInfo.java
@@ -38,7 +38,7 @@ public class ServicesInfo {
      * The only constructor.
      *
      * @param root the root JSON node of the bundles info.
-     * @throws ClientException if the json does not contain the proper info
+     * @throws TestingValidationException if the json does not contain the proper info
      */
     public ServicesInfo(JsonNode root) throws TestingValidationException {
         this.root = root;
@@ -61,7 +61,7 @@ public class ServicesInfo {
      *
      * @param id the id of the service
      * @return the BundleInfo
-     * @throws ClientException if the info could not be retrieved
+     * @throws TestingValidationException if the info could not be retrieved
      */
     public ServiceInfo forId(String id) throws TestingValidationException {
         JsonNode serviceInfo = findBy("id", id);
@@ -73,7 +73,7 @@ public class ServicesInfo {
      *
      * @param type the type of the service
      * @return a Collection of {@link ServiceInfo}s of all services with the given type. Might be empty, never {@code null}
-     * @throws ClientException if the info cannot be retrieved
+     * @throws TestingValidationException if the info cannot be retrieved
      */
     public Collection<ServiceInfo> forType(String type)throws TestingValidationException {
         List<ServiceInfo> results = new LinkedList<>();
diff --git a/src/main/java/org/apache/sling/testing/clients/util/HttpUtils.java b/src/main/java/org/apache/sling/testing/clients/util/HttpUtils.java
index c4bff07..aac0c8e 100644
--- a/src/main/java/org/apache/sling/testing/clients/util/HttpUtils.java
+++ b/src/main/java/org/apache/sling/testing/clients/util/HttpUtils.java
@@ -33,7 +33,7 @@ public class HttpUtils {
      *
      * @param response       The Sling HTTP response
      * @param expectedStatus List of acceptable HTTP Statuses
-     * @throws ClientException if status is not expected
+     * @throws TestingValidationException if status is not expected
      */
     public static void verifyHttpStatus(SlingHttpResponse response, int... expectedStatus) throws TestingValidationException {
         if (!checkStatus(response, expectedStatus)) {
@@ -47,7 +47,7 @@ public class HttpUtils {
      * @param response       The SlingHttpResponse of an executed request.
      * @param errorMessage   error message; if {@code null}, errorMessage is extracted from response
      * @param expectedStatus List of acceptable HTTP Statuses
-     * @throws ClientException if status is not expected
+     * @throws TestingValidationException if status is not expected
      */
     public static void verifyHttpStatus(HttpResponse response, String errorMessage, int... expectedStatus)
             throws TestingValidationException {
@@ -130,7 +130,6 @@ public class HttpUtils {
      *
      * @param response The RequestExecutor of an executed request.
      * @return The HTTP Status of the response
-     * @throws ClientException never (kept for uniformity)
      */
     public static int getHttpStatus(HttpResponse response) {
         return response.getStatusLine().getStatusCode();
@@ -141,7 +140,7 @@ public class HttpUtils {
      *
      * @param response HttpResponse the http response
      * @return the location path
-     * @throws ClientException never (kept for uniformity)
+     * @throws TestingValidationException never (kept for uniformity)
      */
     public static String getLocationHeader(HttpResponse response) throws TestingValidationException {
         if (response == null) throw new TestingValidationException("Response must not be null!");
diff --git a/src/main/java/org/apache/sling/testing/clients/util/JsonUtils.java b/src/main/java/org/apache/sling/testing/clients/util/JsonUtils.java
index d77d833..22f46d7 100644
--- a/src/main/java/org/apache/sling/testing/clients/util/JsonUtils.java
+++ b/src/main/java/org/apache/sling/testing/clients/util/JsonUtils.java
@@ -29,7 +29,7 @@ public class JsonUtils {
      *
      * @param jsonString A string containing JSON
      * @return A {@link JsonNode} that is the root node of the JSON structure.
-     * @throws ClientException if error occurs while reading json string
+     * @throws TestingIOException if error occurs while reading json string
      */
     public static JsonNode getJsonNodeFromString(String jsonString) throws TestingIOException {
         try {
diff --git a/src/main/java/org/apache/sling/testing/clients/util/poller/Polling.java b/src/main/java/org/apache/sling/testing/clients/util/poller/Polling.java
index d6f0f05..ff4c9cf 100644
--- a/src/main/java/org/apache/sling/testing/clients/util/poller/Polling.java
+++ b/src/main/java/org/apache/sling/testing/clients/util/poller/Polling.java
@@ -150,7 +150,7 @@ public class Polling implements Callable<Boolean> {
 
     /**
      * Return the last exception while polling or {null}
-     * @return
+     * @return the last exception (can be null)
      */
     public Exception getLastException() {
         return lastException;
@@ -158,7 +158,7 @@ public class Polling implements Callable<Boolean> {
 
     /**
      * Return the list of all exceptions while polling
-     * @return
+     * @return the non-null list of exceptions
      */
     public List<Exception> getExceptions() {
         return exceptions;