📄 userdaotest.java
字号:
package com.demo.test;
import com.demo.hibernate.beans.User;
import com.demo.hibernate.dao.UserDAO;
import junit.framework.TestCase;
public class UserDAOTest extends TestCase {
public UserDAO service;
public UserDAOTest(String name) {
super(name);
}
protected void setUp() throws Exception {
super.setUp();
service = new UserDAO();
}
protected void tearDown() throws Exception {
super.tearDown();
}
public void testLogin() throws Exception {
User user = service.valid("admin", "admin");
assertNull(user);
user = null;
}
public void testExist() throws Exception {
assertTrue(service.isExist("admin"));
}
public void testAdd() throws Exception {
assertTrue(service.add("abc","abc","abc@def.com"));
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -