Commit 78235e3e by Li Yongyu

nwn

parent e4c3890b
......@@ -43,7 +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();
}
}
......@@ -94,9 +94,9 @@ public class addAccount extends NWN implements API {
if (json.length() != 0) {
String msg=StringUtils.decodeUnicode(getMsg(re));
String code=getCode(re);
String retcode=getCode(re);
if ((data.get("code") != null ) && (code != null) && (!code.equals(data.get("code").toString()))) {
if ((data.get("code") != null ) && (retcode != null) && (!retcode.equals(data.get("code").toString()))) {
result = result && false;
failReason = failReason + "code is expected "
+ data.get("code").toString() + " but actually "
......@@ -121,7 +121,7 @@ public class addAccount extends NWN implements API {
}
}
if("添加成功!".equals(msg)){
if("0".equals(retcode)){
//是否验证数据库
if (!isProduct) {
......
......@@ -50,7 +50,6 @@ 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();
}
......
......@@ -398,9 +398,9 @@ public abstract class BasicsGM {
}
try {
String code=JSONObject.fromObject(re.body().asString()).getString("retcode");
if(StringIsNull(code)){
return code;
String retcode=JSONObject.fromObject(re.body().asString()).getString("retcode");
if(StringIsNull(retcode)){
return retcode;
}
} catch (Exception e) {
}
......@@ -426,9 +426,9 @@ public abstract class BasicsGM {
}
try {
String errmsg=JSONObject.fromObject(re.body().asString()).getString("message");
if(StringIsNull(errmsg)){
return errmsg;
String message=JSONObject.fromObject(re.body().asString()).getString("message");
if(StringIsNull(message)){
return message;
}
} catch (Exception e) {
}
......
......@@ -94,7 +94,7 @@ public class NWN extends BasicsGM{
} catch (Exception e) {
e.printStackTrace();
Log.logInfo("清除数据失败n_admin_card_no_List");
Log.logInfo("清除数据失败n_admin_card_no_qty50636");
}
......
package com.offcn.test;
import io.restassured.response.Response;
import java.sql.SQLException;
import java.util.HashMap;
import net.sf.json.JSONObject;
import org.testng.Assert;
import org.testng.annotations.AfterClass;
import com.offcn.TestData.offcn_api_testData;
import com.offcn.TestUnti.Log;
import com.offcn.TestUnti.Mail;
......@@ -23,28 +27,21 @@ import com.offcn.process.NWN;
import com.offcn.process.TK;
import com.offcn.process.XYZB;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Listeners;
import org.testng.annotations.Test;
@Listeners({ ProcessTestng.class ,ResultTestng.class })
public class APITest_nwn extends NWN{
@AfterClass
@BeforeClass
public void beforeClass() {
//测试结束删除测试所用的数据
if (!isClearMysql) {
System.out.println("start del **************");
this.cleann_n_admin_card_no_List_FromDB_beforeTest();
System.out.println("end del **************");
try {
if(stmt!=null){
stmt.close();
}
if (conn != null){
conn.close();
}
} catch (SQLException e) {
e.printStackTrace();
}
}
Log.logInfo("========测试开始========");
......
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