This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I have developed a Chat Application using JAVA RMI. Now I want to develop Test Cases. My main aim is to develop a test script. The test script should run client applications in different JVM and store the appropriate results.
Can we run multiple java application running in different JVM using single shell script, if yes then can you send me link where I can learn to do this stuff as I am new to Shell script.
At it's simplest, a shell script is simply a list of shell commands (similar to Windows batch or command files). The most trivial implementation of your requirement would be something like:
Your requirements are pretty vague on exactly what constitutes a test and how to store the results. Maybe if you gave us some more information we could help.
If you want to dive in, this is a good introduction to the BASH shell and This is a more in-depth look at scriping.
Thanks for the reply, I guess I didn,t mentioned my question correctly. Actually I just wanted to test my Java RMI application. As in distributed programming we expected to run clients in different JVM . My misunderstanding was that if my shell script is having multiple lines of java x program , all these x program will run on same JVM, which was further corrected by one of the student - all run in different JVM. And thats what I needed. But some how I got hold of IBM tool for testing (14 days trial versionn )don't know exact name. This tool auto generates the testing script .
One of the easiest ways to test services written in Java is by using the JUnit test kit.
It's as easy to test RMI calls with JUnit as it is to test any other kind of API. In fact, it's a good idea to make the backend logic testable as local logic as well as to write a test suite that actually invoked the remote interface.
If you prefer to write your tests as shell scripts, just remember that each time you run the "java" command in a shell script, you're starting up a new VM. If that VM wants to talk to other VMs - as many of them as it wants - it may do so as long as it follows the protocols. Which in this case is RMI.
An IDE is no substitute for an Intelligent Developer.