public class PackageManagerClient extends CQClient
The PackageManagerClient encapsulates operations on content packages just like
those available in the /crx/packmgr/index.jsp
application. It
also uses the same API to invoke them (HTTP requests).
Provides methods to create a new empty package or upload one from the local disk
To manipulate an existing package, usePackageManagerClient.Package
, which can be obtained
using getPackage(String path)
.Modifier and Type | Class and Description |
---|---|
static class |
PackageManagerClient.Package |
CQClient.Builder, CQClient.InternalBuilder<T extends CQClient>
LOG, STATISTICS_ROOT, wcmCommands
Constructor and Description |
---|
PackageManagerClient(org.apache.http.impl.client.CloseableHttpClient http,
org.apache.sling.testing.clients.SlingClientConfig config) |
PackageManagerClient(URI serverUrl,
String user,
String password) |
Modifier and Type | Method and Description |
---|---|
org.apache.sling.testing.clients.SlingHttpResponse |
buildPackage(String packageName,
String packageVersion,
String groupName,
int... expectedStatus)
Builds the specific package.
|
PackageManagerClient.Package |
createPackage(String name,
String version,
String group) |
org.apache.sling.testing.clients.SlingHttpResponse |
createPackage(String packageName,
String packageVersion,
String groupName,
int... expectedStatus)
Creates a new package.
|
org.apache.sling.testing.clients.SlingHttpResponse |
deletePackage(String packageName,
String packageVersion,
String groupName,
int... expectedStatus)
Deletes a package.
|
PackageManagerClient.Package |
getPackage(String path) |
String |
getPackageContentResponse(String packageName,
String packageVersion,
String groupName)
Returns the HTTP response for the package content request.
|
String |
getPackageCoverageResponse(String packageName,
String packageVersion,
String groupName)
Returns the HTTP response for the package content request.
|
org.apache.sling.testing.clients.SlingHttpResponse |
installPackage(String packageName,
String packageVersion,
String groupName,
int... expectedStatus)
Installs the specific package.
|
boolean |
isPackageCreated(String packageName,
String packageVersion,
String groupName)
Checks if the package is created.
|
org.apache.sling.testing.clients.SlingHttpResponse |
renamePackages(String oldName,
String oldVersion,
String oldGroup,
String newName,
String newVersion,
String newGroup,
int... expectedStatus)
Renames a package.
|
org.apache.sling.testing.clients.SlingHttpResponse |
rewrapPackage(String packageName,
String packageVersion,
String groupName,
int... expectedStatus)
Re-wraps the specific package.
|
org.apache.sling.testing.clients.SlingHttpResponse |
testInstallPackage(String packageName,
String packageVersion,
String groupName,
int... expectedStatus)
Test installation for the specific package.
|
org.apache.sling.testing.clients.SlingHttpResponse |
uninstallPackage(String packageName,
String packageVersion,
String groupName,
int... expectedStatus)
Uninstall the specific package.
|
org.apache.sling.testing.clients.SlingHttpResponse |
updateThumbnail(String packageName,
String packageVersion,
String groupName,
String resourcePath,
String fileName,
int... expectedStatus)
Updates the thumbnail for a specific package.
|
PackageManagerClient.Package |
uploadPackage(InputStream is,
String fileName) |
org.apache.sling.testing.clients.SlingHttpResponse |
uploadPackage(String resourcePath,
String fileName,
int... expectedStatus)
Uploads a package.
|
org.apache.sling.testing.clients.SlingHttpResponse |
uploadPictureAsScreenshot(String packageName,
String packageVersion,
String groupName,
String resourcePath,
String fileName,
int... expectedStatus)
Uploads a screenshot for a package.
|
copyLanguages, copyPage, createPage, createPageWithRetry, createVersion, deletePage, deletePageWithRetry, lockPage, movePage, movePage, resetPageStatistics, restoreTree, restoreVersion, rolloutPage, searchAndReplaceInPages, searchInPages, setPageProperties, setPageProperty, setPagePropertyImage, unlockPage, uploadAsset, uploadFileCQStyle
createFolder, createNode, createNodeRecursive, deletePath, doGetJson, exists, getJsonNode, getJsonNode, getNodeNameFromPath, getParentPath, getUUId, getUUID, importContent, importContent, importJson, move, setPropertiesString, setPropertyString, setPropertyStringArray, upload, waitExists, waitUntilExists
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, getUser, getValue, getValues, hasValue
public PackageManagerClient(org.apache.http.impl.client.CloseableHttpClient http, org.apache.sling.testing.clients.SlingClientConfig config) throws org.apache.sling.testing.clients.ClientException
org.apache.sling.testing.clients.ClientException
public PackageManagerClient.Package createPackage(String name, String version, String group) throws org.apache.sling.testing.clients.ClientException
org.apache.sling.testing.clients.ClientException
public PackageManagerClient.Package getPackage(String path) throws org.apache.sling.testing.clients.ClientException
org.apache.sling.testing.clients.ClientException
public PackageManagerClient.Package uploadPackage(InputStream is, String fileName) throws org.apache.sling.testing.clients.ClientException
org.apache.sling.testing.clients.ClientException
public org.apache.sling.testing.clients.SlingHttpResponse createPackage(String packageName, String packageVersion, String groupName, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException
packageName
- name of the package.packageVersion
- version of the package.groupName
- name of the group where the package will be created.expectedStatus
- list of accepted statusesorg.apache.sling.testing.clients.ClientException
- if the request failedpublic org.apache.sling.testing.clients.SlingHttpResponse deletePackage(String packageName, String packageVersion, String groupName, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException
packageName
- Name of the package.packageVersion
- Package version.groupName
- Package group name.expectedStatus
- list of accepted statusesorg.apache.sling.testing.clients.ClientException
- if the request failedpublic org.apache.sling.testing.clients.SlingHttpResponse renamePackages(String oldName, String oldVersion, String oldGroup, String newName, String newVersion, String newGroup, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException
oldName
- The old package name.oldVersion
- The old package version.oldGroup
- The old package group.newName
- The The new name for the package.newVersion
- The new version for the package.newGroup
- The new group for the packageexpectedStatus
- list of accepted statusesorg.apache.sling.testing.clients.ClientException
- if the request failedpublic boolean isPackageCreated(String packageName, String packageVersion, String groupName) throws org.apache.sling.testing.clients.ClientException
packageName
- Name of the package.packageVersion
- Name of the version.groupName
- Name of the group.org.apache.sling.testing.clients.ClientException
- if the request failedpublic org.apache.sling.testing.clients.SlingHttpResponse buildPackage(String packageName, String packageVersion, String groupName, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException
packageName
- Name of the package.packageVersion
- Version for the package.groupName
- Group name for the package.expectedStatus
- list of accepted statusesorg.apache.sling.testing.clients.ClientException
- if the request failedpublic org.apache.sling.testing.clients.SlingHttpResponse rewrapPackage(String packageName, String packageVersion, String groupName, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException
packageName
- Name of the package.packageVersion
- Version for the package.groupName
- Group name for the package.expectedStatus
- List of expected statusesorg.apache.sling.testing.clients.ClientException
- if the request failedpublic org.apache.sling.testing.clients.SlingHttpResponse installPackage(String packageName, String packageVersion, String groupName, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException
packageName
- Name of the package.packageVersion
- Version for the package.groupName
- Group name for the package.expectedStatus
- List of expected statusesorg.apache.sling.testing.clients.ClientException
- if the request failedpublic org.apache.sling.testing.clients.SlingHttpResponse uninstallPackage(String packageName, String packageVersion, String groupName, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException
packageName
- Name of the package.packageVersion
- Version for the package.groupName
- Group name for the package.expectedStatus
- list of expected statusorg.apache.sling.testing.clients.ClientException
- if the request failedpublic org.apache.sling.testing.clients.SlingHttpResponse testInstallPackage(String packageName, String packageVersion, String groupName, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException
packageName
- Name of the package.packageVersion
- Version for the package.groupName
- Group name for the package.expectedStatus
- list of expected statusesorg.apache.sling.testing.clients.ClientException
- if the request failedpublic org.apache.sling.testing.clients.SlingHttpResponse uploadPackage(String resourcePath, String fileName, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException
resourcePath
- File's path.fileName
- Name of the file.expectedStatus
- list of expected statusesorg.apache.sling.testing.clients.ClientException
- if the request failedpublic String getPackageContentResponse(String packageName, String packageVersion, String groupName) throws org.apache.sling.testing.clients.ClientException
packageName
- name of the packagepackageVersion
- version of the packagegroupName
- group of the packageorg.apache.sling.testing.clients.ClientException
- if the request failedpublic String getPackageCoverageResponse(String packageName, String packageVersion, String groupName) throws org.apache.sling.testing.clients.ClientException
packageName
- name of the packagepackageVersion
- version of the packagegroupName
- group of the packageorg.apache.sling.testing.clients.ClientException
- if the request failedpublic org.apache.sling.testing.clients.SlingHttpResponse updateThumbnail(String packageName, String packageVersion, String groupName, String resourcePath, String fileName, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException
packageName
- Name of the packagepackageVersion
- Version of the packagegroupName
- Name of the groupresourcePath
- Path to the thumbnailfileName
- Name of the thumbnailexpectedStatus
- list of expected statusesorg.apache.sling.testing.clients.ClientException
- if the request failedpublic org.apache.sling.testing.clients.SlingHttpResponse uploadPictureAsScreenshot(String packageName, String packageVersion, String groupName, String resourcePath, String fileName, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException
packageName
- name of the packagepackageVersion
- version of the packagegroupName
- group of the packageresourcePath
- path to the thumbnailfileName
- name of the thumbnailexpectedStatus
- list of expected statusesorg.apache.sling.testing.clients.ClientException
- if the request failedCopyright © 2018. All rights reserved.