Package | Description |
---|---|
org.apache.sling.testing.clients | |
org.apache.sling.testing.clients.email | |
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 |
Modifier and Type | Method and Description |
---|---|
<T extends AbstractSlingClient> |
AbstractSlingClient.adaptTo(Class<T> clientClass)
Returns an instance of any class extending the AbstractSlingClient.
|
abstract T |
SlingClient.InternalBuilder.build() |
SlingClient |
SlingClient.Builder.build() |
void |
SlingHttpResponse.checkContentContains(String... expected)
Assert that all the provided
Strings are contained in the response |
void |
SlingHttpResponse.checkContentRegexp(String... regexp)
For each regular expression, assert that at least one line of the response matches the expression
|
void |
SlingHttpResponse.checkContentType(String expected)
Assert that response matches supplied content type (from Content-Type header)
|
void |
SlingHttpResponse.checkStatus(int expected)
Assert that response matches supplied status
|
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() . |
org.codehaus.jackson.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 |
org.codehaus.jackson.JsonNode |
SlingClient.getJsonNode(String path,
int depth)
Deprecated.
|
org.codehaus.jackson.JsonNode |
SlingClient.getJsonNode(String path,
int depth,
long waitMillis,
int retryNumber,
int... expectedStatus)
Deprecated.
|
String |
SlingClient.getUUId(org.codehaus.jackson.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,
org.codehaus.jackson.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.
|
void |
SlingClient.waitUntilExists(String path,
long waitMillis,
int retryCount)
Deprecated.
use
SlingClient.waitExists(String, long, long) instead. |
Constructor and Description |
---|
SlingClient(org.apache.http.impl.client.CloseableHttpClient http,
SlingClientConfig config)
Constructor used by Builders and adaptTo().
|
SlingClient(URI url,
String user,
String password)
Handy constructor easy to use in simple tests.
|
Modifier and Type | Method and 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
|
Constructor and Description |
---|
SlingEmailClient(org.apache.http.impl.client.CloseableHttpClient http,
SlingClientConfig config) |
Constructor and Description |
---|
MicrodataClient(org.apache.http.impl.client.CloseableHttpClient http,
SlingClientConfig config) |
MicrodataClient(URI url,
String user,
String password) |
Modifier and Type | Method and Description |
---|---|
List<String> |
IndexingClient.getLaneNames()
Retrieves the list of indexing lanes configured on the instance
|
void |
IndexingClient.install()
Creates the necessary custom indices in the repository, if not already present.
|
void |
IndexingClient.uninstall()
Cleans all the data generated by
IndexingClient.install() and IndexingClient.waitForAsyncIndexing(long, long) . |
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.
|
Constructor and Description |
---|
IndexingClient(org.apache.http.impl.client.CloseableHttpClient http,
SlingClientConfig config)
Constructor used by Builders and adaptTo().
|
IndexingClient(URI url,
String user,
String password)
Handy constructor easy to use in simple tests.
|
Modifier and Type | Method and 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)
|
ServiceInfo |
ServicesInfo.forId(String id)
Return service info for a service with given id
|
ComponentInfo |
ComponentsInfo.forId(String id) |
BundleInfo |
BundlesInfo.forId(String id)
Return bundle info for a bundle with persistence identifier
pid |
ComponentInfo |
ComponentsInfo.forName(String name) |
BundleInfo |
BundlesInfo.forName(String name)
Return bundle info for a bundle with name
name |
ComponentInfo |
ComponentsInfo.forPid(String pid) |
BundleInfo |
BundlesInfo.forSymbolicName(String name)
Return bundle info for a bundle with symbolic name
name |
Collection<ServiceInfo> |
ServicesInfo.forType(String type)
Return service infos for a bundle with 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
|
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.getConfigurationWithWait(long waitCount,
String pid,
int... expectedStatus)
Deprecated.
|
int |
ComponentsInfo.getNumberOfInstalledComponents() |
String |
BundlesInfo.getStatusMessage() |
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)
|
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.
|
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.
|
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
|
Constructor and Description |
---|
BundleInfo(org.codehaus.jackson.JsonNode root) |
BundlesInfo(org.codehaus.jackson.JsonNode root)
The only constructor.
|
ComponentInfo(org.codehaus.jackson.JsonNode root) |
ComponentsInfo(org.codehaus.jackson.JsonNode rootNode)
The only constructor.
|
OsgiConsoleClient(org.apache.http.impl.client.CloseableHttpClient http,
SlingClientConfig config)
Constructor used by adaptTo() and InternalBuilder classes.
|
OsgiConsoleClient(URI serverUrl,
String userName,
String password)
Default constructor.
|
OsgiInstanceConfig(T client,
String configPID) |
ServiceInfo(org.codehaus.jackson.JsonNode root) |
ServicesInfo(org.codehaus.jackson.JsonNode root)
The only constructor.
|
Modifier and Type | Method and 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
|
org.codehaus.jackson.JsonNode |
QueryClient.doQuery(String query,
QueryClient.QueryType type)
Executes a query on the server and returns the results as a json
|
protected org.codehaus.jackson.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() |
Constructor and Description |
---|
QueryClient(org.apache.http.impl.client.CloseableHttpClient http,
SlingClientConfig config)
Constructor used by adaptTo
|
QueryClient(URI url,
String user,
String password)
Convenience constructor
|
Modifier and Type | Method and Description |
---|---|
static int |
HttpUtils.getHttpStatus(org.apache.http.HttpResponse response)
Get HTTP Status of the response.
|
static org.codehaus.jackson.JsonNode |
JsonUtils.getJsonNodeFromString(String jsonString)
Get
JsonNode from a a String containing JSON. |
static String |
HttpUtils.getLocationHeader(org.apache.http.HttpResponse response)
Get the first 'Location' header and verify it's a valid URI.
|
static void |
HttpUtils.verifyHttpStatus(org.apache.http.HttpResponse response,
String errorMessage,
int... expectedStatus)
Verify expected status and show error message in case expected status is not returned.
|
static void |
HttpUtils.verifyHttpStatus(SlingHttpResponse response,
int... expectedStatus)
Verify expected status and dump response in case expected status is not returned.
|
Constructor and Description |
---|
InputStreamBodyWithLength(String resourcePath,
String contentType,
String fileName) |
Copyright © 2007–2018 The Apache Software Foundation. All rights reserved.