Java Reference
In-Depth Information
have declared that each client should try to rent this movie twice, and because of our explicit
timings, we know that the client who missed out first time should get the movie the second
time, and one of the other clients should miss out.
Figure 9-13. The database contents prior to, and after, running our test
Figure 9-14 shows a sample run of the test harness. As expected, one of the clients (client
2 in this particular run) missed out on their first attempt to rent the movie, and a different
client (client 3) missed out on their second attempt to rent the movie.
Figure 9-14. Test harness output
Caution Although we have made a reasonable attempt to make a multithreaded networked test harness
that will produce repeatable results, you should be aware that the JVM thread scheduler and network
latency may result in slightly different results.
Search WWH ::




Custom Search