• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Concurrency Testing - 2.0

 
John Samuels
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there!

I've been watching these forums for the past couple of weeks (ever since I started working on my OCMJD). It's certainly an excellent resource! One particular stand out is Roberto Perillo's DataClassTest, which inspired me to create the following piece of code. Many of the main ideas remain his; the changes mainly deal with rigorousness and generalness. The mechanism for the execution of the test threads has been changed such that the Data class is put under more concurrent pressure. This is especially helpful since, as well all know, concurrency bugs don't always manifest themselves and they must be put under as much rigor as possible. The mechanism with which each test is created has been made more generic, relying purely on what the DB interface requires. For instance, I didn't have "Room"s or RoomRetriever utilities (maybe I should?), so I had to make substantial changes to the code before I could use it.

I hope this helps! If it doesn't, please tell me how I can improve it. Thanks!

Note: My implementation of 'delete' automatically unlocks the record. To me, that makes the most sense - once you delete a record number, attempting to unlock that record number should result in a RecordNotFoundException being thrown. If that's not how you implemented it (Roberto's original DataClassTest, for instance, assumes so), make sure you add "db.unlock(recNo, cookie);" after "db.delete(recNo, cookie);".

 
Dmitry Kotlov
Greenhorn
Posts: 23
Java Linux Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Howard!
I've tested my Data class by means of your test.
I found it very helpful! Thanks a lot!

Best regards,
Dmitry
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic