Class 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
    • Constructor Detail

      • DSLProtocol

        public DSLProtocol()
    • Method Detail

      • usingUser

        public Client usingUser​(UserModel user)
                         throws java.lang.Exception
        Description copied from interface: DSL
        Defines the current test user that will be used
        Specified by:
        usingUser in interface DSL<Client>
        Throws:
        java.lang.Exception
      • usingAdmin

        public Client usingAdmin()
                          throws java.lang.Exception
        Description copied from interface: DSL
        Defines the current user to be Admin
        Specified by:
        usingAdmin in interface DSL<Client>
        Returns:
        Throws:
        java.lang.Exception
      • getCurrentUser

        public UserModel getCurrentUser()
        Description copied from interface: DSL
        gets the current test user
        Specified by:
        getCurrentUser in interface DSL<Client>
        Returns:
      • usingRoot

        public Client usingRoot()
                         throws java.lang.Exception
        Specified by:
        usingRoot in interface DSL<Client>
        Returns:
        the rootPath
        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
      • closeJmxConnection

        public Client closeJmxConnection()
                                  throws java.io.IOException
        Throws:
        java.io.IOException
      • getProtocolJMXConfigurationStatus

        protected abstract java.lang.String getProtocolJMXConfigurationStatus()
                                                                       throws java.lang.Exception
        get 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 as getLastResource() 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 in getPrefixSpace() 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
      • 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
        Specified by:
        usingSite in interface DSL<Client>
        Parameters:
        siteId -
        Returns:
        Throws:
        java.lang.Exception
      • usingSite

        public abstract Client usingSite​(SiteModel siteModel)
                                  throws java.lang.Exception
        Description copied from interface: DSL
        Defines the current test site to be used based on SiteModel
        Specified by:
        usingSite in interface DSL<Client>
        Returns:
        Throws:
        java.lang.Exception
      • usingUserHome

        public abstract Client usingUserHome​(java.lang.String username)
                                      throws java.lang.Exception
        Description copied from interface: DSL
        Defines the current User Home to be used Example: /User Homes/
        Specified by:
        usingUserHome in interface DSL<Client>
        Returns:
        Throws:
        java.lang.Exception
      • 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:
        usingResource in interface DSL<Client>
        Parameters:
        model -
        Returns:
        Throws:
        java.lang.Exception
      • waitSeconds

        public Client waitSeconds​(int seconds)
      • buildPath

        public java.lang.String buildPath​(java.lang.String parent,
                                          java.lang.String... paths)
      • getLastContentModel

        public ContentModel getLastContentModel()