• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Concurrency Testing - 2.0

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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);".

 
Greenhorn
Posts: 23
Oracle Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
You’ll find me in my office. I’ll probably be drinking. And reading this tiny ad.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic