⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 testaccounthibernatedaoimpl.java

📁 一个简单的Struts, Spring, Hibernate 示例
💻 JAVA
字号:
package com.cognizant.food.dao.hibernate;

import com.cognizant.food.bo.Account;
import com.cognizant.food.bo.Name;

import junit.framework.TestCase;

public class TestAccountHibernateDaoImpl extends TestCase{
	public void testFindAccountByName(){
		try {
			AccountHibernateDaoImpl dao = new AccountHibernateDaoImpl();
			dao.setHibernateTemplate(TestingHibernateTemplate.getInstance().getHibernateTemplate());
			Account a = dao.findAccountByUsername("jerry");
			assertEquals("jerry", a.getUsername());
			Name name = a.getName();
			assertEquals("hello","shen",name.getLast());
			
			//assertNotNull(a.getName());
		} catch (Exception e){
			System.out.print(e.getMessage());
			assertFalse(true);
		}
	}

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -