-
Notifications
You must be signed in to change notification settings - Fork 80
Steps To Add MockFault
This page provides steps to add mock Fault for BW activities in BusinessWorks 2.5.2 with the Maven Plugin- 2.6.0. User 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.
• Apche Maven: https://maven.apache.org/download.cgi
• BusinessWorks Maven Plugin with version 2.6.0 should be installed. Please download the BW6-Maven-Plugin 2.6.0 from here: 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 XML file. Please refer section "Steps to Generate the Mock Fault File" https://github.com/SujataDarekar/bw6-plugin-maven/wiki/Steps-To-Add-MockFault#steps-to-generate-the-mock-fault-file
This section assumes that you have already created the demo project with subprocess which has the activities whose faults to be mocked.
- Right-click on module project and select New->Tests Folder. This will add the "Tests" folder in the module project.
- Right-click on the Tests folder in Project Explorer and choose New -> Add Test File. Change the Test File name if needed and hit Next which will show the wizard with a list of Sub-Processes. Select the subprocess having the activities whose faults to be mocked.
- Right-click on the activity to mock fault and select an option "Add Mock Fault To Activity".
- New "Tests" tab will get added in the property section of activity after selecting the above option. This tab has "File Selector" to select the mock fault File. Select the mock fault data file using File Selector. user can provide the relative mock fault file in "Mock Fault File" field
Please refer below link : https://github.com/TIBCOSoftware/bw6-plugin-maven/wiki/Steps-To-Add-MockOutput#running-the-unit-tests-in-business-studio
- Run the application in debug mode from the Business studio.
- Select the "Fault" tab from the Job Data for an faulted activity for which we need to generate the mock fault file.
- Right click on the activity exception tag in Fault tab and copy the data by selecting the option "Copy Variables" as shown in below image:
- Paste the copied data into the XML file
-
Please check attached file for more details.
- Only sub-processes can be used for unit testing – top-level processes aren’t supported
- Process Starter and SignIn activities don't provide the Mocking Support.
- BusinessWorks needs to be installed on the same server where the tests are to be run
- Unit Tests can currently only be invoked via Maven
Getting started
- Steps to Mavenize BW Application
- Building applications for BWCE
- EAR deployment with Config File
- Shared Modules with Maven
- Add Process Diagram in EAR
- BW Design Utility Goals
- CI/CD using Jenkins
- Custom XPath Function
- Deploy Shared Module on Remote Repository
- TCI Deployment using Maven Plugin
Unit Testing
- Primitive Assertion
- Activity Assertion
- Activity Assertion with Gold Input File
- Mock Output
- Mock Fault
- Test Suite
- Plugin Properties
Help & Contribute