Package com.ibatis.jpetstore.domain

Examples of com.ibatis.jpetstore.domain.Product


  public void testShouldPopulateProductByIdForViewing() {
    Mock catalogServiceMock = mock(CatalogService.class);
    catalogServiceMock.expects(once())
        .method("getProduct")
        .with(NOT_NULL)
        .will(returnValue(new Product()));
    catalogServiceMock.expects(once())
        .method("getItemListByProduct")
        .with(NOT_NULL)
        .will(returnValue(new PaginatedArrayList(4)));
    CatalogBean bean = new CatalogBean((CatalogService) catalogServiceMock.proxy());
View Full Code Here


  public void testShouldSwitchProductPageBackAndForth() {
    Mock catalogServiceMock = mock(CatalogService.class);
    CatalogBean bean = new CatalogBean((CatalogService) catalogServiceMock.proxy());
    PaginatedList productList = new PaginatedArrayList(2);
    productList.add(new Product());
    productList.add(new Product());
    productList.add(new Product());
    productList.add(new Product());
    productList.add(new Product());
    bean.setProductList(productList);

    bean.setPageDirection("next");
    bean.switchProductListPage();
    assertEquals(1, productList.getPageIndex());
View Full Code Here

    bean.setPageDirection("not null");
    bean.setCategoryId("not null");
    bean.setProductId("not null");
    bean.setItemId("not null");
    bean.setCategory(new Category());
    bean.setProduct(new Product());
    bean.setItem(new Item());
    bean.setCategoryList(new PaginatedArrayList(2));
    bean.setProductList(new PaginatedArrayList(2));
    bean.setItemList(new PaginatedArrayList(2));
    bean.clear();
View Full Code Here

    Mock mock = mock(ProductDao.class);

    mock.expects(once())
        .method("getProduct")
        .with(NOT_NULL)
        .will(returnValue(new Product()));

    CatalogService service = new CatalogService(null, null, (ProductDao) mock.proxy());
    service.getProduct("FI-SW-01");

  }
View Full Code Here

TOP

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

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.