This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes Linux / UNIX and the fly likes Java RMI Test Cases Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "Java RMI Test Cases " Watch "Java RMI Test Cases " New topic

Java RMI Test Cases

KA Gupta

Joined: Feb 17, 2009
Posts: 2

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.

Nitesh Kant

Joined: Feb 25, 2007
Posts: 1638

I think this fits more in Linux/Unix forum. Moving ...

apigee, a better way to API!
Joe Ess

Joined: Oct 29, 2001
Posts: 9191

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.

[How To Ask Questions On JavaRanch]
KA Gupta

Joined: Feb 17, 2009
Posts: 2
Hi Joe and Nitesh,

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 .

Thanks once again for your replies.

Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17423

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.
I agree. Here's the link:
subject: Java RMI Test Cases
It's not a secret anymore!