Class AbstractTask

    • Constructor Detail

      • AbstractTask

        public AbstractTask()
    • Method Detail

      • initTask

        protected void initTask()
      • getInstallDir

        public File getInstallDir()
      • setInstallDir

        public void setInstallDir​(File installDir)
      • getUserDir

        public File getUserDir()
      • setUserDir

        public void setUserDir​(File userDir)
      • getOutputDir

        public File getOutputDir()
      • setOutputDir

        public void setOutputDir​(File outputDir)
      • getServerOutputDir

        public File getServerOutputDir()
      • getServerName

        public String getServerName()
        Returns:
        the serverName
      • setServerName

        public void setServerName​(String serverName)
        Parameters:
        serverName - the serverName to set
      • getLogFile

        public File getLogFile()
      • getRef

        public String getRef()
        Returns:
        the ref
      • setRef

        public void setRef​(String ref)
        Parameters:
        ref - the ref to set
      • sendErrorInvokeCommand

        public void sendErrorInvokeCommand​(String commandLine,
                                           int returnCode,
                                           int... expectedExitCodes)
      • waitForStringInLog

        public String waitForStringInLog​(String regexp,
                                         long timeout,
                                         File outputFile)
        Check for a number of strings in a potentially remote file
        Parameters:
        regexp - a regular expression to search for
        timeout - a timeout, in milliseconds
        outputFile - file to check
        Returns:
        line that matched the regexp
      • findStringInFile

        public String findStringInFile​(String regexp,
                                       File fileToSearch)
        Searches the given file for the given regular expression.
        Parameters:
        regexp - a regular expression (or just a text snippet) to search for
        fileToSearch - the file to search
        Returns:
        The first line which includes the pattern, or null if the pattern isn't found or if the file doesn't exist
      • findStringsInFile

        public List<String> findStringsInFile​(String regexp,
                                              File fileToSearch)
        Searches the given file for the given regular expression.
        Parameters:
        regexp - a regular expression (or just a text snippet) to search for
        fileToSearch - the file to search
        Returns:
        List of lines which includes the pattern, or null if the pattern isn't found or if the file doesn't exist
      • countStringOccurrencesInFile

        public int countStringOccurrencesInFile​(String regexp,
                                                File fileToSearch)
        Searches the given file for the given regular expression, and returns the number of times it occurs.
        Parameters:
        regexp - a regular expression (or just a text snippet) to search for
        fileToSearch - the file to search
        Returns:
        the number of occurrences of the regular expression
      • waitForUpdatedStringInLog

        public String waitForUpdatedStringInLog​(String regexp,
                                                long timeout,
                                                File outputFile,
                                                int previousOccurrences)
        Wait until the number of occurrences of the regular expression in the file increases above the given number of previous occurrences.
        Parameters:
        regexp - a regular expression to search for
        timeout - a timeout, in milliseconds
        outputFile - file to check
        previousOccurrences - . the previous number of occurrences of the regular expression
        Returns:
        updated line that matched the regexp
      • getFileName

        protected String getFileName​(String fileName)
      • stopServer

        protected void stopServer​(String timeout)