Commit 82c2f59d by qingfen

update

parent fce72ce7
...@@ -10,4 +10,9 @@ ...@@ -10,4 +10,9 @@
</profile> </profile>
</annotationProcessing> </annotationProcessing>
</component> </component>
<component name="JavacSettings">
<option name="ADDITIONAL_OPTIONS_OVERRIDE">
<module name="Lemon" options="-parameters" />
</option>
</component>
</project> </project>
\ No newline at end of file
...@@ -8,6 +8,21 @@ ...@@ -8,6 +8,21 @@
</remote-repository> </remote-repository>
<remote-repository> <remote-repository>
<option name="id" value="central" /> <option name="id" value="central" />
<option name="name" value="Central Repository" />
<option name="url" value="http://192.168.83.20:8081/nexus/content/groups/public" />
</remote-repository>
<remote-repository>
<option name="id" value="archetype" />
<option name="name" value="pcloud archetypes" />
<option name="url" value="http://192.168.83.20:8081/nexus/content/groups/public" />
</remote-repository>
<remote-repository>
<option name="id" value="HuaweiCloudSDK" />
<option name="name" value="HuaweiCloudSDK" />
<option name="url" value="http://192.168.83.20:8081/nexus/content/groups/public" />
</remote-repository>
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Maven Central repository" /> <option name="name" value="Maven Central repository" />
<option name="url" value="https://repo1.maven.org/maven2" /> <option name="url" value="https://repo1.maven.org/maven2" />
</remote-repository> </remote-repository>
...@@ -16,5 +31,10 @@ ...@@ -16,5 +31,10 @@
<option name="name" value="JBoss Community repository" /> <option name="name" value="JBoss Community repository" />
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" /> <option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
</remote-repository> </remote-repository>
<remote-repository>
<option name="id" value="edu-public" />
<option name="name" value="edu public Repository" />
<option name="url" value="http://192.168.83.20:8081/nexus/content/groups/public" />
</remote-repository>
</component> </component>
</project> </project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="VcsDirectoryMappings"> <component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" /> <mapping directory="" vcs="Git" />
</component> </component>
</project> </project>
\ No newline at end of file
...@@ -143,7 +143,7 @@ ...@@ -143,7 +143,7 @@
<dependency> <dependency>
<groupId>org.apache.httpcomponents</groupId> <groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId> <artifactId>httpclient</artifactId>
<version>4.5.10</version> <version>4.5.13</version>
</dependency> </dependency>
<!--Excel列进行验证--> <!--Excel列进行验证-->
......
...@@ -26,14 +26,14 @@ public class ServerCase extends BaseCase { ...@@ -26,14 +26,14 @@ public class ServerCase extends BaseCase {
@Test(dataProvider = "data1", description = "1A:A段和B段sql完全匹配") // DTO数据传输 @Test(dataProvider = "data1", description = "1A:A段和B段sql完全匹配") // DTO数据传输
@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 {
String assertContent = "Fail"; String assertContent = "Pass";
String body = ""; String body = "";
Object afterASqlResult = null; Object afterASqlResult = null;
Object afterBSqlResult = null; Object afterBSqlResult = null;
try { try {
System.out.println("testManager1A==================================================接口请求分割线=================================================="); System.out.println("testManager1A==================================================接口请求分割线==================================================");
//0、执行前休眠30秒 //0、执行前休眠30秒
Thread.sleep(1000 * 2); Thread.sleep(1000 * 3);
//1、参数化替换 //1、参数化替换
String params = replace(cas.getParams()); String params = replace(cas.getParams());
String sql = replace(cas.getCheckSQL()); String sql = replace(cas.getCheckSQL());
...@@ -79,11 +79,13 @@ public class ServerCase extends BaseCase { ...@@ -79,11 +79,13 @@ public class ServerCase extends BaseCase {
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";
addWBD(Integer.parseInt(cas.getId()), Constants.A_ASSERT_RESULT_CELL_NUM, assertSqlAFlag); addWBD(Integer.parseInt(cas.getId()), Constants.A_ASSERT_RESULT_CELL_NUM, assertSqlAFlag);
if(beforeASqlResult != null) System.out.println("数据库A-sql执行前是否有数据:" + beforeASqlResult.toString());
System.out.println("数据库A-sql断言结果:" + sqlAFlag); System.out.println("数据库A-sql断言结果:" + sqlAFlag);
//7-2、B段数据库断言 //7-2、B段数据库断言
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";
addWBD(Integer.parseInt(cas.getId()), Constants.B_ASSERT_RESULT_CELL_NUM, assertSqlBFlag); addWBD(Integer.parseInt(cas.getId()), Constants.B_ASSERT_RESULT_CELL_NUM, assertSqlBFlag);
if(beforeBSqlResult != null) System.out.println("数据库B-sql执行前是否有数据:" + beforeBSqlResult.toString());
System.out.println("数据库B-sql断言结果:" + sqlBFlag); System.out.println("数据库B-sql断言结果:" + sqlBFlag);
//8、添加断言回写内容 //8、添加断言回写内容
assertContent = (assertResponseFlag && sqlAFlag && sqlBFlag) ? "Pass" : "Fail"; assertContent = (assertResponseFlag && sqlAFlag && sqlBFlag) ? "Pass" : "Fail";
...@@ -130,7 +132,7 @@ public class ServerCase extends BaseCase { ...@@ -130,7 +132,7 @@ public class ServerCase extends BaseCase {
String assertContent = "Fail"; String assertContent = "Fail";
try { try {
System.out.println("testManager2B==================================================接口请求分割线=================================================="); System.out.println("testManager2B==================================================接口请求分割线==================================================");
Thread.sleep(1000 * 2); Thread.sleep(1000 * 5);
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);
...@@ -410,11 +412,13 @@ public class ServerCase extends BaseCase { ...@@ -410,11 +412,13 @@ public class ServerCase extends BaseCase {
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";
addWBD(Integer.parseInt(cas.getId()), Constants.A_ASSERT_RESULT_CELL_NUM, assertSqlAFlag); addWBD(Integer.parseInt(cas.getId()), Constants.A_ASSERT_RESULT_CELL_NUM, assertSqlAFlag);
if(beforeASqlResult != null) System.out.println("数据库A-sql执行前是否有数据:" + beforeASqlResult.toString());
System.out.println("数据库A-sql断言结果:" + sqlAFlag); System.out.println("数据库A-sql断言结果:" + sqlAFlag);
//7-2、B段数据库断言 //7-2、B段数据库断言
boolean sqlBFlag = assertSqlB(beforeBSqlResult == null ? null : beforeBSqlResult.toString(), afterBSqlResult == null ? null : afterBSqlResult.toString()); boolean sqlBFlag = assertSqlB(beforeBSqlResult == null ? null : beforeBSqlResult.toString(), afterBSqlResult == null ? null : afterBSqlResult.toString());
String assertSqlBFlag = (sqlBFlag) ? "Pass" : "Fail"; String assertSqlBFlag = (sqlBFlag) ? "Pass" : "Fail";
addWBD(Integer.parseInt(cas.getId()), Constants.B_ASSERT_RESULT_CELL_NUM, assertSqlBFlag); addWBD(Integer.parseInt(cas.getId()), Constants.B_ASSERT_RESULT_CELL_NUM, assertSqlBFlag);
if(beforeBSqlResult != null) System.out.println("数据库B-sql执行前是否有数据:" + beforeBSqlResult.toString());
System.out.println("数据库B-sql断言结果:" + sqlBFlag); System.out.println("数据库B-sql断言结果:" + sqlBFlag);
//8、添加断言回写内容 //8、添加断言回写内容
assertContent = (assertResponseFlag && sqlAFlag && sqlBFlag) ? "Pass" : "Fail"; assertContent = (assertResponseFlag && sqlAFlag && sqlBFlag) ? "Pass" : "Fail";
...@@ -558,7 +562,7 @@ public class ServerCase extends BaseCase { ...@@ -558,7 +562,7 @@ public class ServerCase extends BaseCase {
String alarmKey = "7782a9ad-817a-4b7e-9745-b2b173ddc04a"; String alarmKey = "7782a9ad-817a-4b7e-9745-b2b173ddc04a";
if (StringUtils.isNotBlank(alarmKey)) { if (StringUtils.isNotBlank(alarmKey)) {
log.info("发送告警消息:" +sb.toString()); log.info("发送告警消息:" +sb.toString());
WeworkRobotSender.asyncSend(alarmKey, MessageBuilder.buildMarkdown(sb.toString())); // WeworkRobotSender.asyncSend(alarmKey, MessageBuilder.buildMarkdown(sb.toString()));
} }
} }
} }
...@@ -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/Lemon正则匹配.xls"; public static final String EXCEL_PATH = "src/test/resources/超越颠覆英文版111.xlsx";
// 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