How it works...
In this recipe, you implemented a test for the LinkedTransferQueue class using the MultithreadedTC library. You can implement a test in any concurrent application or class using this library and its metronome. In the example, you implemented the classical producer/consumer problem with two consumers and a producer. You wanted to test that the first String object introduced in the buffer is consumed by the first consumer that arrives at the buffer, and the second String object introduced in the buffer is consumed by the second consumer that arrives at the buffer.
The MultithreadedTC library is based on the JUnit library, which is the most often used library to implement unit tests in Java. To implement a basic test using the ...
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