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
6e2dcb51
Commit
6e2dcb51
authored
May 14, 2019
by
Li Yongyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update requestdatautiles
parent
be44ce1c
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
293 additions
and
222 deletions
+293
-222
DataAll.xls
tiku_App/TestData/DataAll.xls
+0
-0
RequestDataUtils.java
tiku_App/src/com/offcn/TestUnti/RequestDataUtils.java
+187
-104
uploadImg.java
tiku_App/src/com/offcn/api/nwn/uploadImg.java
+6
-0
BasicsGM.java
tiku_App/src/com/offcn/process/BasicsGM.java
+1
-0
NWN.java
tiku_App/src/com/offcn/process/NWN.java
+13
-11
TK.java
tiku_App/src/com/offcn/process/TK.java
+0
-2
MyRequest.java
tiku_App/src/com/offcn/system/MyRequest.java
+14
-5
APITest_tk.java
tiku_App/src/com/offcn/test/APITest_tk.java
+15
-18
ReadProperties.java
tiku_App/src/test/ReadProperties.java
+57
-0
maxiao.java
tiku_App/src/test/maxiao.java
+0
-82
No files found.
tiku_App/TestData/DataAll.xls
View file @
6e2dcb51
No preview for this file type
tiku_App/src/com/offcn/TestUnti/RequestDataUtils.java
View file @
6e2dcb51
...
@@ -18,7 +18,6 @@ import java.util.HashMap;
...
@@ -18,7 +18,6 @@ import java.util.HashMap;
import
java.util.Map
;
import
java.util.Map
;
import
com.offcn.process.BasicsGM
;
import
com.offcn.process.BasicsGM
;
import
com.offcn.process.XYZB
;
import
com.offcn.system.MyRequest
;
import
com.offcn.system.MyRequest
;
import
com.offcn.system.system
;
import
com.offcn.system.system
;
...
@@ -48,8 +47,8 @@ public class RequestDataUtils {
...
@@ -48,8 +47,8 @@ public class RequestDataUtils {
}
}
// RestAssured.config = ra.config().connectionConfig(RestAssured.config().getConnectionConfig().closeIdleConnectionsAfterEachResponse());
// RestAssured.config = ra.config().connectionConfig(RestAssured.config().getConnectionConfig().closeIdleConnectionsAfterEachResponse());
}
}
//
ra
.config = RestAssured.config().redirect(RedirectConfig.redirectConfig().followRedirects(false));
//
RestAssured
.config = RestAssured.config().redirect(RedirectConfig.redirectConfig().followRedirects(false));
RestAssured
.
config
=
RestAssured
.
config
().
encoderConfig
(
EncoderConfig
.
encoderConfig
().
encodeContentTypeAs
(
"x-www-form-urlencoded"
,
ContentType
.
ANY
).
defaultContentCharset
(
"utf-8"
));
//
RestAssured.config = RestAssured.config().encoderConfig(EncoderConfig.encoderConfig().encodeContentTypeAs("x-www-form-urlencoded", ContentType.ANY).defaultContentCharset("utf-8"));
return
ra
;
return
ra
;
}
}
...
@@ -69,35 +68,31 @@ public class RequestDataUtils {
...
@@ -69,35 +68,31 @@ public class RequestDataUtils {
}
}
public
static
Response
PostAll
(
HashMap
<
String
,
Object
>
data
,
MyRequest
myRequest
){
public
static
Response
PostAll
(
HashMap
<
String
,
Object
>
data
,
MyRequest
myRequest
){
if
(
myRequest
.
getFormParameter
()!=
null
){
if
(
myRequest
.
getFile
()!=
null
){
if
(
myRequest
.
getFile
()!=
null
){
return
Post_file
(
data
,
myRequest
);
return
Post_file
(
data
,
myRequest
);
}
else
{
}
if
(
myRequest
.
getFormParameter
()!=
null
){
return
Post_form_data
(
data
,
myRequest
);
return
Post_form_data
(
data
,
myRequest
);
}
}
}
else
if
(
myRequest
.
getParameter
()!=
null
){
return
Post_JSON
(
data
,
myRequest
);
return
Post_JSON
(
data
,
myRequest
);
}
}
return
Post
(
data
,
myRequest
);
}
public
static
RequestSpecification
jobApi
(
HashMap
<
String
,
Object
>
data
,
MyRequest
myRequest
){
public
static
RequestSpecification
jobApi
(
HashMap
<
String
,
Object
>
data
,
MyRequest
myRequest
){
String
Parameter
=
(
String
)
data
.
get
(
"parameter"
);
String
Parameter
=
(
String
)
data
.
get
(
"parameter"
);
String
system
=
MapUtil
.
getValue
(
"system"
,
data
);
String
system
=
MapUtil
.
getValue
(
"system"
,
data
);
system
=
replaceString
(
system
);
system
=
replaceString
(
system
);
com
.
offcn
.
system
.
system
tem
=
(
com
.
offcn
.
system
.
system
)
(
BasicsGM
.
map
.
get
(
system
));
com
.
offcn
.
system
.
system
tem
=
(
com
.
offcn
.
system
.
system
)
(
BasicsGM
.
map
.
get
(
system
));
String
path
=
""
;
RequestDataUtils
rdu
=
new
RequestDataUtils
();
RequestDataUtils
rdu
=
new
RequestDataUtils
();
String
path
=
""
;
if
(
myRequest
.
getUrl
().
startsWith
(
"http://"
)){
if
(
myRequest
.
getUrl
().
startsWith
(
"http://"
)){
tem
=
null
;
tem
=
null
;
path
=
myRequest
.
getUrl
();
}
else
{
}
else
{
path
=
tem
.
getRM_URI
()+(
tem
.
getRM_port
().
equals
(
""
)?
""
:
":"
+
tem
.
getRM_port
())+
tem
.
getRM_basePath
()+
myRequest
.
getUrl
();
path
=
tem
.
getRM_URI
()+(
tem
.
getRM_port
().
equals
(
""
)?
""
:
":"
+
tem
.
getRM_port
())+
tem
.
getRM_basePath
()+
myRequest
.
getUrl
();
}
}
@SuppressWarnings
(
"static-access"
)
@SuppressWarnings
(
"static-access"
)
RequestSpecification
rsf
=
rdu
.
getRMEnv
(
tem
).
given
();
RequestSpecification
rsf
=
rdu
.
getRMEnv
(
tem
).
given
();
if
(
myRequest
.
getFormParameter
()!=
null
){
if
(
myRequest
.
getFormParameter
()!=
null
){
Log
.
logInfo
(
data
.
get
(
"Description"
).
toString
()
+
","
+
data
.
get
(
"TCNO"
).
toString
()+
","
+
path
+
",FormParameter="
+
myRequest
.
getFormParameter
());
Log
.
logInfo
(
data
.
get
(
"Description"
).
toString
()
+
","
+
data
.
get
(
"TCNO"
).
toString
()+
","
+
path
+
",FormParameter="
+
myRequest
.
getFormParameter
());
}
else
{
}
else
{
...
@@ -115,6 +110,7 @@ public class RequestDataUtils {
...
@@ -115,6 +110,7 @@ public class RequestDataUtils {
}
}
public
static
Response
Post_file
(
HashMap
<
String
,
Object
>
data
,
MyRequest
myRequest
)
{
public
static
Response
Post_file
(
HashMap
<
String
,
Object
>
data
,
MyRequest
myRequest
)
{
String
Parameter
=
(
String
)
data
.
get
(
"parameter"
);
int
state
=
0
;
int
state
=
0
;
Response
re
=
null
;
Response
re
=
null
;
while
(
state
<
5
)
{
while
(
state
<
5
)
{
...
@@ -122,7 +118,7 @@ public class RequestDataUtils {
...
@@ -122,7 +118,7 @@ public class RequestDataUtils {
state
++;
state
++;
File
filen
=
new
File
(
"out/"
+
myRequest
.
getFile
());
File
filen
=
new
File
(
"out/"
+
myRequest
.
getFile
());
re
=
jobApi
(
data
,
myRequest
)
re
=
jobApi
(
data
,
myRequest
)
.
params
(
myRequest
.
getFormParameter
()).
when
().
multiPart
(
"image"
,
filen
)
.
body
(
"{"
+
Parameter
+
"}"
).
when
().
multiPart
(
myRequest
.
getFileType
()
,
filen
)
.
post
(
myRequest
.
getUrl
()).
thenReturn
();
.
post
(
myRequest
.
getUrl
()).
thenReturn
();
if
(!
"200"
.
equals
(
re
.
getStatusCode
()+
""
))
{
if
(!
"200"
.
equals
(
re
.
getStatusCode
()+
""
))
{
Log
.
logError
(
"请求返回:"
+
re
.
getStatusCode
()+
",第"
+
state
+
"次。"
);
Log
.
logError
(
"请求返回:"
+
re
.
getStatusCode
()+
",第"
+
state
+
"次。"
);
...
@@ -136,6 +132,30 @@ public class RequestDataUtils {
...
@@ -136,6 +132,30 @@ public class RequestDataUtils {
}
}
return
re
;
return
re
;
}
}
//反射
public
static
Response
Get_houtai
(
HashMap
<
String
,
Object
>
data
,
MyRequest
myRequest
)
{
//设置参数格式
String
parameter
=
(
String
)
data
.
get
(
"parameter"
);
int
state
=
0
;
Response
re
=
null
;
while
(
state
<
3
){
try
{
state
++;
re
=
jobApi
(
data
,
myRequest
).
config
(
RestAssured
.
config
().
redirect
(
RedirectConfig
.
redirectConfig
().
followRedirects
(
false
)))
.
get
(
myRequest
.
getUrl
()).
thenReturn
();
if
(!
"307"
.
equals
(
re
.
statusCode
()+
""
)){
Log
.
logError
(
"请求返回"
+
re
.
statusCode
()+
"次。"
);
}
else
{
return
re
;
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
Log
.
logError
(
"请求超时,"
+
state
+
"次。"
);
}
}
return
re
;
}
public
static
Response
Post_form_data
(
HashMap
<
String
,
Object
>
data
,
MyRequest
myRequest
)
{
public
static
Response
Post_form_data
(
HashMap
<
String
,
Object
>
data
,
MyRequest
myRequest
)
{
// 设置参数格式
// 设置参数格式
...
@@ -190,32 +210,6 @@ public class RequestDataUtils {
...
@@ -190,32 +210,6 @@ public class RequestDataUtils {
return
re
;
return
re
;
}
}
public
static
Response
Post
(
HashMap
<
String
,
Object
>
data
,
MyRequest
myRequest
)
{
// 设置参数格式
String
Parameter
=
(
String
)
data
.
get
(
"parameter"
);
int
state
=
0
;
Response
re
=
null
;
while
(
state
<
5
)
{
try
{
state
++;
re
=
jobApi
(
data
,
myRequest
)
.
when
()
.
post
(
myRequest
.
getUrl
()).
thenReturn
();
if
(!
"200"
.
equals
(
re
.
getStatusCode
()+
""
))
{
Log
.
logError
(
"请求返回,"
+
re
.
getStatusCode
()
+
"次。"
);
}
else
{
return
re
;
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
Log
.
logError
(
"请求超时,"
+
state
+
"次。"
);
}
}
return
re
;
}
@SuppressWarnings
(
"deprecation"
)
@SuppressWarnings
(
"deprecation"
)
public
static
Response
Put
(
HashMap
<
String
,
Object
>
data
,
MyRequest
myRequest
)
{
public
static
Response
Put
(
HashMap
<
String
,
Object
>
data
,
MyRequest
myRequest
)
{
// 设置参数格式
// 设置参数格式
...
@@ -266,76 +260,24 @@ public class RequestDataUtils {
...
@@ -266,76 +260,24 @@ public class RequestDataUtils {
@SuppressWarnings
(
"static-access"
)
@SuppressWarnings
(
"static-access"
)
public
static
Response
Get
(
HashMap
<
String
,
Object
>
data
,
MyRequest
myRequest
)
{
public
static
Response
Get
(
HashMap
<
String
,
Object
>
data
,
MyRequest
myRequest
)
{
//设置参数格式
//设置参数格式
String
parameter
=
(
String
)
data
.
get
(
"parameter"
);
String
parameter
=
(
String
)
data
.
get
(
"parameter"
);
int
state
=
0
;
int
state
=
0
;
Response
re
=
null
;
Response
re
=
null
;
while
(
state
<
3
){
while
(
state
<
3
){
try
{
try
{
state
++;
state
++;
// System.out.println(parameter != null);
// System.out.println(!"".equals(parameter));
if
(
parameter
!=
null
&&
!
""
.
equals
(
parameter
))
{
if
(
parameter
!=
null
&&
!
""
.
equals
(
parameter
))
{
re
=
jobApi
(
data
,
myRequest
)
re
=
jobApi
(
data
,
myRequest
)
.
get
(
myRequest
.
getUrl
()
+
"?"
+
parameter
).
thenReturn
();
.
get
(
myRequest
.
getUrl
()
+
"?"
+
parameter
).
thenReturn
();
}
else
{
}
else
{
re
=
jobApi
(
data
,
myRequest
)
re
=
jobApi
(
data
,
myRequest
)
.
get
(
myRequest
.
getUrl
()).
thenReturn
();
.
get
(
myRequest
.
getUrl
()).
thenReturn
();
}
}
if
(!
"200"
.
equals
(
re
.
statusCode
()+
""
)){
if
(!
"200"
.
equals
(
re
.
statusCode
()+
""
)){
Log
.
logError
(
"请求返回"
+
re
.
statusCode
()+
"次。"
);
Log
.
logError
(
"请求返回"
+
re
.
statusCode
()+
"次。"
);
}
else
{
return
re
;
}
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
Log
.
logError
(
"请求超时,"
+
state
+
"次。"
);
}
}
return
re
;
}
public
static
Response
Get_houtai
(
HashMap
<
String
,
Object
>
data
,
MyRequest
myRequest
)
{
//设置参数格式
String
parameter
=
(
String
)
data
.
get
(
"parameter"
);
int
state
=
0
;
Response
re
=
null
;
while
(
state
<
3
){
try
{
state
++;
re
=
jobApi
(
data
,
myRequest
).
config
(
RestAssured
.
config
().
redirect
(
RedirectConfig
.
redirectConfig
().
followRedirects
(
false
)))
.
get
(
myRequest
.
getUrl
()).
thenReturn
();
if
(!
"307"
.
equals
(
re
.
statusCode
()+
""
)){
Log
.
logError
(
"请求返回"
+
re
.
statusCode
()+
"次。"
);
}
else
{
return
re
;
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
Log
.
logError
(
"请求超时,"
+
state
+
"次。"
);
}
}
return
re
;
}
public
static
Response
POST_houtai
(
HashMap
<
String
,
Object
>
data
,
MyRequest
myRequest
)
{
//设置参数格式
String
parameter
=
(
String
)
data
.
get
(
"parameter"
);
int
state
=
0
;
Response
re
=
null
;
while
(
state
<
3
){
try
{
state
++;
re
=
jobApi
(
data
,
myRequest
)
.
post
(
myRequest
.
getUrl
()).
thenReturn
();
if
(!
"307"
.
equals
(
re
.
statusCode
()+
""
)){
Log
.
logError
(
"请求返回"
+
re
.
statusCode
()+
"次。"
);
}
else
{
return
re
;
return
re
;
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
Log
.
logError
(
"请求超时,"
+
state
+
"次。"
);
Log
.
logError
(
"请求超时,"
+
state
+
"次。"
);
...
@@ -344,7 +286,6 @@ public class RequestDataUtils {
...
@@ -344,7 +286,6 @@ public class RequestDataUtils {
return
re
;
return
re
;
}
}
//不带token的post请求
//不带token的post请求
public
static
Response
Post_headers
(
HashMap
<
String
,
Object
>
data
,
String
serviceURL
,
String
zgl_clienttype
)
{
public
static
Response
Post_headers
(
HashMap
<
String
,
Object
>
data
,
String
serviceURL
,
String
zgl_clienttype
)
{
// 设置参数格式
// 设置参数格式
...
@@ -384,7 +325,7 @@ public class RequestDataUtils {
...
@@ -384,7 +325,7 @@ public class RequestDataUtils {
}
}
//不带token的post请求
//不带token的post请求
public
static
Response
Post_NOToken
(
HashMap
<
String
,
Object
>
data
,
String
serviceURL
)
{
/*
public static Response Post_NOToken(HashMap<String, Object> data, String serviceURL) {
// 设置参数格式
// 设置参数格式
String Parameter = (String) data.get("parameter");
String Parameter = (String) data.get("parameter");
...
@@ -447,7 +388,7 @@ public class RequestDataUtils {
...
@@ -447,7 +388,7 @@ public class RequestDataUtils {
}
}
}
}
return re;
return re;
}
}
*/
//不带token的post请求
//不带token的post请求
@SuppressWarnings
(
"static-access"
)
@SuppressWarnings
(
"static-access"
)
...
@@ -710,6 +651,41 @@ public class RequestDataUtils {
...
@@ -710,6 +651,41 @@ public class RequestDataUtils {
return
re
;
return
re
;
}
}
//get无token请求
@SuppressWarnings
(
"static-access"
)
public
static
Response
Get_Notoken
(
HashMap
<
String
,
Object
>
data
,
String
serviceURL
)
{
//设置参数格式
String
parameter
=
MapUtil
.
getParameter
(
data
);
String
system
=
MapUtil
.
getValue
(
"system"
,
data
);
system
=
replaceString
(
system
);
com
.
offcn
.
system
.
system
tem
=(
com
.
offcn
.
system
.
system
)(
BasicsGM
.
map
.
get
(
system
));
parameter
=
parameter
.
substring
(
1
,
parameter
.
length
()-
1
);
Log
.
logInfo
(
data
.
get
(
"Description"
).
toString
()+
","
+
data
.
get
(
"TCNO"
).
toString
()+
",Parameter="
+
parameter
);
int
state
=
0
;
Response
re
=
null
;
RequestDataUtils
rdu
=
new
RequestDataUtils
();
while
(
state
<
5
){
try
{
state
++;
//re = rdu.getRMEnv(tem).given().cookie("laravel_session",XYZB.laravel_session).get(serviceURL).andReturn();
// System.out.println(re.asString());
if
(!
"200"
.
equals
(
re
.
statusCode
()+
""
)){
Log
.
logError
(
"请求返回,"
+
re
.
statusCode
()+
"。"
);
}
else
{
return
re
;
}
}
catch
(
Exception
e
)
{
Log
.
logError
(
"请求超时,"
+
state
+
"次。"
);
}
}
return
re
;
}
//发送get请求返回整个响应结果
//发送get请求返回整个响应结果
@SuppressWarnings
(
"static-access"
)
@SuppressWarnings
(
"static-access"
)
public
static
Response
Get_Noparameter
(
HashMap
<
String
,
Object
>
data
,
public
static
Response
Get_Noparameter
(
HashMap
<
String
,
Object
>
data
,
...
@@ -900,7 +876,7 @@ public class RequestDataUtils {
...
@@ -900,7 +876,7 @@ public class RequestDataUtils {
return
re
;
return
re
;
}
}
//get无token请求
/
*/
/get无token请求
@SuppressWarnings("static-access")
@SuppressWarnings("static-access")
public static Response Get_Notoken(HashMap<String, Object> data,
public static Response Get_Notoken(HashMap<String, Object> data,
String serviceURL) {
String serviceURL) {
...
@@ -934,7 +910,7 @@ public class RequestDataUtils {
...
@@ -934,7 +910,7 @@ public class RequestDataUtils {
}
}
return re;
return re;
}
}
*/
//get无token请求
//get无token请求
@SuppressWarnings
(
"static-access"
)
@SuppressWarnings
(
"static-access"
)
public
static
Response
Get_Notoken_NoCookie
(
HashMap
<
String
,
Object
>
data
,
public
static
Response
Get_Notoken_NoCookie
(
HashMap
<
String
,
Object
>
data
,
...
@@ -972,7 +948,7 @@ public class RequestDataUtils {
...
@@ -972,7 +948,7 @@ public class RequestDataUtils {
return
re
;
return
re
;
}
}
@SuppressWarnings
(
"static-access"
)
/*
@SuppressWarnings("static-access")
public static Response Get_cookie(HashMap<String, Object> data,
public static Response Get_cookie(HashMap<String, Object> data,
String serviceURL) {
String serviceURL) {
//设置参数格式
//设置参数格式
...
@@ -1005,7 +981,7 @@ public class RequestDataUtils {
...
@@ -1005,7 +981,7 @@ public class RequestDataUtils {
}
}
}
}
return re;
return re;
}
}
*/
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
Get_two_cookie
(
null
,
""
,
""
,
""
,
""
,
""
);
Get_two_cookie
(
null
,
""
,
""
,
""
,
""
,
""
);
...
@@ -1024,15 +1000,21 @@ public class RequestDataUtils {
...
@@ -1024,15 +1000,21 @@ public class RequestDataUtils {
String
system
=
MapUtil
.
getValue
(
"system"
,
data
);
system
=
replaceString
(
system
);
String
system
=
MapUtil
.
getValue
(
"system"
,
data
);
system
=
replaceString
(
system
);
com
.
offcn
.
system
.
system
tem
=(
com
.
offcn
.
system
.
system
)(
BasicsGM
.
map
.
get
(
system
));
com
.
offcn
.
system
.
system
tem
=(
com
.
offcn
.
system
.
system
)(
BasicsGM
.
map
.
get
(
system
));
parameter
=
parameter
.
substring
(
1
,
parameter
.
length
()-
1
);
parameter
=
parameter
.
substring
(
1
,
parameter
.
length
()-
1
);
Log
.
logInfo
(
data
.
get
(
"Description"
).
toString
()+
","
+
data
.
get
(
"TCNO"
).
toString
()+
",Parameter="
+
parameter
);
Log
.
logInfo
(
data
.
get
(
"Description"
).
toString
()+
","
+
data
.
get
(
"TCNO"
).
toString
()+
",Parameter="
+
parameter
);
int
state
=
0
;
int
state
=
0
;
Response
re
=
null
;
Response
re
=
null
;
RequestDataUtils
rdu
=
new
RequestDataUtils
();
RequestDataUtils
rdu
=
new
RequestDataUtils
();
System
.
out
.
println
(
tem
.
getRM_URI
()+
tem
.
getRM_port
()+
tem
.
getRM_basePath
()+
serviceURL
);
String
path
=
""
;
if
(
serviceURL
.
startsWith
(
"http://"
)){
tem
=
null
;
path
=
serviceURL
;
}
else
{
path
=
tem
.
getRM_URI
()+(
tem
.
getRM_port
().
equals
(
""
)?
""
:
":"
+
tem
.
getRM_port
())+
tem
.
getRM_basePath
()+
serviceURL
;
}
Log
.
logInfo
(
path
);
while
(
state
<
5
){
while
(
state
<
5
){
try
{
try
{
state
++;
state
++;
...
@@ -1261,6 +1243,107 @@ public class RequestDataUtils {
...
@@ -1261,6 +1243,107 @@ public class RequestDataUtils {
}
}
return
re
;
return
re
;
}
}
//不带token的post请求
public
static
Response
Post_NOToken
(
HashMap
<
String
,
Object
>
data
,
String
serviceURL
)
{
// 设置参数格式
String
Parameter
=
(
String
)
data
.
get
(
"parameter"
);
String
system
=
MapUtil
.
getValue
(
"system"
,
data
);
system
=
replaceString
(
system
);
com
.
offcn
.
system
.
system
tem
=
(
com
.
offcn
.
system
.
system
)
(
BasicsGM
.
map
.
get
(
system
));
Log
.
logInfo
(
data
.
get
(
"Description"
).
toString
()
+
","
+
data
.
get
(
"TCNO"
).
toString
()
+
",Parameter="
+
Parameter
);
int
state
=
0
;
Response
re
=
null
;
RequestDataUtils
rdu
=
new
RequestDataUtils
();
while
(
state
<
5
)
{
try
{
state
++;
if
(
"/web/member"
.
equals
(
serviceURL
)){
// Cookie cookie1 = Cookie.Builder("username", "John").setComment("comment 1").build();
// Cookie cookie2 = Cookie.Builder("token", 1234).setComment("comment 2").build();
// Cookies cookies = new Cookies(cookie1, cookie2);
re
=
rdu
.
getRMEnv
(
tem
).
given
()
// .header("laravel_session", XYZB.laravel_session)
// .header("XSRF-TOKEN", XYZB.XSRF_token)
// .cookie("laravel_session", XYZB.laravel_session)
// .cookie("XSRF-TOKEN", XYZB.XSRF_token)
.
contentType
(
JSON
).
body
(
"{"
+
Parameter
+
"}"
).
when
()
.
post
(
serviceURL
).
thenReturn
();
// System.out.println(re.getStatusCode()+"............................");
// System.out.println(re.asString());
// Headers headers=re.getHeaders();
// System.out.println(headers.toString());
// System.out.println(re.getSessionId());
// JsonPath jp = re.body().jsonPath();
if
(!
"200"
.
equals
(
re
.
getStatusCode
()+
""
))
{
Log
.
logError
(
"请求返回:"
+
re
.
getStatusCode
()+
",第"
+
state
+
"次。"
);
Thread
.
sleep
(
1000
);
}
else
{
return
re
;
}
}
else
{
re
=
rdu
.
getRMEnv
(
tem
).
given
()
// .header("laravel_session", XYZB.laravel_session)
// .cookie("laravel_session", XYZB.laravel_session)
.
contentType
(
JSON
).
body
(
"{"
+
Parameter
+
"}"
).
when
()
.
post
(
serviceURL
).
thenReturn
();
// System.out.println(re.getStatusCode()+"............................");
// System.out.println(re.asString());
JsonPath
jp
=
re
.
body
().
jsonPath
();
if
(
"500"
.
equals
(
jp
.
getString
(
"status"
)))
{
Log
.
logError
(
"请求返回500,"
+
state
+
"次。"
);
Thread
.
sleep
(
1000
);
}
else
{
return
re
;
}
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
Log
.
logError
(
"请求超时,"
+
state
+
"次。"
);
}
}
return
re
;
}
@SuppressWarnings
(
"static-access"
)
public
static
Response
Get_cookie
(
HashMap
<
String
,
Object
>
data
,
String
serviceURL
)
{
//设置参数格式
String
parameter
=
MapUtil
.
getParameter
(
data
);
String
system
=
MapUtil
.
getValue
(
"system"
,
data
);
system
=
replaceString
(
system
);
com
.
offcn
.
system
.
system
tem
=(
com
.
offcn
.
system
.
system
)(
BasicsGM
.
map
.
get
(
system
));
parameter
=
parameter
.
substring
(
1
,
parameter
.
length
()-
1
);
Log
.
logInfo
(
data
.
get
(
"Description"
).
toString
()+
","
+
data
.
get
(
"TCNO"
).
toString
()+
",Parameter="
+
parameter
);
int
state
=
0
;
Response
re
=
null
;
RequestDataUtils
rdu
=
new
RequestDataUtils
();
while
(
state
<
5
){
try
{
state
++;
re
=
rdu
.
getRMEnv
(
tem
).
given
()
// .cookie("laravel_session",XYZB.laravel_session)
// .cookie("XSRF-TOKEN", XYZB.XSRF_token)
.
get
(
serviceURL
).
andReturn
();
if
(!
"200"
.
equals
(
re
.
statusCode
()+
""
)){
Log
.
logError
(
"请求返回,"
+
re
.
statusCode
()+
"。"
);
}
else
{
return
re
;
}
}
catch
(
Exception
e
)
{
Log
.
logError
(
"请求超时,"
+
state
+
"次。"
);
}
}
return
re
;
}
public
static
String
replaceString
(
String
SystemName
){
public
static
String
replaceString
(
String
SystemName
){
if
(
SystemName
.
contains
(
"_"
)){
if
(
SystemName
.
contains
(
"_"
)){
SystemName
=
SystemName
.
split
(
"_"
)[
0
];
SystemName
=
SystemName
.
split
(
"_"
)[
0
];
...
...
tiku_App/src/com/offcn/api/nwn/uploadImg.java
View file @
6e2dcb51
...
@@ -9,6 +9,7 @@ import java.sql.Statement;
...
@@ -9,6 +9,7 @@ import java.sql.Statement;
import
java.text.SimpleDateFormat
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.Random
;
import
java.util.Random
;
import
org.json.simple.JSONArray
;
import
org.json.simple.JSONArray
;
...
@@ -20,6 +21,7 @@ import com.offcn.TestUnti.StringUtils;
...
@@ -20,6 +21,7 @@ import com.offcn.TestUnti.StringUtils;
import
com.offcn.interfaces.API
;
import
com.offcn.interfaces.API
;
import
com.offcn.process.NWN
;
import
com.offcn.process.NWN
;
import
com.offcn.process.TK
;
import
com.offcn.process.TK
;
import
com.offcn.system.MyRequest
;
import
com.offcn.TestUnti.ListUtil
;
import
com.offcn.TestUnti.ListUtil
;
import
net.sf.json.JSONObject
;
import
net.sf.json.JSONObject
;
...
@@ -60,6 +62,10 @@ public class uploadImg extends NWN implements API {
...
@@ -60,6 +62,10 @@ public class uploadImg extends NWN implements API {
public
Response
SendRequest
(
HashMap
<
String
,
Object
>
data
,
String
Url
,
public
Response
SendRequest
(
HashMap
<
String
,
Object
>
data
,
String
Url
,
String
Request
)
{
String
Request
)
{
Response
re
=
RequestDataUtils
.
Post_file
(
data
,
Url
,
"PHPSESSID"
,
PHPSESSID
,
"img"
,
"1.png"
);
Response
re
=
RequestDataUtils
.
Post_file
(
data
,
Url
,
"PHPSESSID"
,
PHPSESSID
,
"img"
,
"1.png"
);
// Response re = RequestDataUtils.POST_houtai(data,myRequest);
return
re
;
return
re
;
}
}
...
...
tiku_App/src/com/offcn/process/BasicsGM.java
View file @
6e2dcb51
...
@@ -269,6 +269,7 @@ public class BasicsGM {
...
@@ -269,6 +269,7 @@ public class BasicsGM {
try
{
try
{
String
errmsg
=
JSONObject
.
fromObject
(
re
.
body
().
asString
()).
getString
(
"errmsg"
);
String
errmsg
=
JSONObject
.
fromObject
(
re
.
body
().
asString
()).
getString
(
"errmsg"
);
if
(
StringIsNull
(
errmsg
)){
if
(
StringIsNull
(
errmsg
)){
return
errmsg
;
return
errmsg
;
}
}
...
...
tiku_App/src/com/offcn/process/NWN.java
View file @
6e2dcb51
...
@@ -46,6 +46,10 @@ public class NWN extends BasicsGM{
...
@@ -46,6 +46,10 @@ public class NWN extends BasicsGM{
public
static
String
level_id_List
=
""
;
//层级的id
public
static
String
level_id_List
=
""
;
//层级的id
public
static
List
<
String
>
user_id_List
=
new
ArrayList
<
String
>();
//user_id
public
static
List
<
String
>
user_id_List
=
new
ArrayList
<
String
>();
//user_id
public
NWN
(){
Connectionsa
();
}
public
void
Connectionsa
(){
public
void
Connectionsa
(){
//================设置数据库连接池=====================
//================设置数据库连接池=====================
ConnectionsMap
=
getConnections
(
new
String
[]{
"nwn"
});
ConnectionsMap
=
getConnections
(
new
String
[]{
"nwn"
});
...
@@ -57,9 +61,7 @@ public class NWN extends BasicsGM{
...
@@ -57,9 +61,7 @@ public class NWN extends BasicsGM{
// DynamicParameter.put("sign","code");//动态公共参数
// DynamicParameter.put("sign","code");//动态公共参数
}
}
public
NWN
(){
Connectionsa
();
}
//动态公共参数
//动态公共参数
public
HashMap
<
String
,
Object
>
setDynamicParameter
(
HashMap
<
String
,
Object
>
data
)
{
public
HashMap
<
String
,
Object
>
setDynamicParameter
(
HashMap
<
String
,
Object
>
data
)
{
...
@@ -78,15 +80,15 @@ public class NWN extends BasicsGM{
...
@@ -78,15 +80,15 @@ public class NWN extends BasicsGM{
if
(!
parameter
.
contains
(
"\""
+
key
+
"\""
)
&&
!
parameter
.
contains
(
key
+
"="
)){
if
(!
parameter
.
contains
(
"\""
+
key
+
"\""
)
&&
!
parameter
.
contains
(
key
+
"="
)){
if
(
"get"
.
equals
(
Request
)){
if
(
"get"
.
equals
(
Request
)){
if
(
parameter
==
null
||
parameter
.
length
()==
0
){
if
(
parameter
==
null
||
parameter
.
length
()==
0
){
parameter
=
key
+
"="
+
"
ppp"
;
parameter
=
key
+
"="
+
"
value"
;
//value 需要自己写
}
else
{
}
else
{
parameter
=
parameter
+
"&"
+
key
+
"="
+
"
ppp"
;
parameter
=
parameter
+
"&"
+
key
+
"="
+
"
value"
;
//value 需要自己写
}
}
}
else
{
}
else
{
if
(
parameter
==
null
||
parameter
.
length
()==
0
){
if
(
parameter
==
null
||
parameter
.
length
()==
0
){
parameter
=
key
+
"\":\""
+
"
ppp"
+
"\""
;
parameter
=
key
+
"\":\""
+
"
value"
+
"\""
;
//value 需要自己写
}
else
{
}
else
{
parameter
=
parameter
+
",\""
+
key
+
"\":\""
+
"
ppp"
+
"\""
;
parameter
=
parameter
+
",\""
+
key
+
"\":\""
+
"
value"
+
"\""
;
//value 需要自己写
}
}
}
}
}
}
...
@@ -114,15 +116,15 @@ public class NWN extends BasicsGM{
...
@@ -114,15 +116,15 @@ public class NWN extends BasicsGM{
if
(!
parameter
.
contains
(
"\""
+
key
+
"\""
)
&&
!
parameter
.
contains
(
key
+
"="
)){
if
(!
parameter
.
contains
(
"\""
+
key
+
"\""
)
&&
!
parameter
.
contains
(
key
+
"="
)){
if
(
"get"
.
equals
(
Request
)){
if
(
"get"
.
equals
(
Request
)){
if
(
parameter
==
null
||
parameter
.
length
()==
0
){
if
(
parameter
==
null
||
parameter
.
length
()==
0
){
parameter
=
key
+
"="
+
value
;
parameter
=
key
+
"="
+
value
;
//value 需要自己写
}
else
{
}
else
{
parameter
=
parameter
+
"&"
+
key
+
"="
+
value
;
parameter
=
parameter
+
"&"
+
key
+
"="
+
value
;
//value 需要自己写
}
}
}
else
{
}
else
{
if
(
parameter
==
null
||
parameter
.
length
()==
0
){
if
(
parameter
==
null
||
parameter
.
length
()==
0
){
parameter
=
key
+
"\":\""
+
value
+
"\""
;
parameter
=
key
+
"\":\""
+
value
+
"\""
;
//value 需要自己写
}
else
{
}
else
{
parameter
=
parameter
+
",\""
+
key
+
"\":\""
+
value
+
"\""
;
parameter
=
parameter
+
",\""
+
key
+
"\":\""
+
value
+
"\""
;
//value 需要自己写
}
}
}
}
}
}
...
...
tiku_App/src/com/offcn/process/TK.java
View file @
6e2dcb51
...
@@ -52,8 +52,6 @@ public class TK extends BasicsGM{
...
@@ -52,8 +52,6 @@ public class TK extends BasicsGM{
public
static
String
is_hf_L
=
""
;
//47
public
static
String
is_hf_L
=
""
;
//47
public
static
String
type_L
=
""
;
//47
public
static
String
type_L
=
""
;
//47
public
static
String
recordId_L
=
""
;
//110申论,使用记录id 提交做题记录时需要用到
public
static
String
recordId_L
=
""
;
//110申论,使用记录id 提交做题记录时需要用到
public
static
String
admin_login_ssid
=
""
;
//后台登录cookie
public
static
String
admin_login_ssid
=
""
;
//后台登录cookie
public
static
String
admin_28_encode
=
""
;
//后台登录cookie
public
static
String
admin_28_encode
=
""
;
//后台登录cookie
public
static
String
PHPSESSID
=
""
;
//Cookie,后台第77个接口使用
public
static
String
PHPSESSID
=
""
;
//Cookie,后台第77个接口使用
...
...
tiku_App/src/com/offcn/system/MyRequest.java
View file @
6e2dcb51
...
@@ -7,10 +7,11 @@ public class MyRequest {
...
@@ -7,10 +7,11 @@ public class MyRequest {
private
String
Request
;
private
String
Request
;
private
String
Url
;
private
String
Url
;
private
Map
<
String
,
String
>
Cookies
;
private
Map
<
String
,
String
>
Cookies
;
private
Map
<
String
,
String
>
h
eaders
;
private
Map
<
String
,
String
>
H
eaders
;
private
String
Parameter
;
//json请求方式的参数
private
String
Parameter
;
//json请求方式的参数
private
Map
<
String
,
String
>
formParameter
;
//form_data请求方式的参数、或file请求方式的参数
private
Map
<
String
,
String
>
formParameter
;
//form_data请求方式的参数、或file请求方式的参数
private
String
file
;
private
String
file
;
private
String
fileType
;
public
String
getRequest
()
{
public
String
getRequest
()
{
return
Request
;
return
Request
;
}
}
...
@@ -30,10 +31,10 @@ public class MyRequest {
...
@@ -30,10 +31,10 @@ public class MyRequest {
Cookies
=
cookies
;
Cookies
=
cookies
;
}
}
public
Map
<
String
,
String
>
getHeaders
()
{
public
Map
<
String
,
String
>
getHeaders
()
{
return
h
eaders
;
return
H
eaders
;
}
}
public
void
setHeaders
(
Map
<
String
,
String
>
headers
)
{
public
void
setHeaders
(
Map
<
String
,
String
>
headers
)
{
this
.
h
eaders
=
headers
;
H
eaders
=
headers
;
}
}
public
String
getParameter
()
{
public
String
getParameter
()
{
return
Parameter
;
return
Parameter
;
...
@@ -53,19 +54,27 @@ public class MyRequest {
...
@@ -53,19 +54,27 @@ public class MyRequest {
public
void
setFile
(
String
file
)
{
public
void
setFile
(
String
file
)
{
this
.
file
=
file
;
this
.
file
=
file
;
}
}
public
String
getFileType
()
{
return
fileType
;
}
public
void
setFileType
(
String
fileType
)
{
this
.
fileType
=
fileType
;
}
public
MyRequest
(
String
request
,
String
url
,
Map
<
String
,
String
>
cookies
,
public
MyRequest
(
String
request
,
String
url
,
Map
<
String
,
String
>
cookies
,
Map
<
String
,
String
>
headers
,
String
parameter
,
Map
<
String
,
String
>
headers
,
String
parameter
,
Map
<
String
,
String
>
formParameter
,
String
file
)
{
Map
<
String
,
String
>
formParameter
,
String
file
,
String
fileType
)
{
super
();
super
();
Request
=
request
;
Request
=
request
;
Url
=
url
;
Url
=
url
;
Cookies
=
cookies
;
Cookies
=
cookies
;
this
.
h
eaders
=
headers
;
H
eaders
=
headers
;
Parameter
=
parameter
;
Parameter
=
parameter
;
this
.
formParameter
=
formParameter
;
this
.
formParameter
=
formParameter
;
this
.
file
=
file
;
this
.
file
=
file
;
this
.
fileType
=
fileType
;
}
}
public
MyRequest
()
{
public
MyRequest
()
{
}
}
}
}
tiku_App/src/com/offcn/test/APITest_tk.java
View file @
6e2dcb51
...
@@ -8,12 +8,9 @@ import java.util.Iterator;
...
@@ -8,12 +8,9 @@ import java.util.Iterator;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.Set
;
import
java.util.Set
;
import
java.util.Map.Entry
;
import
java.util.Map.Entry
;
import
net.sf.json.JSONObject
;
import
net.sf.json.JSONObject
;
import
org.testng.Assert
;
import
org.testng.Assert
;
import
org.testng.annotations.AfterClass
;
import
org.testng.annotations.AfterClass
;
import
com.offcn.TestData.offcn_api_testData
;
import
com.offcn.TestData.offcn_api_testData
;
import
com.offcn.TestUnti.Log
;
import
com.offcn.TestUnti.Log
;
import
com.offcn.TestUnti.MapUtil
;
import
com.offcn.TestUnti.MapUtil
;
...
@@ -91,21 +88,21 @@ public class APITest_tk extends BasicsGM{
...
@@ -91,21 +88,21 @@ public class APITest_tk extends BasicsGM{
//数据回写
//数据回写
//
HashMap<String, Object> ExpectResult=MapUtil.Expect(data);
HashMap
<
String
,
Object
>
ExpectResult
=
MapUtil
.
Expect
(
data
);
//
SheetUtils sheet = new SheetUtils("DataAll.xls", "Output");
SheetUtils
sheet
=
new
SheetUtils
(
"DataAll.xls"
,
"Output"
);
//
sheet.writeExcel(
sheet
.
writeExcel
(
//
data.get("NO").toString(),
data
.
get
(
"NO"
).
toString
(),
//
data.get("TCNO").toString() + "_Step" + data.get("Step").toString(),
data
.
get
(
"TCNO"
).
toString
()
+
"_Step"
+
data
.
get
(
"Step"
).
toString
(),
//
data.get("Description").toString(),
data
.
get
(
"Description"
).
toString
(),
//
parameter.length()>1000?"内容超长。":parameter,
parameter
.
length
()>
1000
?
"内容超长。"
:
parameter
,
//
JSONObject.fromObject(ExpectResult).toString(),
JSONObject
.
fromObject
(
ExpectResult
).
toString
(),
//
StringUtils.decodeUnicode(re.asString().length()>10000?"内容超长。状态码:"+re.getStatusCode():re.asString()),
StringUtils
.
decodeUnicode
(
re
.
asString
().
length
()>
10000
?
"内容超长。状态码:"
+
re
.
getStatusCode
():
re
.
asString
()),
//
codeORerrcode,
codeORerrcode
,
//
msgORerrmsy,
msgORerrmsy
,
//
result,
result
,
//
time
time
//
);
);
//
if
(
result
.
indexOf
(
"Fail"
)!=-
1
){
if
(
result
.
indexOf
(
"Fail"
)!=-
1
){
String
Expect1
=
data
.
get
(
"code"
)==
null
?
""
:
data
.
get
(
"code"
).
toString
();
String
Expect1
=
data
.
get
(
"code"
)==
null
?
""
:
data
.
get
(
"code"
).
toString
();
...
...
tiku_App/src/test/ReadProperties.java
0 → 100644
View file @
6e2dcb51
package
test
;
import
java.io.BufferedInputStream
;
import
java.io.File
;
import
java.io.FileInputStream
;
import
java.io.FileOutputStream
;
import
java.io.FileWriter
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.util.Properties
;
public
class
ReadProperties
{
public
static
void
main
(
String
[]
args
)
{
String
s
=
ReadProperties
.
GetTestPropertyByKey
(
"xls"
);
System
.
out
.
println
(
s
);
// ClearProperty();
// SetProperty("123","111");
}
public
static
String
GetPropertyByKey
(
String
key
)
{
Properties
pps
=
new
Properties
();
try
{
File
directory
=
new
File
(
"."
);
String
sourceFile
=
directory
.
getCanonicalPath
()
+
File
.
separator
+
"src"
+
File
.
separator
+
"resources"
+
File
.
separator
+
"class.properties"
;
InputStream
in
=
new
BufferedInputStream
(
new
FileInputStream
(
sourceFile
));
pps
.
load
(
in
);
String
value
=
pps
.
getProperty
(
key
);
return
value
;
}
catch
(
IOException
e
)
{
return
null
;
}
}
public
static
String
GetTestPropertyByKey
(
String
key
)
{
Properties
pps
=
new
Properties
();
try
{
File
directory
=
new
File
(
"."
);
System
.
out
.
println
(
directory
);
String
sourceFile
=
directory
.
getCanonicalPath
()
+
File
.
separator
+
"src"
+
File
.
separator
+
"resources"
+
File
.
separator
+
"test.properties"
;
InputStream
in
=
new
BufferedInputStream
(
new
FileInputStream
(
sourceFile
));
pps
.
load
(
in
);
String
value
=
pps
.
getProperty
(
key
);
System
.
out
.
println
(
"value===="
+
value
);
return
value
;
}
catch
(
IOException
e
)
{
return
null
;
}
}
}
\ No newline at end of file
tiku_App/src/test/maxiao.java
deleted
100644 → 0
View file @
be44ce1c
package
test
;
import
static
io
.
restassured
.
http
.
ContentType
.
JSON
;
import
java.util.List
;
import
io.restassured.RestAssured
;
import
io.restassured.http.ContentType
;
import
io.restassured.http.Header
;
import
io.restassured.http.Headers
;
import
io.restassured.response.Response
;
public
class
maxiao
implements
Runnable
{
public
String
JSESSIONID
;
public
String
StatusCode
;
public
String
time
;
public
maxiao
(
String
jSESSIONID
)
{
JSESSIONID
=
jSESSIONID
;
}
@Override
public
void
run
()
{
// RestAssured ra_VerifyCode = new RestAssured();
// ra_VerifyCode.baseURI = "http://10.10.197.245";
// ra_VerifyCode.port = 8888;
// ra_VerifyCode.basePath = "/puhui-lend-pre/page/lendRepay/repayList.jsp";
//
// Long start=System.currentTimeMillis();
// Response re2 = ra_VerifyCode.given().given().
// headers("Cookie", JSESSIONID,
// "Referer","http://10.10.197.245:8888/puhui-lend-pre/main",
// "Upgrade-Insecure-Requests","1"
// ).get();
// Long end=System.currentTimeMillis();
//
// time=(end-start)+"";
// System.out.println();
// StatusCode=re2.getStatusCode()+"";
// System.out.println(re2.getBody().asString());
// System.out.print("名称:"+Thread.currentThread().getName()+"状态:"+re2.getStatusCode()+"耗时:"+time+"毫秒");
RestAssured
ra_VerifyCode
=
new
RestAssured
();
ra_VerifyCode
.
baseURI
=
"http://10.10.197.245"
;
ra_VerifyCode
.
port
=
8888
;
ra_VerifyCode
.
basePath
=
"/puhui-lend-pre/lendRepay/list "
;
String
Parameter
=
"{\"billDate\":\"2016-12-25\",\"page\":1,\"rows\":20}"
;
System
.
out
.
println
(
Parameter
);
Long
start
=
System
.
currentTimeMillis
();
Response
re2
=
ra_VerifyCode
.
given
().
given
().
contentType
(
JSON
).
headers
(
"Cookie"
,
"JSESSIONID=17E32712D50602F82C30A29E827343E6"
,
"Referer"
,
" http://10.10.197.245:8888/puhui-lend-pre/page/lendRepay/repayList.jsp"
,
"Origin"
,
"http://10.10.197.245:8888"
).
body
(
Parameter
).
when
().
post
();
Long
end
=
System
.
currentTimeMillis
();
time
=(
end
-
start
)+
""
;
System
.
out
.
println
(
re2
.
getBody
().
asString
());
System
.
out
.
print
(
"名称:"
+
Thread
.
currentThread
().
getName
()+
"状态:"
+
re2
.
getStatusCode
()+
"耗时:"
+
time
+
"毫秒"
);
}
public
static
void
main
(
String
[]
args
)
{
RestAssured
ra_VerifyCode
=
new
RestAssured
();
ra_VerifyCode
.
baseURI
=
"http://10.10.197.245"
;
ra_VerifyCode
.
port
=
8888
;
ra_VerifyCode
.
basePath
=
"/puhui-lend-pre/lendRepay/list"
;
String
Parameter
=
"{\"billDate\":\"2016-12-25\",\"page\":1,\"rows\":20}"
;
System
.
out
.
println
(
Parameter
);
Long
start
=
System
.
currentTimeMillis
();
Response
re2
=
ra_VerifyCode
.
given
().
given
().
contentType
(
ContentType
.
URLENC
).
headers
(
"Cookie"
,
"JSESSIONID=17E32712D50602F82C30A29E827343E6"
,
"Referer"
,
" http://10.10.197.245:8888/puhui-lend-pre/page/lendRepay/repayList.jsp"
,
"Origin"
,
"http://10.10.197.245:8888"
).
body
(
"billDate=2016-12-25&page=1&rows=20"
).
when
().
post
();
Long
end
=
System
.
currentTimeMillis
();
System
.
out
.
println
(
re2
.
getBody
().
asString
());
System
.
out
.
print
(
"名称:"
+
Thread
.
currentThread
().
getName
()+
"状态:"
+
re2
.
getStatusCode
()+
"耗时:毫秒"
);
}
}
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