📄 testemploydao.java~10~
字号:
package chapter25.db;
import junit.framework.*;
import fixture.*;
import java.sql.*;
public class TestEmployDAO extends TestCase {
private EmployDAO employDAO = null;
HrJdbcFixture hrJdbcFixture;
protected void setUp() throws Exception {
super.setUp();
hrJdbcFixture = new HrJdbcFixture(this);
hrJdbcFixture.setUp();
employDAO = new EmployDAO(hrJdbcFixture.getConnection());
hrJdbcFixture.runSqlFile("D:/JTJB2005/chapter25/db/insert.sql",true);
}
protected void tearDown() throws Exception {
employDAO = null;
hrJdbcFixture.tearDown();
hrJdbcFixture = null;
super.tearDown();
}
public void testFindById() throws SQLException {
Employ expectEmp = new Employ("0004","大山",23);
Employ realEmp = employDAO.findById("0004");
assertNotNull(realEmp);
assertEquals(expectEmp,realEmp);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -