Package com.ibatis.jpetstore.domain

Examples of com.ibatis.jpetstore.domain.Cart


  public String viewCart() {
    return "success";
  }

  public void clear() {
    cart = new Cart();
    workingItemId = null;
    pageDirection = null;
  }
View Full Code Here


    public String viewCart() {
        return SUCCESS;
    }

    public void clear() {
        cart = new Cart();
        workingItemId = null;
        pageDirection = null;
    }
View Full Code Here

  public String viewCart() {
    return SUCCESS;
  }

  public void clear() {
    cart = new Cart();
    workingItemId = null;
    pageDirection = null;
  }
View Full Code Here

  public void testShouldSwitchPagesBackAndForth() {
    Mock catalogServiceMock = mock(CatalogService.class);
    CartBean bean = new CartBean((CatalogService) catalogServiceMock.proxy());
    assertEquals(AbstractBean.SUCCESS, bean.viewCart());

    Cart cart = new Cart();
    for (int i = 0; i < cart.getCartItemList().getPageSize() * 2; i++) {
      cart.getCartItemList().add(new Item());
    }
    bean.setCart(cart);
    bean.setPageDirection("next");
    assertEquals(AbstractBean.SUCCESS, bean.switchCartPage());
    assertEquals(1, cart.getCartItemList().getPageIndex());
    bean.setPageDirection("previous");
    assertEquals(AbstractBean.SUCCESS, bean.switchCartPage());
    assertEquals(0, cart.getCartItemList().getPageIndex());

  }
View Full Code Here

  }

  public void testShouldClearAllCartData() {
    Mock catalogServiceMock = mock(CatalogService.class);
    CartBean bean = new CartBean((CatalogService) catalogServiceMock.proxy());
    Cart cart = new Cart();
    bean.setCart(cart);
    bean.setWorkingItemId("not null");
    bean.setPageDirection("not null");
    bean.clear();
    assertFalse(cart == bean.getCart());
View Full Code Here

  public String viewCart() {
    return "success";
  }

  public void clear() {
    cart = new Cart();
    workingItemId = null;
    pageDirection = null;
  }
View Full Code Here

TOP

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

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.