# Uses of Class
org.apache.sling.testing.clients.ClientException

Packages that use ClientException
Package
Description
org.apache.sling.testing.clients
org.apache.sling.testing.clients.email
org.apache.sling.testing.clients.exceptions
org.apache.sling.testing.clients.html
org.apache.sling.testing.clients.indexing
org.apache.sling.testing.clients.osgi
OSGI testing tools.
org.apache.sling.testing.clients.query
Query tools leveraging javax.jcr.query
org.apache.sling.testing.clients.util

## Uses of ClientException in org.apache.sling.testing.clients

Methods in org.apache.sling.testing.clients that throw ClientException
Modifier and Type
Method
Description
`SlingClient`
SlingClient.Builder.`build()`
`abstract T`
SlingClient.InternalBuilder.`build()`
`SlingClientConfig`
SlingClientConfig.Builder.`build()`
`protected SlingClientConfig`
SlingClient.InternalBuilder.`buildSlingClientConfig()`
`SlingHttpResponse`
SlingClient.`createFolder(String folderName, String folderTitle, String parentPath, int... expectedStatus)`
Creates a new Folder of type sling:OrderedFolder.
`SlingHttpResponse`
SlingClient.`createNode(String path, String nodeType)`
Creates the node specified by a given path with the given node type.
If the given node type is `null`, the node will be created with the default type: "sling:OrderedFolder".
If the node already exists, the method will return null, with no errors.
The method ignores trailing slashes so a path like this /a/b/c/// is accepted and will create the c node if the rest of the path exists.
`SlingHttpResponse`
SlingClient.`createNodeRecursive(String path, String nodeType)`
Recursively creates all the none existing nodes in the given path using the `SlingClient.createNode(String, String)` method.
`SlingHttpResponse`
SlingClient.`deletePath(String path, int... expectedStatus)`
Deletes a sling path (:operation delete)
`SlingHttpResponse`
AbstractSlingClient.`doDelete(String requestPath, List<org.apache.http.NameValuePair> parameters, List<org.apache.http.Header> headers, int... expectedStatus)`
Executes a DELETE request and consumes the entity in the response.
`SlingHttpResponse`
AbstractSlingClient.`doGet(String requestPath, int... expectedStatus)`
Executes a GET request and consumes the entity in the response (so the connection is closed immediately) The content is cached and can be retrieved using `response.getContent()`.
`SlingHttpResponse`
AbstractSlingClient.`doGet(String requestPath, List<org.apache.http.NameValuePair> parameters, int... expectedStatus)`
Executes a GET request and consumes the entity in the response (so the connection is closed immediately) The content is cached and can be retrieved using `response.getContent()`.
`SlingHttpResponse`
AbstractSlingClient.`doGet(String requestPath, List<org.apache.http.NameValuePair> parameters, List<org.apache.http.Header> headers, int... expectedStatus)`
Executes a GET request and consumes the entity in the response (so the connection is closed immediately) The content is cached and can be retrieved using `response.getContent()`.
`com.fasterxml.jackson.databind.JsonNode`
SlingClient.`doGetJson(String path, int depth, int... expectedStatus)`
Returns the `JsonNode` object corresponding to a content node.
`SlingHttpResponse`
AbstractSlingClient.`doHead(String requestPath, List<org.apache.http.NameValuePair> parameters, List<org.apache.http.Header> headers, int... expectedStatus)`
Executes a HEAD request
`SlingHttpResponse`
AbstractSlingClient.`doPatch(String requestPath, org.apache.http.HttpEntity entity, List<org.apache.http.Header> headers, int... expectedStatus)`
Executes a PATCH request and consumes the entity in the response.
`SlingHttpResponse`
AbstractSlingClient.`doPost(String requestPath, org.apache.http.HttpEntity entity, int... expectedStatus)`
Executes a POST request and consumes the entity in the response.
`SlingHttpResponse`
AbstractSlingClient.`doPost(String requestPath, org.apache.http.HttpEntity entity, List<org.apache.http.Header> headers, int... expectedStatus)`
Executes a POST request and consumes the entity in the response.
`SlingHttpResponse`
AbstractSlingClient.`doPut(String requestPath, org.apache.http.HttpEntity entity, List<org.apache.http.Header> headers, int... expectedStatus)`
Executes a PUT request and consumes the entity in the response.
`SlingHttpResponse`
AbstractSlingClient.`doRawRequest(String method, String uri, List<org.apache.http.Header> headers, int... expectedStatus)`
Executes a raw HTTP request, WITHOUT consuming the entity in the response.
`SlingHttpResponse`
AbstractSlingClient.`doRequest(org.apache.http.client.methods.HttpUriRequest request, List<org.apache.http.Header> headers, int... expectedStatus)`
Execute an HTTP request and consumes the entity in the response.
`SlingHttpResponse`
AbstractSlingClient.`doStreamGet(String requestPath, List<org.apache.http.NameValuePair> parameters, List<org.apache.http.Header> headers, int... expectedStatus)`
Executes a GET request WITHOUT consuming the entity in the response.
`SlingHttpResponse`
AbstractSlingClient.`doStreamPost(String requestPath, org.apache.http.HttpEntity entity, List<org.apache.http.Header> headers, int... expectedStatus)`
Executes a POST request WITHOUT consuming the entity in the response.
`SlingHttpResponse`
AbstractSlingClient.`doStreamRequest(org.apache.http.client.methods.HttpUriRequest request, List<org.apache.http.Header> headers, int... expectedStatus)`
Executes an HTTP request, WITHOUT consuming the entity in the response.
`boolean`
SlingClient.`exists(String path)`
Checks whether a path exists or not by making a GET request to that path with the `json` extension
`com.fasterxml.jackson.databind.JsonNode`
SlingClient.`getJsonNode(String path, int depth)`
Deprecated.
use `SlingClient.waitExists(String, long, long)` and `SlingClient.doGetJson(String, int, int...)` instead
`com.fasterxml.jackson.databind.JsonNode`
SlingClient.`getJsonNode(String path, int depth, long waitMillis, int retryNumber, int... expectedStatus)`
Deprecated.
use `SlingClient.waitExists(String, long, long)` and `SlingClient.doGetJson(String, int, int...)` instead
`String`
SlingClient.`getUUId(com.fasterxml.jackson.databind.JsonNode jsonNode)`
Get the UUID from a node that was already parsed in a `JsonNode`
`String`
SlingClient.`getUUID(String path)`
Get the UUID of a repository path
`SlingHttpResponse`
SlingClient.`importContent(String parentPath, String contentType, File contentFile, int... expectedStatus)`
Create a tree structure under `parentPath` by providing a `contentFile` in one of the supported formats: xml, jcr.xml, json, jar, zip.
`SlingHttpResponse`
SlingClient.`importContent(String parentPath, String contentType, String content, int... expectedStatus)`
Create a tree structure under `parentPath` by providing a `content` in one of the supported formats: xml, jcr.xml, json, jar, zip.
`SlingHttpResponse`
SlingClient.`importJson(String parentPath, com.fasterxml.jackson.databind.JsonNode json, int... expectedStatus)`
Wrapper method over `SlingClient.importContent(String, String, String, int...)` for directly importing a json node
`SlingHttpResponse`
SlingClient.`move(String srcPath, String destPath, int... expectedStatus)`
Moves a sling path to a new location (:operation move)
`SlingHttpResponse`
SlingClient.`setPropertiesString(String nodePath, List<org.apache.http.NameValuePair> properties, int... expectedStatus)`
Sets multiple String properties on a node in a single request
`SlingHttpResponse`
SlingClient.`setPropertyString(String nodePath, String propName, String propValue, int... expectedStatus)`
Sets String component property on a node.
`SlingHttpResponse`
SlingClient.`setPropertyStringArray(String nodePath, String propName, List<String> propValueList, int... expectedStatus)`
Sets a String[] component property on a node.
`SlingHttpResponse`
SlingClient.`upload(File file, String mimeType, String toPath, boolean createFolders, int... expectedStatus)`
Uploads a file to the repository.
Constructors in org.apache.sling.testing.clients that throw ClientException
Modifier
Constructor
Description
``
`SlingClient(URI url, String user, String password)`
Handy constructor easy to use in simple tests.
``
`SlingClient(org.apache.http.impl.client.CloseableHttpClient http, SlingClientConfig config)`
Constructor used by Builders and adaptTo().

## Uses of ClientException in org.apache.sling.testing.clients.email

Methods in org.apache.sling.testing.clients.email that throw ClientException
Modifier and Type
Method
Description
`void`
SlingEmailClient.`deleteMessages()`
Deletes all mail messages currently stored
`int`
SlingEmailClient.`getBindPort()`
Retrieves the actual bind port of the SMTP server
`List<EmailMessage>`
SlingEmailClient.`getMessages()`
Retrieves the list of mail messages currently stored
Constructors in org.apache.sling.testing.clients.email that throw ClientException
Modifier
Constructor
Description
``
`SlingEmailClient(org.apache.http.impl.client.CloseableHttpClient http, SlingClientConfig config)`

## Uses of ClientException in org.apache.sling.testing.clients.exceptions

Subclasses of ClientException in org.apache.sling.testing.clients.exceptions
Modifier and Type
Class
Description
`class`
`TestingIOException`
Use this exception to indicate any problems with networking (typically manifested as IOException).
`class`
`TestingSetupException`
Use this exception to signal problems in the test setup, e.g.
`class`
`TestingValidationException`
Use this exception to indicate any mismatch between expectations and the actual test result.

## Uses of ClientException in org.apache.sling.testing.clients.html

Constructors in org.apache.sling.testing.clients.html that throw ClientException
Modifier
Constructor
Description
``
`MicrodataClient(URI url, String user, String password)`
``
`MicrodataClient(org.apache.http.impl.client.CloseableHttpClient http, SlingClientConfig config)`

## Uses of ClientException in org.apache.sling.testing.clients.indexing

Methods in org.apache.sling.testing.clients.indexing that throw ClientException
Modifier and Type
Method
Description
`List<String>`
IndexingClient.`getLaneNames()`
Return the list of indexing lanes configured by `IndexingClient.setLaneNames(java.lang.String...)`, if any.
`void`
IndexingClient.`install()`
Creates the necessary custom indices in the repository, if not already present.
`void`
IndexingClient.`uninstall()`
Deprecated.
Use #uninstallWithRetry
`void`
IndexingClient.`waitForAsyncIndexing()`
Same as `IndexingClient.waitForAsyncIndexing(long timeout, long delay)`, but with default values for `timeout=1min` and `delay=500ms`.
`void`
IndexingClient.`waitForAsyncIndexing(long timeout, long delay)`
Blocks until all the async indices are up to date, to guarantee that the susequent queries return all the results.
Constructors in org.apache.sling.testing.clients.indexing that throw ClientException
Modifier
Constructor
Description
``
`IndexingClient(URI url, String user, String password)`
Handy constructor easy to use in simple tests.
``
`IndexingClient(org.apache.http.impl.client.CloseableHttpClient http, SlingClientConfig config)`
Constructor used by Builders and adaptTo().

## Uses of ClientException in org.apache.sling.testing.clients.osgi

Methods in org.apache.sling.testing.clients.osgi that throw ClientException
Modifier and Type
Method
Description
`SlingHttpResponse`
OsgiConsoleClient.`deleteConfiguration(String pid, int... expectedStatus)`
Delete the config referenced by the PID
`String`
OsgiConsoleClient.`editConfiguration(String PID, String factoryPID, Map<String,Object> configProperties, int... expectedStatus)`
Sets properties of a config referenced by its PID.
`String`
OsgiConsoleClient.`editConfigurationWithWait(int waitCount, String PID, String factoryPID, Map<String,Object> configProperties, int... expectedStatus)`
Deprecated.
use `OsgiConsoleClient.waitEditConfiguration(long, String, String, Map, int...)`
`BundleInfo`
BundlesInfo.`forId(String id)`
Return bundle info for a bundle with persistence identifier `pid`
`BundleInfo`
BundlesInfo.`forName(String name)`
Return bundle info for a bundle with name `name`
`BundleInfo`
BundlesInfo.`forSymbolicName(String name)`
Return bundle info for a bundle with symbolic name `name`
`long`
OsgiConsoleClient.`getBundleId(String symbolicName)`
Get the id of the bundle
`BundleInfo`
OsgiConsoleClient.`getBundleInfo(String id, int... expectedStatus)`
Returns the wrapper for the bundle info json
`BundlesInfo`
OsgiConsoleClient.`getBundlesInfo(int... expectedStatus)`
Returns the wrapper for the bundles info json
`String`
OsgiConsoleClient.`getBundleState(String symbolicName)`
Get the state of the bundle
`String`
OsgiConsoleClient.`getBundleVersion(String symbolicName)`
Get the version of the bundle
`ComponentInfo`
OsgiConsoleClient.`getComponentInfo(String id, int expectedStatus)`
Returns the wrapper for the component info json
`ComponentsInfo`
OsgiConsoleClient.`getComponentsInfo(int... expectedStatus)`
Returns the wrapper for the components info json
`String`
OsgiConsoleClient.`getConfigPIDFromServices(String serviceType, String propertyName, String propertyValue, long timeout, long delay)`
Performs a search of a config PID through the service information.
`Map<String,Object>`
OsgiConsoleClient.`getConfiguration(String pid, int... expectedStatus)`
Returns a map of all properties set for the config referenced by the PID, where the map keys are the property names.
`Map<String,Object>`
OsgiConsoleClient.`getOSGiConfiguration(String pid, int... expectedStatus)`
Returns a map of all properties set for the config referenced by the PID, where the map keys are the property names.
`SlingHttpResponse`
OsgiConsoleClient.`installBundle(File f, boolean startBundle)`
Install a bundle using the Felix webconsole HTTP interface
`SlingHttpResponse`
OsgiConsoleClient.`installBundle(File f, boolean startBundle, int startLevel)`
Install a bundle using the Felix webconsole HTTP interface, with a specific start level
`void`
BundlesInstaller.`installBundles(List<File> toInstall, boolean startBundles)`
Install a list of bundles supplied as Files
`boolean`
OsgiConsoleClient.`installBundleWithRetry(File f, boolean startBundle, int startLevel, int waitTime, int retries)`
Deprecated.
`OsgiConsoleClient.waitInstallBundle(File, boolean, int, long, long)`
`boolean`
BundlesInstaller.`isInstalled(File bundleFile)`
Checks if a bundle is installed or not.
`boolean`
BundlesInstaller.`isInstalledWithSameVersion(File bundleFile)`
Check if the installed version matches the one of the bundle (file)
`void`
OsgiConsoleClient.`refreshPackages()`
Calls PackageAdmin.refreshPackages to force re-wiring of all the bundles.
`void`
OsgiConsoleClient.`startBundle(String symbolicName)`
Starts a bundle
`void`
OsgiConsoleClient.`startBundlewithWait(String symbolicName, int waitTime, int retries)`
Deprecated.
use `OsgiConsoleClient.waitStartBundle(String, long, long)`
`void`
OsgiConsoleClient.`stopBundle(String symbolicName)`
Stop a bundle
`SlingHttpResponse`
OsgiConsoleClient.`uninstallBundle(String symbolicName)`
Uninstall a bundle
`void`
BundlesInstaller.`uninstallBundles(List<File> toUninstall)`
Uninstall a list of bundles supplied as Files
`String`
OsgiConsoleClient.`waitEditConfiguration(long timeout, String PID, String factoryPID, Map<String,Object> configProperties, int... expectedStatus)`
Sets properties of a config referenced by its PID.
`boolean`
BundlesInstaller.`waitForBundlesInstalled(List<String> symbolicNames, int timeoutSeconds)`
Deprecated.
use `BundlesInstaller.waitBundlesInstalled(List, long)`
`Map<String,Object>`
OsgiConsoleClient.`waitGetConfiguration(long timeout, String pid, int... expectedStatus)`
Returns a map of all properties set for the config referenced by the PID, where the map keys are the property names.
`void`
OsgiConsoleClient.`waitInstallBundle(File f, boolean startBundle, int startLevel, long timeout, long delay)`
Install a bundle using the Felix webconsole HTTP interface and wait for it to be installed.
`void`
OsgiConsoleClient.`waitStartBundle(String symbolicName, long timeout, long delay)`
Starts a bundle and waits for it to be started
Constructors in org.apache.sling.testing.clients.osgi that throw ClientException
Modifier
Constructor
Description
``
`OsgiConsoleClient(URI serverUrl, String userName, String password)`
Default constructor.
``
`OsgiConsoleClient(org.apache.http.impl.client.CloseableHttpClient http, SlingClientConfig config)`
Constructor used by adaptTo() and InternalBuilder classes.
``
`OsgiInstanceConfig(T client, String configPID)`

## Uses of ClientException in org.apache.sling.testing.clients.query

Methods in org.apache.sling.testing.clients.query that throw ClientException
Modifier and Type
Method
Description
`long`
QueryClient.`doCount(String query, QueryClient.QueryType type)`
Executes a query on the server and returns only the number of rows in the result
`com.fasterxml.jackson.databind.JsonNode`
QueryClient.`doQuery(String query, QueryClient.QueryType type)`
Executes a query on the server and returns the results as a json
`protected com.fasterxml.jackson.databind.JsonNode`
QueryClient.`doQuery(String query, QueryClient.QueryType type, boolean showResults, boolean explain)`
`String`
QueryClient.`getPlan(String query, QueryClient.QueryType type)`
Retrieves the plan of the query.
`QueryClient`
QueryClient.`installServlet()`
Installs the servlet to be able to perform queries.
`QueryClient`
QueryClient.`uninstallServlet()`
Deletes all the resources created by `QueryClient.installServlet()`
Constructors in org.apache.sling.testing.clients.query that throw ClientException
Modifier
Constructor
Description
``
`QueryClient(URI url, String user, String password)`
Convenience constructor
``
`QueryClient(org.apache.http.impl.client.CloseableHttpClient http, SlingClientConfig config)`
Constructor used by adaptTo

## Uses of ClientException in org.apache.sling.testing.clients.util

Constructors in org.apache.sling.testing.clients.util that throw ClientException
Modifier
Constructor
Description
``
`InputStreamBodyWithLength(String resourcePath, String contentType, String fileName)`