Package com.ibatis.jpetstore.domain

Examples of com.ibatis.jpetstore.domain.CartItem


  public String updateCartQuantities() {
    Map parameterMap = ActionContext.getActionContext().getParameterMap();

    Iterator cartItems = getCart().getAllCartItems();
    while (cartItems.hasNext()) {
      CartItem cartItem = (CartItem) cartItems.next();
      String itemId = cartItem.getItem().getItemId();
      try {
        int quantity = Integer.parseInt((String) parameterMap.get(itemId));
        getCart().setQuantityByItemId(itemId, quantity);
        if (quantity < 1) {
          cartItems.remove();
View Full Code Here


    public String updateCartQuantities() {
        Map parameterMap = ActionContext.getActionContext().getParameterMap();

        Iterator cartItems = getCart().getAllCartItems();
        while (cartItems.hasNext()) {
            CartItem cartItem = (CartItem) cartItems.next();
            String itemId = cartItem.getItem().getItemId();
            try {
                int quantity = Integer.parseInt((String) parameterMap.get(itemId));
                getCart().setQuantityByItemId(itemId, quantity);
                if (quantity < 1) {
                    cartItems.remove();
View Full Code Here

  public String updateCartQuantities() {
    Map parameterMap = ActionContext.getActionContext().getParameterMap();

    Iterator cartItems = getCart().getAllCartItems();
    while (cartItems.hasNext()) {
      CartItem cartItem = (CartItem) cartItems.next();
      String itemId = cartItem.getItem().getItemId();
      try {
        int quantity = Integer.parseInt((String) parameterMap.get(itemId));
        getCart().setQuantityByItemId(itemId, quantity);
        if (quantity < 1) {
          cartItems.remove();
View Full Code Here

        .with(NOT_NULL)
        .will(returnValue(item));
    CartBean bean = new CartBean((CatalogService) catalogServiceMock.proxy());
    bean.setWorkingItemId("SomeItem");
    assertEquals(AbstractBean.SUCCESS, bean.addItemToCart());
    CartItem cartItem = (CartItem)bean.getCart().getCartItemList().get(0);
    assertEquals(1,cartItem.getQuantity());
    assertEquals(AbstractBean.SUCCESS, bean.addItemToCart());
    assertEquals(2,cartItem.getQuantity());
  }
View Full Code Here

    bean.addItemToCart();

    ActionContext.getActionContext().getParameterMap().put("AnID", "5");

    assertEquals(AbstractBean.SUCCESS, bean.updateCartQuantities());
    CartItem cartItem = (CartItem)bean.getCart().getCartItemList().get(0);
    assertEquals(5,cartItem.getQuantity());
  }
View Full Code Here

  public String updateCartQuantities() {
    Map parameterMap = ActionContext.getActionContext().getParameterMap();

    Iterator cartItems = getCart().getAllCartItems();
    while (cartItems.hasNext()) {
      CartItem cartItem = (CartItem) cartItems.next();
      String itemId = cartItem.getItem().getItemId();
      try {
        int quantity = Integer.parseInt((String) parameterMap.get(itemId));
        getCart().setQuantityByItemId(itemId, quantity);
        if (quantity < 1) {
          cartItems.remove();
View Full Code Here

TOP

Related Classes of com.ibatis.jpetstore.domain.CartItem

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.