Package com.ibatis.jpetstore.domain

Examples of com.ibatis.jpetstore.domain.Account


    assertEquals(AbstractBean.SUCCESS, accountBean.signoff());
    assertFalse(accountBean.isAuthenticated());
  }

  public void testShouldSignonAccount() {
    Account account = DomainFixture.newTestAccount();
    Mock accountServiceMock = mock(AccountService.class);
    accountServiceMock.expects(once())
        .method("getAccount")
        .with(NOT_NULL,NOT_NULL)
        .will(returnValue(account));
View Full Code Here


    assertEquals(AbstractBean.SUCCESS, accountBean.signon());
    assertTrue(accountBean.isAuthenticated());
  }

  public void testShouldFailToSignonAccount() {
    Account account = DomainFixture.newTestAccount();
    Mock accountServiceMock = mock(AccountService.class);
    accountServiceMock.expects(once())
        .method("getAccount")
        .with(NULL,NULL)
        .will(returnValue(null));
View Full Code Here

public class AccountDaoTest extends BasePersistenceTest {

  private AccountDao acctDao = (AccountDao)daoMgr.getDao(AccountDao.class);

  public void testShouldFindDefaultUserAccountByUsername () throws Exception {
    Account acct = acctDao.getAccount("j2ee");
    assertNotNull(acct);
  }
View Full Code Here

    Account acct = acctDao.getAccount("j2ee");
    assertNotNull(acct);
  }

  public void testShouldFindDefaultUserAccountByUsernameAndPassword () throws Exception {
    Account acct = acctDao.getAccount("j2ee", "j2ee");
    assertNotNull(acct);
  }
View Full Code Here

    Account acct = acctDao.getAccount("j2ee", "j2ee");
    assertNotNull(acct);
  }

  public void testShouldInsertNewAccount () throws Exception {
    Account acct = DomainFixture.newTestAccount();
    acctDao.insertAccount(acct);
    acct = acctDao.getAccount("cbegin");
    assertNotNull(acct);
  }
View Full Code Here

    assertNotNull(acct);
  }

  public void testShouldUpdateAccountEmailAddress () throws Exception {
    String newEmail = "new@email.com";
    Account acct = acctDao.getAccount("j2ee");
    acct.setEmail(newEmail);
    acctDao.updateAccount(acct);
    acct = acctDao.getAccount("j2ee");
    assertNotNull(acct);
    assertEquals(newEmail,acct.getEmail());
  }
View Full Code Here

    OrderBean bean = new OrderBean((AccountService)accountServiceMock.proxy(), (OrderService)orderServiceMock.proxy());
    assertEquals(AbstractBean.SIGNON, bean.newOrderForm());
  }

  public void testShouldFailDueToAMissingCart () {
    Account account = DomainFixture.newTestAccount();
    Mock accountServiceMock = mock(AccountService.class);
    accountServiceMock.expects(once())
        .method("getAccount")
        .with(NOT_NULL,NOT_NULL)
        .will(returnValue(account));
View Full Code Here

    OrderBean bean = new OrderBean((AccountService)accountServiceMock.proxy(), (OrderService)orderServiceMock.proxy());
    assertEquals(AbstractBean.FAILURE, bean.newOrderForm());
  }

  public void testSuccessfullyViewCart() {
    Account account = DomainFixture.newTestAccount();
    Mock accountServiceMock = mock(AccountService.class);
    accountServiceMock.expects(once())
        .method("getAccount")
        .with(NOT_NULL,NOT_NULL)
        .will(returnValue(account));
View Full Code Here

  public Account getAccount(String username) {
    return (Account) queryForObject("getAccountByUsername", username);
  }

  public Account getAccount(String username, String password) {
    Account account = new Account();
    account.setUsername(username);
    account.setPassword(password);
    return (Account) queryForObject("getAccountByUsernameAndPassword", account);
  }
View Full Code Here

  public List getUsernameList() {
    return queryForList("getUsernameList", null);
  }

  public Account getAccount(String username, String password) {
    Account account = new Account();
    account.setUsername(username);
    account.setPassword(password);
    return (Account) queryForObject("getAccountByUsernameAndPassword", account);
  }
View Full Code Here

TOP

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

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.