Package com.adobe.cq.testing.client
Class MSMClient
java.lang.Object
org.apache.sling.testing.clients.AbstractSlingClient
org.apache.sling.testing.clients.SlingClient
com.adobe.cq.testing.client.CQClient
com.adobe.cq.testing.client.MSMClient
- All Implemented Interfaces:
Closeable,AutoCloseable,org.apache.http.client.HttpClient
The base client for all Multi Site Manager (MSM) related tests. It provides a core set of commonly used MSM
functions e.g. creating a blueprint / site / live copy. The MSM enables you to create a site (called a live copy)
based on another site (called a blueprint) and to actively manage the relationships between the blueprint and the
live copy.
It extends from
It extends from
CQClient which in turn provides a core set of
commonly used website and page functionality.-
Nested Class Summary
Nested classes/interfaces inherited from class com.adobe.cq.testing.client.CQClient
CQClient.Builder, CQClient.InternalBuilder<T extends CQClient> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final StringBlueprint rollout configurationstatic final StringBluePrint locationstatic final Stringstatic final Stringstatic final Stringstatic final StringLiveCopy configurationstatic final Stringstatic final Stringstatic final Stringstatic final StringLiveCopy general propertiesstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringFields inherited from class com.adobe.cq.testing.client.CQClient
LOG, STATISTICS_ROOT, wcmCommandsFields inherited from class org.apache.sling.testing.clients.SlingClient
CLIENT_CONNECTION_TIMEOUT_PROP, DEFAULT_NODE_TYPE, SUDO_COOKIE_NAME -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.sling.testing.clients.SlingHttpResponsecreateBluePrint(String name, String title, String sitePath, int... expectedStatus) Creates a blueprint.org.apache.sling.testing.clients.SlingHttpResponsecreateLiveCopy(String label, String title, String destPath, String srcPath, boolean shallow, String[] rolloutConfigs, String[] missingPages, boolean excludeSubPages, int... expectedStatus) Creates a live copy.createRolloutConfig(String name, String above, String trigger, String... liveActions) Create a new RolloutConfiguration with given Trigger and given LiveActionsorg.apache.sling.testing.clients.SlingHttpResponsecreateSite(String label, String title, String destPath, boolean isLiveCopy, String[] languages, String[] chapterPaths, String blueprintPath, String[] rolloutConfigs, String siteOwner, int... expectedStatus) Creates an new site.org.apache.sling.testing.clients.SlingHttpResponsedeleteBluePrint(String blueprintPath, int... expectedStatus) Delete a blueprint.org.apache.sling.testing.clients.SlingHttpResponseeditRelationship(String target, String sourcePath, boolean deep, String[] rolloutConfigs, int... expectedStatus) Edit the LiveRelationship at a given PathMethods inherited from class com.adobe.cq.testing.client.CQClient
copyLanguages, copyPage, createPage, createPageWithRetry, createVersion, deletePage, deletePageWithRetry, getAuthorSitesPage, lockPage, movePage, movePage, pageExists, pageExistsWithRetry, pageExistsWithRetry, resetPageStatistics, restoreTree, restoreVersion, rolloutPage, searchAndReplaceInPages, searchInPages, setPageProperties, setPageProperty, setPagePropertyImage, unlockPage, uploadFileCQStyleMethods 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, waitUntilExistsMethods 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
-
Field Details
-
JCR_PRIMARYTYPE
- See Also:
-
JCR_CONTENT
- See Also:
-
PARAM_SOURCEPATH
- See Also:
-
PARAM_IS_DEEP
- See Also:
-
PN_ROLLOUT_CONFIGS
- See Also:
-
LIVECOPY_POST_EXTENSION
LiveCopy configuration- See Also:
-
LIVECOPY_GET_EXTENSION
- See Also:
-
BLUEPRINT_POST_EXTENSION
Blueprint rollout configuration- See Also:
-
BLUEPRINT_GET_EXTENSION
- See Also:
-
PROPERTY_LASTROLLEDOUT
LiveCopy general properties- See Also:
-
PROPERTY_LASTROLLEDOUTBY
- See Also:
-
ROLLOUTCONFIG_DEFAULT
- See Also:
-
ROLLOUTCONFIG_ACTIVATE
- See Also:
-
ROLLOUTCONFIG_DEACTIVATE
- See Also:
-
ROLLOUTCONFIG_PUSHONMODIFY
- See Also:
-
BLUEPRINT_ROOT
BluePrint location- See Also:
-
-
Constructor Details
-
MSMClient
public MSMClient(org.apache.http.impl.client.CloseableHttpClient http, org.apache.sling.testing.clients.SlingClientConfig config) throws org.apache.sling.testing.clients.ClientException - Throws:
org.apache.sling.testing.clients.ClientException
-
MSMClient
public MSMClient(URI serverUrl, String user, String password) throws org.apache.sling.testing.clients.ClientException - Throws:
org.apache.sling.testing.clients.ClientException
-
-
Method Details
-
createBluePrint
public org.apache.sling.testing.clients.SlingHttpResponse createBluePrint(String name, String title, String sitePath, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException Creates a blueprint.
The blueprint makes it possible to define structure and content centrally. The structure and content of the blueprint can then be used in the live copy- Parameters:
name- the label/name of the blueprinttitle- the title of the blueprintsitePath- the path to an existing branch (site)expectedStatus- list of allowed HTTP Status to be returned. If not set, http status 200 (OK) is assumed.- Returns:
- Sling response
- Throws:
org.apache.sling.testing.clients.ClientException- If something fails during request/response cycle
-
deleteBluePrint
public org.apache.sling.testing.clients.SlingHttpResponse deleteBluePrint(String blueprintPath, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException Delete a blueprint.
The blueprint makes it possible to define structure and content centrally. The structure and content of the blueprint can then be used in the live copy- Parameters:
blueprintPath- the path to the blueprintexpectedStatus- list of allowed HTTP Status to be returned. If not set, http status 200 (OK) is assumed.- Returns:
- Sling response
- Throws:
org.apache.sling.testing.clients.ClientException- If something fails during request/response cycle
-
createSite
public org.apache.sling.testing.clients.SlingHttpResponse createSite(String label, String title, String destPath, boolean isLiveCopy, String[] languages, String[] chapterPaths, String blueprintPath, String[] rolloutConfigs, String siteOwner, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException Creates an new site. A site can be considered as 1:1 copy of an existing branch or page. Every site can be defined as live copy which manage the relationships between the blueprint and the live copy.- Parameters:
label- the label/name of the new sitetitle- the title of the new sitedestPath- the location where the new site gets createdisLiveCopy- true if the new site works as a live copylanguages- the languages labels to copychapterPaths- the chapters' pages to copy taken from first language of siteblueprintPath- the path to the blueprintrolloutConfigs- the rollout configuration for the live copysiteOwner- the site owner for the new siteexpectedStatus- list of allowed HTTP Status to be returned. If not set, http status 200 (OK) is assumed.- Returns:
- Sling response
- Throws:
org.apache.sling.testing.clients.ClientException- If something fails during request/response cycle
-
createLiveCopy
public org.apache.sling.testing.clients.SlingHttpResponse createLiveCopy(String label, String title, String destPath, String srcPath, boolean shallow, String[] rolloutConfigs, String[] missingPages, boolean excludeSubPages, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException Creates a live copy. A live copy can be created from an existing branch or page or a site that is a live copy by using a blueprint.- Parameters:
label- the label/name of the new sitetitle- the title of the new sitedestPath- the location where the new site gets createdsrcPath- the source path of the liveCopyshallow- if set to true subpages are excludedrolloutConfigs- the rollout configuration for the live copymissingPages- pages which are not rolled out yet (missing) but should be part of the rolloutexcludeSubPages- true if subpages of missing pages are excluded (subpages of missing pages are not par of rollout)expectedStatus- list of allowed HTTP Status to be returned. If not set, http status 200 (OK) is assumed.- Returns:
- Sling response
- Throws:
org.apache.sling.testing.clients.ClientException- If something fails during request/response cycle
-
editRelationship
public org.apache.sling.testing.clients.SlingHttpResponse editRelationship(String target, String sourcePath, boolean deep, String[] rolloutConfigs, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException Edit the LiveRelationship at a given Path- Parameters:
target- the LiveCopy to editsourcePath- the blueprint pathdeep- if the LiveCopy is deeprolloutConfigs- the RolloutConfigs to take for LiveCopyexpectedStatus- list of allowed HTTP Status to be returned. If not set, http status 200 (OK) is assumed.- Returns:
- Sling response
- Throws:
org.apache.sling.testing.clients.ClientException- If something fails during request/response cycle
-
createRolloutConfig
public String createRolloutConfig(String name, String above, String trigger, String... liveActions) throws org.apache.sling.testing.clients.ClientException Create a new RolloutConfiguration with given Trigger and given LiveActions- Parameters:
name- to give for the RolloutConfigabove- optional, Page name the RolloutConfig to be next to the newtrigger- Trigger to be used for the RolloutConfigliveActions- names of the LiveActions to be contained in the RolloutConfig @return the Path to the newly created RolloutConfig- Returns:
- the path to the rollout config
- Throws:
org.apache.sling.testing.clients.ClientException- in case of Errors during RolloutConfiguration creation
-