v10.1 CC API Changes
Removed API
- The SonarQube exporter was removed from the ccapi.jar and is now in its own ccsonarqube.jar. Package and class names are the same. To use the Sonarqube exporter you must now add it to the classpath when calling the ccapi.jar directly.
Changed API
- ICCResultInfo.getCreatedTime() now returns a more consistent time. If the input result doesn't contain a created tag then the modified date of a key file in the result will be used. Most platforms preserve the modified date of a file even if it is copied from one location to another.
- ICCFile.setName() correctly updates internal mapping information to use the new name. Subsequent calls to get the item will work correctly.
- Properties and messages added to ICCFlowpoints are now correctly exported and imported by the "CCRESULT" exporter/importer. Temporary properties (Name of property starts with "T_") are not exported.
- Access to constructors of some internal types has been reduced. This was done to discourage extending these internal classes. e.g. CCAbstractTreeItem, CCModule, CCPart are among the ones changed. Extending or directly accessing classes in packages with "internal" in their name is discouraged as these classes can change at any time and are not considered part of the external API.
- All API jars are now signed.
Added API
- ICCImportFile.removeLine(int lineNumber) allows importers to remove lines that were already added. This may be used by post processing that runs after the importer to remove lines that are not needed. Calling to remove a line that doesn't exist has no effect and will not cause an error.
v10 CC API Changes
Changed API
- CCAbstractItem.TEMPPROP is now public and can be used as a prefix to the name of a property added to an artifact. Properties with this prefix are considered valid for the session only and are not saved.
- Sample source has been moved to the simpler package name "samples"
- ICCResult.getFiles() and ICCPart.getFiles() support the EXCLUDE_ZEROLINES filter. When the filter is enabled files with zero executable lines will not be returned in the list. Removing the filter will show the complete list.
Added API
- Artifacts support returning a UUID that is globally unique
and consistent.
This means that for the same ICCResult (importing the same data) a given artifact will always return the same UUID. This can be used to retrieve the same artifact from a result loaded in different sessions. It is no longer required that an ICCResult be held in memory to get the same artifacts.
E.g. create an ICCResult and get an ICCFile and get its UUID. The ICCResult can be deleted from memory. Create another ICCResult from the same input data and the same ICCFile can be retrieved using ICCResult.getItem(String UUID).
For backward compatibility the UUID returned for older data may not look like a proper UUID but will behave correctly. All new data exported to a cczip (CCRESULT format) with the v10 ccapi will contain a proper UUID.
- ICCTreeItem.getUUID() will return a UUID for artifacts that implement ICCTreeItem. Most of the key artifacts implement this interface.
- ICCTreeItem.setUUID(String) can be used by importers and exporters to override the UUID if needed.
- ICCTreeItem.supportsUUID() returns true if a UUID is available.
- ICCTreeItem.getUniqueID() returns an internal unique ID when UUID is not available, only needed for backwards compatibility.
- To retrieve an item by UUID use ICCResult.getItem(String).
- ICCImportResult.addItem(String) is used by importers to register artifacts by UUID in the ICCResult to be retrieved later.
- Flowpoints can be obtained by qualified name using ICCFile.getFlowPointByQualifiedName(String).
- Source annotated with hit information can be obtained using:
- ICCFile.getStream(boolean) or artifacts that implement ICCSource.getStream(boolean).
- The prefix of each line that has hit information will have "H" for hit or "X" for executable but not hit.
- Annotation characters can be modified in the ICCResult by calling ICCCompareSource.setAnnotatedMarker(MARKERTYPE, String). See ICCCompareSource interface for more information on the types available.
- In this release calling getStream(boolean) on a flowpoint will return ICCFile.getStream(boolean), in a future release it will return the source of the flowpoint annotated not the whole file.
- Java block statistics are now available from the ccapi
- ICCFlowPoint.getNumExecutableBlocks()
- ICCFlowPoint.getNumHitBlocks()
- ICCImportFlowPoint.addBlockFirstLine(int) can be used by importers to add block information. The built-in Java importer uses this method
- (experimental) ICCResult now implements ICCCompareSource that
allows for comparing hit information in the same file from another
ICCResult.
- This works by passing an ICCSource artifact from one ICCResult to another ICCResult using the ICCCompareSource.getAnnotatedSource() method. If the files are the same (same content) they will be analyzed and the returned stream will have the source's prefix annotated with hit information from both results.
- See ICCCompareSource interface for more information.
- Please note that this a new feature that is still under development and may not fully work as expected.
v9 CC API Changes
Removed API
- In ICCImportFile the following method was removed (not
deprecated)
ICCImportFlowPoint createFlowPoint(String name) throws CCDuplicateFlowPointException;
Rather than deprecate the method it was removed. In order to properly support nested flowpoints it would have been ambiguous to allow the above call without requiring a first line number.
The replacement methods are now part of ICCImportFlowPointParent that defines the create methods for artifacts that support flowpoints as children. E.g. ICCFile and ICCFlowPoint
The closet replacement takes a first line number:
- ICCImportFlowPoint createFlowPoint(String name, int firstLine) throws CCDuplicateFlowPointException, CCImportFlowPointException;
Added or enhanced API
- Export supports multiple results by merging results before exporting.
- Statement support
- Multiple statements on a line
- Statements can be created with as little as a line number
or as details as
- Index
- Column start
- Column end
- When setting a statement as hit; the line, index and the test id are supplied
- ICCStatement supports setting the "hit count" value
- ICCStatement supports adding the content of the statement
- Branch support (this is defined but is not fully supported
yet and therefore subject to change)
- Decision branch only (will support conditional branch in the future)
- New ICCBranchData interface that is implemented by artifacts that can return branch data (ICCFlowPoint/ICCBranchPoint)
- ICCBranchPoint represents a branch point
- Has 1 origin and 2 or more targets
- getOrigin() and getOriginStatement()
- getTargets() and getTargetStatements()
- Testcases can be associated with a branch point's target line or statement
- Part and Module support
- ICCImportFile.addPart(ICCImportPart)
- ICCImportModule.addPart(ICCImportPart)
- Same part can exist in different modules
- Can create files from a part ICCImportPart.createFile()
- Add an existing file to a part ICCImportPart.addFile()
- Full support for flowpoint hiearchy
- ICCImportFlowPointParent
- ICCFile and ICCFlowPoint can be flowpoint parents
- When creating a flowpoint you can pass in an ICCFlowPointParent, meaning that both files and flowpoints can have flowpoints as children
- Can still get a flat list of flowpoints for backward
compatibility
- Hierarchy is flattened when calling
ICCFile.getFlowPoints()
- Hierarchy is flattened when calling
ICCFile.getFlowPoints()
- ICCImportFlowPointParent
- CCAbstractItem.setName() allows any item to have it's name
changed, not just at creation time. Normally used by importers
- Result modifiers (CCAbstractResultModifier) have been
simplified and extended to support more types. These can be
used to filter or modify returned items from a result. They do
not change the content of the result but rather modify what is
returned in real time. i.e. modifiers are not destructive
- Result
- Testcase
- File
- Module
- Part
- Any item that implements ICCTreeItem (exhibits parent/child behaviour) can not return the owning ICCResult
- Support for returning labels in any language
- This is similar to how messages are processed but without a message ID
- Supports multi-threaded requests for different languages similar to messages
- 5 additional languages have been added
- Polish/Brazilian/Russian/Simplified Chinese/Traditional
Chinese
- As before, if a message/label is not found in the requested language the English text will be returned
- Polish/Brazilian/Russian/Simplified Chinese/Traditional
Chinese
- CCResultsFactory now supports passing a single path without requiring an array
- ICCBase.addMessage(String messageKey, String... parms)
- Supports zero or more params to be passed using a single method
- ICCBase.updateProperty(String key, Object value)
- Properties on any artifact can be modified
- NOTE: any property added to an artifact (of a type that can be converted to a String) will be saved on export to a CCRESULT (cczip) and restored on import
- Properties with "T_" are considered as a temporary or Session property and are not saved or exported. Very useful for attaching reference to an object for use during a session
- New interface that has a subset of coverage data
- ICCCoverageDataBasic
- Most artifacts in an ICCResult will implement it
- Artifacts that have more detailed coverage data implement ICCCoverageData
- E.g. flowpoints and files implement coverage data while parts/results/modules implement the subset coverage data basic
- Flowpoints have types
- E.g. COBOL paragraph/section/program id etc.
- Java class/method/constructor
- ICCFlowPoint.getName(byte options) allows for getting a name qualified, uppercased or both
- ICCFlowPoint.getLanguage/getType are added
- ICCResult can be set to exclude all modules/parts that have
zero executable lines
- ICCResult.addFilter(byte filter, String... args)
- ICCResult.clearFilter()
- This will be enhanced in the future
- Modifiers are more power but slightly more complicated to implement
- ICCResult.getFile(String name) can return a file by name but will only return the first match
- ICCResult.getTestcase(String name) will return first match or null
- CCAbstractExporter.getAPIVersion() and getBuildID() can be
used to identify the exact version of the ccapi
- Some of the supplied exporters will write this to the output file to help with problem determination
| Package | Description |
|---|---|
| com.ibm.debug.pdt.codecoverage.core.results |
Interfaces and classes used to interact with code coverage results.
|
| com.ibm.debug.pdt.codecoverage.core.results.exporters |
Importers of code coverage data implement these interfaces.
|
| com.ibm.debug.pdt.codecoverage.core.results.filters |
Interfaces and classes that support Filters.
|
| com.ibm.debug.pdt.codecoverage.core.results.importers |
Exporters of code coverage data implement these interfaces.
|
| samples |