Adding Mock Fault to an activity

This document provides steps to add Mock Fault for activties in TIBCO BusinessWorks™ Container Edition with the Maven Plug-in. Users can also mock faults thrown by activities so that they can test their exception handling logic and test all the transitions. Currently, Mocking Feature doesn't support the main process. They only mock faults of the activities from sub-processes.

Prerequisites

  • Apache Maven:

    https://maven.apache.org/download.cgi
  • TIBCO ActiveMatrix BusinessWorks™ Plug-in for Maven Plugin 2.6.0 should be installed. Please download the plug-in from:

    https://github.com/TIBCOSoftware/bw6-plugin-maven/releases
  • Activities to be mocked should be present in sub-process where sub-process should be under Unit testing.
  • Generate valid Mock Fault file. For more information on generating the mock output file, see Generating Mock Fault File.

Make sure the demo project with the subprocess that has faults to be mocked, is created.

To add mock fault to an activity in TIBCO BusinessWorks™ Container Edition, follow these steps:

Procedure

  1. Right-click on module project and select New > Tests Folder.
    This will add the Tests folder in the module project.
  2. In Project Explorer, right-click on the Tests folder and choose New > Add Test File. If needed, change the name of the Test File and Click Next. This displays the wizard with a list of subprocesses. Select the subprocess having the activities fault to be mocked.

  3. Right-click on the activity to mock fault and select the Add Mock Fault To Activity option.
  4. The new Tests tab is added in the property section of the activity. The new Tests tab has file selector to select the mock fault file. Select the mock fault data file using file selector. It is also possible to provide the relative mock fault file in the Mock Fault File field.

    To run Unit Tests in TIBCO Business Studio for BusinessWorks, see Running Unit Tests in Studio.