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
3871941c
Commit
3871941c
authored
Apr 18, 2019
by
wff66504
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
解决冲突
parent
a8444c18
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
26 deletions
+45
-26
APITest_tk.java
tiku_App/src/com/offcn/test/APITest_tk.java
+20
-20
system.xml
tiku_App/src/resources/system.xml
+25
-6
No files found.
tiku_App/src/com/offcn/test/APITest_tk.java
View file @
3871941c
...
...
@@ -31,12 +31,12 @@ import org.testng.annotations.BeforeClass;
import
org.testng.annotations.Listeners
;
import
org.testng.annotations.Test
;
@Listeners
({
SkipIInvokedMethodListener
.
class
,
MyTestListener
.
class
})
//
//
@Listeners({ SkipIInvokedMethodListener.class,MyTestListener.class})//
public
class
APITest_tk
extends
BasicsGM
{
@Test
(
dataProvider
=
"renmai"
,
dataProviderClass
=
offcn_api_testData
.
class
)
public
void
f
(
HashMap
<
String
,
Object
>
data
)
{
System
.
gc
();
Log
.
logInfo
(
data
.
get
(
"serviceUrl"
).
toString
()
+
data
.
get
(
"Description"
).
toString
()
+
" is running......"
);
Reflect_api
Reflect
=
new
Reflect_api
();
...
...
@@ -53,21 +53,21 @@ 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
();
String
time
=(
endTime
-
startTime
)+
"毫秒"
;
String
body
=
re
.
asString
()
;
String
body
=
""
;
String
codeORerrcode
=
""
;
String
msgORerrmsy
=
""
;
String
result
=
""
;
if
(
re
!=
null
){
body
=
re
.
asString
();
if
(
body
.
contains
(
"<html
>
"
)){
if
(
body
.
contains
(
"<html"
)){
body
=
"返回html页面,状态码:"
+
re
.
getStatusCode
();
if
(
body
.
contains
(
"<title>"
)){
int
Alength
=
"<title>"
.
length
();
...
...
@@ -92,21 +92,21 @@ 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
){
String
Expect1
=
data
.
get
(
"code"
)==
null
?
""
:
data
.
get
(
"code"
).
toString
();
...
...
tiku_App/src/resources/system.xml
View file @
3871941c
...
...
@@ -49,22 +49,40 @@
<sqlpwd>
ufNie8h9ywWCfewcXqyOQsaDf8TEJH
</sqlpwd>
</system>
<system
name=
"
tknewApp"
>
<!-- 题库新接口
-->
<system
name=
"
htym"
>
<!--题库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://
tiku.
t.eoffcn.com
</RM_URI>
<RM_URI>
http://
zgadmin.tes
t.eoffcn.com
</RM_URI>
<RM_port></RM_port>
<RM_basePath></RM_basePath>
<redis_URI>
10.10.229.48
</redis_URI>
<redis_db_index>
5
</redis_db_index>
<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
/tiku?useUnicode=true
&
characterEncoding=UTF-8
&
zeroDateTimeBehavior=convertToNull
</sqlurl>
<sqlname>
pre_tiku
</sqlname>
<sqlpwd>
ufNie8h9ywWCfewcXqyOQsaDf8TEJH
</sqlpwd>
</system>
<system
name=
"ht"
>
<!-- 后台 -->
<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://tiku-admin.t.eoffcn.com
</RM_URI>
<RM_port></RM_port>
<RM_basePath></RM_basePath>
<redis_URI>
10.10.229.48
</redis_URI>
<redis_db_index>
5
</redis_db_index>
<sqlurl>
jdbc:mysql://39.105.124.219:3312/nwn?useUnicode=true
&
characterEncoding=UTF-8
&
zeroDateTimeBehavior=convertToNull
</sqlurl>
<sqlname>
nwnBeta
</sqlname>
<sqlpwd>
Beta@
&
123
</sqlpwd>
</system>
<system
name=
"nwn"
>
<!-- nwn -->
<access_token_uri>
http://106.75.5.205:8082/uaa/oauth/token
</access_token_uri>
<client_id>
bestbuy-acceptance
</client_id>
...
...
@@ -115,4 +133,4 @@
</systems>
</systems>
\ No newline at end of file
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