Parasoft's solution provides extensive support for generating and consuming JMS messages and simulating various patterns-including point-to-point and publish-and-subscribe patterns. This allows for end-to-end testing and validation of messaging systems. These same scenarios can be scaled into load tests. 

The exercises in this lesson will use the ParaBank application introduced in Setting Up ParaBank

Preparation: Running ParaBank

To configure SOAtest for the ParaBank tests:

  1. Add the JDBC driver to the SOAtest JDBC Driver preference page as follows:
    1. Go to Parasoft > Preferences, then Parasoft > JDBC Drivers.
    2. Click New.
    3. Navigate to your ParaBank workspace and choose the hsqldb-<VERSION>.jar in the <PARABANK>/WebContent/WEB-INF/lib/ directory, then click Open.
    4. Click OK and apply the changes.
  2. Add the ActiveMQ driver to the SOAtest System Properties preference page as follows:
    1. Go to Parasoft > System Properties.
    2. Click Add JARs.
    3. Navigate to your ParaBank workspace and choose the activemq-client-<VERSION>.jar in the <PARABANK>/WebContent/WEB-INF/lib/ directory, then click Open.
  3. Ensure that the ParaBank Tomcat 9.0 Server is Started and Synchronized.

Testing JMS Services

To test JMS services provided by the ParaBank application:

  1. Right-click the main project you have been using in this tutorial, then choose Add New > Test (.tst) File.
  2. Enter LoanProcessor in the File Name field, then click Next.
  3. Choose Empty, then click Finish.
  4. Right-click the Loan Processor > Test Suite: Test Suite node, then choose Add New > Test.
  5. Add a SOAP Client tool as follows:
    1. Right-click the Loan Processor > Test Suite: Test Suite node, then choose Add New > Test.
    2. Choose SOAPClient, then click Finish.
    3. In the SOAP Client editor that opens, rename the SOAP Client to initializeDB.
    4. Click the WSDL tab and enter http://localhost:8080/parabank/services/ParaBank?wsdl in the WSDLURL field.
    5. Click RefreshWSDL to propagate the WSDL to the other sections of the SOAP Client.
    6. Click the Request tab and ensure that Operation is set to initializeDB. This will reset the ParaBank database for this example.
    7. Save the initializeDB SOAP Client.
  6. Add a Messaging Client tool as follows:
    1. Right-click the Loan Processor > Test Suite: Test Suite node, then choose Add New > Test.
    2. Choose MessagingClient, then click Finish.
    3. In the Messaging Client editor that opens, rename the Messaging Client to requestLoan.
    4. Click the Request tab and set InputMode to Literal.
    5. Replace the <Placeholder/> element with the following XML:

      <?xml version="1.0" encoding="UTF-8"?> 
      <loanRequest>
       <requestDate>2017-04-14T16:23:24.974-07:00</requestDate>  
       <customerId>13344</customerId>
       <availableFunds>1231.10</availableFunds>  
       <loanAmount>1000</loanAmount>
       <downPayment>100</downPayment>
      </loanRequest>

    6. Save the Messaging Client.
    7. Switch the InputMode to FormXML.

      If prompted, click Yes to propagate the values. You will see the tree structure of the loanRequest element.
    8. Click the Transport tab, set Transport to JMS, then enter the following:
      • ProviderURL: tcp://localhost:61616
      • InitialContext: org.apache.activemq.jndi.ActiveMQInitialContextFactory
      • Connection Factory: QueueConnectionFactory
    9. Choose Queue/Topic in the left panel, then enter queue.loans.request for the JMSDestination and queue.loans.response for the JMSReplyTo.
    10. Save the requestLoan Messaging Client.
  7. Run the test suite.
  8. Expand the requestLoan Messaging Client node, double click the Traffic Viewer.
  9. Click the Traffic Viewer’s Response tab and note that the <approved> element returns true.
  • No labels