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
public abstract class DSLProtocol<Client> extends DSLWrapper<Client> implements DSL<Client>
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 Constructor Description DSLProtocol()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Clientand()DSLAssertionassertThat()abstract ClientauthenticateUser(UserModel userModel)java.lang.StringbuildPath(java.lang.String parent, java.lang.String... paths)protected java.lang.StringbuildSiteDocumentLibraryPath(java.lang.String siteId, java.lang.String... filesOrFoldersHierarcy)protected java.lang.StringbuildUserHomePath(java.lang.String username, java.lang.String... filesOrFoldersHierarcy)ClientcloseJmxConnection()abstract Clientdisconnect()java.lang.StringgetCurrentSpace()UserModelgetCurrentUser()gets the current test userabstract java.lang.StringgetDataDictionaryPath()ContentModelgetLastContentModel()java.lang.StringgetLastResource()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 usedjava.lang.StringgetLastResourceWithoutPrefix()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()methodabstract java.lang.StringgetPrefixSpace()protected abstract java.lang.StringgetProtocolJMXConfigurationStatus()get the current status true/false of the protocol on test serverjava.lang.StringgetProtocolName()abstract java.lang.StringgetRootPath()abstract java.lang.StringgetSitesPath()abstract java.lang.StringgetUserHomesPath()booleanisProtocolEnabled()ClientsetCurrentSpace(java.lang.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(java.lang.String fullPath)The last resource should be the full path of the last file/folder used in testsClientthen()ClientusingAdmin()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 wrapperClientusingRoot()abstract ClientusingSite(java.lang.String siteId)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 abstract ClientusingSite(SiteModel siteModel)Defines the current test site to be used based onSiteModelClientusingUser(UserModel user)Defines the current test user that will be usedabstract ClientusingUserHome()abstract ClientusingUserHome(java.lang.String username)Defines the current User Home to be used Example: /User Homes/ClientwaitSeconds(int seconds)Clientwhen()-
Methods inherited from class org.alfresco.utility.dsl.DSLWrapper
getDataContentService, getTestUser, setTestUser
-
-
-
-
Method Detail
-
usingUser
public Client usingUser(UserModel user) throws java.lang.Exception
Description copied from interface:DSLDefines the current test user that will be used
-
usingAdmin
public Client usingAdmin() throws java.lang.Exception
Description copied from interface:DSLDefines the current user to be Admin- Specified by:
usingAdminin interfaceDSL<Client>- Returns:
- Throws:
java.lang.Exception
-
getCurrentUser
public UserModel getCurrentUser()
Description copied from interface:DSLgets the current test user- Specified by:
getCurrentUserin interfaceDSL<Client>- Returns:
-
usingRoot
public Client usingRoot() throws java.lang.Exception
-
buildSiteDocumentLibraryPath
protected java.lang.String buildSiteDocumentLibraryPath(java.lang.String siteId, java.lang.String... filesOrFoldersHierarcy) throws TestConfigurationException- Parameters:
siteId-filesOrFoldersHierarcy-- Returns:
- the full path of
inside /Sites/documentLibrary - Throws:
TestConfigurationException
-
buildUserHomePath
protected java.lang.String buildUserHomePath(java.lang.String username, java.lang.String... filesOrFoldersHierarcy) throws TestConfigurationException- Parameters:
siteId-filesOrFoldersHierarcy-- Returns:
- the full path of
inside /User Home/ - Throws:
TestConfigurationException
-
getCurrentSpace
public java.lang.String getCurrentSpace() throws TestConfigurationException- 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
public Client setCurrentSpace(java.lang.String currentRepositorySpace)
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
public Client closeJmxConnection() throws java.io.IOException
- Throws:
java.io.IOException
-
getProtocolJMXConfigurationStatus
protected abstract java.lang.String getProtocolJMXConfigurationStatus() throws java.lang.Exceptionget the current status true/false of the protocol on test server- Returns:
- Throws:
java.lang.Exception
-
isProtocolEnabled
public boolean isProtocolEnabled() throws java.lang.Exception- Returns:
- true/false if current protocl is enabled on server
- Throws:
java.lang.Exception
-
getLastResource
public java.lang.String 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
public java.lang.String 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
public void setLastResource(java.lang.String fullPath)
The last resource should be the full path of the last file/folder used in tests- Parameters:
fullPath-
-
getProtocolName
public java.lang.String getProtocolName()
- Returns:
- the name of the protocol based on the class name
-
and
public Client and()
-
then
public Client then()
-
when
public Client when()
-
authenticateUser
public abstract Client authenticateUser(UserModel userModel) throws java.lang.Exception
- Throws:
java.lang.Exception
-
disconnect
public abstract Client disconnect() throws java.lang.Exception
- Throws:
java.lang.Exception
-
usingSite
public abstract Client usingSite(java.lang.String siteId) throws java.lang.Exception
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
-
usingSite
public abstract Client usingSite(SiteModel siteModel) throws java.lang.Exception
Description copied from interface:DSLDefines the current test site to be used based onSiteModel
-
usingUserHome
public abstract Client usingUserHome(java.lang.String username) throws java.lang.Exception
Description copied from interface:DSLDefines the current User Home to be used Example: /User Homes/- Specified by:
usingUserHomein interfaceDSL<Client>- Returns:
- Throws:
java.lang.Exception
-
usingUserHome
public abstract Client usingUserHome() throws java.lang.Exception
- Specified by:
usingUserHomein interfaceDSL<Client>- Returns:
- the userhome path based on
DSL.getCurrentUser() - Throws:
java.lang.Exception
-
getRootPath
public abstract java.lang.String getRootPath() throws TestConfigurationException- Specified by:
getRootPathin interfaceDSL<Client>- Returns:
- the root path
- Throws:
TestConfigurationException
-
getSitesPath
public abstract java.lang.String getSitesPath() throws TestConfigurationException- Specified by:
getSitesPathin interfaceDSL<Client>- Returns:
- the Sites path Example: /Sites
- Throws:
TestConfigurationException
-
getUserHomesPath
public abstract java.lang.String getUserHomesPath() throws TestConfigurationException- Specified by:
getUserHomesPathin interfaceDSL<Client>- Returns:
- user home path Example: /User Homes
- Throws:
TestConfigurationException
-
getDataDictionaryPath
public abstract java.lang.String getDataDictionaryPath() throws TestConfigurationException- Specified by:
getDataDictionaryPathin interfaceDSL<Client>- Returns:
- the Data Dictionary path /Data Dictionary
- Throws:
TestConfigurationException
-
getPrefixSpace
public abstract java.lang.String getPrefixSpace()
-
usingResource
public abstract Client usingResource(ContentModel model) throws java.lang.Exception
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:
java.lang.Exception
-
assertThat
public DSLAssertion assertThat()
-
waitSeconds
public Client waitSeconds(int seconds)
-
buildPath
public java.lang.String buildPath(java.lang.String parent, java.lang.String... paths)
-
getLastContentModel
public ContentModel getLastContentModel()
-
setLastContentModel
public void setLastContentModel(ContentModel lastContentModel)
The last ContentModel tested fromusingResource(ContentModel)- Parameters:
lastContentModel-
-
-