Currently, there is a functionality inside dbsourcemanager which enables automatic checking of the Openbravo API at database level (both structure and data/AD parts).
This functionality is designed to work with the whole Openbravo distribution. However, we have found that it would be very useful also to be able to check the API of individual modules, or groups of modules. It would specifically be very useful to automatically check the API of Openbravo for Retail.
Therefore, this project aims to modify the existing "run.api.test.model" task in Openbravo so that it can optionally receive a "modules" parameter, and if it receives it, it checks the API of just the modules specified instead of the whole Openbravo distribution.
The way the run.api.test.model task is used now doesn't differ significantly from how it was before. Now, however, it's possible to use it in two ways:
- ant run.api.test.model -DstableDBdir="path" : This will do the API check against the whole distribution of modules, like it did before.
- ant run.api.test.model -DstableDBdir="path" -Dmodules='javapackage1,javapackage2' : This will check the API of the modules defined by javapackage1 and javapackage2 only, and it will ignore other potential API changes existing in other modules.
The test plan has been implemented to verify that the task continues to work as expected when used in the old mode to check the distribution, and to verify that the new mode to check individual modules, or groups of modules, also works correctly. Specifically, the following tests have been done:
- Created several API changes (both in structure and data/AD parts) in Core, to see if the task in old mode detects them
- Created several API changes (both in structure and data/AD parts) in Core distribution modules, to see if the task in old mode detects them
- Created several API changes in Retail modules (both in structure and data/AD parts) to see if the task in new mode detects them.
- Verified also that the Core and distribution API changes were not detected by the task in new mode, as expected.