What you will want to do is create a new class that just has a main method Have it make a connection to the RMI Server, get your connection Object, and then call some lock calls. Yuo can use loops to make the client wait, or use a wait() with time to wait. Have a second class like the first above, then have it lock some records. Have it lock the same as the one above and some new ones. Have many System.out.println() calls to display when a lock is made and when unlock is called. When you run them, you will have two dos windows open. And try to execute them at about the same time. It will take a second to switch to the other window to start up the next class. I wish I still had my test client code, but unfortunately I don't. you could also try a search on this forum and I think there have been some test client code around somewhere. Good Luck Mark
Hi, I thought this might come in handy for any one trying to simulate multiple remote clients, it worked for me.
Disclaimer: Please only use this code as an example of how you might want to simulate multiple clients. This works in my current circumstances and might not necessarily be ideal for you. I can not be held liable, so use this at your own risk.
I hope this can help you. Regards, Chiji
SCJP, SCJD, SCWCD<br />"Meekness is not weakness, but power under control"
Have many System.out.println() calls to display when a lock is made and when unlock is called.
In addition to this, I think it is equally important to test multiple booking. Even though the following sequence works: lock(5, client1)->lock(5,client2)waits->unlock(5, client1)->lock(5,client2)succeeds->unlock(5,client2) Doesn't mean that this sequence will work as well: client1.book(for record 5) -> client2.book(for record 5) waits -> client1.book(for record 5) ends -> client2.book(for record 5) starts and ends. Eugene.
subject: How to simulate multiple clients for testing