Package com.adobe.cq.testing.util
Class WCMCommands
java.lang.Object
com.adobe.cq.testing.util.WCMCommands
Utility class that has separate methods for each available WCM Command.
WCM Commands are requests sent to /bin/wcmcommand, with a list of of parameters. one of the parameters must be named "cmd" and contains the actual command string.
Currently available commands are:
WCM Commands are requests sent to /bin/wcmcommand, with a list of of parameters. one of the parameters must be named "cmd" and contains the actual command string.
Currently available commands are:
- createPage: Creates a CQ Page
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.sling.testing.clients.SlingHttpResponsecloneLaunch(String orgPath, int... expectedStatus) Clones an existing launch sectionorg.apache.sling.testing.clients.SlingHttpResponsecopyLanguages(String sitePath, List<org.apache.http.message.BasicNameValuePair> relPaths, int... expectedStatus) org.apache.sling.testing.clients.SlingHttpResponsecopyPage(String[] srcPaths, String destName, String destParentPath, String before, boolean shallow, int... expectedStatus) org.apache.sling.testing.clients.SlingHttpResponsecreateCatalog(String source, String dest, String label, String title, int... expectedStatus) Creates a catalog from a blueprintorg.apache.sling.testing.clients.SlingHttpResponsecreateLaunch(String title, String srcPath, Calendar liveDate, boolean ignoreSubPages, boolean isLiveCopy, String template, String[] sourceRolloutConfigs, String[] promoteRolloutConfigs, int... expectedStatus) Creates a new launch copy.org.apache.sling.testing.clients.SlingHttpResponsecreateLaunch(String title, ArrayList<String> srcPathList, Calendar liveDate, ArrayList<Boolean> ignoreSubPagesList, boolean isLiveCopy, String template, String[] sourceRolloutConfigs, String[] promoteRolloutConfigs) Creates a new launch copy.org.apache.sling.testing.clients.SlingHttpResponsecreateLiveCopy(String label, String title, String destPath, String srcPath, boolean shallow, String[] rolloutConfigs, String[] missingPages, boolean excludeSubPages, int... expectedStatus) Create liveCopyorg.apache.sling.testing.clients.SlingHttpResponsecreatePage(String pageLabel, String pageTitle, String parentPath, String templatePath, int... expectedStatus) org.apache.sling.testing.clients.SlingHttpResponsecreateSite(String label, String title, String destPath, boolean isLiveCopy, String[] languages, String[] chapterPages, String bluePrintPath, String[] rolloutConfigs, String siteOwner, int... expectedStatus) Creates an new siteorg.apache.sling.testing.clients.SlingHttpResponsecreateVersion(String pagePath, String comment, String label, int... expectedStatus) org.apache.sling.testing.clients.SlingHttpResponsedeleteComment(String commentPath, int... expectedStatus) org.apache.sling.testing.clients.SlingHttpResponsedeleteLaunch(String path, int... expectedStatus) Deletes a launch sectionorg.apache.sling.testing.clients.SlingHttpResponsedeletePage(String[] pagePaths, boolean force, boolean shallow, int... expectedStatus) org.apache.sling.testing.clients.SlingHttpResponseorg.apache.sling.testing.clients.SlingHttpResponseLock a pageorg.apache.sling.testing.clients.SlingHttpResponsemarkCommentAsSpam(String commentPath, boolean spam, int... expectedStatus) org.apache.sling.testing.clients.SlingHttpResponsemoderateComment(String commentPath, boolean approve, int... expectedStatus) org.apache.sling.testing.clients.SlingHttpResponsemovePage(String[] srcPaths, String destName, String destParentPath, String before, boolean shallow, boolean integrity, String[] adjusts, int... expectedStatus) org.apache.sling.testing.clients.SlingHttpResponsemovePage(String[] srcPaths, String destName, String destParentPath, String before, boolean shallow, boolean integrity, String[] adjusts, String[] publishes, int... expectedStatus) org.apache.sling.testing.clients.SlingHttpResponsepromoteLaunch(String path, boolean promoteSubPages, String target, String workflowPackage, int... expectedStatus) Promotes a launch sectionorg.apache.sling.testing.clients.SlingHttpResponserestoreTree(String path, Date date, boolean preserveNVP, int... expectedStatus) org.apache.sling.testing.clients.SlingHttpResponserestoreVersion(String[] versionIds, String pagePath, int... expectedStatus) org.apache.sling.testing.clients.SlingHttpResponserollout(String[] sourcePaths, String[] targetPaths, String[] paragraphPaths, String type, boolean reset, boolean useBackgroundJob, int... expectedStatus) type deep, delete, page (=deep)org.apache.sling.testing.clients.SlingHttpResponserolloutSection(String source, String dest, boolean force, int... expectedStatus) Rolls out a sectionorg.apache.sling.testing.clients.SlingHttpResponseunlockPage(String path, int... expectedStatus) Unlock a page
-
Field Details
-
CMD_CREATE_PAGE
- See Also:
-
CMD_DELETE_PAGE
- See Also:
-
CMD_COPY_PAGE
- See Also:
-
CMD_MOVE_PAGE
- See Also:
-
CMD_COPY_LANGUAGE
- See Also:
-
CMD_CREATE_VERSION
- See Also:
-
CMD_RESTORE_VERSION
- See Also:
-
CMD_RESTORE_TREE
- See Also:
-
CMD_LOCK_PAGE
- See Also:
-
CMD_UNLOCK_PAGE
- See Also:
-
CMD_ROLLOUT
- See Also:
-
CMD_CREATE_SITE
- See Also:
-
CMD_CREATE_LIVECOPY
- See Also:
-
CMD_MODERATE_COMMENT
- See Also:
-
CMD_MARK_COMMENT_AS_SPAM
- See Also:
-
CMD_DELETE_COMMENT
- See Also:
-
CMD_CREATE_LAUNCH
- See Also:
-
CMD_DELETE_LAUNCH
- See Also:
-
CMD_EDIT_LAUNCH
- See Also:
-
CMD_CLONE_LAUNCH
- See Also:
-
CMD_PROMOTE_LAUNCH
- See Also:
-
CMD_CREATE_CATALOG
- See Also:
-
CMD_ROLLOUT_SECTION
- See Also:
-
-
Constructor Details
-
WCMCommands
public WCMCommands(org.apache.sling.testing.clients.SlingClient client)
-
-
Method Details
-
createPage
public org.apache.sling.testing.clients.SlingHttpResponse createPage(String pageLabel, String pageTitle, String parentPath, String templatePath, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException - Throws:
org.apache.sling.testing.clients.ClientException
-
deletePage
public org.apache.sling.testing.clients.SlingHttpResponse deletePage(String[] pagePaths, boolean force, boolean shallow, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException - Throws:
org.apache.sling.testing.clients.ClientException
-
copyPage
public org.apache.sling.testing.clients.SlingHttpResponse copyPage(String[] srcPaths, String destName, String destParentPath, String before, boolean shallow, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException - Throws:
org.apache.sling.testing.clients.ClientException
-
movePage
public org.apache.sling.testing.clients.SlingHttpResponse movePage(String[] srcPaths, String destName, String destParentPath, String before, boolean shallow, boolean integrity, String[] adjusts, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException - Throws:
org.apache.sling.testing.clients.ClientException
-
movePage
public org.apache.sling.testing.clients.SlingHttpResponse movePage(String[] srcPaths, String destName, String destParentPath, String before, boolean shallow, boolean integrity, String[] adjusts, String[] publishes, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException - Throws:
org.apache.sling.testing.clients.ClientException
-
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 - Throws:
org.apache.sling.testing.clients.ClientException
-
createVersion
public org.apache.sling.testing.clients.SlingHttpResponse createVersion(String pagePath, String comment, String label, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException - Throws:
org.apache.sling.testing.clients.ClientException
-
restoreVersion
public org.apache.sling.testing.clients.SlingHttpResponse restoreVersion(String[] versionIds, String pagePath, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException - Throws:
org.apache.sling.testing.clients.ClientException
-
restoreTree
public org.apache.sling.testing.clients.SlingHttpResponse restoreTree(String path, Date date, boolean preserveNVP, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException - Throws:
org.apache.sling.testing.clients.ClientException
-
lockPage
public org.apache.sling.testing.clients.SlingHttpResponse lockPage(String path, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException Lock a page- Parameters:
path- Path of the page to lockexpectedStatus- list of expected http status codes- Returns:
- the http response
- Throws:
org.apache.sling.testing.clients.ClientException- if the request fails
-
unlockPage
public org.apache.sling.testing.clients.SlingHttpResponse unlockPage(String path, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException Unlock a page- Parameters:
path- Path of the page to unlockexpectedStatus- list of expected http status codes- Returns:
- the http response
- Throws:
org.apache.sling.testing.clients.ClientException- if the request fails
-
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 Create liveCopy- Parameters:
label- label of the liveCopytitle- title of the liveCopydestPath- destination path for the liveCopysrcPath- source path of the liveCopyshallow- if set to true subpages are excludedrolloutConfigs- rollout configurationmissingPages- pages which are not rolled out yetexcludeSubPages- if set to true subpages of missing pages are excludedexpectedStatus- list of expected http status codes- Returns:
- the http response
- Throws:
org.apache.sling.testing.clients.ClientException- if livecopy cannot be created
-
createSite
public org.apache.sling.testing.clients.SlingHttpResponse createSite(String label, String title, String destPath, boolean isLiveCopy, String[] languages, String[] chapterPages, String bluePrintPath, String[] rolloutConfigs, String siteOwner, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException Creates an new site- Parameters:
label- Label of the new sitetitle- Title of the new sitedestPath- Location where the new site gets createdisLiveCopy- If the new site works as a liveCopylanguages- What languages to copychapterPages- What chapters to copybluePrintPath- Whats the blueprint usedrolloutConfigs- Whats the rollout configuration for the liveCopysiteOwner- Who is the site ownerexpectedStatus- list of expected http status codes- Returns:
- the http response
- Throws:
org.apache.sling.testing.clients.ClientException- if site cannot be created
-
moderateComment
public org.apache.sling.testing.clients.SlingHttpResponse moderateComment(String commentPath, boolean approve, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException - Throws:
org.apache.sling.testing.clients.ClientException
-
markCommentAsSpam
public org.apache.sling.testing.clients.SlingHttpResponse markCommentAsSpam(String commentPath, boolean spam, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException - Throws:
org.apache.sling.testing.clients.ClientException
-
deleteComment
public org.apache.sling.testing.clients.SlingHttpResponse deleteComment(String commentPath, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException - Throws:
org.apache.sling.testing.clients.ClientException
-
rollout
public org.apache.sling.testing.clients.SlingHttpResponse rollout(String[] sourcePaths, String[] targetPaths, String[] paragraphPaths, String type, boolean reset, boolean useBackgroundJob, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException type deep, delete, page (=deep)- Parameters:
sourcePaths- the blue print pathstargetPaths- the live copy pathsparagraphPaths- the paragraph pathstype- the type of rollout - deep / shallowreset- whether to reset or not the jobuseBackgroundJob- if true use a background job, otherwise do not use a background jobexpectedStatus- list of expected http status codes- Returns:
- the response
- Throws:
org.apache.sling.testing.clients.ClientException- if the request fails
-
createLaunch
public org.apache.sling.testing.clients.SlingHttpResponse createLaunch(String title, String srcPath, Calendar liveDate, boolean ignoreSubPages, boolean isLiveCopy, String template, String[] sourceRolloutConfigs, String[] promoteRolloutConfigs, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException Creates a new launch copy.- Parameters:
title- Title of the new launch sectionsrcPath- the root page to be copied fromliveDate- the date the launch section should go liveignoreSubPages- if sub pages should be copied withisLiveCopy- if the launch section is connected to the source via live copytemplate- a template if the launch should be created with a different template, null otherwisesourceRolloutConfigs- Rollout configs used for the launch live copypromoteRolloutConfigs- Rollout configs used on launch promotionexpectedStatus- list of expected http status codes- Returns:
- the http response
- Throws:
org.apache.sling.testing.clients.ClientException- if anything goes wrong
-
createLaunch
public org.apache.sling.testing.clients.SlingHttpResponse createLaunch(String title, ArrayList<String> srcPathList, Calendar liveDate, ArrayList<Boolean> ignoreSubPagesList, boolean isLiveCopy, String template, String[] sourceRolloutConfigs, String[] promoteRolloutConfigs) throws org.apache.sling.testing.clients.ClientException Creates a new launch copy.- Parameters:
title- Title of the new launch sectionsrcPathList- list of the root page to be copied fromliveDate- the date the launch section should go liveignoreSubPagesList- list specifying if sub pages should be copied withisLiveCopy- if the launch section is connected to the source via live copytemplate- a template if the launch should be created with a different template, null otherwisesourceRolloutConfigs- Rollout configs used for the launch live copypromoteRolloutConfigs- Rollout configs used on launch promotion- Returns:
- the http response
- Throws:
org.apache.sling.testing.clients.ClientException- if anything goes wrong
-
editLaunch
public org.apache.sling.testing.clients.SlingHttpResponse editLaunch(String launchPath, ArrayList<String> srcPathList, ArrayList<Boolean> ignoreSubPagesList) throws org.apache.sling.testing.clients.ClientException - Throws:
org.apache.sling.testing.clients.ClientException
-
deleteLaunch
public org.apache.sling.testing.clients.SlingHttpResponse deleteLaunch(String path, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException Deletes a launch section- Parameters:
path- complete path to the launch sections root page handleexpectedStatus- list of expected http status codes- Returns:
- the sling http response
- Throws:
org.apache.sling.testing.clients.ClientException- If anything goes wrong
-
cloneLaunch
public org.apache.sling.testing.clients.SlingHttpResponse cloneLaunch(String orgPath, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException Clones an existing launch section- Parameters:
orgPath- path to the root page of launch section to copyexpectedStatus- list of expected http status codes- Returns:
- the sling http response
- Throws:
org.apache.sling.testing.clients.ClientException- if anything goes wrong
-
promoteLaunch
public org.apache.sling.testing.clients.SlingHttpResponse promoteLaunch(String path, boolean promoteSubPages, String target, String workflowPackage, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException Promotes a launch section- Parameters:
path- path to the root page of the launch section to promotepromoteSubPages- true if sub pages should be promoted as welltarget- the path to a target launch or null to promote to productionworkflowPackage- path to the workflow package or nullexpectedStatus- list of expected http status codes- Returns:
- the http response
- Throws:
org.apache.sling.testing.clients.ClientException- If anything goes wrong
-
createCatalog
public org.apache.sling.testing.clients.SlingHttpResponse createCatalog(String source, String dest, String label, String title, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException Creates a catalog from a blueprint- Parameters:
source- path to the blueprintdest- destination path to the cataloglabel- label of the catalogtitle- title of the catalogexpectedStatus- expected HTTP response status codes- Returns:
- the http response
- Throws:
org.apache.sling.testing.clients.ClientException- if the request could not be executed
-
rolloutSection
public org.apache.sling.testing.clients.SlingHttpResponse rolloutSection(String source, String dest, boolean force, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException Rolls out a section- Parameters:
source- path to blueprintdest- destination path to the catalogforce- whether the rollout should be forcedexpectedStatus- expected HTTP response status code- Returns:
- the http response
- Throws:
org.apache.sling.testing.clients.ClientException- if the request could not be executed
-