Commit 2f57e8dc by 左磊磊

add:23年8月9日新增代码

parent 6129a456
...@@ -23,7 +23,7 @@ public class ServerCase extends BaseCase { ...@@ -23,7 +23,7 @@ public class ServerCase extends BaseCase {
@Description("1A:A段和B段sql完全匹配") @Description("1A:A段和B段sql完全匹配")
public void testManager1A(API api, Case cas) throws Exception { public void testManager1A(API api, Case cas) throws Exception {
//0、执行前休眠30秒 //0、执行前休眠30秒
Thread.sleep(1000 * 40); Thread.sleep(1000 * 10);
//1、参数化替换 //1、参数化替换
String params = replace(cas.getParams()); String params = replace(cas.getParams());
String sql = replace(cas.getCheckSQL()); String sql = replace(cas.getCheckSQL());
...@@ -74,7 +74,7 @@ public class ServerCase extends BaseCase { ...@@ -74,7 +74,7 @@ public class ServerCase extends BaseCase {
@Test(dataProvider = "data2", description = "2B:B段sql部分匹配") @Test(dataProvider = "data2", description = "2B:B段sql部分匹配")
@Description("2B:B段sql部分匹配") @Description("2B:B段sql部分匹配")
public void testManager2B(API api, Case cas) throws Exception { public void testManager2B(API api, Case cas) throws Exception {
Thread.sleep(1000 * 40); Thread.sleep(1000 * 10);
String params = replace(cas.getParams()); String params = replace(cas.getParams());
String Bsql = replace(cas.getCheckBSQL()); String Bsql = replace(cas.getCheckBSQL());
cas.setParams(params); cas.setParams(params);
...@@ -109,7 +109,7 @@ public class ServerCase extends BaseCase { ...@@ -109,7 +109,7 @@ public class ServerCase extends BaseCase {
@Test(dataProvider = "data3", description = "3C:A段sql完全匹配") // DTO数据传输 @Test(dataProvider = "data3", description = "3C:A段sql完全匹配") // DTO数据传输
@Description("3C:A段sql完全匹配") @Description("3C:A段sql完全匹配")
public void testManager3C(API api, Case cas) throws Exception { public void testManager3C(API api, Case cas) throws Exception {
Thread.sleep(1000 * 40); Thread.sleep(1000 * 10);
String params = replace(cas.getParams()); String params = replace(cas.getParams());
String sql = replace(cas.getCheckSQL()); String sql = replace(cas.getCheckSQL());
cas.setParams(params); cas.setParams(params);
...@@ -120,6 +120,7 @@ public class ServerCase extends BaseCase { ...@@ -120,6 +120,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("a-sql: " + cas.getCheckSQL()); System.out.println("a-sql: " + cas.getCheckSQL());
Thread.sleep(1000 * 30); //A段SQL的休眠时间60秒
Object afterASqlResult = SqlUtils.querySingle(cas.getCheckSQL()); Object afterASqlResult = SqlUtils.querySingle(cas.getCheckSQL());
boolean sqlAFlag = assertSql(cas.getaExpectValue(), beforeASqlResult == null ? null : beforeASqlResult.toString(), afterASqlResult == null ? null : afterASqlResult.toString()); boolean sqlAFlag = assertSql(cas.getaExpectValue(), beforeASqlResult == null ? null : beforeASqlResult.toString(), afterASqlResult == null ? null : afterASqlResult.toString());
String assertSqlAFlag = (sqlAFlag) ? "Pass" : "Fail"; String assertSqlAFlag = (sqlAFlag) ? "Pass" : "Fail";
...@@ -141,7 +142,6 @@ public class ServerCase extends BaseCase { ...@@ -141,7 +142,6 @@ public class ServerCase extends BaseCase {
@Description("4D:A段sql完全匹配,B段sql部分匹配") @Description("4D:A段sql完全匹配,B段sql部分匹配")
public void testManager4D(API api, Case cas) throws Exception { public void testManager4D(API api, Case cas) throws Exception {
//0、执行前休眠30秒 //0、执行前休眠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());
...@@ -150,7 +150,9 @@ public class ServerCase extends BaseCase { ...@@ -150,7 +150,9 @@ public class ServerCase extends BaseCase {
cas.setCheckSQL(sql); cas.setCheckSQL(sql);
cas.setCheckBSQL(Bsql); cas.setCheckBSQL(Bsql);
//2、数据库前置查询结果(断言必须在接口执行前后都查询) //2、数据库前置查询结果(断言必须在接口执行前后都查询)
Thread.sleep(1000 * 30);
Object beforeASqlResult = SqlUtils.querySingle(cas.getCheckSQL()); Object beforeASqlResult = SqlUtils.querySingle(cas.getCheckSQL());
Thread.sleep(1000 * 30);
Object beforeBSqlResult = SqlUtils.querySingle(cas.getCheckBSQL()); Object beforeBSqlResult = SqlUtils.querySingle(cas.getCheckBSQL());
//3、调用接口 //3、调用接口
String body = call(api, cas, false); String body = call(api, cas, false);
...@@ -163,6 +165,7 @@ public class ServerCase extends BaseCase { ...@@ -163,6 +165,7 @@ public class ServerCase extends BaseCase {
addWBD(Integer.parseInt(cas.getId()), Constants.ACTURL_WRITER_BACK_CELL_NUM, body); addWBD(Integer.parseInt(cas.getId()), Constants.ACTURL_WRITER_BACK_CELL_NUM, body);
//6、数据库后置查询结果 //6、数据库后置查询结果
System.out.println("A-sql: " + cas.getCheckSQL()); System.out.println("A-sql: " + cas.getCheckSQL());
Thread.sleep(1000 * 30);
Object afterASqlResult = SqlUtils.querySingle(cas.getCheckSQL()); Object afterASqlResult = SqlUtils.querySingle(cas.getCheckSQL());
System.out.println("B-sql: " + cas.getCheckBSQL()); System.out.println("B-sql: " + cas.getCheckBSQL());
Thread.sleep(1000 * 30); //验证B段SQL的休眠时间60秒 Thread.sleep(1000 * 30); //验证B段SQL的休眠时间60秒
...@@ -194,8 +197,6 @@ public class ServerCase extends BaseCase { ...@@ -194,8 +197,6 @@ public class ServerCase extends BaseCase {
@Test(dataProvider = "data5", description = "5E:A段sql完全匹配,B段sql部分匹配,适用于作品应用") @Test(dataProvider = "data5", description = "5E:A段sql完全匹配,B段sql部分匹配,适用于作品应用")
@Description("5E:A段sql完全匹配,B段sql部分匹配,适用于作品应用") @Description("5E:A段sql完全匹配,B段sql部分匹配,适用于作品应用")
public void testManager5E(API api, Case cas) throws Exception { public void testManager5E(API api, Case cas) throws Exception {
//0、执行前休眠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());
...@@ -217,6 +218,7 @@ public class ServerCase extends BaseCase { ...@@ -217,6 +218,7 @@ public class ServerCase extends BaseCase {
addWBD(Integer.parseInt(cas.getId()), Constants.ACTURL_WRITER_BACK_CELL_NUM, body); addWBD(Integer.parseInt(cas.getId()), Constants.ACTURL_WRITER_BACK_CELL_NUM, body);
//6、数据库后置查询结果 //6、数据库后置查询结果
System.out.println("A-sql: " + cas.getCheckSQL()); System.out.println("A-sql: " + cas.getCheckSQL());
Thread.sleep(1000 * 30);
Object afterASqlResult = SqlUtils.querySingle(cas.getCheckSQL()); Object afterASqlResult = SqlUtils.querySingle(cas.getCheckSQL());
System.out.println("B-sql: " + cas.getCheckBSQL()); System.out.println("B-sql: " + cas.getCheckBSQL());
Thread.sleep(1000 * 30); //验证B段SQL的休眠时间60秒 Thread.sleep(1000 * 30); //验证B段SQL的休眠时间60秒
......
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