Hi all, I am not sure how you guys are testing your locking strategy. I have used the followed testing program. May be you should use it. Because I had to go back and change my code a lot during testing. Create1
I think this code posting is ok, because this is outside of the assignment. But I found this very useful and you may too. If you have followed different testting strategy, post your code here. [ October 05, 2003: Message edited by: Suds Pati ]
Hi Suds, I am planning to test me code using JUnit. I am only at the start of the project so I don't currently have any thing useful to show you. You may want to look it up at :JUnit Hope you find it useful Chris
SCJP 1.2, SCWCD, SCBCD
author and jackaroo
Hi Suds, Do you go back and manually verify that the database is OK after these tests? I am guessing that you should see a few stack traces when you run this. Is that correct? Chris did make a good suggestion with JUnit - it is very good, and a lot of businesses use it. Working on this assignment is a good time to learn how to use it yourself. Regards, Andrew
I am familiar with JUnit. Also I am using JBuilder which allows me to create TestCases, Test Suites on fly. JUnut will help you on functional testing. Every method can be tested with JUnit to see if the methods are returning the right value. But how would you test for deadlock, thread contention and livelock ? Can JUnit help me creating concurrent threads ? Well, I have OptimizeIt Thread Debugger which will help me finding thread contention, dealdlock and livelock. But I have left the heavy use of tools for testing towards the end of the project. How do I know my database status after the testing. I periodically display the entire database content in JBuilder. Also I monitor the exceptions and outputs (System.out.println()). Sometimes I use the JBuilder debugger. Regards, Suds
Joined: Mar 13, 2002
But how would you test for deadlock, thread contention and livelock ? Can JUnit help me creating concurrent threads ?
How do I know my database status after the testing.
Just re-read the databasefile and match it against the original. Or you could have the original stored as a static variable somewhere (or a more complex object if you for example read the databasefile into objects). I have a BaseTest-class which I extend in my testclasses instead of TestCase, in which setUp-method I simply copy the original databasefile to a test-directory. This way each test works against a newly copied original databasefile, and after tests I could match the files if I need. cheers, Sakke