Have a configuration file Lock.txt which contains recNo,NoOfSeats as follows
10,10
10,20
10,10
10,1
10,1
Lets assume there are 41 seats are there for RecNo 10
Now write a
Thread based TestClient which will read the above conf and span that much threads by having the recNo, seatNo. Inside the run method call lock(recNo), modify(seatNo), unLock(recNo) dont forget to use yeild() inside ur run().
In ur DataImpl's modifyRec() have a sleep(2000) as the first statement(For testing purpose alone).
Once the above program is compleated start the client program.
Here my modifyRec will return true(boolean var)
once the seat is booked else false. So for the above test case only the last should return false. if it happen u can be sure about ur locking procedure.
Guys & Girls please give ur valid feedback about my test case.
regards,
-rameshkumar