1. Getting Started

Install Maven

Download Maven and follow the Installation instructions. Make sure that the MAVEN_HOME environment variable is set and add $MAVEN_HOME/bin to your PATH.

Maven uses the concept of a remote repository to host the jar files a project depnds upon. SwitchRMI uses the standard Maven remote repository at a http://www.ibiblio.org/maven/ and a custom repository for jar files not available from the standard repository.

Download

The files can be dopwnloade from the download page at the Sourceforge project site Ignore versions prior to version 0.0.6, these instructions apply only to versions after 0.0.5 when Maven was introduced as the project build management tool. The distribution on the download page contain everything you need to build SwitchRMI, run the JUnit test suites and create your own published object services.

Once you have completed the download use the following command to unpack the file:


	$>gnutar -zxvf switchrmi-X.X.X.tgz

If you are using a Windows OS you can use WinZip to unpack the file.

Build

The archive unpacks into a directory named switchrmi-X.X.X where X.X.X is the number of the SwitchRMI release. This directory will be referred to from this point as the SWITCHRMI_ROOT directory. SwitchRMI uses maven as the build tool.To build the required code to start testing, make sure your JAVA_HOME environment variable is set and enter the following commands:

			
			$>cd $SWITCHRMI_ROOT
			$>maven war
			
			

The first time you run maven the jar files declared as dependencies in the SwitchRMI project.xml file are downloaded from the remote repositories and stored in the local repository under the MAVEN_HOME directory.

Windows users take note: The project.xml file used by maven works differently on Windows with the version if Maven used in testing (1.0 beta 7). In order to run all of the tests, edit the project.xml file and comment out the line with the reference to jasper-runtime-4.04.jar and run the maven command a second time. This will force maven to download the jasper-compiler-4.0.4.jar which is required for the testing servlet to run.

To see the options available as for building with maven enter:

			
			$>maven -g
			
			
The war goal will build the switchrmi jar file and run the standalone junit tests. The build will failif these tests are not passed. More information on maven and the concept of goals is available from the maven site.

Run the Test Suite

In order to run the test-suite you must launch the web-application you just built as part of the install:

			
			$>cd $SWITCHRMI_ROOT/bin
			$>./waserver.sh
			
			

A waserver.bat file is also available for Windows platforms.

Once the servlet engine has launched successfully you can browse the objects which have been published. Using a web-browser go to http://localhost:8080/rmi/index.html .

Maven is used to run the tests:

			
				$>cd $SWITCHRMI_ROOT
				$>maven custom-iutest
			
			

Browsing the Deployed Objects

The Web Application has a HTML interface which allows you to browse the deployed objects. Once you have the web application running simply enter the URL: http://localhost:8080/rmi/index.html into the address field of your browser.

Validating the SwitchRMI XMLRPC Implementation

SwitchRMI includes an implementation of the XMLRPC validation suite. If the host you are running the test-suite web application on is exposed on the internet you can point your browser at http://validator.xmlrpc.com and enter the following values:

			
			Server:The fully qualified name of your host or the IP address.
			Port:8080
			Path:/rmi/validator.xmlrpc.
			
			

and submit the form. The test may take a while but the page will refresh with a report of each test and a pass or fail grade for each test. The source code for the validator is under $SWITCHRMI_ROOT/src/com/mjh/switchrmi/protocol/xmlrpc/validator .

The distribution also contains a Javascript implementation of the validation tests. You can try it out by entering a value of /rmi/jsvalidator.xmlrpc instead of the /rar.xmlrpc value used to test the Java implementation as described in the preceding pgraph. For more information regarding Javascript and other scripting languages, move on to chapter 4.