Commit fd547080 by Li Yongyu

package 不能为空和长度限制判断的bug修改

parent f8c75656
......@@ -43,6 +43,7 @@ public class addAccount extends NWN implements API {
public void initialize(HashMap<String, Object> data) {
if (!isProduct && data.get("CleanDB").toString().contains("Y")) {
this.cleann_n_admin_card_no_List_FromDB();
this.cleann_n_admin_card_no_List_FromDB_beforeTest();
}
}
......
......@@ -50,6 +50,7 @@ public class sign extends NWN implements API {
// n_admin_username_List.clear();
// user_id_List.clear();
this.cleann_n_admin_card_no_List_FromDB();
this.cleann_n_admin_card_no_List_FromDB_beforeTest();
this.cleann_n_package_List_FromDB();
this.cleann_user_id_List_FromDB();
}
......
......@@ -86,7 +86,21 @@ public class NWN extends BasicsGM{
}
}
public void cleann_n_admin_card_no_List_FromDB_beforeTest() {
try {
deleteFromDB("n_admin", "card_no", "qty50636");
} catch (Exception e) {
e.printStackTrace();
Log.logInfo("清除数据失败n_admin_card_no_List");
}
// System.out.println(user_idList.toString());
}
//清除注册数据根据n_admin_card_no_List
public void cleann_n_admin_card_no_List_FromDB() {
......
......@@ -29,6 +29,28 @@ import org.testng.annotations.Test;
@Listeners({ ProcessTestng.class ,ResultTestng.class })
public class APITest_nwn extends NWN{
@AfterClass
public void beforeClass() {
//测试结束删除测试所用的数据
if (!isClearMysql) {
this.cleann_n_admin_card_no_List_FromDB_beforeTest();
this.cleann_n_package_List_FromDB();
this.cleann_user_id_List_FromDB();
this.cleann_getcode_id_List_FromDB();
try {
if(stmt!=null){
stmt.close();
}
if (conn != null){
conn.close();
}
} catch (SQLException e) {
e.printStackTrace();
}
}
Log.logInfo("========测试结束========");
}
@Test(dataProvider = "renmai", dataProviderClass = offcn_api_testData.class)
public void f(HashMap<String, Object> data) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment