Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tiku_APP_APITest
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
shuai
tiku_APP_APITest
Commits
5d2f4033
Commit
5d2f4033
authored
Mar 27, 2019
by
shuai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
20190327
parent
506999c8
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
107 additions
and
43 deletions
+107
-43
CaseMake.xls
tiku_App/TestData/CaseMake.xls
+0
-0
DataAll.xls
tiku_App/TestData/DataAll.xls
+0
-0
deleteNote.java
tiku_App/src/com/offcn/api/tk/app/deleteNote.java
+0
-1
NWN.java
tiku_App/src/com/offcn/process/NWN.java
+4
-4
TK.java
tiku_App/src/com/offcn/process/TK.java
+11
-8
APITest_tk.java
tiku_App/src/com/offcn/test/APITest_tk.java
+18
-14
NewMakeTestCases.java
tiku_App/src/makeTestCase/NewMakeTestCases.java
+1
-1
DatabaseSql.xml
tiku_App/src/resources/DatabaseSql.xml
+3
-3
case.txt
tiku_App/src/resources/case.txt
+3
-8
caseOut.txt
tiku_App/src/resources/caseOut.txt
+65
-2
system.xml
tiku_App/src/resources/system.xml
+2
-2
No files found.
tiku_App/TestData/CaseMake.xls
View file @
5d2f4033
No preview for this file type
tiku_App/TestData/DataAll.xls
View file @
5d2f4033
No preview for this file type
tiku_App/src/com/offcn/api/tk/app/deleteNote.java
View file @
5d2f4033
...
...
@@ -141,7 +141,6 @@ public String parameter;//参数集合
}
if
(
"接口响应成功!"
.
equals
(
msg
)){
}
}
if
(
result
)
...
...
tiku_App/src/com/offcn/process/NWN.java
View file @
5d2f4033
...
...
@@ -186,12 +186,12 @@ public class NWN extends BasicsGM{
public
void
cleanMysqlData
()
{
if
(!
isClearMysql
)
{
System
.
out
.
println
(
"nwn=====cleanMysqlData"
);
conn
=
ConnectionsMap
.
get
(
"nwn"
);
//设置默认的连接对象
stmt
=
StatementsMap
.
get
(
"nwn"
);
//设置默认的连接对象
Log
.
logInfo
(
"nwn=====cleanMysqlData"
);
conn
=
ConnectionsMap
.
get
(
"nwn"
);
//设置默认的连接对象
stmt
=
StatementsMap
.
get
(
"nwn"
);
//设置默认的连接对象
cleann_n_admin_card_no_List_FromDB
();
//清除注册数据根据n_admin_card_no_List
cleann_n_package_List_FromDB
();
//清除注册user_id,
cleann_user_id_List_FromDB
();
//清除用户地区操作表t_exam_area
cleann_user_id_List_FromDB
();
//清除用户地区操作表t_exam_area
}
}
...
...
tiku_App/src/com/offcn/process/TK.java
View file @
5d2f4033
...
...
@@ -51,9 +51,10 @@ public class TK extends BasicsGM{
public
static
String
type_L
=
""
;
//47
public
static
String
recordId_L
=
""
;
//110申论,使用记录id 提交做题记录时需要用到
//必有
public
void
Connectionsa
(){
//================设置数据库连接池=====================
ConnectionsMap
=
getConnections
(
new
String
[]{
"tk"
,
"xyzb"
});
ConnectionsMap
=
getConnections
(
new
String
[]{
"tk"
});
StatementsMap
=
getStatements
(
ConnectionsMap
);
conn
=
ConnectionsMap
.
get
(
"tk"
);
//设置默认的连接对象
stmt
=
StatementsMap
.
get
(
"tk"
);
//设置默认的连接对象
...
...
@@ -62,11 +63,12 @@ public class TK extends BasicsGM{
DynamicParameter
.
put
(
"sign"
,
"code"
);
//动态公共参数
}
//必有
public
TK
(){
Connectionsa
();
}
//动态公共参数
//
必有//
动态公共参数
public
HashMap
<
String
,
Object
>
setDynamicParameter
(
HashMap
<
String
,
Object
>
data
)
{
String
parameter
=
null
;
HashMap
<
String
,
Object
>
dataNew
=
data
;
...
...
@@ -101,7 +103,7 @@ public class TK extends BasicsGM{
return
dataNew
;
}
//必有
public
HashMap
<
String
,
Object
>
setPublicParameter
(
HashMap
<
String
,
Object
>
data
)
{
String
parameter
=
null
;
...
...
@@ -156,13 +158,14 @@ public class TK extends BasicsGM{
return
MD5keyUtil
.
getMD5Str
(
parameter
);
}
//必有
public
void
cleanMysqlData
()
{
if
(!
isClearMysql
)
{
System
.
out
.
println
(
"tk=====cleanMysqlData"
);
conn
=
ConnectionsMap
.
get
(
"tk"
);
//设置默认的连接对象
stmt
=
StatementsMap
.
get
(
"tk"
);
//设置默认的连接对象
cleanUser_FromDB
();
//清除注册user_id,
cleanexam_FromDB
();
//清除用户地区操作表t_exam_area
Log
.
logInfo
(
"tk=====cleanMysqlData"
);
conn
=
ConnectionsMap
.
get
(
"tk"
);
//设置默认的连接对象
stmt
=
StatementsMap
.
get
(
"tk"
);
//设置默认的连接对象
cleanUser_FromDB
();
//清除注册user_id,
cleanexam_FromDB
();
//清除用户地区操作表t_exam_area
}
}
...
...
tiku_App/src/com/offcn/test/APITest_tk.java
View file @
5d2f4033
...
...
@@ -9,6 +9,8 @@ import java.util.Map;
import
java.util.Set
;
import
java.util.Map.Entry
;
import
net.sf.json.JSONObject
;
import
org.testng.Assert
;
import
org.testng.annotations.AfterClass
;
...
...
@@ -17,6 +19,7 @@ import com.offcn.TestUnti.Log;
import
com.offcn.TestUnti.MapUtil
;
import
com.offcn.TestUnti.Reflect_api
;
import
com.offcn.TestUnti.StringUtils
;
import
com.offcn.TestUnti.SheetUtils
;
import
com.offcn.TestUnti.XMLread
;
import
com.offcn.interfaces.API
;
import
com.offcn.listener.MyTestListener
;
...
...
@@ -51,6 +54,7 @@ public class APITest_tk extends BasicsGM{
data
=
setPublicParameter
(
c
,
object
,
data
);
//静态公共参数
data
=
setDynamicParameter
(
c
,
object
,
data
);
//动态公共参数
String
parameter
=
MapUtil
.
getValue
(
"parameter"
,
data
);
Long
startTime
=
System
.
currentTimeMillis
();
Response
re
=
obj
.
SendRequest
(
data
,
data
.
get
(
"serviceUrl"
).
toString
(),
data
.
get
(
"Request"
).
toString
());
Long
endTime
=
System
.
currentTimeMillis
();
...
...
@@ -88,20 +92,20 @@ public class APITest_tk extends BasicsGM{
//数据回写
//
HashMap<String, Object> ExpectResult=MapUtil.Expect(data);
//
SheetUtils sheet = new SheetUtils("DataAll.xls", "Output");
//
sheet.writeExcel(
//
data.get("NO").toString(),
//
data.get("TCNO").toString() + "_Step" + data.get("Step").toString(),
//
data.get("Description").toString(),
//
parameter.length()>1000?"内容超长。":parameter,
//
JSONObject.fromObject(ExpectResult).toString(),
//
StringUtils.decodeUnicode(re.asString().length()>10000?"内容超长。状态码:"+re.getStatusCode():re.asString()),
//
codeORerrcode,
//
msgORerrmsy,
//
result,
//
time
//
);
HashMap
<
String
,
Object
>
ExpectResult
=
MapUtil
.
Expect
(
data
);
SheetUtils
sheet
=
new
SheetUtils
(
"DataAll.xls"
,
"Output"
);
sheet
.
writeExcel
(
data
.
get
(
"NO"
).
toString
(),
data
.
get
(
"TCNO"
).
toString
()
+
"_Step"
+
data
.
get
(
"Step"
).
toString
(),
data
.
get
(
"Description"
).
toString
(),
parameter
.
length
()>
1000
?
"内容超长。"
:
parameter
,
JSONObject
.
fromObject
(
ExpectResult
).
toString
(),
StringUtils
.
decodeUnicode
(
re
.
asString
().
length
()>
10000
?
"内容超长。状态码:"
+
re
.
getStatusCode
():
re
.
asString
()),
codeORerrcode
,
msgORerrmsy
,
result
,
time
);
if
(
result
.
indexOf
(
"Fail"
)!=-
1
){
...
...
tiku_App/src/makeTestCase/NewMakeTestCases.java
View file @
5d2f4033
...
...
@@ -33,7 +33,7 @@ public class NewMakeTestCases {
public
static
List
<
List
<
String
>>
list_all
=
new
ArrayList
<
List
<
String
>>();
//缺失字段,最后判断是否应该算正向还是反向
public
static
String
CaseKeLiDu
=
null
;
//设置用例颗粒度,2元祖测试为null,其他自行设置3,4,5,6,看参数数量而定
public
static
String
CaseKeLiDu
=
"3"
;
//设置用例颗粒度,2元祖测试为null,其他自行设置3,4,5,6,看参数数量而定
public
static
void
main
(
String
[]
args
)
{
...
...
tiku_App/src/resources/DatabaseSql.xml
View file @
5d2f4033
...
...
@@ -8,9 +8,9 @@
</Database>
<Database
name=
"tk"
>
<sqlurl>
jdbc:mysql://
39.105.124.219:3312/
tiku?useUnicode=true
&
characterEncoding=UTF-8
&
zeroDateTimeBehavior=convertToNull
</sqlurl>
<sqlname>
testTest
</sqlname>
<sqlpwd>
7b467efW#$%f5c50aa3d
</sqlpwd>
<sqlurl>
jdbc:mysql://
rm-2zevlk47ul0ovuci80o.mysql.rds.aliyuncs.com:3306/pre_
tiku?useUnicode=true
&
characterEncoding=UTF-8
&
zeroDateTimeBehavior=convertToNull
</sqlurl>
<sqlname>
pre_tiku
</sqlname>
<sqlpwd>
ufNie8h9ywWCfewcXqyOQsaDf8TEJH
</sqlpwd>
</Database>
<Database
name=
"nwn"
>
...
...
tiku_App/src/resources/case.txt
View file @
5d2f4033
title:code
content:"详情"
type:"1"
url:"www.baidu.com"
id:"150"
push_type:"1"
push_token:"push_token"
appid:"tiku"
title:"1","2","3","4"
content:"1","2","3","4"
type:"1","2","3","4"
tiku_App/src/resources/caseOut.txt
View file @
5d2f4033
title content type url id push_type push_token appid
code "详情" "1" "www.baidu.com" "150" "1" "push_token" "tiku"
title content type
"3" "2" "3"
"2" "1" "3"
"4" "1" "3"
"2" "4" "4"
"2" "2" "3"
"1" "4" "4"
"2" "4" "1"
"1" "3" "2"
"1" "3" "3"
"1" "2" "3"
"3" "2" "2"
"3" "3" "1"
"3" "4" "4"
"3" "4" "2"
"1" "1" "4"
"2" "3" "4"
"4" "1" "2"
"3" "4" "1"
"4" "2" "1"
"1" "4" "1"
"4" "4" "3"
"4" "3" "3"
"4" "2" "3"
"3" "2" "4"
"2" "3" "2"
"3" "3" "4"
"2" "1" "1"
"4" "4" "2"
"3" "2" "1"
"4" "4" "1"
"4" "3" "4"
"2" "2" "4"
"1" "1" "2"
"3" "1" "3"
"1" "1" "3"
"3" "1" "2"
"4" "3" "1"
"1" "2" "2"
"4" "1" "1"
"3" "4" "3"
"2" "3" "3"
"3" "1" "1"
"4" "2" "4"
"3" "1" "4"
"1" "2" "4"
"4" "2" "2"
"4" "3" "2"
"1" "2" "1"
"1" "4" "3"
"2" "1" "4"
"4" "4" "4"
"4" "1" "4"
"2" "3" "1"
"3" "3" "3"
"2" "4" "3"
"2" "1" "2"
"2" "2" "1"
"1" "3" "1"
"1" "4" "2"
"1" "3" "4"
"3" "3" "2"
"1" "1" "1"
"2" "2" "2"
"2" "4" "2"
tiku_App/src/resources/system.xml
View file @
5d2f4033
...
...
@@ -33,13 +33,13 @@
<sqlpwd>
EDCdd22LLZBCADF123
</sqlpwd>
</system>
<system
name=
"tk"
>
<!-- 题库 -->
<system
name=
"tk"
>
<!-- 题库
http://test.tiku.eoffcn.com
-->
<access_token_uri>
http://106.75.5.205:8082/uaa/oauth/token
</access_token_uri>
<client_id>
bestbuy-acceptance
</client_id>
<client_secret>
bestbuy-acceptance
</client_secret>
<grant_type>
client_credentials
</grant_type>
<isProduct>
false
</isProduct>
<RM_URI>
http://t
est.tiku
.eoffcn.com
</RM_URI>
<RM_URI>
http://t
iku.t
.eoffcn.com
</RM_URI>
<RM_port></RM_port>
<RM_basePath></RM_basePath>
<redis_URI>
10.10.229.48
</redis_URI>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment