Example: Virtualizing services with Rational Test Workbench

The following example describes a scenario that includes a component process that uses virtualized services. In this example, an application in IBM® UrbanCode Deploy comprises two components. One component is the user interface for a web application running on an application server. The second component is a virtual representation of a web service.

Before you begin

You must install IBM Rational® Test Workbench, including IBM Rational Test Control Panel and IBM Rational Integration Tester. To learn more about Rational Test Workbench, see the Rational Test Workbench information center.

About this task

To virtualize the web service, you can use the Green Hat plug-in to create a transient environment that mimics the behavior of the actual web service. The user interface component is deployed as any other component to a node where the IBM UrbanCode Deploy agent is installed, either on a specific host or on the cloud. When the application server is configured on the user interface component, the proxy is installed so that HTTP calls are routed to the IBM Rational Test Control Panel server, which then returns the data from the stub.

Procedure

  1. Use IBM Rational Test Control Panel to record and publish the virtual services that you want to emulate. These virtual services are also known as stubs. When you create the stubs, add environment tags to replace the recorded data with dynamic data, such as the host name. To learn more about stubs, see Stubs in the Rational Test Workbench information center.
  2. In IBM UrbanCode Deploy, create an application with two components, one for the user interface component and one for the virtualized service. To learn more about creating applications, see Applications.
  3. Create a component process to install the user interface component. The following steps show an example set of process steps for an application running on Tomcat.
    1. Install Tomcat Use the Tomcat plug-in to install the application server.
    2. Download Artifacts Use a source control plug-in such as the UrbanCode Versioned File Storage plug-in to download the user interface application.
    3. Unzip Use the File Utils plug-in to extract the user interface application.
    4. Modify Tomcat Artifacts Use the Tomcat plug-in to update the WSDL host name that the user interface application uses for calls to web services.
    5. Update Config File Use the Tomcat plug-in to add the proxy information for IBM Rational Test Control Panel to the tomcat6 configuration file. For Tomcat, you change the JAVA_OPTS properties for http.proxyHost and http.proxyPort to point to the host name and port number of the IBM Rational Test Control Panel proxy.
    6. Start Tomcat Use the Tomcat plug-in to start the application server.
  4. Create a component process to deploy the virtualized service and to run integration tests. The following steps show an example set of process steps.
    1. Create Transient Environment Use a base environment that you have created in IBM Rational Test Control Panel to create a transient environment. The transient environment is used to start the stub with dynamic property values.
    2. Update Transient Environment Update the environment with properties specific to the deployment environment.
    3. Start Stub. Start the virtualized service in the transient environment.
    4. Run Integration Tests When the application process runs, at this point the user interface component is deployed and the virtual services are running. You can run tests using any test software that is available on the agent. In this example, you run tests in IBM Rational Integration Tester.
    5. Stop Stub Shut down the virtualized service.
    6. Delete Transient Environment Delete the transient environment.

Results

When you run the application process, the user interface component is deployed and then the virtual services component is deployed. After integration tests run, the virtual services are shut down.

Feedback