Tutorials > Program model > Modify an existing controller command

< Previous | Next >


Test the MyOrderItemAddCmdImpl command

The next step is to test to ensure the new logic is functioning well.

To test the new logic, you should be able to successfully add five items to the shopping cart, but expect an error to be thrown when you attempt to add a sixth 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 > WebContentConsumerDirect_name 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, the shopping cart status will be similar to the following screen capture:

  5. Try to add another item to the shopping cart. A page displays containing the text: Return to the previous screen and the error message: You cannot add more items into the 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.

< Previous | Next >


+

Search Tips   |   Advanced Search