Tutorial 3: JMS Virtual Service Using DevTest Workstation

This tutorial describes how to create a JMS recording of a loan application using the Forward Cars application. If you do not want to use the prerecorded loan-offers service that ldt Solutions provides (in Tutorial 2), you can create your own virtual service using ldt Workstation.
dts105
This tutorial describes how to create a JMS recording of a loan application using the Forward Cars application. If you do not want to use the prerecorded loan-offers service that 
DevTest
Solutions provides (in Tutorial 2), you can create your own virtual service using 
DevTest
Workstation.
2
Step 1 – Copy JAR Files
Two JAR files are required for deploying the JMS-based virtual service and must be copied into the DevTest directory.
Follow these steps
:
  1.  Extract the following files from the cars .war file or download them from the Internet.
    • activemq-client-5.12.1.jar
    • hawtbuf-1.11.jar
  2. Copy them to the following directory:
    DEVTEST_HOME
    \hotDeploy
Step 2 – Configure Forward Cars to Use Proxy JMS Queues
Follow these steps
:
  1. If Forward Cars is running, stop the application.
  2. Open
    DEVTEST_HOME
    \DemoServer\carsdemo \cars-loan.properties.
  3. Edit the following properties to point to the PROXY JMS destinations to enable recording and playback for a JMS service, as follows:
    cars.partner.responseQueue=PROXY.CARS.PARTNER.RESPONSE
    cars.partner.bofaRequestQueue=PROXY.CARS.PARTNER.BOFA
    cars.partner.chaseRequestQueue=PROXY.CARS.PARTNER.CHASE
    cars.partner.citiRequestQueue=PROXY.CARS.PARTNER.CITI
  4. Start Forward Cars. Go to the 
    DEVTEST_HOME\DemoServer\carsdemo
     directory and start the script for your operating system:
    • (Windows)
      start.bat
      If the Windows computer has UAC enabled (the default for Windows 7), the start script must run with Administrative privileges.
    • (UNIX or Linux) ./
      start.sh
    • (OS/X) 
      ./start.command
    The application can take several minutes to start.
  5. Enter the following URL in a web browser:
    /localhost:3434/cars-app
    The home page opens. Since Forward Cars uses port 3434, that port cannot be in use by any other application. If this port is not available, Forward Cars does not start successfully
Step 3 - Open DevTest Workstation
Follow these steps
:
  1. Start the Enterprise Dashboard by clicking
    Start Menu
    ,
    All Programs
    ,
    DevTest Solutions
    ,
    Enterprise Dashboard Server
    . Wait until the "Grails application running" message appears.
  2. Start the registry by clicking
    Start Menu
    ,
    All Programs
    ,
    DevTest Solutions
    ,
    Registry
    .
  3. Click
    Start
    ,
    All Programs
    ,
    DevTest Solutions
    ,
    Workstation
    .
    The Set DevTest Registry dialog opens.
  4. Select a registry and click
    OK
    .
  5. The Login dialog opens. Enter a valid username and password and click
    Login
    .
    The DevTest Workstation opens.
  6. Start Service Virtualization by clicking
    Start
    ,
    All Programs
    ,
    DevTest Solutions
    ,
    Virtual Service Environment
    .
Step 4 - Record a JMS Session to Apply for a Loan in Forward Cars
Follow these steps
:
  1. In
    DevTest
    Workstation, open the Cars v9 project. The project is located in the
    DEVTEST_HOME
    \Projects\ folder.
  2. Double-click the project.config file. The JMS assets display in the Assets panel:
    Assets.PNG
  3. You can verify the assets to ensure that the recording and playback is set up properly. Double-click an asset, then in the asset editor, click the green Verify button.
  4. View the log window for a success or failure message.
  5. Click
    VSE Recorder
    in the main toolbar.
  6. On the
    Basics
    tab, click the blue folder icon at the bottom left of the window.
  7. Navigate to Projects\Cars v9\Data, and select the
    loan-offers-jms.vrs
    file. This file contains the required configuration for the recording.
  8. Click
    Open
    .
  9. On the
    Basics
    tab, in the
    Write image to
    field, rename the file from newimage to a unique name.
  10. In the
    Model file
    field, enter the same unique name with a .vsm extension.
  11. Click
    Next
    .
    The proxy recorder setup page opens. The JMS-related configuration is already established.
    Three request channels for the loan are submitted to three different banks, as specified in the cars-loan.properties file (Step 2). The recorder forwards those requests to the live request queues, where they are processed by the Forward Cars application. The banks then process and return the response to the proxy response queue.
  12. Click
    Next
    to start the recording session.
    The recording feedback page opens. The green status icons indicate that the setup was successful.
  13. Keep 
    DevTest
    Workstation open, with the recording feedback page displayed.
Step 5 – Apply for a Loan Application in Forward Cars
Follow these steps
:
  1. Navigate to Forward Cars.
  2. From the home page, click
    Guest
    in the upper-right corner, then select
    Log In
    .
  3. In the
    Name
    field, enter
    lisa.simpson
    .
  4. In the
    Password
    field, enter
    golisa
    .
  5. Click
    Sign In
    .
    The home page opens.
  6. From the home page, click
    Loan Application
    .
    The Finance Application displays for Lisa Simpson.
  7. Click
    Apply
    .
    An Application Submitted message opens.
  8. Click
    OK
    .
Step 6 - Complete the JMS Recording in 
DevTest
Workstation
Follow these steps
:
  1. Back in 
    DevTest
    Workstation, the table in the Summary tab lists each request channel and response channel.
    Notice that the Bank Partners Response Channel has increased to three, for each loan application response that was generated in Forward Cars.
  2. Click
    Next
    to finish the recording.
  3. Keep the Request and Response data protocols as-is and click
    Next
    .
  4. Under
    Remaining Transactions
    , the three requests for each bank display. Under
    Token Identification
    , the three responses for the loan application display.
  5. Click
    Next
    , then
    Finish
    .
  6. On the Project Panel in DevTest Workstation, the new JMS service image and virtual service model display under the VirtualServices folder.
Step 7 - Change the Forward Cars Application ID to a Magic String
Once the recording is complete, you need to change the magic string of the application ID so it can play back properly.
Follow these steps
:
  1. In 
    DevTest
    Workstation Project panel, double-click the new virtual service image that you created.
    The Transactions page opens.
  2. The Response panel on the right shows the response to the requests. When you deploy the service and apply for a loan application, the <applicationId> that displays in the Response panel must be changed to the default (or Meta) response. In this example, the application ID is 2.
    magicstring.PNG
    Replace 2 with the following magic string:
    {{=request_applicationId;}}
  3. Click the
    Save
    icon.
Now that you have recorded the JMS service image, you can deploy it from 
DevTest
Workstation or 
DevTest
Portal.