Class CQClient

java.lang.Object
org.apache.sling.testing.clients.AbstractSlingClient
org.apache.sling.testing.clients.SlingClient
com.adobe.cq.testing.client.CQClient
All Implemented Interfaces:
Closeable, AutoCloseable, org.apache.http.client.HttpClient
Direct Known Subclasses:
BulkEditorClient, CommunityClient, ComponentClient, CQAssetsClient, CQConfigManagerClient, ExperienceFragmentsClient, FormClient, JobsClient, JsonClient, MSMClient, NotificationClient, OffloadingBrowserClient, OffloadingClient, PackageManagerClient, ReplicationClient, SecurityClient, TagClient, TemplateEditorManagerClient, TogglesClient, TopologyClient, VersioningClient, WorkflowClient

@Contract(threading=IMMUTABLE) public class CQClient extends org.apache.sling.testing.clients.SlingClient

Base client for all CQ related clients. It provides a core set of commonly used website and page functions e.g. creating/deleting/moving pages, versioning, activation/deactivation, restore tree etc.

It extends from SlingClient which in turn provides functions for manipulating repository nodes directly.

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final class 
     
    static class 
     
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static org.slf4j.Logger
     
    protected static final String
    Path where statistics are stored
    protected final WCMCommands
    WCMCommands object that encapsulates all available WCM commands

    Fields inherited from class org.apache.sling.testing.clients.SlingClient

    CLIENT_CONNECTION_TIMEOUT_PROP, DEFAULT_NODE_TYPE, SUDO_COOKIE_NAME
  • Constructor Summary

    Constructors
    Constructor
    Description
    CQClient(URI url, String user, String password)
    Handy constructor easy to use in simple tests.
    CQClient(org.apache.http.impl.client.CloseableHttpClient http, org.apache.sling.testing.clients.SlingClientConfig config)
    Constructor used by Builders and adaptTo().
  • Method Summary

    Modifier and Type
    Method
    Description
    org.apache.sling.testing.clients.SlingHttpResponse
    copyLanguages(String sitePath, List<org.apache.http.message.BasicNameValuePair> relPaths, int... expectedStatus)
    Creates language copies af a master site.
    org.apache.sling.testing.clients.SlingHttpResponse
    copyPage(String[] srcPaths, String destName, String destPath, String destParentPath, String before, boolean shallow, int... expectedStatus)
    Copies one or more CQ pages to a specified location in the repository.
    org.apache.sling.testing.clients.SlingHttpResponse
    createPage(String pageName, String pageTitle, String parentPath, String templatePath, int... expectedStatus)
    Creates a CQ page in the repository.
    org.apache.sling.testing.clients.SlingHttpResponse
    createPageWithRetry(String pageName, String pageTitle, String parentPath, String templatePath, long timeout, long delay, int... expectedStatus)
    Tries to create a CQ page until the request succeeds or timeout is reached
    org.apache.sling.testing.clients.SlingHttpResponse
    createVersion(String pagePath, String comment, String label, int... expectedStatus)
    Creates a Version for a CQ page.
    org.apache.sling.testing.clients.SlingHttpResponse
    deletePage(String[] pagePaths, boolean force, boolean shallow, int... expectedStatus)
    Deletes an array of pages.
    org.apache.sling.testing.clients.SlingHttpResponse
    deletePageWithRetry(String pagePath, boolean force, boolean shallow, long timeout, long delay, int... expectedStatus)
    Tries to deletes a CQ page multiple times if the request fails
    org.apache.sling.testing.clients.SlingHttpResponse
    getAuthorSitesPage(String pagePath, int... expectedStatus)
    Get a CQ Page (.html extension)
    org.apache.sling.testing.clients.SlingHttpResponse
    lockPage(String path, int... expectedStatus)
    Locks a CQ page so it can only be edited by the person who locked it.
    org.apache.sling.testing.clients.SlingHttpResponse
    movePage(String[] srcPaths, String destName, String destPath, String destParentPath, String before, boolean shallow, boolean integrity, String[] adjusts, int... expectedStatus)
    Moves one or more CQ pages to a specified location.

    Setting integrity to false and list of referrers in adjusts to null equals a drag'n'drop move in the site admin.
    org.apache.sling.testing.clients.SlingHttpResponse
    movePage(String[] srcPaths, String destName, String destPath, String destParentPath, String before, boolean shallow, boolean integrity, String[] adjusts, String[] publishes, int... expectedStatus)
    Moves one or more CQ pages to a specified location.

    Setting integrity to false and list of referrers in adjusts to null equals a drag'n'drop move in the site admin.
    boolean
    pageExists(String pagePath)
    Returns whether a CQ page exists or not
    boolean
    Polls on whether a CQ page exists or not after 1 second
    boolean
    pageExistsWithRetry(String pagePath, int timeout)
    Polls on whether a CQ page exists or not
    void
    Deletes existing statistics (page impressions) of a page.
    org.apache.sling.testing.clients.SlingHttpResponse
    restoreTree(String path, Date date, boolean preserveNVP, int... expectedStatus)
    Restores a sub page in path to the version that existed at the given date.
    org.apache.sling.testing.clients.SlingHttpResponse
    restoreVersion(String[] versionIds, String pagePath, int... expectedStatus)
    Restores a specified version of a CQ page.
    org.apache.sling.testing.clients.SlingHttpResponse
    rolloutPage(String srcPath, String[] targetPaths, boolean deep, boolean reset, boolean useBackgroundJob, int... expectedStatus)
    Rolls out changes to the livecopy
    void
    searchAndReplaceInPages(String startPath, String searchQuery, String replace, boolean caseSensitive, boolean wholeWordOnly)
    Requests a search and replaces the content of a path.
    com.fasterxml.jackson.databind.JsonNode
    searchInPages(String startPath, String searchQuery, boolean caseSensitive, boolean wholeWordOnly)
    Requests a text search on the content of a path and returns the pages matching the criteria.
    org.apache.sling.testing.clients.SlingHttpResponse
    setPageProperties(String pagePath, List<org.apache.http.NameValuePair> props, int... expectedStatus)
    Sets multiple page properties on a CQ page with one request.
    org.apache.sling.testing.clients.SlingHttpResponse
    setPageProperty(String pagePath, String propName, String propValue, int... expectedStatus)
    Sets a single page property on a CQ page.
    org.apache.sling.testing.clients.SlingHttpResponse
    setPagePropertyImage(String pagePath, String mimeType, String fileName, String resourcePath, int... expectedStatus)
    Sets the teaser image of a content page.
    org.apache.sling.testing.clients.SlingHttpResponse
    unlockPage(String path, int... expectedStatus)
    Unlocks a previously locked CQ page.
    org.apache.sling.testing.clients.SlingHttpResponse
    uploadFileCQStyle(String fileName, String resourcePath, String mimeType, String parentPath, int... expectedStatus)
    Uploads an File to the repository.

    Methods inherited from class org.apache.sling.testing.clients.SlingClient

    createFolder, createNode, createNodeRecursive, deletePath, doGetJson, endImpersonation, exists, getJsonNode, getJsonNode, getNodeNameFromPath, getParentPath, getUser, getUUId, getUUID, impersonate, importContent, importContent, importJson, move, setPropertiesString, setPropertyString, setPropertyStringArray, upload, waitExists, waitUntilExists

    Methods inherited from class org.apache.sling.testing.clients.AbstractSlingClient

    adaptTo, addValue, close, doDelete, doGet, doGet, doGet, doHead, doPatch, doPost, doPost, doPut, doRawRequest, doRequest, doStreamGet, doStreamPost, doStreamRequest, execute, execute, execute, execute, execute, execute, execute, execute, getClientId, getConnectionManager, getCookieStore, getCredentialsProvider, getParams, getPassword, getPath, getPath, getUrl, getUrl, getUrl, getValue, getValues, hasValue

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • LOG

      public static org.slf4j.Logger LOG
    • STATISTICS_ROOT

      protected static final String STATISTICS_ROOT
      Path where statistics are stored
      See Also:
    • wcmCommands

      protected final WCMCommands wcmCommands
      WCMCommands object that encapsulates all available WCM commands
  • Constructor Details

    • CQClient

      public CQClient(org.apache.http.impl.client.CloseableHttpClient http, org.apache.sling.testing.clients.SlingClientConfig config) throws org.apache.sling.testing.clients.ClientException
      Constructor used by Builders and adaptTo(). Should never be called directly from the code. See AbstractSlingClient#AbstractSlingClient(CloseableHttpClient, SlingClientConfig)
      Parameters:
      http - the underlying HttpClient to be used
      config - sling specific configs
      Throws:
      org.apache.sling.testing.clients.ClientException - if the client could not be created
    • CQClient

      public CQClient(URI url, String user, String password) throws org.apache.sling.testing.clients.ClientException

      Handy constructor easy to use in simple tests. Creates a client that uses basic authentication.

      For constructing clients with complex configurations, use a CQClient.InternalBuilder

      For constructing clients with the same configuration, but a different class, use AbstractSlingClient.adaptTo(Class)

      Parameters:
      url - url of the server (including context path)
      user - username for basic authentication
      password - password for basic authentication
      Throws:
      org.apache.sling.testing.clients.ClientException - never, kept for uniformity with the other constructors
  • Method Details

    • createPage

      public org.apache.sling.testing.clients.SlingHttpResponse createPage(String pageName, String pageTitle, String parentPath, String templatePath, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException
      Creates a CQ page in the repository.
      Parameters:
      pageName - name of the page
      pageTitle - title of the page
      parentPath - path to the parent page
      templatePath - path to the template
      expectedStatus - list of expected HTTP Status to be returned, if not set, 200 is assumed.
      Returns:
      a SlingHttpResponse
      Throws:
      org.apache.sling.testing.clients.ClientException - if something fails during the request/response cycle
    • createPageWithRetry

      public org.apache.sling.testing.clients.SlingHttpResponse createPageWithRetry(String pageName, String pageTitle, String parentPath, String templatePath, long timeout, long delay, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException, InterruptedException
      Tries to create a CQ page until the request succeeds or timeout is reached
      Parameters:
      pageName - name of the page
      pageTitle - title of the page
      parentPath - path to the parent page
      templatePath - path to the template definition
      timeout - max execution time, in milliseconds
      delay - time to wait between retries, in milliseconds
      expectedStatus - list of expected HTTP Status to be returned, if not set, 200 is assumed.
      Returns:
      a SlingHttpResponse
      Throws:
      org.apache.sling.testing.clients.ClientException - if something fails during the request/response cycle
      InterruptedException - to mark this method as waiting
    • deletePage

      public org.apache.sling.testing.clients.SlingHttpResponse deletePage(String[] pagePaths, boolean force, boolean shallow, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException

      Deletes an array of pages.

      The caller must ensure that the paths can be deleted

      Parameters:
      pagePaths - array of paths to be deleted
      force - force param passed to wcmCommands
      shallow - shallow param passed to wcmCommands
      expectedStatus - list of expected HTTP status to be returned
      Returns:
      the response
      Throws:
      org.apache.sling.testing.clients.ClientException - if one of the pages fails to delete
    • deletePageWithRetry

      public org.apache.sling.testing.clients.SlingHttpResponse deletePageWithRetry(String pagePath, boolean force, boolean shallow, long timeout, long delay, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException, InterruptedException
      Tries to deletes a CQ page multiple times if the request fails
      Parameters:
      pagePath - the path to delete
      force - passed to wcmCommands
      shallow - passed to wcmCommands
      timeout - max execution time, in milliseconds
      delay - time to wait between retries, in milliseconds
      expectedStatus - list of expected HTTP status to be returned
      Returns:
      the response
      Throws:
      org.apache.sling.testing.clients.ClientException - if the page(s) wre not deleted
      InterruptedException - if the method was interrupted
    • pageExists

      public boolean pageExists(String pagePath) throws org.apache.sling.testing.clients.ClientException
      Returns whether a CQ page exists or not
      Parameters:
      pagePath - The path of the page
      Returns:
      whether the CQ page exists
      Throws:
      org.apache.sling.testing.clients.ClientException - If the request failed
    • pageExistsWithRetry

      public boolean pageExistsWithRetry(String pagePath, int timeout) throws InterruptedException
      Polls on whether a CQ page exists or not
      Parameters:
      pagePath - The path of the page
      timeout - Timeout in milliseconds for the poller
      Returns:
      whether the CQ page exists
      Throws:
      InterruptedException - if interrupted
    • pageExistsWithRetry

      public boolean pageExistsWithRetry(String pagePath) throws InterruptedException
      Polls on whether a CQ page exists or not after 1 second
      Parameters:
      pagePath - The path of the page
      Returns:
      whether the CQ page exists
      Throws:
      InterruptedException - if interrupted
    • getAuthorSitesPage

      public org.apache.sling.testing.clients.SlingHttpResponse getAuthorSitesPage(String pagePath, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException
      Get a CQ Page (.html extension)
      Parameters:
      pagePath - The path of the page
      expectedStatus - An array of expected HTTP status codes for the response
      Returns:
      the http response
      Throws:
      org.apache.sling.testing.clients.ClientException - if the request failed
    • copyPage

      public org.apache.sling.testing.clients.SlingHttpResponse copyPage(String[] srcPaths, String destName, String destPath, String destParentPath, String before, boolean shallow, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException
      Copies one or more CQ pages to a specified location in the repository.
      Parameters:
      srcPaths - list of pages to copy
      destName - name given to the copied page at new location. Only works for single page copy, otherwise the operation fails.
      destPath - destination of copy operation. Can be used instead of destParentPath + destName. Works only for single page copy, otherwise the operation fails.
      destParentPath - target location of the copy operation
      before - if true, the copied page will be ordered before the page with this label (Name)
      shallow - if true, the only the page itself gets copied
      expectedStatus - list of expected HTTP Status to be returned, if not set, 200 is assumed.
      Returns:
      the http response
      Throws:
      org.apache.sling.testing.clients.ClientException - if something fails during the request/response cycle
    • movePage

      public org.apache.sling.testing.clients.SlingHttpResponse movePage(String[] srcPaths, String destName, String destPath, String destParentPath, String before, boolean shallow, boolean integrity, String[] adjusts, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException
      Moves one or more CQ pages to a specified location.

      Setting integrity to false and list of referrers in adjusts to null equals a drag'n'drop move in the site admin. The server then performs an auto adjustment on referring pages.

      Passing a list of referrers and setting integrity flag to true is the same as the Move... command in the site admin.
      Parameters:
      srcPaths - list of pages to copy
      destName - name given to the moved page at new location. Only works for single page copy, otherwise the operation fails.
      destPath - destination of copy operation. Can be used instead of destParentPath + destName. Only works for single page copy, otherwise the operation fails.
      destParentPath - target location of the move operation
      before - if true, the copied page will be ordered before the page with this label (Name)
      shallow - if true, the only the page itself gets copied
      integrity - if true, no auto adjustment of referred pages will be done
      adjusts - List of referrer page paths that need adjusting
      expectedStatus - list of expected HTTP Status to be returned, if not set, 200 is assumed.
      Returns:
      the response
      Throws:
      org.apache.sling.testing.clients.ClientException - if something fails during the request/response cycle
    • movePage

      public org.apache.sling.testing.clients.SlingHttpResponse movePage(String[] srcPaths, String destName, String destPath, String destParentPath, String before, boolean shallow, boolean integrity, String[] adjusts, String[] publishes, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException
      Moves one or more CQ pages to a specified location.

      Setting integrity to false and list of referrers in adjusts to null equals a drag'n'drop move in the site admin. The server then performs an auto adjustment on referring pages.

      Passing a list of referrers and setting integrity flag to true is the same as the Move... command in the site admin.
      Parameters:
      srcPaths - list of pages to copy
      destName - name given to the moved page at new location. Only works for single page copy, otherwise the operation fails.
      destPath - destination of copy operation. Can be used instead of destParentPath + destName. Only works for single page copy, otherwise the operation fails.
      destParentPath - target location of the move operation
      before - if true, the copied page will be ordered before the page with this label (Name)
      shallow - if true, the only the page itself gets copied
      integrity - if true, no auto adjustment of referred pages will be done
      adjusts - list of referrer page paths that need adjusting
      publishes - list of page paths that need to be published
      expectedStatus - list of expected HTTP Status to be returned, if not set, 200 is assumed
      Returns:
      the response
      Throws:
      org.apache.sling.testing.clients.ClientException - if something fails during the request/response cycle
    • lockPage

      public org.apache.sling.testing.clients.SlingHttpResponse lockPage(String path, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException
      Locks a CQ page so it can only be edited by the person who locked it.
      Parameters:
      path - path of the page to lock
      expectedStatus - list of expected HTTP Status to be returned, if not set, 200 is assumed.
      Returns:
      the response
      Throws:
      org.apache.sling.testing.clients.ClientException - if something fails during the request/response cycle
    • unlockPage

      public org.apache.sling.testing.clients.SlingHttpResponse unlockPage(String path, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException
      Unlocks a previously locked CQ page.
      Parameters:
      path - path of the page to unlock
      expectedStatus - list of expected HTTP Status to be returned, if not set, 200 is assumed.
      Returns:
      the response
      Throws:
      org.apache.sling.testing.clients.ClientException - if something fails during the request/response cycle
    • setPageProperty

      public org.apache.sling.testing.clients.SlingHttpResponse setPageProperty(String pagePath, String propName, String propValue, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException
      Sets a single page property on a CQ page.
      Parameters:
      pagePath - path of the page to be edited
      propName - name of the property to be edited
      propValue - value to be set
      expectedStatus - list of expected HTTP Status to be returned, if not set, 200 is assumed.
      Returns:
      the response
      Throws:
      org.apache.sling.testing.clients.ClientException - if something fails during the request/response cycle
    • setPageProperties

      public org.apache.sling.testing.clients.SlingHttpResponse setPageProperties(String pagePath, List<org.apache.http.NameValuePair> props, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException
      Sets multiple page properties on a CQ page with one request.
      Parameters:
      pagePath - path of the page to be edited
      props - list of name/value string pairs to be set
      expectedStatus - list of expected HTTP Status to be returned, if not set, 200 is assumed.
      Returns:
      the response
      Throws:
      org.apache.sling.testing.clients.ClientException - if something fails during the request/response cycle
    • setPagePropertyImage

      public org.apache.sling.testing.clients.SlingHttpResponse setPagePropertyImage(String pagePath, String mimeType, String fileName, String resourcePath, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException
      Sets the teaser image of a content page.
      Parameters:
      pagePath - path to the page to be edited
      mimeType - MIME type of the image getting uploaded
      fileName - file name of the image
      resourcePath - defines the path to the resource
      expectedStatus - list of expected HTTP Status to be returned, if not set, 200 is assumed.
      Returns:
      the response
      Throws:
      org.apache.sling.testing.clients.ClientException - if something fails during the request/response cycle
    • uploadFileCQStyle

      public org.apache.sling.testing.clients.SlingHttpResponse uploadFileCQStyle(String fileName, String resourcePath, String mimeType, String parentPath, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException
      Uploads an File to the repository. Same as using New File... in the Site Admin outside of the Digital Assets folder.

      This will create a folder with the file name and upload the file below it in a node typed nt:file.
      To upload a file that is to be handled as an Asset use CQAssetsClient.uploadAsset(java.lang.String, java.lang.String, java.lang.String, java.lang.String, int...) instead.
      To upload a file directly using sling use upload.
      Parameters:
      fileName - file name. The file name will become part of the URL to the file.
      resourcePath - defines the path to the resource
      mimeType - MIME type of the image getting uploaded
      parentPath - parent page (folder) that will contain the file
      expectedStatus - list of expected HTTP Status to be returned, if not set, 201 is assumed.
      Returns:
      the response
      Throws:
      org.apache.sling.testing.clients.ClientException - if something fails during the request/response cycle
    • createVersion

      public org.apache.sling.testing.clients.SlingHttpResponse createVersion(String pagePath, String comment, String label, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException
      Creates a Version for a CQ page. See Version tab in the sidekick of a page when opened on an author instance.
      Parameters:
      pagePath - path of the page we want to create a version of
      comment - comment to be set for this version
      label - Version label to be set
      expectedStatus - list of expected HTTP Status to be returned, if not set, 200 is assumed
      Returns:
      the response
      Throws:
      org.apache.sling.testing.clients.ClientException - if something fails during the request/response cycle
    • restoreVersion

      public org.apache.sling.testing.clients.SlingHttpResponse restoreVersion(String[] versionIds, String pagePath, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException
      Restores a specified version of a CQ page. See Version tab in the sidekick of a page when opened on an author instance.
      Parameters:
      versionIds - version Id of the current page and/or version ids of sub pages of pagePath
      pagePath - path to the page we want to restore the version
      expectedStatus - list of expected HTTP Status to be returned, if not set, 200 is assumed
      Returns:
      the response
      Throws:
      org.apache.sling.testing.clients.ClientException - if something fails during the request/response cycle
    • restoreTree

      public org.apache.sling.testing.clients.SlingHttpResponse restoreTree(String path, Date date, boolean preserveNVP, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException
      Restores a sub page in path to the version that existed at the given date.
      Parameters:
      path - path of the root page of the tree
      date - the date to restore
      preserveNVP - whether to preserve NVP or not
      expectedStatus - list of expected HTTP Status to be returned, if not set, 200 is assumed
      Returns:
      the response
      Throws:
      org.apache.sling.testing.clients.ClientException - if something fails during the request/response cycle
    • copyLanguages

      public org.apache.sling.testing.clients.SlingHttpResponse copyLanguages(String sitePath, List<org.apache.http.message.BasicNameValuePair> relPaths, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException
      Creates language copies af a master site.
      Parameters:
      sitePath - path to the site with the master content
      relPaths - list of string pairs, first being the relative path to be created, second the language shortcut to be copied from e.g. {fr/products/circle,en}
      expectedStatus - list of expected HTTP Status to be returned, if not set, 200 is assumed
      Returns:
      the response
      Throws:
      org.apache.sling.testing.clients.ClientException - if something fails during the request/response cycle
    • rolloutPage

      public org.apache.sling.testing.clients.SlingHttpResponse rolloutPage(String srcPath, String[] targetPaths, boolean deep, boolean reset, boolean useBackgroundJob, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException
      Rolls out changes to the livecopy
      Parameters:
      srcPath - the blue print path
      targetPaths - the live copy paths
      deep - if set to false, page is the fallback
      reset - reset
      useBackgroundJob - if set to true background jobs are used for rollout
      expectedStatus - list of expected HTTP Status to be returned, if not set, 200 is assumed
      Returns:
      Sling response
      Throws:
      org.apache.sling.testing.clients.ClientException - If something fails during request/response cycle
    • searchInPages

      public com.fasterxml.jackson.databind.JsonNode searchInPages(String startPath, String searchQuery, boolean caseSensitive, boolean wholeWordOnly) throws Exception
      Requests a text search on the content of a path and returns the pages matching the criteria.
      Parameters:
      startPath - Path to look at
      searchQuery - The text to search for
      caseSensitive - Do a "case-sensitive" search or not
      wholeWordOnly - Do a "whole word" search or not
      Returns:
      The list of pages matching the search criteria
      Throws:
      Exception - If something fails during the request/response cycle
    • searchAndReplaceInPages

      public void searchAndReplaceInPages(String startPath, String searchQuery, String replace, boolean caseSensitive, boolean wholeWordOnly) throws Exception
      Requests a search and replaces the content of a path.
      Parameters:
      startPath - Path to look at
      searchQuery - The text to search for
      replace - The text to replace with
      caseSensitive - Do a "case-sensitive" search or not
      wholeWordOnly - Do a "whole word" search or not
      Throws:
      Exception - If something fails during the request/response cycle
    • resetPageStatistics

      public void resetPageStatistics(String pagePath) throws org.apache.sling.testing.clients.ClientException
      Deletes existing statistics (page impressions) of a page.
      Parameters:
      pagePath - path of the page to delete the statistics for.
      Throws:
      org.apache.sling.testing.clients.ClientException - if something fails during the request/response cycle