Package com.polarion.alm.tracker
Class AbstractTestsFileProcessor
java.lang.Object
com.polarion.alm.tracker.AbstractTestsFileProcessor
- All Implemented Interfaces:
ITestsFileProcessor
Extend this class to implement your custom
ITestsFileProcessor
,
it will allow your implementation to work even when new methods are added to the ITestsFileProcessor
- Since:
- 3.6.1
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.polarion.alm.tracker.ITestsFileProcessor
ITestsFileProcessor.FileReaderSource, ITestsFileProcessor.ReaderSource, ITestsFileProcessor.ResultsSummary, ITestsFileProcessor.StringReaderSource
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal void
addContent
(String content) Adds content to be processed as String, can be called more times.final void
addSources
(List<ITestsFileProcessor.ReaderSource> sources) Adds sources to be processed, can be called more times.Return the names of the sources separated by comma.void
setDefectTemplate
(IWorkItem workItem) Sets template Work Item for creating defect work items.final void
setMaxCreatedDefects
(Integer value) Sets limit for how many defects per source should be created, summary defect is created instead of individual defect when this limit is reached.final void
Sets limit for percent of failed tests for which defects should be created, summary defect is created instead of individual defect when this limit is reached.void
setProperties
(Map<String, String> properties) Sets custom properties for this processor.void
setTestCaseTemplate
(IWorkItem workItem) Sets template Work Item for creating test case work items.boolean
shouldCreateSummaryDefect
(int totalTests, int totalFailures, int totalErrors) Checks if the failures and errors counts exceeded maximal values configured bysetMaxCreatedDefects(Integer)
orsetMaxCreatedDefectsPercent(Integer)
orTestsConfiguration.getMaxCreatedDefects()
orTestsConfiguration.getMaxCreatedDefectsPercent()
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.polarion.alm.tracker.ITestsFileProcessor
process, setTestRun
-
Constructor Details
-
AbstractTestsFileProcessor
- Parameters:
configuration
- - can be null
-
-
Method Details
-
addContent
Description copied from interface:ITestsFileProcessor
Adds content to be processed as String, can be called more times.- Specified by:
addContent
in interfaceITestsFileProcessor
-
addSources
Description copied from interface:ITestsFileProcessor
Adds sources to be processed, can be called more times.- Specified by:
addSources
in interfaceITestsFileProcessor
-
getSourceNames
Return the names of the sources separated by comma. It is useful to be used forITestRun.updateSummaryDefect(String, int, int, int, IWorkItem)
; -
setMaxCreatedDefects
Description copied from interface:ITestsFileProcessor
Sets limit for how many defects per source should be created, summary defect is created instead of individual defect when this limit is reached. Value from configuration will be used when null, zero or negative- Specified by:
setMaxCreatedDefects
in interfaceITestsFileProcessor
-
setMaxCreatedDefectsPercent
Description copied from interface:ITestsFileProcessor
Sets limit for percent of failed tests for which defects should be created, summary defect is created instead of individual defect when this limit is reached. Value from configuration will be used when null, zero or negative.- Specified by:
setMaxCreatedDefectsPercent
in interfaceITestsFileProcessor
-
setTestCaseTemplate
Description copied from interface:ITestsFileProcessor
Sets template Work Item for creating test case work items. Value from configuration will be used when null.- Specified by:
setTestCaseTemplate
in interfaceITestsFileProcessor
-
setDefectTemplate
Description copied from interface:ITestsFileProcessor
Sets template Work Item for creating defect work items. Value from configuration will be used when null.- Specified by:
setDefectTemplate
in interfaceITestsFileProcessor
-
setProperties
Description copied from interface:ITestsFileProcessor
Sets custom properties for this processor.- Specified by:
setProperties
in interfaceITestsFileProcessor
-
shouldCreateSummaryDefect
public boolean shouldCreateSummaryDefect(int totalTests, int totalFailures, int totalErrors) Checks if the failures and errors counts exceeded maximal values configured bysetMaxCreatedDefects(Integer)
orsetMaxCreatedDefectsPercent(Integer)
orTestsConfiguration.getMaxCreatedDefects()
orTestsConfiguration.getMaxCreatedDefectsPercent()
- Parameters:
totalTests
- total count of teststotalFailures
- count of failed testtotalErrors
- count of tests with error- Since:
- 3.6.1
-