Table of Contents

Search

  1. Preface
  2. Welcome to Informatica Process Developer
  3. Using Guide Developer for the First Time
  4. Getting Started with Informatica Process Developer
  5. About Interfaces Service References and Local WSDL
  6. Planning Your BPEL Process
  7. Participants
  8. Implementing a BPMN Task or Event in BPEL
  9. Implementing a BPMN Gateway or Control Flow
  10. Using Variables
  11. Attachments
  12. Using Links
  13. Data Manipulation
  14. Compensation
  15. Correlation
  16. What is Correlation
  17. What is a Correlation Set
  18. Creating Message Properties and Property Aliases
  19. Adding a Correlation Set
  20. Deleting a Correlation Set
  21. Adding Correlations to an Activity
  22. Rules for Declaring and Using Correlation Sets
  23. Correlation Sets and Engine-Managed Correlation
  24. Event Handling
  25. Fault Handling
  26. Simulating and Debugging
  27. Deploying Your Processes
  28. BPEL Unit Testing
  29. Creating POJO and XQuery Custom Functions
  30. Custom Service Interactions
  31. Process Exception Management
  32. Creating Reports for Process Server and Central
  33. Business Event Processing
  34. Process Central Forms and Configuration
  35. Building a Process with a System Service
  36. Human Tasks
  37. BPEL Faults and Reports

2. Designer

2. Designer

Generating a Code Coverage Report

Generating a Code Coverage Report

Using a B-unit ant script, you can generate a code coverage report. The report tracks execution paths and display which activities were executed, expressed as percentage of activities executed at least once, in relation to all process's activities.
To generate a code coverage report:
  1. Create a B-unit ant script as described in Creating and Running a B-unit Ant Script.
  2. In the
    <target>
    named
    instrument
    , remove the comments and fill in a resource collection of bpel files. The following example show a simple resource collection:
    <target depends="init" name="instrument"> <!-- optional <coverage activitycoverage="true" linkcoverage="true" /> --> <bunit-instrument> <filelist> <file name="../bpel/myFile.bpel"/> </filelist> </bunit-instrument>
    By default, a code coverage report is generated for activities. If you want to include links, add the optional
    <coverage>
    element.
  3. In the target named
    test
    , uncomment the
    <engine properties>
    section.
  4. In the target named
    coverage report
    , do the following:
    • Provide a destination directory for your report.
    • Provide a report type. The types are HTML (default), XML (raw XML used to create HTML) or CONSOLE (writes summary results to the Ant Logger that you specify on the command line)
    • If you create a HTML report, you can add an xsltPath attribute.
    • Rename the filePrefix, if desired. The Ant project name is the default filePrefix. When you generate a report, the date and time are appended to the prefix.
  5. Run the B-unit ant script on the command line to generate the report. For example, in a command window, type
    ant -f filename.ant.xml
    .
What the Code Coverage Report Shows
  • Activity Coverage (default coverage): the total number of activities executed at least once over the total number of activities in the process.
  • Link Coverage (optional): the total number of activities that evaluated to true plus those that evaluated to false over the 2x total number of links with conditions.
    (totalTrue + totalFalse) / (totalLinksWithConditions *2).
    This ensures that the unit tests cover the execution of links completely because each link with a condition can evaluate to true or false.
Adding Code Coverage to an Existing B-Unit Ant Script
If you have an existing B-unit ant script, you can add code coverage to it just by putting in the correct ant tasks in the B-unit ant script.
  • Register the following typedefs in your Ant script and note that the attribute
    loaderref
    is set to
    bunit
    . This attribute must be set in order for all the Ant tasks to use the same classloader. The value of the attribute is unimportant as long as the value for all three typedefs match:
    <typedef classname="com.activee.ant.bunit.tasks.AeBUnitTask" loaderref="bunit" classpathref="bunit.classpath" name="bunit"/> <typedef classname="com.activee.ant.bunit.coverage.AeBUnitInstrumentTask" loaderref="bunit" classpathref="bunit.classpath" name="bunit-instrument"/> <typedef classname="com.activee.ant.bunit.coverage.AeBUnitCoverageReportTask" loaderref="bunit" classpathref="bunit.classpath" name="bunit-report"/>
  • Instrument your processes that are part of code coverage:
    <bunit-instrument> <coverage activitycoverage="true" linkcoverage="true" /> <filelist> <file name="../bpel/myBEPL.bpel"/> </filelist> </bunit-instrument>
  • Add the following engine property to the B-unit task that will execute the B-unit tests as follows:
    <bunit processLogging="urn:ae:full" trace="on"> <engineProperties> <engineProperty name="CustomManagers/AeBUnitCoverageManager/Class" value="com.activee.rt.bunit.coverage.AeBUnitCoverageManager"/> </engineProperties> <filelist> <file name="CancelTO.bunit"/> <file name="CreateTO.bunit"/> <file name="SubmitPO_UNI.bunit"/> <file name="SubmitUNIPO_AIFallOut.bunit"/> </filelist> </bunit>
  • Finally, you will need to output the report using the bunit-report Ant task:
    <bunit-report reportType="HTML" destdir="/Users/User1/Downloads/bunit/html" />
    For details on the parameters you can use for the B-unit report task (filePrefix, xsltPath, destDir, and reportType, see
    Step Four
    in the above procedure.


Updated March 30, 2020