Commit d12263c0 by 左磊磊

add:2023年8月4日新增代码

parent 4fb558ba
...@@ -89,7 +89,7 @@ public class ServerCase extends BaseCase { ...@@ -89,7 +89,7 @@ public class ServerCase extends BaseCase {
boolean assertResponseFlag = assertResponse(cas, body); boolean assertResponseFlag = assertResponse(cas, body);
addWBD(Integer.parseInt(cas.getId()), Constants.ACTURL_WRITER_BACK_CELL_NUM, body); addWBD(Integer.parseInt(cas.getId()), Constants.ACTURL_WRITER_BACK_CELL_NUM, body);
System.out.println("B-sql: " + cas.getCheckBSQL()); System.out.println("B-sql: " + cas.getCheckBSQL());
Thread.sleep(1000 * 240); Thread.sleep(1000 * 60);
Object afterBSqlResult = SqlUtils.querySingle(cas.getCheckBSQL()); Object afterBSqlResult = SqlUtils.querySingle(cas.getCheckBSQL());
boolean sqlBFlag = assertSql(cas.getbExpectValue(), beforeBSqlResult == null ? null : beforeBSqlResult.toString(), afterBSqlResult == null ? null : afterBSqlResult.toString()); boolean sqlBFlag = assertSql(cas.getbExpectValue(), beforeBSqlResult == null ? null : beforeBSqlResult.toString(), afterBSqlResult == null ? null : afterBSqlResult.toString());
String assertSqlBFlag = (sqlBFlag) ? "Pass" : "Fail"; String assertSqlBFlag = (sqlBFlag) ? "Pass" : "Fail";
...@@ -112,22 +112,21 @@ public class ServerCase extends BaseCase { ...@@ -112,22 +112,21 @@ public class ServerCase extends BaseCase {
public void testManager3(API api, Case cas) throws Exception { public void testManager3(API api, Case cas) throws Exception {
Thread.sleep(1000 * 30); Thread.sleep(1000 * 30);
String params = replace(cas.getParams()); String params = replace(cas.getParams());
String Bsql = replace(cas.getCheckBSQL()); String sql = replace(cas.getCheckSQL());
cas.setParams(params); cas.setParams(params);
cas.setCheckBSQL(Bsql); cas.setCheckBSQL(sql);
Object beforeBSqlResult = SqlUtils.querySingle(cas.getCheckBSQL()); Object beforeASqlResult = SqlUtils.querySingle(cas.getCheckSQL());
String body = call(api, cas, false); String body = call(api, cas, false);
AuthorizationUtils.storeToken(body); AuthorizationUtils.storeToken(body);
boolean assertResponseFlag = assertResponse(cas, body); boolean assertResponseFlag = assertResponse(cas, body);
addWBD(Integer.parseInt(cas.getId()), Constants.ACTURL_WRITER_BACK_CELL_NUM, body); addWBD(Integer.parseInt(cas.getId()), Constants.ACTURL_WRITER_BACK_CELL_NUM, body);
System.out.println("B-sql: " + cas.getCheckBSQL()); System.out.println("a-sql: " + cas.getCheckSQL());
Thread.sleep(1000 * 60); Object afterASqlResult = SqlUtils.querySingle(cas.getCheckSQL());
Object afterBSqlResult = SqlUtils.querySingle(cas.getCheckBSQL()); boolean sqlAFlag = assertSql(cas.getaExpectValue(), beforeASqlResult == null ? null : beforeASqlResult.toString(), afterASqlResult == null ? null : afterASqlResult.toString());
boolean sqlBFlag = assertSql(cas.getbExpectValue(), beforeBSqlResult == null ? null : beforeBSqlResult.toString(), afterBSqlResult == null ? null : afterBSqlResult.toString()); String assertSqlAFlag = (sqlAFlag) ? "Pass" : "Fail";
String assertSqlBFlag = (sqlBFlag) ? "Pass" : "Fail"; addWBD(Integer.parseInt(cas.getId()), Constants.A_ASSERT_RESULT_CELL_NUM, assertSqlAFlag);
addWBD(Integer.parseInt(cas.getId()), Constants.B_ASSERT_RESULT_CELL_NUM, assertSqlBFlag); System.out.println("数据库A-sql断言结果:" + sqlAFlag);
System.out.println("数据库B-sql断言结果:" + sqlBFlag); String assertContent = (assertResponseFlag && sqlAFlag) ? "Pass" : "Fail";
String assertContent = (assertResponseFlag && sqlBFlag) ? "Pass" : "Fail";
addWBD(Integer.parseInt(cas.getId()), Constants.ASSERT_RESULT_CELL_NUM, assertContent); addWBD(Integer.parseInt(cas.getId()), Constants.ASSERT_RESULT_CELL_NUM, assertContent);
Assert.assertEquals(assertContent, "Pass"); Assert.assertEquals(assertContent, "Pass");
} }
...@@ -144,7 +143,7 @@ public class ServerCase extends BaseCase { ...@@ -144,7 +143,7 @@ public class ServerCase extends BaseCase {
@Description("推送消息-第2段部分匹配判断") @Description("推送消息-第2段部分匹配判断")
public void testManager4(API api, Case cas) throws Exception { public void testManager4(API api, Case cas) throws Exception {
//0、执行前休眠30秒 //0、执行前休眠30秒
Thread.sleep(1000 * 30); Thread.sleep(1000 * 40);
//1、参数化替换 //1、参数化替换
String params = replace(cas.getParams()); String params = replace(cas.getParams());
String sql = replace(cas.getCheckSQL()); String sql = replace(cas.getCheckSQL());
...@@ -183,8 +182,6 @@ public class ServerCase extends BaseCase { ...@@ -183,8 +182,6 @@ public class ServerCase extends BaseCase {
//8、添加断言回写内容 //8、添加断言回写内容
String assertContent = (assertResponseFlag && sqlAFlag && sqlBFlag) ? "Pass" : "Fail"; String assertContent = (assertResponseFlag && sqlAFlag && sqlBFlag) ? "Pass" : "Fail";
addWBD(Integer.parseInt(cas.getId()), Constants.ASSERT_RESULT_CELL_NUM, assertContent); addWBD(Integer.parseInt(cas.getId()), Constants.ASSERT_RESULT_CELL_NUM, assertContent);
//9、添加日志
//10、报表断言
Assert.assertEquals(assertContent, "Pass"); Assert.assertEquals(assertContent, "Pass");
} }
......
...@@ -17,7 +17,7 @@ public class Constants { ...@@ -17,7 +17,7 @@ public class Constants {
*/ */
//excel用例路径 //excel用例路径
public static final String EXCEL_PATH = "src/test/resources/RAYS7.xls"; public static final String EXCEL_PATH = "src/test/resources/RAYS7服务-磊磊.xls";
// token鉴权版本 // token鉴权版本
// public static final String HEADER_MEDIA_TYPE_NAME = "X-Requested-With"; // X-Lemonban-Media-Type // public static final String HEADER_MEDIA_TYPE_NAME = "X-Requested-With"; // X-Lemonban-Media-Type
// token鉴权方式值 // token鉴权方式值
......
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