Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/openj9
Path: blob/master/test/functional/Java9andUp/modules/README.md
6004 views

Introduction

This directory holds the various modules used for testing method visibility between modules. The module-info files are in a separate non-source directory because Eclipse allows only one module per project. The org.openj9test.modularity modules are as follows:

  • common: contains the tester interface defining the test methods

  • testerModule: contains the actual test implementation. An instance of the test class is created via reflection and cast to the tester interface.

  • moduleA, moduleB, moduleC, moduleD: These selectively export packages with various conditions: opens, transitive requirements, etc.

The packages need to be in separate module, hence separate directories, to test the visibility restrictions. The build script compile target compiles the classes with all the other test suites. The build_moduletest copies the various compiled classes to the module directories. It also creates special test class files using the Java assembler.

The modularity test does not use GeneralTest.jar since it makes all the classes visible. Instead, the tests are run out of the module directories generated by the build script.

A separated testng.xml file is required because the main testng.xml file refers to classes related to other tests. These are not visible because of the special class/module path and will cause the test to fail.