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.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.queryorg.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 <T extends AbstractSlingClient>
TAbstractSlingClient. adaptTo(Class<T> clientClass)Returns an instance of any class extending the AbstractSlingClient.SlingClientSlingClient.Builder. build()abstract TSlingClient.InternalBuilder. build()SlingClientConfigSlingClientConfig.Builder. build()protected SlingClientConfigSlingClient.InternalBuilder. buildSlingClientConfig()voidSlingHttpResponse. checkContentContains(String... expected)Assert that all the providedStringsare contained in the responsevoidSlingHttpResponse. checkContentRegexp(String... regexp)For each regular expression, assert that at least one line of the response matches the expressionvoidSlingHttpResponse. checkContentType(String expected)Assert that response matches supplied content type (from Content-Type header)voidSlingHttpResponse. checkStatus(int expected)Assert that response matches supplied statusSlingHttpResponseSlingClient. createFolder(String folderName, String folderTitle, String parentPath, int... expectedStatus)Creates a new Folder of type sling:OrderedFolder.SlingHttpResponseSlingClient. createNode(String path, String nodeType)Creates the node specified by a given path with the given node type.
If the given node type isnull, 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.SlingHttpResponseSlingClient. createNodeRecursive(String path, String nodeType)Recursively creates all the none existing nodes in the given path using theSlingClient.createNode(String, String)method.SlingHttpResponseSlingClient. deletePath(String path, int... expectedStatus)Deletes a sling path (:operation delete)SlingHttpResponseAbstractSlingClient. 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.SlingHttpResponseAbstractSlingClient. 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 usingresponse.getContent().SlingHttpResponseAbstractSlingClient. 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 usingresponse.getContent().SlingHttpResponseAbstractSlingClient. 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 usingresponse.getContent().com.fasterxml.jackson.databind.JsonNodeSlingClient. doGetJson(String path, int depth, int... expectedStatus)Returns theJsonNodeobject corresponding to a content node.SlingHttpResponseAbstractSlingClient. doHead(String requestPath, List<org.apache.http.NameValuePair> parameters, List<org.apache.http.Header> headers, int... expectedStatus)Executes a HEAD requestSlingHttpResponseAbstractSlingClient. 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.SlingHttpResponseAbstractSlingClient. doPost(String requestPath, org.apache.http.HttpEntity entity, int... expectedStatus)Executes a POST request and consumes the entity in the response.SlingHttpResponseAbstractSlingClient. 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.SlingHttpResponseAbstractSlingClient. 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.SlingHttpResponseAbstractSlingClient. 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.SlingHttpResponseAbstractSlingClient. 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.SlingHttpResponseAbstractSlingClient. 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.SlingHttpResponseAbstractSlingClient. 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.SlingHttpResponseAbstractSlingClient. 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.booleanSlingClient. exists(String path)Checks whether a path exists or not by making a GET request to that path with thejsonextensioncom.fasterxml.jackson.databind.JsonNodeSlingClient. getJsonNode(String path, int depth)Deprecated.com.fasterxml.jackson.databind.JsonNodeSlingClient. getJsonNode(String path, int depth, long waitMillis, int retryNumber, int... expectedStatus)Deprecated.StringSlingClient. getUUId(com.fasterxml.jackson.databind.JsonNode jsonNode)Get the UUID from a node that was already parsed in aJsonNodeStringSlingClient. getUUID(String path)Get the UUID of a repository pathSlingHttpResponseSlingClient. importContent(String parentPath, String contentType, File contentFile, int... expectedStatus)Create a tree structure underparentPathby providing acontentFilein one of the supported formats: xml, jcr.xml, json, jar, zip.SlingHttpResponseSlingClient. importContent(String parentPath, String contentType, String content, int... expectedStatus)Create a tree structure underparentPathby providing acontentin one of the supported formats: xml, jcr.xml, json, jar, zip.SlingHttpResponseSlingClient. importJson(String parentPath, com.fasterxml.jackson.databind.JsonNode json, int... expectedStatus)Wrapper method overSlingClient.importContent(String, String, String, int...)for directly importing a json nodeSlingHttpResponseSlingClient. move(String srcPath, String destPath, int... expectedStatus)Moves a sling path to a new location (:operation move)SlingHttpResponseSlingClient. setPropertiesString(String nodePath, List<org.apache.http.NameValuePair> properties, int... expectedStatus)Sets multiple String properties on a node in a single requestSlingHttpResponseSlingClient. setPropertyString(String nodePath, String propName, String propValue, int... expectedStatus)Sets String component property on a node.SlingHttpResponseSlingClient. setPropertyStringArray(String nodePath, String propName, List<String> propValueList, int... expectedStatus)Sets a String[] component property on a node.SlingHttpResponseSlingClient. upload(File file, String mimeType, String toPath, boolean createFolders, int... expectedStatus)Uploads a file to the repository.voidSlingClient. waitUntilExists(String path, long waitMillis, int retryCount)Deprecated.useSlingClient.waitExists(String, long, long)instead.Constructors in org.apache.sling.testing.clients that throw ClientException 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 voidSlingEmailClient. deleteMessages()Deletes all mail messages currently storedintSlingEmailClient. getBindPort()Retrieves the actual bind port of the SMTP serverList<EmailMessage>SlingEmailClient. getMessages()Retrieves the list of mail messages currently storedConstructors in org.apache.sling.testing.clients.email that throw ClientException Constructor Description SlingEmailClient(org.apache.http.impl.client.CloseableHttpClient http, SlingClientConfig config) -
Uses of ClientException in org.apache.sling.testing.clients.html
Constructors in org.apache.sling.testing.clients.html that throw ClientException 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 byIndexingClient.setLaneNames(java.lang.String...), if any.voidIndexingClient. install()Creates the necessary custom indices in the repository, if not already present.voidIndexingClient. uninstall()Deprecated.Use #uninstallWithRetryvoidIndexingClient. waitForAsyncIndexing()Same asIndexingClient.waitForAsyncIndexing(long timeout, long delay), but with default values fortimeout=1minanddelay=500ms.voidIndexingClient. 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 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 SlingHttpResponseOsgiConsoleClient. deleteConfiguration(String pid, int... expectedStatus)Delete the config referenced by the PIDStringOsgiConsoleClient. editConfiguration(String PID, String factoryPID, Map<String,Object> configProperties, int... expectedStatus)Sets properties of a config referenced by its PID.StringOsgiConsoleClient. editConfigurationWithWait(int waitCount, String PID, String factoryPID, Map<String,Object> configProperties, int... expectedStatus)BundleInfoBundlesInfo. forId(String id)Return bundle info for a bundle with persistence identifierpidComponentInfoComponentsInfo. forId(String id)ServiceInfoServicesInfo. forId(String id)Return service info for a service with given idBundleInfoBundlesInfo. forName(String name)Return bundle info for a bundle with namenameComponentInfoComponentsInfo. forName(String name)ComponentInfoComponentsInfo. forPid(String pid)BundleInfoBundlesInfo. forSymbolicName(String name)Return bundle info for a bundle with symbolic namenameCollection<ServiceInfo>ServicesInfo. forType(String type)Return service infos for a bundle with namenamelongOsgiConsoleClient. getBundleId(String symbolicName)Get the id of the bundleBundleInfoOsgiConsoleClient. getBundleInfo(String id, int... expectedStatus)Returns the wrapper for the bundle info jsonBundlesInfoOsgiConsoleClient. getBundlesInfo(int... expectedStatus)Returns the wrapper for the bundles info jsonStringOsgiConsoleClient. getBundleState(String symbolicName)Get the state of the bundleStringOsgiConsoleClient. getBundleVersion(String symbolicName)Get the version of the bundleComponentInfoOsgiConsoleClient. getComponentInfo(String id, int expectedStatus)Returns the wrapper for the component info jsonComponentsInfoOsgiConsoleClient. getComponentsInfo(int... expectedStatus)Returns the wrapper for the components info jsonMap<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.intComponentsInfo. getNumberOfInstalledComponents()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.StringBundlesInfo. getStatusMessage()SlingHttpResponseOsgiConsoleClient. installBundle(File f, boolean startBundle)Install a bundle using the Felix webconsole HTTP interfaceSlingHttpResponseOsgiConsoleClient. installBundle(File f, boolean startBundle, int startLevel)Install a bundle using the Felix webconsole HTTP interface, with a specific start levelvoidBundlesInstaller. installBundles(List<File> toInstall, boolean startBundles)Install a list of bundles supplied as FilesbooleanOsgiConsoleClient. installBundleWithRetry(File f, boolean startBundle, int startLevel, int waitTime, int retries)booleanBundlesInstaller. isInstalled(File bundleFile)Checks if a bundle is installed or not.booleanBundlesInstaller. isInstalledWithSameVersion(File bundleFile)Check if the installed version matches the one of the bundle (file)voidOsgiConsoleClient. refreshPackages()Calls PackageAdmin.refreshPackages to force re-wiring of all the bundles.voidOsgiConsoleClient. startBundle(String symbolicName)Starts a bundlevoidOsgiConsoleClient. startBundlewithWait(String symbolicName, int waitTime, int retries)Deprecated.voidOsgiConsoleClient. stopBundle(String symbolicName)Stop a bundleSlingHttpResponseOsgiConsoleClient. uninstallBundle(String symbolicName)Uninstall a bundlevoidBundlesInstaller. uninstallBundles(List<File> toUninstall)Uninstall a list of bundles supplied as FilesStringOsgiConsoleClient. waitEditConfiguration(long timeout, String PID, String factoryPID, Map<String,Object> configProperties, int... expectedStatus)Sets properties of a config referenced by its PID.booleanBundlesInstaller. 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.voidOsgiConsoleClient. 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.voidOsgiConsoleClient. waitStartBundle(String symbolicName, long timeout, long delay)Starts a bundle and waits for it to be startedConstructors in org.apache.sling.testing.clients.osgi that throw ClientException Constructor Description BundleInfo(com.fasterxml.jackson.databind.JsonNode root)BundlesInfo(com.fasterxml.jackson.databind.JsonNode root)The only constructor.ComponentInfo(com.fasterxml.jackson.databind.JsonNode root)ComponentsInfo(com.fasterxml.jackson.databind.JsonNode rootNode)The only constructor.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)ServiceInfo(com.fasterxml.jackson.databind.JsonNode root)ServicesInfo(com.fasterxml.jackson.databind.JsonNode root)The only constructor. -
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 longQueryClient. doCount(String query, QueryClient.QueryType type)Executes a query on the server and returns only the number of rows in the resultcom.fasterxml.jackson.databind.JsonNodeQueryClient. doQuery(String query, QueryClient.QueryType type)Executes a query on the server and returns the results as a jsonprotected com.fasterxml.jackson.databind.JsonNodeQueryClient. doQuery(String query, QueryClient.QueryType type, boolean showResults, boolean explain)StringQueryClient. getPlan(String query, QueryClient.QueryType type)Retrieves the plan of the query.QueryClientQueryClient. installServlet()Installs the servlet to be able to perform queries.QueryClientQueryClient. uninstallServlet()Deletes all the resources created byQueryClient.installServlet()Constructors in org.apache.sling.testing.clients.query that throw ClientException Constructor Description QueryClient(URI url, String user, String password)Convenience constructorQueryClient(org.apache.http.impl.client.CloseableHttpClient http, SlingClientConfig config)Constructor used by adaptTo -
Uses of ClientException in org.apache.sling.testing.clients.util
Methods in org.apache.sling.testing.clients.util that throw ClientException Modifier and Type Method Description static intHttpUtils. getHttpStatus(org.apache.http.HttpResponse response)Get HTTP Status of the response.static com.fasterxml.jackson.databind.JsonNodeJsonUtils. getJsonNodeFromString(String jsonString)GetJsonNodefrom a a String containing JSON.static StringHttpUtils. getLocationHeader(org.apache.http.HttpResponse response)Get the first 'Location' header and verify it's a valid URI.static voidHttpUtils. 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 voidHttpUtils. verifyHttpStatus(SlingHttpResponse response, int... expectedStatus)Verify expected status and dump response in case expected status is not returned.Constructors in org.apache.sling.testing.clients.util that throw ClientException Constructor Description InputStreamBodyWithLength(String resourcePath, String contentType, String fileName)
-