Testing Method

for the project on Design and Implementation of Basic RMI Mechanisms

by Kohei Honda

Department of Computer Science, Queen Mary and Westfield College, University of London
March 2000

Here is the default testing method. By default I mean that you use the most basic path: using the ROR (remote object reference) and the registry I provided. If you use a different design the corresponding assessment will be done.

Note that even if you are not following this line of design, that is all right, as far as it is reasonable and, for testing, your programs you can do essentially the same thing. In that case, provide your own registry etc. so that you can give the demostration to the same effect.

(A) Basics

Make one main program, which I call yourRMI. We use test programs which are already referred elsewhere, which we also list here for convenience.

(B) How things would be tested

Assuming you hardwired the port (3021) which RMI listens to:

  1. In some host (say at 138.37.94.253).

    java SimpleRegistryServer 3021

  2. In a remote host:

    java yourRMI ZipCodeServerImpl 138.37.94.253 3021 aServiceName

    So yourRMI should take as its argument a class name, turn it into a class, create its instance and bind it to a registry. How can this be done? A basic framework is illustrated in the following programs. They also offer hints if you are really stuck in design etc. They assume one stub for each remote object, one skeleton (or none if you like) for each remote class, and that the port which RMI listens to is hard wired. Here are the programs yourRMI.java and RORtbl.java

  3. In a local host:

    java ZipCodeClient 138.37.94.253 3021 aServiceName

    where ZipCodeClient, given below, simply tests all methods which are in the server: store data,
    retrieve data, or print them. ZipCodeClient.java

    For the ZipCodeRList, we have the following client program: ZipCodeRListClient.java

    This program simply retrieves data from the remote site and prints them. Both test programs use a data file: a sample data file is given below. It is simply a list of a city name and a zip code.
    Here is some sample data .