6.7.3: Application testing tutorial

During this tutorial, you will test the application that you deployed during the Application deployment tutorial. This involves trying the Web and Java clients of the application to ensure the application can be accessed by users.

Prerequisites

You need to have performed the Application deployment tutorial successfully so that you have a deployed application to test.

Overview of steps (requires 10 minutes)

  1. Ensure that the application, application server, and Web server are running
  2. Test the Web client
  3. Test the Java application client
Paths through the tutorial

Ensure that the application, application server, and Web server are running

For successful use of the client:

To verify whether the application and application server are running:

  1. Start the administrative server, or verify that it is running already.
  2. Start the Default Server, or verify that it is running already. To verify its status:

    1. Open the administrative console.
    2. Expand the tree view to see WebSphere Administrative Domain -> Nodes -> your_host_name -> Application Servers -> Default Server.
    3. Verify that the icon next to the Default Server's name in the tree shows that it is running. The icon should feature a green circle with an arrow in it.

      Default Server is running

  3. Verify that the SimpleSessionApp is running by right-clicking it in the console tree view under WebSphere Administrative Domain -> Enterprise Applications -> SimpleSessionApp and selecting Show Status from the resulting menu.
  4. Ensure that your Web server is running.

Test the Web client

Test the Web client of simpleSession by browsing the URL:

http://hostname:9080/gettingstarted3/SimpleSession?msg=Hi

Testing the unsecured Web client

The client will return your original message of "Hi" (notice the end of the URL: ?msg=Hi). You can send other messages and have them echoed back to you, such as ?msg=Wow

Testing the unsecured Web client again

Test the Java application client

Test the Java application client by launching your client application in the client container.

  1. Open a system command prompt.
  2. Change directory to:
    product_installation_root/bin
  3. Enter the command:
    launchClient ../temp/tutorial/assembly/Deployed_simpleSession.ear
    
    (Remember, on Windows systems, the forward slashes should be backslashes).

    Launching the application client

The client will contact the enterprise bean and return a "hello world" message.

Results of launching client

  The above command is issued from the bin directory because the argument providing the path to the Deployed_simpleSession.ear is relative to the bin directory. Actually, you should be able to issue the command from any directory, as long as you correctly specify the path to the .ear file whose application client you want to launch. More information is available about the launchClient command.

What's next?

Now that you have assembled and deployed an unsecured application, and tested your results, you might be interested in securing your application. The Application security tutorial describes how to do so, using local operating system authentication and login forms.