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
public class MSMClient extends CQClient
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 fromCQClient
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
Fields Modifier and Type Field Description static String
BLUEPRINT_GET_EXTENSION
static String
BLUEPRINT_POST_EXTENSION
Blueprint rollout configurationstatic String
BLUEPRINT_ROOT
BluePrint locationstatic String
JCR_CONTENT
static String
JCR_PRIMARYTYPE
static String
LIVECOPY_GET_EXTENSION
static String
LIVECOPY_POST_EXTENSION
LiveCopy configurationstatic String
PARAM_IS_DEEP
static String
PARAM_SOURCEPATH
static String
PN_ROLLOUT_CONFIGS
static String
PROPERTY_LASTROLLEDOUT
LiveCopy general propertiesstatic String
PROPERTY_LASTROLLEDOUTBY
static String
ROLLOUTCONFIG_ACTIVATE
static String
ROLLOUTCONFIG_DEACTIVATE
static String
ROLLOUTCONFIG_DEFAULT
static String
ROLLOUTCONFIG_PUSHONMODIFY
-
Fields inherited from class com.adobe.cq.testing.client.CQClient
LOG, STATISTICS_ROOT, wcmCommands
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.sling.testing.clients.SlingHttpResponse
createBluePrint(String name, String title, String sitePath, int... expectedStatus)
Creates a blueprint.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)
Creates a live copy.String
createRolloutConfig(String name, String above, String trigger, String... liveActions)
Create a new RolloutConfiguration with given Trigger and given LiveActionsorg.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)
Creates an new site.org.apache.sling.testing.clients.SlingHttpResponse
deleteBluePrint(String blueprintPath, int... expectedStatus)
Delete a blueprint.org.apache.sling.testing.clients.SlingHttpResponse
editRelationship(String target, String sourcePath, boolean deep, String[] rolloutConfigs, int... expectedStatus)
Edit the LiveRelationship at a given Path-
Methods 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, uploadFileCQStyle
-
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
-
-
-
-
Field Detail
-
JCR_PRIMARYTYPE
public static final String JCR_PRIMARYTYPE
- See Also:
- Constant Field Values
-
JCR_CONTENT
public static final String JCR_CONTENT
- See Also:
- Constant Field Values
-
PARAM_SOURCEPATH
public static final String PARAM_SOURCEPATH
- See Also:
- Constant Field Values
-
PARAM_IS_DEEP
public static final String PARAM_IS_DEEP
- See Also:
- Constant Field Values
-
PN_ROLLOUT_CONFIGS
public static final String PN_ROLLOUT_CONFIGS
- See Also:
- Constant Field Values
-
LIVECOPY_POST_EXTENSION
public static final String LIVECOPY_POST_EXTENSION
LiveCopy configuration- See Also:
- Constant Field Values
-
LIVECOPY_GET_EXTENSION
public static final String LIVECOPY_GET_EXTENSION
- See Also:
- Constant Field Values
-
BLUEPRINT_POST_EXTENSION
public static final String BLUEPRINT_POST_EXTENSION
Blueprint rollout configuration- See Also:
- Constant Field Values
-
BLUEPRINT_GET_EXTENSION
public static final String BLUEPRINT_GET_EXTENSION
- See Also:
- Constant Field Values
-
PROPERTY_LASTROLLEDOUT
public static final String PROPERTY_LASTROLLEDOUT
LiveCopy general properties- See Also:
- Constant Field Values
-
PROPERTY_LASTROLLEDOUTBY
public static final String PROPERTY_LASTROLLEDOUTBY
- See Also:
- Constant Field Values
-
ROLLOUTCONFIG_DEFAULT
public static final String ROLLOUTCONFIG_DEFAULT
- See Also:
- Constant Field Values
-
ROLLOUTCONFIG_ACTIVATE
public static final String ROLLOUTCONFIG_ACTIVATE
- See Also:
- Constant Field Values
-
ROLLOUTCONFIG_DEACTIVATE
public static final String ROLLOUTCONFIG_DEACTIVATE
- See Also:
- Constant Field Values
-
ROLLOUTCONFIG_PUSHONMODIFY
public static final String ROLLOUTCONFIG_PUSHONMODIFY
- See Also:
- Constant Field Values
-
BLUEPRINT_ROOT
public static final String BLUEPRINT_ROOT
BluePrint location- See Also:
- Constant Field Values
-
-
Method Detail
-
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
-
-