There are several levels of testing in this project.
- Regular unit tests.
- Integration tests based on
io.spine.tools.gradle.testing.GradleProjectAPI residing under the corresponding module. - Functional tests based on
PipelineSetupAPI placed in separate test-only modules. Please read the section below for details about these tests. - Integration tests under the
testssubproject. These tests are documented in the project.
A modules with the -tests suffix in their names is a test-only module for the module which
has the name before the suffix. For example, mc-java-signal-tests is the test module for
mc-java-signal
We need to have separate test-only modules because of the following reasons.
-
We want to run code generation tests using the vanilla Protobuf code placed into resources by ProtoTap using
PipelineSetupAPI. -
We need this code to be "vanilla" Protobuf — not the one produced by the previous version of McJava — because ProtoData plugins run on top of such code.
-
We use
testFixturessource set for storing input proto files for the code generation tests. -
It is not possible to apply a Gradle plugin to a source set. Plugins are applied to a project.
-
The module
mc-java-signalneeds McJava plugin for generating events and entity states for the Signal ProtoData plugin. Once McJava plugin is applied to a project, it serves all the source sets, includingtestFixtures, making the generated code enhanced with Spine features, which we need to avoid.
Therefore, to have "vanilla" Protobuf code generated for our stub types, we need to have a separate Gradle project