Stand Alone Testing

You can run your application within a stand-alone environment. This is useful when testing your application's logic (which is independent of the hosting service provider's network of TaskServers & Hosts).

The HspAgent constructor takes 1 argument: a String denoting the domain name of the machine that is running the hosting service provider which you would like to use. The special String "test" causes the HspAgent to construct a minimal hosting service provider, depicted in the diagram below.

When your application invokes the getClient2Hsp() method, it is returned a reference to this internal hosting service provider. Thus, when testing, you need to run only 1 JVM.

The application below shows this tiny change in code (the HspAgent constructor argument).

There are 2 aspects of test mode that you should know:
  • System.out of the Hsp, TaskServer, Host, and your application is combined: They are all running in the same JVM. I have displayed only the application's output ( in red).
  • Although the Application main thread terminates, the JVM does not: You do this manually (e.g., ctrl-c).


Hello, world!