Thanks for this additional information.
onCopyPreprocessorEvent
is called only on objects which are registered as preprocessor listeners. This is automatically handled when running an analysis with sonar-scanner
.
However, CobolCheckVerifier
does not behave the same way.
You can register your check as a preprocessor listener when creating the instance of CobolConfiguration
that you pass to CobolCheckVerifier
:
CobolConfiguration myConfig = new CobolConfiguration();
// ...
myConfig.setPreprocessorListeners(Collections.singletonList(myCustomCheck));
CobolCheckVerifier.verify(myFile, myConfig, myCustomCheck);