Package com.ibatis.common.util

Examples of com.ibatis.common.util.PaginatedArrayList


    Mock mock = mock(ProductDao.class);

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

    CatalogService service = new CatalogService(null, null, (ProductDao) mock.proxy());
    service.searchProductList("dog");

  }
View Full Code Here


  public void testShouldCallGetOrdersByUsernameOnOrderDao() {
    Mock orderDao = mock(OrderDao.class);
    orderDao.expects(once())
        .method("getOrdersByUsername")
        .with(NOT_NULL)
        .will(returnValue(new PaginatedArrayList(5)));
    OrderService service = new OrderService(null, null, (OrderDao) orderDao.proxy(), null);
    service.getOrdersByUsername("j2ee");
  }
View Full Code Here

    Mock catalogServiceMock = mock(CatalogService.class);

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

    AccountBean accountBean = new AccountBean((AccountService)accountServiceMock.proxy(), (CatalogService)catalogServiceMock.proxy());
    accountBean.setAccount(account);

    String result = accountBean.newAccount();
View Full Code Here

    Mock catalogServiceMock = mock(CatalogService.class);

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

    AccountBean accountBean = new AccountBean((AccountService)accountServiceMock.proxy(), (CatalogService)catalogServiceMock.proxy());
    accountBean.setAccount(account);

    String result = accountBean.editAccount();
View Full Code Here

    Account account = DomainFixture.newTestAccount();
    Mock accountServiceMock = mock(AccountService.class);
    Mock catalogServiceMock = mock(CatalogService.class);
    AccountBean accountBean = new AccountBean((AccountService)accountServiceMock.proxy(), (CatalogService)catalogServiceMock.proxy());
    accountBean.setAccount(account);
    accountBean.setMyList(new PaginatedArrayList(5));
    accountBean.setPageDirection("next");
    assertEquals(AbstractBean.SUCCESS,accountBean.switchMyListPage());
    accountBean.setPageDirection("previous");
    assertEquals(AbstractBean.SUCCESS,accountBean.switchMyListPage());
  }
View Full Code Here

        .will(returnValue(account));
    Mock catalogServiceMock = mock(CatalogService.class);
    catalogServiceMock.expects(once())
        .method("getProductListByCategory")
        .with(NOT_NULL)
        .will(returnValue(new PaginatedArrayList(5)));
    AccountBean accountBean = new AccountBean((AccountService)accountServiceMock.proxy(), (CatalogService)catalogServiceMock.proxy());
    accountBean.setAccount(account);
    accountBean.signon();

    assertEquals(AbstractBean.SUCCESS, accountBean.signoff());
View Full Code Here

        .will(returnValue(account));
    Mock catalogServiceMock = mock(CatalogService.class);
    catalogServiceMock.expects(once())
        .method("getProductListByCategory")
        .with(NOT_NULL)
        .will(returnValue(new PaginatedArrayList(5)));
    AccountBean accountBean = new AccountBean((AccountService)accountServiceMock.proxy(), (CatalogService)catalogServiceMock.proxy());
    accountBean.setAccount(account);
    assertEquals(AbstractBean.SUCCESS, accountBean.signon());
    assertTrue(accountBean.isAuthenticated());
  }
View Full Code Here

    Mock catalogServiceMock = mock(CatalogService.class);
    AccountBean accountBean = new AccountBean((AccountService)accountServiceMock.proxy(), (CatalogService)catalogServiceMock.proxy());
    accountBean.setAccount(DomainFixture.newTestAccount());
    accountBean.setRepeatedPassword("something");
    accountBean.setPageDirection("F");
    accountBean.setMyList(new PaginatedArrayList(5));

    accountBean.clear();

    assertEquals(null, accountBean.getAccount().getFirstName());
    assertEquals(null, accountBean.getRepeatedPassword());
View Full Code Here

  }

  public void testListListOrdersByUsername() {
    Mock accountServiceMock = mock(AccountService.class);
    Mock orderServiceMock = mock(OrderService.class);
    PaginatedArrayList orderList = new PaginatedArrayList(5);
    orderList.add(new Order());
    orderList.add(new Order());
    orderList.add(new Order());
    orderServiceMock.expects(once())
        .method("getOrdersByUsername")
        .with(NOT_NULL)
        .will(returnValue(orderList));
    Map sessionMap = ActionContext.getActionContext().getSessionMap();
View Full Code Here

  }

  public void testShouldSwitchOrderListPagesBackAndForth() {
    Mock accountServiceMock = mock(AccountService.class);
    Mock orderServiceMock = mock(OrderService.class);
    PaginatedArrayList orderList = new PaginatedArrayList(2);
    orderList.add(new Order());
    orderList.add(new Order());
    orderList.add(new Order());
    orderServiceMock.expects(once())
        .method("getOrdersByUsername")
        .with(NOT_NULL)
        .will(returnValue(orderList));
    Map sessionMap = ActionContext.getActionContext().getSessionMap();
View Full Code Here

TOP

Related Classes of com.ibatis.common.util.PaginatedArrayList

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.