Interface ICCResult

All Superinterfaces:
ICCBase, ICCCompareSource, ICCConstants, ICCCoverageDataBasic, ICCPercentItem, ICCStatementDataBasic, ICCTreeItem
All Known Subinterfaces:
ICCImportResult
All Known Implementing Classes:
CCEmptyResult

Represents one or more CC results. When > 1 are included the results are merged, therefore retrieved results represent merged values.
Since:
3.1
  • Field Details

    • EXCLUDE_ZEROLINES

      static final byte EXCLUDE_ZEROLINES
      Filter out modules and parts that have zero executable lines There are no extra arguments required.
      Since:
      9.0
      See Also:
  • Method Details

    • getInfo

      ICCResultInfo getInfo()
      Returns more detailed information about this result.
      Returns:
      information ICCResultInfo about the result or results included
    • getNumFiles

      int getNumFiles()
      Returns the number of files in the merged results.
      Returns:
      number of files or zero
    • getFiles

      ICCFile[] getFiles()
      Returns an array of files in the merged results. New in v9, the list will be sorted by file name. New in v10, the list is affected by addFilter(byte, String...) with EXCLUDE_ZEROLINES If EXCLUDE_ZEROLINES filter is active then the returned list will NOT contain files with zero executable lines
      Returns:
      array of ICCFile or empty array
    • getFile

      ICCFile getFile(String name)
      Given a file name return an already added file.
      Parameters:
      name - file name
      Returns:
      ICCFile or null
      Since:
      9.0
    • getFile

      ICCFile getFile(int id)
      Returns the ICCFile with the matching ID or null.
      Parameters:
      id - unique id of the file
      Returns:
      ICCFile or null
      Since:
      9.0
    • getTestcases

      ICCTestcase[] getTestcases()
      Returns an array of testcases referenced in the merged results. The testcases may or may not have caused lines to be hit.
      Specified by:
      getTestcases in interface ICCCoverageDataBasic
      Returns:
      array of ICCTestcase or empty array
    • getTestcases

      ICCTestcase[] getTestcases(String fileName)
      Given a file name return the testcases that hit at least one executable line.
      Parameters:
      fileName - retrieve testcases for this file name
      Returns:
      array of ICCTestcase or empty array
    • getTestcases

      ICCTestcase[] getTestcases(String[] fileNames)
      Given 1 or more file names return a set of testcases (no duplicates) that hit at least 1 executable line. This is a union of all testcases that affect at least 1 of the passed files.
      Parameters:
      fileNames - array of fileNames
      Returns:
      array of ICCTestcase or empty array
    • getTestcase

      ICCTestcase getTestcase(int id)
      Get testcase by ID. Testcases are assigned a unique ID, this method returns a testcase given an ID.
      Parameters:
      id - testcase id
      Returns:
      testcase or null if not found
    • getTestcase

      ICCTestcase getTestcase(String testName)
      Returns the testcase with the passed name. If there is > 1 testcase with the same name only the first instance will be returned.
      Parameters:
      testName - name of the testcase
      Returns:
      testcase or null if not found
      Since:
      9.0
    • removeTestcase

      ICCTestcase removeTestcase(int id)
      Remove a testcase from this result.
      Parameters:
      id - - testcase id
      Returns:
      removed testcase
    • getStatus

      byte getStatus()
      Returns a status value that represents an overall status. When merging results a single result can set this status to something other than OK. See ICCConstants.
      Returns:
      ICCConstants
    • setName

      void setName(String name)
      Assigns a name to this result.
      Specified by:
      setName in interface ICCBase
      Parameters:
      name - to assign
    • getLevel

      Return the coverage level. If this is a merged result then the coverage level of the first result is returned. to get the coverage level of an individual result use ICCTestcase.getLevel().
      Returns:
      ICCConstants.COVERAGE_LEVEL
    • getPercentCoverage

      int getPercentCoverage(ICCTestcase testcase)
      Retrieves the coverage of a testcase.
      Parameters:
      testcase - the testcase to compute coverage.
      Returns:
      the percent coverage for the testcase
      Since:
      3.1
    • isMerged

      boolean isMerged()
      If this result was created from 2 or more input results then it is considered "merged".
      Returns:
      true if this result is considered merged
    • isComplete

      boolean isComplete()
      Return a simple boolean indicating if the results are valid. During import if an error occurs that could affect the validity of the merged result then a CCResultException will be thrown and it will contain this result and any exceptions encountered during the import. Use the ICCResultInfo to obtain a list of successful and unsuccessful import inputs.
      Returns:
      true if all results were imported successfully, false if 1 or more results encountered errors that could affect the validity of the merged result
      Since:
      4.0
    • getModules

      ICCModule[] getModules()
      Returns an array of ICCModule. New in v9, only modules that have executable lines will be returned. If all modules/parts are needed then use the EXCLUDE_ZEROLINES filter.
      Returns:
      array of modules or an empty array
      Since:
      4.0
    • getModule

      ICCModule getModule(String name)
      Return a ICCModule that matches the name. New in v9 the returned value is affected by the EXCLUDE_ZEROLINES filter.
      Parameters:
      name - module name
      Returns:
      matching module or null
      Since:
      6.0
    • setUnZipOptions

      void setUnZipOptions(String unZipDir)
      When an unzip directory is set the API will use the directory to unzip and return a File when ICCFile.getFile() is called.
      Parameters:
      unZipDir - path to a working directory that will be used to unzip files
      Since:
      4.0
    • getUnZipDir

      String getUnZipDir()
      Returns the directory to use when unzipping ICCFile contents.
      Returns:
      directory used to unzip
      Since:
      4.0
    • getParts

      ICCPart[] getParts()
      Returns an array of ICCPart. This will traverse all modules and return a complete list of unique parts. New in v9 the list will be sorted by the part name. New in v9 the list is affected by the EXCLUDE_ZEROLINES filter.
      Returns:
      array of parts or an empty array
      Since:
      6.0
    • getPart

      ICCPart getPart(String name)
      Returns a ICCPart that matches the name. Returns the first part that matches the name. New in v9 the returned value is affected by the EXCLUDE_ZEROLINES filter.
      Parameters:
      name - of the part
      Returns:
      null or the matching part
      Since:
      6.0
    • addFilter

      void addFilter(byte filter, String... args)
      Adds a filter. The filter type will document if the order it is added can affect the results. To clear filters use clearFilters() Current list of filters: EXCLUDE_ZEROLINES This will include all modules and parts that have zero executable lines. There are no additional parameters. New in v10, this filter also works on files with zero executable lines Filters act on the content of the result. This means that clearing the filters will return the results returned back to the default. Filters do not remove what is stored internally.
      Parameters:
      filter - filter type
      args - arguments as determined by the filter type
      Since:
      9.0
    • clearFilters

      void clearFilters()
      Clears any filters that have been added to the result.
      Since:
      9.0
    • getItem

      ICCTreeItem getItem(String uuid)
      Get an item by unique ID
      Parameters:
      uuid - UUID unique to the artifact
      Returns:
      item or null
      Since:
      10.0