Class Publish


  • public final class Publish
    extends Object
    Class for helper methods to collect and tranform TPT test result.
    Author:
    jkuhnert, PikeTec GmbH
    • Constructor Detail

      • Publish

        public Publish()
    • Method Detail

      • publishJUnitResults

        public static int publishJUnitResults​(JenkinsConfiguration jenkinsConfig,
                                              FilePath testDataDir,
                                              FilePath jUnitOutputDir,
                                              TptLogger logger,
                                              com.piketec.jenkins.plugins.tpt.TptLog.LogLevel logLevel)
                                       throws IOException,
                                              InterruptedException
        Publish the Junits results, it creates an XML file and write the results on it.
        Parameters:
        jenkinsConfig - The configuration to which the TPT test resuklt should be tranformed to JUnit
        testDataDir - The directory where TPT test data should be searched
        jUnitOutputDir - The directory where the transformed results should be written to.
        logger - to display the information
        logLevel - the threshold for the severity of the log messages
        Returns:
        the number of testcases .
        Throws:
        IOException - if an error occured while parsing TPT test data or writing the JUnit xml files
        InterruptedException - If the job was interrupted
      • getTestcases

        public static com.piketec.jenkins.plugins.tpt.TestCasesParseResult getTestcases​(FilePath testDataDir,
                                                                                        TptLogger logger)
                                                                                 throws IOException,
                                                                                        InterruptedException
        Collects recursively all test cases by searching for "testcase_information.xml" files in "rootdir". If a file could not be loaded, an error message will be printed.
        Parameters:
        testDataDir - The directory where TPT test data should be searched
        logger - to display the information
        Returns:
        The list of parsed TPT test cases
        Throws:
        IOException - If an error occured while parsing TPT test data
        InterruptedException - If the job was interrupted
      • find

        public static void find​(FilePath rootdir,
                                String pattern,
                                Collection<FilePath> files)
                         throws IOException,
                                InterruptedException
        find all files in directory "root" with file name "pattern" and stores them in collection "files"
        Parameters:
        rootdir - The directory that should be searched
        pattern - The file name that has to be found.
        files - The collection to pupulate
        Throws:
        IOException - If an error occured while parsing TPT test data
        InterruptedException - If the job was interrupted