Class CCResultsFactory

java.lang.Object
com.ibm.debug.pdt.codecoverage.core.results.CCResultsFactory

public class CCResultsFactory extends Object
This class generates a CC Result object
Since:
3.1
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Clear 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 populated
    createResult(String resultPath)
    helper method to process 1 path
    createResult(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.
    void
    Removes a registered importer If the importer is not registered it will do nothing
     
    Returns a copy of the registered importers Use registerImporter(ICCImporter) or deregisterImporter(ICCImporter) to update the list of importers
    void
    Adds an importer to the registered importers If processing has already started the registered importer will not be used importers must be registered before createResult(String[]) is called Only 1 instance of an importer is allowed
    void
    Reset the importers to the default list
    static void
    Call to enable exception stacktrace logging
    int
    verifyResultPaths(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.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • getInstance

      public static CCResultsFactory getInstance()
      Returns:
      an instance of the CCResultsFactory
    • createResult

      public ICCImportResult createResult()
      Use this method to return an empty result that can be directly populated
      Returns:
      ICCImportResult
      Since:
      10.1
    • createResult

      public ICCResult createResult(String resultPath) throws CCResultException
      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

      public ICCResult createResult(String[] resultPaths) 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 of String
      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 of String
      resultModifier - code coverage result modifier ICCResultModifier
      Returns:
      created ICCResult
      Throws:
      CCResultException - contains one or more exceptions with details of the problem
      Since:
      4.0
    • createResult

      public ICCResult createResult(String[] resultPaths, 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 - as String
      sourcePaths - 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 - as String
      resultModifier - code coverage result modifier ICCResultModifier
      sourcePaths - 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

      public ICCResult 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

      public void registerImporter(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 before createResult(String[]) is called Only 1 instance of an importer is allowed
      Parameters:
      importer - a code coverage importer
      Since:
      4.0
    • deregisterImporter

      public void deregisterImporter(ICCImporter importer)
      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 Use resetRegisteredImporters() to return to default
      Since:
      5.0
    • resetRegisteredImporters

      public void resetRegisteredImporters()
      Reset the importers to the default list
      Since:
      5.1
    • getRegisteredImporters

      public ICCImporter[] getRegisteredImporters()
      Returns a copy of the registered importers Use registerImporter(ICCImporter) or deregisterImporter(ICCImporter) to update the list of importers
      Returns:
      array of zero or more registered importers
      Since:
      5.0
    • verifyResultPaths

      public int verifyResultPaths(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. 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 directories
      quickFail - 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