tests v4 guidelines - eclipse-dirigible/dirigible GitHub Wiki
Tests v4.x Guidelines
Testing the different types of modules as follows:
Java
Standard Java modules should be tested by utilizing JUnit 4.0.
Sample can be found here
Guice
Guice framework is used for dependency injection. The unit test which require such functionality should extend the AbstractGuiceTest.
Sample can be found here
Facades
Facades are Java based modules, so that along with the above guidance here could be added a dependency to the external service, if any.
Samples:
- Without dependency can be found here
- With mocked service can be found here
- With built-in service can be found here
Javascript API
Testing Javascript APIs is the most complex one.
- First there should be written the Javascript test like is shown here
- Second the test should be added to AbstractApiSuiteTest
- If needed some of the method should be mocked as shown here
- Run test suite from one of the test classes extending the AbstractApiSuiteTest like GraalVMApiSuiteTest
The whole process can be done separately like it is done here