Test the MyOrderItemAddCmdImpl command

The next step tests to ensure the new logic is functioning well. To test the new logic, you should be able to successfully add five unique items to the shopping cart, but expect an error to be thrown when you attempt to add a sixth unique item to the cart.

Procedure

  1. In the Servers view, restart the WC Project:
    1. Expand WebSphere Commerce Test Server, right-click WC; then click Restart Project.
    2. Wait until the project restarts successfully.
  2. Navigate to the Stores > WebContent > storedir directory.
  3. Select the index.jsp file and from its pop-up menu select Run > Run on Server. The store home page displays in the Web browser.
  4. Shop through the store and add five items to the shopping cart. After adding the fifth item, your shopping cart status will be similar to the following screen capture:

    Screen capture showing shopping cart with five items

  5. Try to add another item to your shopping cart. A page displays containing the text: Return to the previous screen and the error message: You cannot add more items into your shopping cart. Your shopping cart can hold up to five different items. displays in the Rational Application Developer Console view.
  6. Click the Return to the previous screen button to be redirected back to the product display page.