Examples of PaginatedArrayList


Examples of com.ibatis.common.util.PaginatedArrayList

    template.queryWithRowHandler("myStatement", "myParameter", rowHandler);
    template.executorControl.verify();
  }

  public void testQueryForPaginatedList() throws SQLException {
    PaginatedList result = new PaginatedArrayList(10);
    TestSqlMapClientTemplate template = new TestSqlMapClientTemplate();
    template.executor.queryForPaginatedList("myStatement", null, 10);
    template.executorControl.setReturnValue(result, 1);
    template.executorControl.replay();
    assertEquals(result, template.queryForPaginatedList("myStatement", 10));
View Full Code Here

Examples of com.ibatis.common.util.PaginatedArrayList

    assertEquals(result, template.queryForPaginatedList("myStatement", 10));
    template.executorControl.verify();
  }

  public void testQueryForPaginatedListWithParameter() throws SQLException {
    PaginatedList result = new PaginatedArrayList(10);
    TestSqlMapClientTemplate template = new TestSqlMapClientTemplate();
    template.executor.queryForPaginatedList("myStatement", "myParameter", 10);
    template.executorControl.setReturnValue(result, 1);
    template.executorControl.replay();
    assertEquals(result, template.queryForPaginatedList("myStatement", "myParameter", 10));
View Full Code Here

Examples of com.ibatis.common.util.PaginatedArrayList

        .with(NOT_NULL)
        .will(returnValue(new Category()));
    catalogServiceMock.expects(once())
        .method("getProductListByCategory")
        .with(NOT_NULL)
        .will(returnValue(new PaginatedArrayList(4)));
    CatalogBean bean = new CatalogBean((CatalogService) catalogServiceMock.proxy());
    bean.setCategoryId("DOGS");
    assertEquals(AbstractBean.SUCCESS, bean.viewCategory());
    assertNotNull(bean.getCategory());
    assertNotNull(bean.getProductList());
View Full Code Here

Examples of com.ibatis.common.util.PaginatedArrayList

        .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());
    bean.setProductId("EST-1");
    assertEquals(AbstractBean.SUCCESS, bean.viewProduct());
    assertNotNull(bean.getProduct());
    assertNotNull(bean.getItemList());
View Full Code Here

Examples of com.ibatis.common.util.PaginatedArrayList

  public void testShouldSearchProductsByKeyword() {
    Mock catalogServiceMock = mock(CatalogService.class);
    catalogServiceMock.expects(once())
        .method("searchProductList")
        .with(NOT_NULL)
        .will(returnValue(new PaginatedArrayList(4)));
    CatalogBean bean = new CatalogBean((CatalogService) catalogServiceMock.proxy());
    bean.setKeyword("dog");
    assertEquals(AbstractBean.SUCCESS, bean.searchProducts());
    assertNotNull(bean.getProductList());
  }
View Full Code Here

Examples of com.ibatis.common.util.PaginatedArrayList

  }

  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());
    bean.setPageDirection("previous");
    bean.switchProductListPage();
    assertEquals(0, productList.getPageIndex());
  }
View Full Code Here

Examples of com.ibatis.common.util.PaginatedArrayList

  }

  public void testShouldSwitchItemPageBackAndForth() {
    Mock catalogServiceMock = mock(CatalogService.class);
    CatalogBean bean = new CatalogBean((CatalogService) catalogServiceMock.proxy());
    PaginatedList itemList = new PaginatedArrayList(2);
    itemList.add(new Item());
    itemList.add(new Item());
    itemList.add(new Item());
    itemList.add(new Item());
    itemList.add(new Item());
    bean.setItemList(itemList);

    bean.setPageDirection("next");
    assertEquals(AbstractBean.SUCCESS, bean.switchItemListPage());
    assertEquals(1, itemList.getPageIndex());
    bean.setPageDirection("previous");
    assertEquals(AbstractBean.SUCCESS, bean.switchItemListPage());
    assertEquals(0, itemList.getPageIndex());
  }
View Full Code Here

Examples of com.ibatis.common.util.PaginatedArrayList

    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();
    assertNull(bean.getKeyword());
    assertNull(bean.getPageDirection());
    assertNull(bean.getCategoryId());
    assertNull(bean.getCategory());
View Full Code Here

Examples of com.ibatis.common.util.PaginatedArrayList

    Mock mock = mock(ItemDao.class);

    mock.expects(once())
        .method("getItemListByProduct")
        .with(NOT_NULL)
        .will(returnValue(new PaginatedArrayList(5)));

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

  }
View Full Code Here

Examples of com.ibatis.common.util.PaginatedArrayList

    Mock mock = mock(ProductDao.class);

    mock.expects(once())
        .method("getProductListByCategory")
        .with(NOT_NULL)
        .will(returnValue(new PaginatedArrayList(5)));

    CatalogService service = new CatalogService(null, null, (ProductDao) mock.proxy());
    service.getProductListByCategory("DOGS");

  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.