Package org.alfresco.utility.dsl
Class DSLProtocol<Client>
java.lang.Object
org.alfresco.utility.dsl.DSLWrapper<Client>
org.alfresco.utility.dsl.DSLProtocol<Client>
- Type Parameters:
Client-
- All Implemented Interfaces:
DSL<Client>
- Direct Known Subclasses:
DSLProtocolWithNetworkDrive
Extend this class if you want add implementation for a new protocol.
See example of CifsWrapper, FtpWrapper
-
Field Summary
Fields inherited from class org.alfresco.utility.dsl.DSLWrapper
contentService, dataContent, jmxBuilder, LOG -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionand()abstract ClientauthenticateUser(UserModel userModel) protected StringbuildSiteDocumentLibraryPath(String siteId, String... filesOrFoldersHierarcy) protected StringbuildUserHomePath(String username, String... filesOrFoldersHierarcy) abstract Clientgets the current test userabstract StringReturns the last ContentModel resource created within alfresco repository This will return the full path so something like: or -> smb://172.29.100.215/alfresco/Sites/qcAqgLSMO2OU5txtPMQG/documentLibrary/ /folder-syKFUjMWgY if CIFS protocol is usedThe same asgetLastResource()but without the repository prefix So if the lastResource is smb://172.29.100.215/alfresco/Sites/qcAqgLSMO2OU5txtPMQG/documentLibrary/ folder-syKFUjMWgY we will return only "/Sites/qcAqgLSMO2OU5txtPMQG/documentLibrary//folder-syKFUjMWgY" without "smb://172.29.100.215/alfresco" prefix defined ingetPrefixSpace()methodabstract Stringprotected abstract Stringget the current status true/false of the protocol on test serverabstract Stringabstract Stringabstract StringbooleansetCurrentSpace(String currentRepositorySpace) DSL.getSitesPath(), DSL.getUserHomesPath(),DSL.getDataDictionaryPath(), etc If nothing is specified, the root folder is usedvoidsetLastContentModel(ContentModel lastContentModel) The last ContentModel tested fromusingResource(ContentModel)voidsetLastResource(String fullPath) The last resource should be the full path of the last file/folder used in teststhen()Defines the current user to be Adminabstract ClientusingResource(ContentModel model) Operations on files or folders If you call this method you can use all assertion within this wrapperabstract ClientUser for changing current site location This method will build the path of the siteId location Example: /Sites//documentLibrary Add implementation for your protocol accordingly abstract ClientDefines the current test site to be used based onSiteModelDefines the current test user that will be usedabstract Clientabstract ClientusingUserHome(String username) Defines the current User Home to be used Example: /User Homes/waitSeconds(int seconds) when()Methods inherited from class org.alfresco.utility.dsl.DSLWrapper
getDataContentService, getTestUser, setTestUser
-
Constructor Details
-
DSLProtocol
public DSLProtocol()
-
-
Method Details
-
usingUser
Description copied from interface:DSLDefines the current test user that will be used -
usingAdmin
Description copied from interface:DSLDefines the current user to be Admin- Specified by:
usingAdminin interfaceDSL<Client>- Returns:
- Throws:
Exception
-
getCurrentUser
Description copied from interface:DSLgets the current test user- Specified by:
getCurrentUserin interfaceDSL<Client>- Returns:
-
usingRoot
-
buildSiteDocumentLibraryPath
protected String buildSiteDocumentLibraryPath(String siteId, String... filesOrFoldersHierarcy) throws TestConfigurationException - Parameters:
siteId-filesOrFoldersHierarcy-- Returns:
- the full path of
inside /Sites/documentLibrary - Throws:
TestConfigurationException
-
buildUserHomePath
protected String buildUserHomePath(String username, String... filesOrFoldersHierarcy) throws TestConfigurationException - Parameters:
siteId-filesOrFoldersHierarcy-- Returns:
- the full path of
inside /User Home/ - Throws:
TestConfigurationException
-
getCurrentSpace
- Specified by:
getCurrentSpacein interfaceDSL<Client>- Returns:
- the current Repository Space, can be: getSitesPath(), getRootPath(), getUserHomesPath(), etc If nothing is specified, the root folder is used
- Throws:
TestConfigurationException
-
setCurrentSpace
Description copied from interface:DSLDSL.getSitesPath(), DSL.getUserHomesPath(),DSL.getDataDictionaryPath(), etc If nothing is specified, the root folder is used- Specified by:
setCurrentSpacein interfaceDSL<Client>
-
closeJmxConnection
- Throws:
IOException
-
getProtocolJMXConfigurationStatus
get the current status true/false of the protocol on test server- Returns:
- Throws:
Exception
-
isProtocolEnabled
- Returns:
- true/false if current protocl is enabled on server
- Throws:
Exception
-
getLastResource
Returns the last ContentModel resource created within alfresco repository This will return the full path so something like: or -> smb://172.29.100.215/alfresco/Sites/qcAqgLSMO2OU5txtPMQG/documentLibrary/ /folder-syKFUjMWgY if CIFS protocol is used -
getLastResourceWithoutPrefix
The same asgetLastResource()but without the repository prefix So if the lastResource is smb://172.29.100.215/alfresco/Sites/qcAqgLSMO2OU5txtPMQG/documentLibrary/ folder-syKFUjMWgY we will return only "/Sites/qcAqgLSMO2OU5txtPMQG/documentLibrary//folder-syKFUjMWgY" without "smb://172.29.100.215/alfresco" prefix defined ingetPrefixSpace()method -
setLastResource
The last resource should be the full path of the last file/folder used in tests- Parameters:
fullPath-
-
getProtocolName
- Returns:
- the name of the protocol based on the class name
-
and
-
then
-
when
-
authenticateUser
- Throws:
Exception
-
disconnect
- Throws:
Exception
-
usingSite
Description copied from interface:DSLDefines the current test site to be used based onSiteModel -
usingSite
User for changing current site location This method will build the path of the siteId location Example: /Sites//documentLibrary Add implementation for your protocol accordingly -
usingUserHome
Description copied from interface:DSLDefines the current User Home to be used Example: /User Homes/- Specified by:
usingUserHomein interfaceDSL<Client>- Returns:
- Throws:
Exception
-
usingUserHome
- Specified by:
usingUserHomein interfaceDSL<Client>- Returns:
- the userhome path based on
DSL.getCurrentUser() - Throws:
Exception
-
getRootPath
- Specified by:
getRootPathin interfaceDSL<Client>- Returns:
- the root path
- Throws:
TestConfigurationException
-
getSitesPath
- Specified by:
getSitesPathin interfaceDSL<Client>- Returns:
- the Sites path Example: /Sites
- Throws:
TestConfigurationException
-
getUserHomesPath
- Specified by:
getUserHomesPathin interfaceDSL<Client>- Returns:
- user home path Example: /User Homes
- Throws:
TestConfigurationException
-
getDataDictionaryPath
- Specified by:
getDataDictionaryPathin interfaceDSL<Client>- Returns:
- the Data Dictionary path /Data Dictionary
- Throws:
TestConfigurationException
-
getPrefixSpace
-
usingResource
Operations on files or folders If you call this method you can use all assertion within this wrapper- Specified by:
usingResourcein interfaceDSL<Client>- Parameters:
model-- Returns:
- Throws:
Exception
-
assertThat
-
waitSeconds
-
buildPath
-
getLastContentModel
-
setLastContentModel
The last ContentModel tested fromusingResource(ContentModel)- Parameters:
lastContentModel-
-