?? accountdaotest.java
字號:
package com.ibatis.jpetstore.persistence;
import com.ibatis.jpetstore.domain.Account;
import com.ibatis.jpetstore.domain.DomainFixture;
import com.ibatis.jpetstore.persistence.iface.AccountDao;
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);
}
public void testShouldFindDefaultUserAccountByUsernameAndPassword () throws Exception {
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);
}
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());
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -