Package com.piketec.jenkins.plugins.tpt
Class Publish
- java.lang.Object
-
- com.piketec.jenkins.plugins.tpt.Publish
-
public final class Publish extends Object
Class for helper methods to collect and tranform TPT test result.- Author:
- jkuhnert, PikeTec GmbH
-
-
Constructor Summary
Constructors Constructor Description Publish()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
find(FilePath rootdir, String pattern, Collection<FilePath> files)
find all files in directory "root" with file name "pattern" and stores them in collection "files"static com.piketec.jenkins.plugins.tpt.TestCasesParseResult
getTestcases(FilePath testDataDir, TptLogger logger)
Collects recursively all test cases by searching for "testcase_information.xml" files in "rootdir".static int
publishJUnitResults(JenkinsConfiguration jenkinsConfig, FilePath testDataDir, FilePath jUnitOutputDir, TptLogger logger, com.piketec.jenkins.plugins.tpt.TptLog.LogLevel logLevel)
Publish the Junits results, it creates an XML file and write the results on it.
-
-
-
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 JUnittestDataDir
- The directory where TPT test data should be searchedjUnitOutputDir
- The directory where the transformed results should be written to.logger
- to display the informationlogLevel
- 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 filesInterruptedException
- 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 searchedlogger
- to display the information- Returns:
- The list of parsed TPT test cases
- Throws:
IOException
- If an error occured while parsing TPT test dataInterruptedException
- 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 searchedpattern
- The file name that has to be found.files
- The collection to pupulate- Throws:
IOException
- If an error occured while parsing TPT test dataInterruptedException
- If the job was interrupted
-
-