Class CCResultsFactory
java.lang.Object
com.ibm.debug.pdt.codecoverage.core.results.CCResultsFactory
This class generates a CC Result object
- Since:
- 3.1
-
Method Summary
Modifier and TypeMethodDescriptionvoidClear all registered importers This can be used if the caller wants full control over which importers should be called.This will create an empty result that will behave like it has no CC data It can be used where an ICCResult is required but is empty.Use this method to return an empty result that can be directly populatedcreateResult(String resultPath) helper method to process 1 pathcreateResult(String[] resultPaths) Creates an ICCResult by passing in 1 or more strings that resolve to path(s) where CC results can be found Each of the paths will be processed by the registered importers It is up to each importer to determine if the resultPath contains results that can be imported.createResult(String[] resultPaths, ICCResultModifier resultModifier) Creates an ICCResult by passing in 1 or more strings that resolve to path(s) where CC results can be found Each of the paths will be processed by the registered importers It is up to each importer to determine if the resultPath contains results that can be imported.createResult(String[] resultPaths, ICCResultModifier resultModifier, String[] sourcePaths) Creates an ICCResult by passing in 1 or more strings that resolve to path(s) where CC results can be found Each of the paths will be processed by the registered importers It is up to each importer to determine if the resultPath contains results that can be imported.createResult(String[] resultPaths, String[] sourcePaths) Creates an ICCResult by passing in 1 or more strings that resolve to path(s) where CC results can be found Each of the paths will be processed by the registered importers It is up to each importer to determine if the resultPath contains results that can be imported.voidderegisterImporter(ICCImporter importer) Removes a registered importer If the importer is not registered it will do nothingstatic CCResultsFactoryReturns a copy of the registered importers UseregisterImporter(ICCImporter)orderegisterImporter(ICCImporter)to update the list of importersvoidregisterImporter(ICCImporter importer) Adds an importer to the registered importers If processing has already started the registered importer will not be used importers must be registered beforecreateResult(String[])is called Only 1 instance of an importer is allowedvoidReset the importers to the default liststatic voidCall to enable exception stacktrace loggingintverifyResultPaths(String[] resultPaths, boolean quickFail) Verify result paths without doing the import This can be used to do a quick verify of paths to determine if they contain results that could be imported.
-
Method Details
-
getInstance
- Returns:
- an instance of the CCResultsFactory
-
createResult
Use this method to return an empty result that can be directly populated- Returns:
ICCImportResult- Since:
- 10.1
-
createResult
helper method to process 1 path- Parameters:
resultPath- create a result from this path- Returns:
- created ICCResult
- Throws:
CCResultException- contains one or more exceptions with details of the problem- Since:
- 9.0
-
createResult
Creates an ICCResult by passing in 1 or more strings that resolve to path(s) where CC results can be found Each of the paths will be processed by the registered importers It is up to each importer to determine if the resultPath contains results that can be imported. To allow a resultPath to contain different result formats each registered importer will be given the opportunity to process the resultPath.- Parameters:
resultPaths- an array ofString- Returns:
- ICCResult object
- Throws:
CCResultException- contains one or more exceptions with details of the problem
-
createResult
public ICCResult createResult(String[] resultPaths, ICCResultModifier resultModifier) throws CCResultException Creates an ICCResult by passing in 1 or more strings that resolve to path(s) where CC results can be found Each of the paths will be processed by the registered importers It is up to each importer to determine if the resultPath contains results that can be imported. To allow a resultPath to contain different result formats each registered importer will be given the opportunity to process the resultPath.- Parameters:
resultPaths- an array ofStringresultModifier- code coverage result modifierICCResultModifier- Returns:
- created ICCResult
- Throws:
CCResultException- contains one or more exceptions with details of the problem- Since:
- 4.0
-
createResult
Creates an ICCResult by passing in 1 or more strings that resolve to path(s) where CC results can be found Each of the paths will be processed by the registered importers It is up to each importer to determine if the resultPath contains results that can be imported. To allow a resultPath to contain different result formats each registered importer will be given the opportunity to process the resultPath.- Parameters:
resultPaths- asStringsourcePaths- as an array of strings that will be used by the matching importer to find source if it can't be found with the results - Note: each importer that discovers results and supports this path parameter will be given a chance to use it- Returns:
- cc result object
- Throws:
CCResultException- contains one or more exceptions with details of the problem- Since:
- 4.0
-
createResult
public ICCResult createResult(String[] resultPaths, ICCResultModifier resultModifier, String[] sourcePaths) throws CCResultException Creates an ICCResult by passing in 1 or more strings that resolve to path(s) where CC results can be found Each of the paths will be processed by the registered importers It is up to each importer to determine if the resultPath contains results that can be imported. To allow a resultPath to contain different result formats each registered importer will be given the opportunity to process the resultPath.- Parameters:
resultPaths- asStringresultModifier- code coverage result modifierICCResultModifiersourcePaths- as an array of strings that will be used by the matching importer to find source if it can't be found with the results - Note: each importer that discovers results and supports this path parameter will be given a chance to use it- Returns:
- cc result object
- Throws:
CCResultException- contains one or more exceptions with details of the problem- Since:
- 4.0
-
createEmptyResult
This will create an empty result that will behave like it has no CC data It can be used where an ICCResult is required but is empty.- Returns:
- empty
ICCResult - Since:
- 10.1
-
setExceptionLogging
public static void setExceptionLogging()Call to enable exception stacktrace logging -
registerImporter
Adds an importer to the registered importers If processing has already started the registered importer will not be used importers must be registered beforecreateResult(String[])is called Only 1 instance of an importer is allowed- Parameters:
importer- a code coverage importer- Since:
- 4.0
-
deregisterImporter
Removes a registered importer If the importer is not registered it will do nothing- Parameters:
importer- to remove- Since:
- 5.0
-
clearRegisteredImporters
public void clearRegisteredImporters()Clear all registered importers This can be used if the caller wants full control over which importers should be called. After calling this method at least one importer should be registered UseresetRegisteredImporters()to return to default- Since:
- 5.0
-
resetRegisteredImporters
public void resetRegisteredImporters()Reset the importers to the default list- Since:
- 5.1
-
getRegisteredImporters
Returns a copy of the registered importers UseregisterImporter(ICCImporter)orderegisterImporter(ICCImporter)to update the list of importers- Returns:
- array of zero or more registered importers
- Since:
- 5.0
-
verifyResultPaths
Verify result paths without doing the import This can be used to do a quick verify of paths to determine if they contain results that could be imported. The results may not be valid but the registered importers recognize the paths as potentially containing results- Parameters:
resultPaths- array of paths to files or directoriesquickFail- if true the verify will fail on the first path that doesn't contain a result, if false all paths will be checked and the number of valid results will be returned- Returns:
- the valid number of results found (a path may contain > 1 result)
- Since:
- 7.0
-