Win a copy of Java 9 Revealed this week in the Features new in Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Testing Lock/Unlock  RSS feed

Sajid Raza
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This might help peoplee trying to verify their lock/unlock implementations: Test the functionality by setting break-points in the code at appropriate location. What I did was to set a break point after a call to lock, starting the clien in the debugger, and then starting other clients that try to lock the same record to see if the call blocked properly.
I think simulating many threads/clients is still tricky as compared to testing one or two clients with the right break-points set to see how they operate step by step. There's not much too it, but it makes life easy when you want to see how your locking code operates.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!