Chapter 7. Displaying the Results
We left the last chapter having invoked the tests. In this chapter, we will
Design the protocol for collecting test results
Outline what it takes to actually run the tests
Display the test results
How are we going to display the results? The JUnit plug-in class should know nothing about how results are displayed. So, what if the plug-in class broadcasts the results of tests that are running?
The Observer pattern is useful when you have loosely coupled communication patterns:
You don't care in what order the receivers receive the messages.
You don't have to return any results to the sender.
You don't know a priori how many objects will want to receive the message (see Figure 7.1).
Figure 7.1. One Subject Notifies Several ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access