[SUREFIRE-2011] Updated abstractions which helps associating standard out/err with a test by Tibor17 · Pull Request #469 · apache/maven-surefire (original) (raw)

The data flow fork -> plugin is all about reporting events.
The data flow plugin -> fork is about commands.
So this is Command Event based architecture. Similar wordings are in the enterprise world CQRS and Event Sourcing.

The first data flow usually sends objects in the form of:

Therefore there is such a wording report because the provider (InPlugin or fork) sends a report back to the plugin, and the provider is under the plugin in the hierarchy because the plugin is a manager of providers.

Now it is visible in the inheritance
ForkingRunListener -> RunListener, TestOutputReceiver, ConsoleLogger.
These are 3 types and three interfaces.

I know that you have a problem with the name of class ForkingRunListener but it is not mandatory for the developers because the developers and their code operates with abstractions and their code instantiates the object somewhere but the interfaces are used everywhere. The interfaces have different purpose because we do not want ParallelComputer to send TEST_SUCCESS of course not, and the PC sends console internal error if any. This is called information hiding. So there are reports, all these three interfaces are about reports but different group of reports.

Regarding ForkingRunListener, whatsoever, do you like ForkingReportListener more?

From the history, you should know how the code was before. These methods of reports were everywhere. They did not exist one place like it is now in one hotspot. Their implementation was really everywhere, the encoder did not exist in one place and so the encoder's logic was everywhere and it was very hard to maintain the code. Naturally, this situation happened because we are OSS, and in the OSS you start from simple use cases and you do not have time to think of encapsulation, information hiding, and such things like a cost of maintenance, and such style results in paches and not in real fixes.