Skip to content

tests v4 guidelines

Nedelcho Delchev edited this page Mar 8, 2021 · 1 revision

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.

  1. First there should be written the Javascript test like is shown here
  2. Second the test should be added to AbstractApiSuiteTest
  3. If needed some of the method should be mocked as shown here
  4. 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