1. 程式人生 > >jdbc:關於junit測試No tests found matching

jdbc:關於junit測試No tests found matching

對象 方法 t對象 unit class 負責 sts n) cti

[email protected]方法方法時,就會報No tests found matching。。。

from [email protected],[email protected]

@Test
public void testSatement(){
Connection connection=null;
Statement statement=null;
ResultSet resultSet=null;
try {
//1.獲取數據庫連接
connection=getConnection();
//2.調用Connection對象的createStatement()方法獲取Statement對象
statement=connection.createStatement();
//3.準備SQL語句
String sql="update customers set name=‘Jerry‘ where id=6";

//4.發送SQL語句:調用Statement對象的executeUpdate(sql)方法
statement.executeUpdate(sql);
} catch (Exception e) {
e.printStackTrace();
}finally{
//5.關閉數據庫資源:由裏向外關閉
releaseDB(resultSet, statement, connection);
}

比如上述測試中需保證方法getConnection()和releaseDB(resultSet, statement, connection)[email protected],負責就會報上述錯誤

註:junit4----junit_4.12.0.v201504281640


jdbc:關於junit測試No tests found matching