Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nwn_Api_auto_test
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
nwn_Api_auto_test
Commits
84ac91ce
Commit
84ac91ce
authored
Mar 10, 2021
by
Li Yongyu
Browse files
Options
Browse Files
Download
Plain Diff
Conflicts:
parents
749a7281
e60c0438
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
930 additions
and
939 deletions
+930
-939
.gitignore
nwn_Api_auto_test/.gitignore
+1
-0
codeold.java
nwn_Api_auto_test/src/com/offcn/api/nwn/process/codeold.java
+103
-103
logon.java
nwn_Api_auto_test/src/com/offcn/api/nwn/process/logon.java
+84
-84
programLevel.java
...auto_test/src/com/offcn/api/nwn/process/programLevel.java
+149
-149
returnUserInfo.java
...to_test/src/com/offcn/api/nwn/process/returnUserInfo.java
+115
-115
addTask.java
nwn_Api_auto_test/src/com/offcn/api/nwn/service/addTask.java
+152
-152
programLevel.java
...auto_test/src/com/offcn/api/nwn/service/programLevel.java
+141
-141
add.java
nwn_Api_auto_test/src/com/offcn/api/nwn/shop/add.java
+149
-149
NWN.java
nwn_Api_auto_test/src/com/offcn/process/NWN.java
+2
-4
APITest_nwn.java
nwn_Api_auto_test/src/com/offcn/test/APITest_nwn.java
+30
-42
map.txt
nwn_Api_auto_test/src/resources/map.txt
+4
-0
No files found.
nwn_Api_auto_test/.gitignore
View file @
84ac91ce
...
...
@@ -6,3 +6,4 @@ bin/
log/
testoutput/
test-output/
/测试报告详细资料.zip
nwn_Api_auto_test/src/com/offcn/api/nwn/process/codeold.java
View file @
84ac91ce
package
com
.
offcn
.
api
.
nwn
.
process
;
import
io.restassured.http.Headers
;
import
io.restassured.path.json.JsonPath
;
import
io.restassured.response.Response
;
import
java.io.FileInputStream
;
import
java.io.InputStream
;
import
java.io.UnsupportedEncodingException
;
import
java.sql.ResultSet
;
import
java.sql.SQLException
;
import
java.sql.Statement
;
import
java.util.Arrays
;
import
java.util.HashMap
;
import
java.util.Random
;
import
org.json.simple.JSONArray
;
import
com.offcn.TestUnti.Log
;
import
com.offcn.TestUnti.MapUtil
;
import
com.offcn.TestUnti.ReadProperties
;
import
com.offcn.TestUnti.RequestDataUtils
;
import
com.offcn.TestUnti.StringUtils
;
import
com.offcn.interfaces.API
;
import
com.offcn.process.NWN
;
import
net.sf.json.JSONObject
;
/**
*获取PHPSESSID
*
* @author puhui
*
*/
public
class
codeold
extends
NWN
implements
API
{
@Override
public
void
initialize
(
HashMap
<
String
,
Object
>
data
)
{
}
@Override
public
HashMap
<
String
,
Object
>
handleInput
(
HashMap
<
String
,
Object
>
data
)
{
return
data
;
}
@Override
public
Response
SendRequest
(
HashMap
<
String
,
Object
>
data
,
String
Url
,
String
Request
)
{
Response
re
=
RequestDataUtils
.
Get_two_cookie
(
data
,
url
,
"admin_login_ssid"
,
admin_login_ssid
,
"PHPSESSID"
,
PHPSESSID
);
// Response re = RequestDataUtils.Get_two_cookie(data,nwn_url,
// "admin_login_ssid",admin_login_ssid,"PHPSESSID",PHPSESSID);
// Response re = RequestDataUtils.Get_houtai(data, Request,"admin_login_ssid",admin_login_ssid,"PHPSESSID",PHPSESSID);
return
re
;
}
@Override
public
String
handleOutput
(
Response
re
,
HashMap
<
String
,
Object
>
data
)
{
String
body
=
re
.
asString
();
// InputStream input = new FileInputStream(file);
StringBuffer
buffer
=
new
StringBuffer
();
boolean
result
=
true
;
String
failReason
=
""
;
if
(
body
.
contains
(
"<title>"
)){
int
Alength
=
"<title>"
.
length
();
int
start
=
body
.
indexOf
(
"<title>"
);
int
end
=
body
.
indexOf
(
"</title>"
)+
1
;
body
=
body
.
substring
(
start
+
Alength
,
end
-
1
);
}
// http://zgadmin.test.eoffcn.com/sso/login.html?action=check_login&encode=f086da4a32899a75e07a83476de9035f%3AiYF9fPjJbhmmEDswMBNi3KO3%2FsPCu1JSYyet723Xays%2FrXdnPRskyrutMZvbMlG0yiAjI1ibhfZtTotQsZf6VA%3D%3D&app_id=31&ref=http://nwn.t.eoffcn.com/admin/package/packagelist
// http://nwn.t.eoffcn.comhttp://zgadmin.test.eoffcn.com/sso/login.html?action=check_login&encode=f086da4a32899a75e07a83476de9035f%3AiYF9fPjJbhmmEDswMBNi3KO3%2FsPCu1JSYyet723Xays%2FrXdnPRskyrutMZvbMlG0yiAjI1ibhfZtTotQsZf6VA%3D%3D&app_id=31&ref=http://nwn.t.eoffcn.com/admin/package/packagelist
if
(
data
.
get
(
"custom"
)
!=
null
&&
body
!=
null
){
if
(!(
body
.
equals
(
data
.
get
(
"custom"
)))){
result
=
result
&&
false
;
failReason
=
failReason
+
"custom is expected "
+
data
.
get
(
"custom"
).
toString
()
+
" but actually "
+
body
+
"."
;
// admin_login_ssid=re.getCookie("admin_login_ssid");
admin_31_encode
=
re
.
getCookie
(
"admin_31_encode"
);
}
else
{
System
.
out
.
println
(
re
.
asString
());
}
}
if
(
result
)
return
"Pass"
;
else
return
"Fail:"
+
failReason
;
}
}
package
com
.
offcn
.
api
.
nwn
.
process
;
import
io.restassured.http.Headers
;
import
io.restassured.path.json.JsonPath
;
import
io.restassured.response.Response
;
import
java.io.FileInputStream
;
import
java.io.InputStream
;
import
java.io.UnsupportedEncodingException
;
import
java.sql.ResultSet
;
import
java.sql.SQLException
;
import
java.sql.Statement
;
import
java.util.Arrays
;
import
java.util.HashMap
;
import
java.util.Random
;
import
org.json.simple.JSONArray
;
import
com.offcn.TestUnti.Log
;
import
com.offcn.TestUnti.MapUtil
;
import
com.offcn.TestUnti.ReadProperties
;
import
com.offcn.TestUnti.RequestDataUtils
;
import
com.offcn.TestUnti.StringUtils
;
import
com.offcn.interfaces.API
;
import
com.offcn.process.NWN
;
import
net.sf.json.JSONObject
;
/**
*获取PHPSESSID
*
* @author puhui
*
*/
public
class
codeold
extends
NWN
implements
API
{
@Override
public
void
initialize
(
HashMap
<
String
,
Object
>
data
)
{
}
@Override
public
HashMap
<
String
,
Object
>
handleInput
(
HashMap
<
String
,
Object
>
data
)
{
return
data
;
}
@Override
public
Response
SendRequest
(
HashMap
<
String
,
Object
>
data
,
String
Url
,
String
Request
)
{
Response
re
=
RequestDataUtils
.
Get_two_cookie
(
data
,
url
,
"admin_login_ssid"
,
admin_login_ssid
,
"PHPSESSID"
,
PHPSESSID
);
// Response re = RequestDataUtils.Get_two_cookie(data,nwn_url,
// "admin_login_ssid",admin_login_ssid,"PHPSESSID",PHPSESSID);
// Response re = RequestDataUtils.Get_houtai(data, Request,"admin_login_ssid",admin_login_ssid,"PHPSESSID",PHPSESSID);
return
re
;
}
@Override
public
String
handleOutput
(
Response
re
,
HashMap
<
String
,
Object
>
data
)
{
String
body
=
re
.
asString
();
// InputStream input = new FileInputStream(file);
StringBuffer
buffer
=
new
StringBuffer
();
boolean
result
=
true
;
String
failReason
=
""
;
if
(
body
.
contains
(
"<title>"
)){
int
Alength
=
"<title>"
.
length
();
int
start
=
body
.
indexOf
(
"<title>"
);
int
end
=
body
.
indexOf
(
"</title>"
)+
1
;
body
=
body
.
substring
(
start
+
Alength
,
end
-
1
);
}
// http://zgadmin.test.eoffcn.com/sso/login.html?action=check_login&encode=f086da4a32899a75e07a83476de9035f%3AiYF9fPjJbhmmEDswMBNi3KO3%2FsPCu1JSYyet723Xays%2FrXdnPRskyrutMZvbMlG0yiAjI1ibhfZtTotQsZf6VA%3D%3D&app_id=31&ref=http://nwn.t.eoffcn.com/admin/package/packagelist
// http://nwn.t.eoffcn.comhttp://zgadmin.test.eoffcn.com/sso/login.html?action=check_login&encode=f086da4a32899a75e07a83476de9035f%3AiYF9fPjJbhmmEDswMBNi3KO3%2FsPCu1JSYyet723Xays%2FrXdnPRskyrutMZvbMlG0yiAjI1ibhfZtTotQsZf6VA%3D%3D&app_id=31&ref=http://nwn.t.eoffcn.com/admin/package/packagelist
if
(
data
.
get
(
"custom"
)
!=
null
&&
body
!=
null
){
if
(!(
body
.
equals
(
data
.
get
(
"custom"
)))){
result
=
result
&&
false
;
failReason
=
failReason
+
"custom is expected "
+
data
.
get
(
"custom"
).
toString
()
+
" but actually "
+
body
+
"."
;
// admin_login_ssid=re.getCookie("admin_login_ssid");
admin_31_encode
=
re
.
getCookie
(
"admin_31_encode"
);
}
else
{
System
.
out
.
println
(
re
.
asString
());
}
}
if
(
result
)
return
"Pass"
;
else
return
"Fail:"
+
failReason
;
}
}
nwn_Api_auto_test/src/com/offcn/api/nwn/process/logon.java
View file @
84ac91ce
package
com
.
offcn
.
api
.
nwn
.
process
;
import
io.restassured.response.Response
;
import
java.util.HashMap
;
import
com.offcn.TestUnti.RequestDataUtils
;
import
com.offcn.interfaces.API
;
import
com.offcn.process.NWN
;
/**
*获取encode
*
* @author Lyy
*
*/
public
class
logon
extends
NWN
implements
API
{
@Override
public
void
initialize
(
HashMap
<
String
,
Object
>
data
)
{
}
@Override
public
HashMap
<
String
,
Object
>
handleInput
(
HashMap
<
String
,
Object
>
data
)
{
return
data
;
}
@Override
public
Response
SendRequest
(
HashMap
<
String
,
Object
>
data
,
String
Url
,
String
Request
)
{
// postGet.HttpPostWithJson(nwn_url, "", "{\"admin_login_ssid\":"+admin_login_ssid+"}");
String
re
=
RequestDataUtils
.
Get_two_cookie_shop
(
data
,
"http://dianshang.t.eoffcn.com/p/user/logon"
,
"admin_login_ssid"
,
admin_login_ssid
,
"go_session_id"
,
go_session_id
);
// try {
// Process p = Runtime.getRuntime().exec("python src/main/java/testTools/tools/python/login.py "+admin_login_ssid+" "+PHPSESSID+" "+nwn_url);
// } catch (IOException e) {
// // TODO Auto-generated catch block
// e.printStackTrace();
// }
System
.
out
.
println
(
re
);
return
null
;
}
@Override
public
String
handleOutput
(
Response
re
,
HashMap
<
String
,
Object
>
data
)
{
// String body=re.asString();
//// InputStream input = new FileInputStream(file);
// StringBuffer buffer = new StringBuffer();
//
// boolean result = true;
// String failReason = "";
//
// if(body.contains("<title>")){
// int Alength="<title>".length();
// int start=body.indexOf("<title>");
// int end=body.indexOf("</title>")+1;
// body=body.substring(start+Alength, end-1);
// }
//// http://zgadmin.test.eoffcn.com/sso/login.html?action=check_login&encode=f086da4a32899a75e07a83476de9035f%3AiYF9fPjJbhmmEDswMBNi3KO3%2FsPCu1JSYyet723Xays%2FrXdnPRskyrutMZvbMlG0yiAjI1ibhfZtTotQsZf6VA%3D%3D&app_id=31&ref=http://nwn.t.eoffcn.com/admin/package/packagelist
//// http://nwn.t.eoffcn.comhttp://zgadmin.test.eoffcn.com/sso/login.html?action=check_login&encode=f086da4a32899a75e07a83476de9035f%3AiYF9fPjJbhmmEDswMBNi3KO3%2FsPCu1JSYyet723Xays%2FrXdnPRskyrutMZvbMlG0yiAjI1ibhfZtTotQsZf6VA%3D%3D&app_id=31&ref=http://nwn.t.eoffcn.com/admin/package/packagelist
//
// if(data.get("custom") != null && body!=null){
// if(!(body.equals(data.get("custom")))){
// result = result && false;
// failReason = failReason + "custom is expected "
// + data.get("custom").toString() + " but actually "
// + body + ".";
//// admin_login_ssid=re.getCookie("admin_login_ssid");
// admin_31_encode=re.getCookie("admin_31_encode");
// }else{
//
// System.out.println(re.asString());
//
// }
// }
//
return
"Pass"
;
}}
package
com
.
offcn
.
api
.
nwn
.
process
;
import
io.restassured.response.Response
;
import
java.util.HashMap
;
import
com.offcn.TestUnti.RequestDataUtils
;
import
com.offcn.interfaces.API
;
import
com.offcn.process.NWN
;
/**
*获取encode
*
* @author Lyy
*
*/
public
class
logon
extends
NWN
implements
API
{
@Override
public
void
initialize
(
HashMap
<
String
,
Object
>
data
)
{
}
@Override
public
HashMap
<
String
,
Object
>
handleInput
(
HashMap
<
String
,
Object
>
data
)
{
return
data
;
}
@Override
public
Response
SendRequest
(
HashMap
<
String
,
Object
>
data
,
String
Url
,
String
Request
)
{
// postGet.HttpPostWithJson(nwn_url, "", "{\"admin_login_ssid\":"+admin_login_ssid+"}");
String
re
=
RequestDataUtils
.
Get_two_cookie_shop
(
data
,
"http://dianshang.t.eoffcn.com/p/user/logon"
,
"admin_login_ssid"
,
admin_login_ssid
,
"go_session_id"
,
go_session_id
);
// try {
// Process p = Runtime.getRuntime().exec("python src/main/java/testTools/tools/python/login.py "+admin_login_ssid+" "+PHPSESSID+" "+nwn_url);
// } catch (IOException e) {
// // TODO Auto-generated catch block
// e.printStackTrace();
// }
System
.
out
.
println
(
re
);
return
null
;
}
@Override
public
String
handleOutput
(
Response
re
,
HashMap
<
String
,
Object
>
data
)
{
// String body=re.asString();
//// InputStream input = new FileInputStream(file);
// StringBuffer buffer = new StringBuffer();
//
// boolean result = true;
// String failReason = "";
//
// if(body.contains("<title>")){
// int Alength="<title>".length();
// int start=body.indexOf("<title>");
// int end=body.indexOf("</title>")+1;
// body=body.substring(start+Alength, end-1);
// }
//// http://zgadmin.test.eoffcn.com/sso/login.html?action=check_login&encode=f086da4a32899a75e07a83476de9035f%3AiYF9fPjJbhmmEDswMBNi3KO3%2FsPCu1JSYyet723Xays%2FrXdnPRskyrutMZvbMlG0yiAjI1ibhfZtTotQsZf6VA%3D%3D&app_id=31&ref=http://nwn.t.eoffcn.com/admin/package/packagelist
//// http://nwn.t.eoffcn.comhttp://zgadmin.test.eoffcn.com/sso/login.html?action=check_login&encode=f086da4a32899a75e07a83476de9035f%3AiYF9fPjJbhmmEDswMBNi3KO3%2FsPCu1JSYyet723Xays%2FrXdnPRskyrutMZvbMlG0yiAjI1ibhfZtTotQsZf6VA%3D%3D&app_id=31&ref=http://nwn.t.eoffcn.com/admin/package/packagelist
//
// if(data.get("custom") != null && body!=null){
// if(!(body.equals(data.get("custom")))){
// result = result && false;
// failReason = failReason + "custom is expected "
// + data.get("custom").toString() + " but actually "
// + body + ".";
//// admin_login_ssid=re.getCookie("admin_login_ssid");
// admin_31_encode=re.getCookie("admin_31_encode");
// }else{
//
// System.out.println(re.asString());
//
// }
// }
//
return
"Pass"
;
}}
nwn_Api_auto_test/src/com/offcn/api/nwn/process/programLevel.java
View file @
84ac91ce
package
com
.
offcn
.
api
.
nwn
.
process
;
import
io.restassured.path.json.JsonPath
;
import
io.restassured.response.Response
;
import
java.io.UnsupportedEncodingException
;
import
java.sql.ResultSet
;
import
java.sql.SQLException
;
import
java.sql.Statement
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.Random
;
import
org.json.simple.JSONArray
;
import
com.offcn.TestUnti.HttpRequest
;
import
com.offcn.TestUnti.Log
;
import
com.offcn.TestUnti.MapUtil
;
import
com.offcn.TestUnti.RequestDataUtils
;
import
com.offcn.TestUnti.StringUtils
;
import
com.offcn.api.nwn.md5.nwngetsign
;
import
com.offcn.interfaces.API
;
import
com.offcn.process.NWN
;
import
com.offcn.system.MyRequest
;
import
com.offcn.TestUnti.ListUtil
;
/**
* 获取直播列表
*
* @author liyy
*
*/
public
class
programLevel
extends
NWN
implements
API
{
public
String
parameter
;
// 参数集合
public
String
t_id
;
//
public
String
t_id_getdatabase
;
@Override
public
void
initialize
(
HashMap
<
String
,
Object
>
data
)
{
// try {
// Thread.sleep(20000);
// } catch (InterruptedException e) {
// // TODO Auto-generated catch block
// e.printStackTrace();
// }
}
@Override
public
HashMap
<
String
,
Object
>
handleInput
(
HashMap
<
String
,
Object
>
data
)
{
// 获取parameter对应的内容
//data.put("parameter", parameter);
return
data
;
}
@Override
public
Response
SendRequest
(
HashMap
<
String
,
Object
>
data
,
String
Url
,
String
Request
)
{
Map
<
String
,
String
>
cookies
=
new
HashMap
<
String
,
String
>();
cookies
.
put
(
"PHPSESSID"
,
PHPSESSID
);
cookies
.
put
(
"admin_login_ssid"
,
admin_login_ssid
);
cookies
.
put
(
"admin_31_encode"
,
admin_31_encode
);
MyRequest
myRequest
=
new
MyRequest
();
myRequest
.
setUrl
(
Url
);
myRequest
.
setRequest
(
Request
);
myRequest
.
setCookies
(
cookies
);
Response
re
=
RequestDataUtils
.
RestAssuredApi
(
data
,
myRequest
);
return
re
;
}
@Override
public
String
handleOutput
(
Response
re
,
HashMap
<
String
,
Object
>
data
)
{
JsonPath
jp
=
new
JsonPath
(
re
.
asString
());
System
.
out
.
println
(
"jp===="
+
jp
);
boolean
result
=
true
;
String
failReason
=
""
;
String
json
=
re
.
asString
();
json
=
StringUtils
.
decodeUnicode
(
json
);
if
((
data
.
get
(
"statusCode"
)
!=
null
)
&&
(!
data
.
get
(
"statusCode"
).
toString
()
.
equals
(
String
.
valueOf
(
re
.
getStatusCode
()))))
{
result
=
result
&&
false
;
failReason
=
failReason
+
"statusCode is expected "
+
data
.
get
(
"statusCode"
).
toString
()
+
" but actually "
+
String
.
valueOf
(
re
.
getStatusCode
())
+
". "
;
}
if
(
json
.
length
()
!=
0
)
{
if
(!
json
.
contains
(
data
.
get
(
"msg"
).
toString
()))
{
result
=
result
&&
false
;
failReason
=
failReason
+
"msg is expected "
+
data
.
get
(
"msg"
).
toString
()
+
" but actually "
+
jp
.
getString
(
"message"
)
+
"."
;
}
String
url
=
jp
.
getString
(
"url"
);
if
(
data
.
get
(
"custom"
)
!=
null
&&
json
!=
null
)
{
// 如果自定义结果包含多个希望结果,也就是有逗号,那么就切割,包含比较。
if
(
data
.
get
(
"custom"
).
toString
().
contains
(
","
))
{
String
[]
strCustomStrings
=
data
.
get
(
"custom"
).
toString
()
.
split
(
","
);
// System.out.println(strCustomStrings.length);
for
(
int
i
=
0
;
i
<
strCustomStrings
.
length
;
i
++)
{
if
(!
json
.
contains
(
strCustomStrings
[
i
]))
{
result
=
result
&&
false
;
nwn_url
=
url
;
PHPSESSID
=
re
.
getCookie
(
"PHPSESSID"
);
failReason
=
failReason
+
"custom is expected "
+
data
.
get
(
"custom"
).
toString
()
+
" but actually "
+
strCustomStrings
[
i
]
+
"."
;
break
;
}
}
}
else
{
// 如果只有一个希望结果,就直接包含比较。
if
(!
json
.
contains
(
data
.
get
(
"custom"
).
toString
()))
{
result
=
result
&&
false
;
failReason
=
failReason
+
"custom is expected "
+
data
.
get
(
"custom"
).
toString
()
+
" but actually "
+
data
.
get
(
"custom"
).
toString
()
+
"."
;
}
else
{
nwn_url
=
url
;
PHPSESSID
=
re
.
getCookie
(
"PHPSESSID"
);
}
}
}
if
(
"0"
.
equals
(
jp
.
getString
(
"retcode"
))){
//是否验证数据库
}
}
if
(
result
)
return
"Pass"
;
else
return
"Fail:"
+
failReason
;
}
}
package
com
.
offcn
.
api
.
nwn
.
process
;
import
io.restassured.path.json.JsonPath
;
import
io.restassured.response.Response
;
import
java.io.UnsupportedEncodingException
;
import
java.sql.ResultSet
;
import
java.sql.SQLException
;
import
java.sql.Statement
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.Random
;
import
org.json.simple.JSONArray
;
import
com.offcn.TestUnti.HttpRequest
;
import
com.offcn.TestUnti.Log
;
import
com.offcn.TestUnti.MapUtil
;
import
com.offcn.TestUnti.RequestDataUtils
;
import
com.offcn.TestUnti.StringUtils
;
import
com.offcn.api.nwn.md5.nwngetsign
;
import
com.offcn.interfaces.API
;
import
com.offcn.process.NWN
;
import
com.offcn.system.MyRequest
;
import
com.offcn.TestUnti.ListUtil
;
/**
* 获取直播列表
*
* @author liyy
*
*/
public
class
programLevel
extends
NWN
implements
API
{
public
String
parameter
;
// 参数集合
public
String
t_id
;
//
public
String
t_id_getdatabase
;
@Override
public
void
initialize
(
HashMap
<
String
,
Object
>
data
)
{
// try {
// Thread.sleep(20000);
// } catch (InterruptedException e) {
// // TODO Auto-generated catch block
// e.printStackTrace();
// }
}
@Override
public
HashMap
<
String
,
Object
>
handleInput
(
HashMap
<
String
,
Object
>
data
)
{
// 获取parameter对应的内容
//data.put("parameter", parameter);
return
data
;
}
@Override
public
Response
SendRequest
(
HashMap
<
String
,
Object
>
data
,
String
Url
,
String
Request
)
{
Map
<
String
,
String
>
cookies
=
new
HashMap
<
String
,
String
>();
cookies
.
put
(
"PHPSESSID"
,
PHPSESSID
);
cookies
.
put
(
"admin_login_ssid"
,
admin_login_ssid
);
cookies
.
put
(
"admin_31_encode"
,
admin_31_encode
);
MyRequest
myRequest
=
new
MyRequest
();
myRequest
.
setUrl
(
Url
);
myRequest
.
setRequest
(
Request
);
myRequest
.
setCookies
(
cookies
);
Response
re
=
RequestDataUtils
.
RestAssuredApi
(
data
,
myRequest
);
return
re
;
}
@Override
public
String
handleOutput
(
Response
re
,
HashMap
<
String
,
Object
>
data
)
{
JsonPath
jp
=
new
JsonPath
(
re
.
asString
());
System
.
out
.
println
(
"jp===="
+
jp
);
boolean
result
=
true
;
String
failReason
=
""
;
String
json
=
re
.
asString
();
json
=
StringUtils
.
decodeUnicode
(
json
);
if
((
data
.
get
(
"statusCode"
)
!=
null
)
&&
(!
data
.
get
(
"statusCode"
).
toString
()
.
equals
(
String
.
valueOf
(
re
.
getStatusCode
()))))
{
result
=
result
&&
false
;
failReason
=
failReason
+
"statusCode is expected "
+
data
.
get
(
"statusCode"
).
toString
()
+
" but actually "
+
String
.
valueOf
(
re
.
getStatusCode
())
+
". "
;
}
if
(
json
.
length
()
!=
0
)
{
if
(!
json
.
contains
(
data
.
get
(
"msg"
).
toString
()))
{
result
=
result
&&
false
;
failReason
=
failReason
+
"msg is expected "
+
data
.
get
(
"msg"
).
toString
()
+
" but actually "
+
jp
.
getString
(
"message"
)
+
"."
;
}
String
url
=
jp
.
getString
(
"url"
);
if
(
data
.
get
(
"custom"
)
!=
null
&&
json
!=
null
)
{
// 如果自定义结果包含多个希望结果,也就是有逗号,那么就切割,包含比较。
if
(
data
.
get
(
"custom"
).
toString
().
contains
(
","
))
{
String
[]
strCustomStrings
=
data
.
get
(
"custom"
).
toString
()
.
split
(
","
);
// System.out.println(strCustomStrings.length);
for
(
int
i
=
0
;
i
<
strCustomStrings
.
length
;
i
++)
{
if
(!
json
.
contains
(
strCustomStrings
[
i
]))
{
result
=
result
&&
false
;
nwn_url
=
url
;
PHPSESSID
=
re
.
getCookie
(
"PHPSESSID"
);
failReason
=
failReason
+
"custom is expected "
+
data
.
get
(
"custom"
).
toString
()
+
" but actually "
+
strCustomStrings
[
i
]
+
"."
;
break
;
}
}
}
else
{
// 如果只有一个希望结果,就直接包含比较。
if
(!
json
.
contains
(
data
.
get
(
"custom"
).
toString
()))
{
result
=
result
&&
false
;
failReason
=
failReason
+
"custom is expected "
+
data
.
get
(
"custom"
).
toString
()
+
" but actually "
+
data
.
get
(
"custom"
).
toString
()
+
"."
;
}
else
{
nwn_url
=
url
;
PHPSESSID
=
re
.
getCookie
(
"PHPSESSID"
);
}
}
}
if
(
"0"
.
equals
(
jp
.
getString
(
"retcode"
))){
//是否验证数据库
}
}
if
(
result
)
return
"Pass"
;
else
return
"Fail:"
+
failReason
;
}
}
nwn_Api_auto_test/src/com/offcn/api/nwn/process/returnUserInfo.java
View file @
84ac91ce
package
com
.
offcn
.
api
.
nwn
.
process
;
import
io.restassured.path.json.JsonPath
;
import
io.restassured.response.Response
;
import
java.sql.ResultSet
;
import
java.sql.SQLException
;
import
java.sql.Statement
;
import
java.util.Arrays
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Random
;
import
org.json.simple.JSONArray
;
import
com.offcn.TestUnti.Log
;
import
com.offcn.TestUnti.MapUtil
;
import
com.offcn.TestUnti.MySqlUtil
;
import
com.offcn.TestUnti.ReadProperties
;
import
com.offcn.TestUnti.RequestDataUtils
;
import
com.offcn.TestUnti.StringUtils
;
import
com.offcn.interfaces.API
;
import
com.offcn.process.NWN
;
import
net.sf.json.JSONObject
;
/**
*获取登录地址,和获取学习包列表
*
* @author puhui
*
*/
public
class
returnUserInfo
extends
NWN
implements
API
{
@Override
public
void
initialize
(
HashMap
<
String
,
Object
>
data
)
{
}
@Override
public
HashMap
<
String
,
Object
>
handleInput
(
HashMap
<
String
,
Object
>
data
)
{
return
data
;
}
@Override
public
Response
SendRequest
(
HashMap
<
String
,
Object
>
data
,
String
Url
,
String
Request
)
{
//System.out.println("url==" + Url );
//System.out.println("PHPSESSID==" + PHPSESSID );
Response
re
=
RequestDataUtils
.
Get_one_cookie
(
data
,
Url
,
"PHPSESSID"
,
PHPSESSID
);
//Response re = RequestDataUtils.Get_Notoken_NoCookie(data, Url);
return
re
;
}
@Override
public
String
handleOutput
(
Response
re
,
HashMap
<
String
,
Object
>
data
)
{
JsonPath
jp
=
re
.
body
().
jsonPath
();
boolean
result
=
true
;
String
failReason
=
""
;
String
json
=
re
.
asString
();
if
((
data
.
get
(
"statusCode"
)
!=
null
)
&&
(!
data
.
get
(
"statusCode"
).
toString
()
.
equals
(
String
.
valueOf
(
re
.
getStatusCode
()))))
{
result
=
result
&&
false
;
failReason
=
failReason
+
"statusCode is expected "
+
data
.
get
(
"statusCode"
).
toString
()
+
" but actually "
+
String
.
valueOf
(
re
.
getStatusCode
())
+
". "
;
}
if
(
json
.
length
()
!=
0
)
{
String
msg
=
jp
.
getString
(
"msg"
);
String
code
=
jp
.
getString
(
"retcode"
);
if
((
data
.
get
(
"code"
)
!=
null
)
&&
(
code
!=
null
)
&&
(!
code
.
equals
(
data
.
get
(
"code"
).
toString
())))
{
result
=
result
&&
false
;
failReason
=
failReason
+
"code is expected "
+
data
.
get
(
"code"
).
toString
()
+
" but actually "
+
jp
.
getString
(
"code"
)
+
"."
;
}
if
((
data
.
get
(
"msg"
)
!=
null
)
&&
(
msg
!=
null
)
&&
(!
msg
.
equals
(
data
.
get
(
"msg"
).
toString
())))
{
result
=
result
&&
false
;
failReason
=
failReason
+
"msg is expected "
+
data
.
get
(
"msg"
).
toString
()
+
" but actually "
+
jp
.
getString
(
"msg"
)
+
"."
;
}
if
(
code
.
equals
(
"1002"
)){
nwn_url
=
jp
.
getString
(
"url"
);
PHPSESSID
=
re
.
getCookie
(
"PHPSESSID"
);
}
}
if
(
result
)
return
"Pass"
;
else
return
"Fail:"
+
failReason
;
}
}
package
com
.
offcn
.
api
.
nwn
.
process
;
import
io.restassured.path.json.JsonPath
;
import
io.restassured.response.Response
;
import
java.sql.ResultSet
;
import
java.sql.SQLException
;
import
java.sql.Statement
;
import
java.util.Arrays
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Random
;
import
org.json.simple.JSONArray
;
import
com.offcn.TestUnti.Log
;
import
com.offcn.TestUnti.MapUtil
;
import
com.offcn.TestUnti.MySqlUtil
;
import
com.offcn.TestUnti.ReadProperties
;
import
com.offcn.TestUnti.RequestDataUtils
;
import
com.offcn.TestUnti.StringUtils
;
import
com.offcn.interfaces.API
;
import
com.offcn.process.NWN
;
import
net.sf.json.JSONObject
;
/**
*获取登录地址,和获取学习包列表
*
* @author puhui
*
*/
public
class
returnUserInfo
extends
NWN
implements
API
{
@Override
public
void
initialize
(
HashMap
<
String
,
Object
>
data
)
{
}
@Override
public
HashMap
<
String
,
Object
>
handleInput
(
HashMap
<
String
,
Object
>
data
)
{
return
data
;
}
@Override
public
Response
SendRequest
(
HashMap
<
String
,
Object
>
data
,
String
Url
,
String
Request
)
{
//System.out.println("url==" + Url );
//System.out.println("PHPSESSID==" + PHPSESSID );
Response
re
=
RequestDataUtils
.
Get_one_cookie
(
data
,
Url
,
"PHPSESSID"
,
PHPSESSID
);
//Response re = RequestDataUtils.Get_Notoken_NoCookie(data, Url);
return
re
;
}
@Override
public
String
handleOutput
(
Response
re
,
HashMap
<
String
,
Object
>
data
)
{
JsonPath
jp
=
re
.
body
().
jsonPath
();
boolean
result
=
true
;
String
failReason
=
""
;
String
json
=
re
.
asString
();
if
((
data
.
get
(
"statusCode"
)
!=
null
)
&&
(!
data
.
get
(
"statusCode"
).
toString
()
.
equals
(
String
.
valueOf
(
re
.
getStatusCode
()))))
{
result
=
result
&&
false
;
failReason
=
failReason
+
"statusCode is expected "
+
data
.
get
(
"statusCode"
).
toString
()
+
" but actually "
+
String
.
valueOf
(
re
.
getStatusCode
())
+
". "
;
}
if
(
json
.
length
()
!=
0
)
{
String
msg
=
jp
.
getString
(
"msg"
);
String
code
=
jp
.
getString
(
"retcode"
);
if
((
data
.
get
(
"code"
)
!=
null
)
&&
(
code
!=
null
)
&&
(!
code
.
equals
(
data
.
get
(
"code"
).
toString
())))
{
result
=
result
&&
false
;
failReason
=
failReason
+
"code is expected "
+
data
.
get
(
"code"
).
toString
()
+
" but actually "
+
jp
.
getString
(
"code"
)
+
"."
;
}
if
((
data
.
get
(
"msg"
)
!=
null
)
&&
(
msg
!=
null
)
&&
(!
msg
.
equals
(
data
.
get
(
"msg"
).
toString
())))
{
result
=
result
&&
false
;
failReason
=
failReason
+
"msg is expected "
+
data
.
get
(
"msg"
).
toString
()
+
" but actually "
+
jp
.
getString
(
"msg"
)
+
"."
;
}
if
(
code
.
equals
(
"1002"
)){
nwn_url
=
jp
.
getString
(
"url"
);
PHPSESSID
=
re
.
getCookie
(
"PHPSESSID"
);
}
}
if
(
result
)
return
"Pass"
;
else
return
"Fail:"
+
failReason
;
}
}
nwn_Api_auto_test/src/com/offcn/api/nwn/service/addTask.java
View file @
84ac91ce
package
com
.
offcn
.
api
.
nwn
.
service
;
import
io.restassured.path.json.JsonPath
;
import
io.restassured.response.Response
;
import
java.io.UnsupportedEncodingException
;
import
java.sql.ResultSet
;
import
java.sql.SQLException
;
import
java.sql.Statement
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.Random
;
import
org.json.simple.JSONArray
;
import
com.offcn.TestUnti.HttpRequest
;
import
com.offcn.TestUnti.Log
;
import
com.offcn.TestUnti.MapUtil
;
import
com.offcn.TestUnti.RequestDataUtils
;
import
com.offcn.TestUnti.StringUtils
;
import
com.offcn.api.nwn.md5.nwngetsign
;
import
com.offcn.interfaces.API
;
import
com.offcn.process.NWN
;
import
com.offcn.system.MyRequest
;
import
com.offcn.TestUnti.ListUtil
;
/**
* 添加作业
*
* @author liyy
*
*/
public
class
addTask
extends
NWN
implements
API
{
public
String
parameter
;
// 参数集合
public
String
t_id
;
//
public
String
t_id_getdatabase
;
@Override
public
void
initialize
(
HashMap
<
String
,
Object
>
data
)
{
// try {
// Thread.sleep(20000);
// } catch (InterruptedException e) {
// // TODO Auto-generated catch block
// e.printStackTrace();
// }
}
@Override
public
HashMap
<
String
,
Object
>
handleInput
(
HashMap
<
String
,
Object
>
data
)
{
// 获取parameter对应的内容
parameter
=
MapUtil
.
getValue
(
"parameter"
,
data
);
t_id
=
MapUtil
.
getParameter
(
parameter
,
"t_id"
).
trim
();
if
((!
t_id
.
equals
(
""
))
&&
t_id
.
contains
(
"t_id"
))
{
parameter
=
parameter
.
replace
(
"\"t_id\":t_id"
,
"\"t_id\":"
+
t_id_getdatabase
);
}
data
.
put
(
"parameter"
,
parameter
);
return
data
;
}
@Override
public
Response
SendRequest
(
HashMap
<
String
,
Object
>
data
,
String
Url
,
String
Request
)
{
Map
<
String
,
String
>
cookies
=
new
HashMap
<
String
,
String
>();
cookies
.
put
(
"PHPSESSID"
,
PHPSESSID
);
MyRequest
myRequest
=
new
MyRequest
();
myRequest
.
setParameter
(
parameter
);
myRequest
.
setUrl
(
Url
);
myRequest
.
setRequest
(
Request
);
myRequest
.
setCookies
(
cookies
);
Response
re
=
RequestDataUtils
.
RestAssuredApi
(
data
,
myRequest
);
return
re
;
}
@Override
public
String
handleOutput
(
Response
re
,
HashMap
<
String
,
Object
>
data
)
{
JsonPath
jp
=
new
JsonPath
(
re
.
asString
());
System
.
out
.
println
(
"jp===="
+
jp
);
boolean
result
=
true
;
String
failReason
=
""
;
String
json
=
re
.
asString
();
json
=
StringUtils
.
decodeUnicode
(
json
);
if
((
data
.
get
(
"statusCode"
)
!=
null
)
&&
(!
data
.
get
(
"statusCode"
).
toString
()
.
equals
(
String
.
valueOf
(
re
.
getStatusCode
()))))
{
result
=
result
&&
false
;
failReason
=
failReason
+
"statusCode is expected "
+
data
.
get
(
"statusCode"
).
toString
()
+
" but actually "
+
String
.
valueOf
(
re
.
getStatusCode
())
+
". "
;
}
if
(
json
.
length
()
!=
0
)
{
if
(!
json
.
contains
(
data
.
get
(
"msg"
).
toString
()))
{
result
=
result
&&
false
;
failReason
=
failReason
+
"msg is expected "
+
data
.
get
(
"msg"
).
toString
()
+
" but actually "
+
jp
.
getString
(
"message"
)
+
"."
;
}
if
(
data
.
get
(
"custom"
)
!=
null
&&
json
!=
null
)
{
// 如果自定义结果包含多个希望结果,也就是有逗号,那么就切割,包含比较。
if
(
data
.
get
(
"custom"
).
toString
().
contains
(
","
))
{
String
[]
strCustomStrings
=
data
.
get
(
"custom"
).
toString
()
.
split
(
","
);
// System.out.println(strCustomStrings.length);
for
(
int
i
=
0
;
i
<
strCustomStrings
.
length
;
i
++)
{
if
(!
json
.
contains
(
strCustomStrings
[
i
]))
{
result
=
result
&&
false
;
failReason
=
failReason
+
"custom is expected "
+
data
.
get
(
"custom"
).
toString
()
+
" but actually "
+
strCustomStrings
[
i
]
+
"."
;
break
;
}
}
}
else
{
// 如果只有一个希望结果,就直接包含比较。
if
(!
json
.
contains
(
data
.
get
(
"custom"
).
toString
()))
{
result
=
result
&&
false
;
failReason
=
failReason
+
"custom is expected "
+
data
.
get
(
"custom"
).
toString
()
+
" but actually "
+
data
.
get
(
"custom"
).
toString
()
+
"."
;
}
}
}
if
(
"0"
.
equals
(
jp
.
getString
(
"retcode"
))){
//是否验证数据库
}
}
if
(
result
)
return
"Pass"
;
else
return
"Fail:"
+
failReason
;
}
}
package
com
.
offcn
.
api
.
nwn
.
service
;
import
io.restassured.path.json.JsonPath
;
import
io.restassured.response.Response
;
import
java.io.UnsupportedEncodingException
;
import
java.sql.ResultSet
;
import
java.sql.SQLException
;
import
java.sql.Statement
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.Random
;
import
org.json.simple.JSONArray
;
import
com.offcn.TestUnti.HttpRequest
;
import
com.offcn.TestUnti.Log
;
import
com.offcn.TestUnti.MapUtil
;
import
com.offcn.TestUnti.RequestDataUtils
;
import
com.offcn.TestUnti.StringUtils
;
import
com.offcn.api.nwn.md5.nwngetsign
;
import
com.offcn.interfaces.API
;
import
com.offcn.process.NWN
;
import
com.offcn.system.MyRequest
;
import
com.offcn.TestUnti.ListUtil
;
/**
* 添加作业
*
* @author liyy
*
*/
public
class
addTask
extends
NWN
implements
API
{
public
String
parameter
;
// 参数集合
public
String
t_id
;
//
public
String
t_id_getdatabase
;
@Override
public
void
initialize
(
HashMap
<
String
,
Object
>
data
)
{
// try {
// Thread.sleep(20000);
// } catch (InterruptedException e) {
// // TODO Auto-generated catch block
// e.printStackTrace();
// }
}
@Override
public
HashMap
<
String
,
Object
>
handleInput
(
HashMap
<
String
,
Object
>
data
)
{
// 获取parameter对应的内容
parameter
=
MapUtil
.
getValue
(
"parameter"
,
data
);
t_id
=
MapUtil
.
getParameter
(
parameter
,
"t_id"
).
trim
();
if
((!
t_id
.
equals
(
""
))
&&
t_id
.
contains
(
"t_id"
))
{
parameter
=
parameter
.
replace
(
"\"t_id\":t_id"
,
"\"t_id\":"
+
t_id_getdatabase
);
}
data
.
put
(
"parameter"
,
parameter
);
return
data
;
}
@Override
public
Response
SendRequest
(
HashMap
<
String
,
Object
>
data
,
String
Url
,
String
Request
)
{
Map
<
String
,
String
>
cookies
=
new
HashMap
<
String
,
String
>();
cookies
.
put
(
"PHPSESSID"
,
PHPSESSID
);
MyRequest
myRequest
=
new
MyRequest
();
myRequest
.
setParameter
(
parameter
);
myRequest
.
setUrl
(
Url
);
myRequest
.
setRequest
(
Request
);
myRequest
.
setCookies
(
cookies
);
Response
re
=
RequestDataUtils
.
RestAssuredApi
(
data
,
myRequest
);
return
re
;
}
@Override
public
String
handleOutput
(
Response
re
,
HashMap
<
String
,
Object
>
data
)
{
JsonPath
jp
=
new
JsonPath
(
re
.
asString
());
System
.
out
.
println
(
"jp===="
+
jp
);
boolean
result
=
true
;
String
failReason
=
""
;
String
json
=
re
.
asString
();
json
=
StringUtils
.
decodeUnicode
(
json
);
if
((
data
.
get
(
"statusCode"
)
!=
null
)
&&
(!
data
.
get
(
"statusCode"
).
toString
()
.
equals
(
String
.
valueOf
(
re
.
getStatusCode
()))))
{
result
=
result
&&
false
;
failReason
=
failReason
+
"statusCode is expected "
+
data
.
get
(
"statusCode"
).
toString
()
+
" but actually "
+
String
.
valueOf
(
re
.
getStatusCode
())
+
". "
;
}
if
(
json
.
length
()
!=
0
)
{
if
(!
json
.
contains
(
data
.
get
(
"msg"
).
toString
()))
{
result
=
result
&&
false
;
failReason
=
failReason
+
"msg is expected "
+
data
.
get
(
"msg"
).
toString
()
+
" but actually "
+
jp
.
getString
(
"message"
)
+
"."
;
}
if
(
data
.
get
(
"custom"
)
!=
null
&&
json
!=
null
)
{
// 如果自定义结果包含多个希望结果,也就是有逗号,那么就切割,包含比较。
if
(
data
.
get
(
"custom"
).
toString
().
contains
(
","
))
{
String
[]
strCustomStrings
=
data
.
get
(
"custom"
).
toString
()
.
split
(
","
);
// System.out.println(strCustomStrings.length);
for
(
int
i
=
0
;
i
<
strCustomStrings
.
length
;
i
++)
{
if
(!
json
.
contains
(
strCustomStrings
[
i
]))
{
result
=
result
&&
false
;
failReason
=
failReason
+
"custom is expected "
+
data
.
get
(
"custom"
).
toString
()
+
" but actually "
+
strCustomStrings
[
i
]
+
"."
;
break
;
}
}
}
else
{
// 如果只有一个希望结果,就直接包含比较。
if
(!
json
.
contains
(
data
.
get
(
"custom"
).
toString
()))
{
result
=
result
&&
false
;
failReason
=
failReason
+
"custom is expected "
+
data
.
get
(
"custom"
).
toString
()
+
" but actually "
+
data
.
get
(
"custom"
).
toString
()
+
"."
;
}
}
}
if
(
"0"
.
equals
(
jp
.
getString
(
"retcode"
))){
//是否验证数据库
}
}
if
(
result
)
return
"Pass"
;
else
return
"Fail:"
+
failReason
;
}
}
nwn_Api_auto_test/src/com/offcn/api/nwn/service/programLevel.java
View file @
84ac91ce
package
com
.
offcn
.
api
.
nwn
.
service
;
import
io.restassured.path.json.JsonPath
;
import
io.restassured.response.Response
;
import
java.io.UnsupportedEncodingException
;
import
java.sql.ResultSet
;
import
java.sql.SQLException
;
import
java.sql.Statement
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.Random
;
import
org.json.simple.JSONArray
;
import
com.offcn.TestUnti.HttpRequest
;
import
com.offcn.TestUnti.Log
;
import
com.offcn.TestUnti.MapUtil
;
import
com.offcn.TestUnti.RequestDataUtils
;
import
com.offcn.TestUnti.StringUtils
;
import
com.offcn.api.nwn.md5.nwngetsign
;
import
com.offcn.interfaces.API
;
import
com.offcn.process.NWN
;
import
com.offcn.system.MyRequest
;
import
com.offcn.TestUnti.ListUtil
;
/**
* 获取直播列表
*
* @author liyy
*
*/
public
class
programLevel
extends
NWN
implements
API
{
public
String
parameter
;
// 参数集合
public
String
t_id
;
//
public
String
t_id_getdatabase
;
@Override
public
void
initialize
(
HashMap
<
String
,
Object
>
data
)
{
// try {
// Thread.sleep(20000);
// } catch (InterruptedException e) {
// // TODO Auto-generated catch block
// e.printStackTrace();
// }
}
@Override
public
HashMap
<
String
,
Object
>
handleInput
(
HashMap
<
String
,
Object
>
data
)
{
// 获取parameter对应的内容
return
data
;
}
@Override
public
Response
SendRequest
(
HashMap
<
String
,
Object
>
data
,
String
Url
,
String
Request
)
{
Map
<
String
,
String
>
cookies
=
new
HashMap
<
String
,
String
>();
cookies
.
put
(
"PHPSESSID"
,
PHPSESSID
);
cookies
.
put
(
"admin_login_ssid"
,
admin_login_ssid
);
cookies
.
put
(
"admin_31_encode"
,
admin_31_encode
);
MyRequest
myRequest
=
new
MyRequest
();
myRequest
.
setParameter
(
parameter
);
myRequest
.
setUrl
(
Url
);
myRequest
.
setRequest
(
Request
);
myRequest
.
setCookies
(
cookies
);
Response
re
=
RequestDataUtils
.
RestAssuredApi
(
data
,
myRequest
);
return
re
;
}
@Override
public
String
handleOutput
(
Response
re
,
HashMap
<
String
,
Object
>
data
)
{
JsonPath
jp
=
new
JsonPath
(
re
.
asString
());
System
.
out
.
println
(
"jp===="
+
jp
);
boolean
result
=
true
;
String
failReason
=
""
;
String
json
=
re
.
asString
();
json
=
StringUtils
.
decodeUnicode
(
json
);
if
((
data
.
get
(
"statusCode"
)
!=
null
)
&&
(!
data
.
get
(
"statusCode"
).
toString
()
.
equals
(
String
.
valueOf
(
re
.
getStatusCode
()))))
{
result
=
result
&&
false
;
failReason
=
failReason
+
"statusCode is expected "
+
data
.
get
(
"statusCode"
).
toString
()
+
" but actually "
+
String
.
valueOf
(
re
.
getStatusCode
())
+
". "
;
}
if
(
json
.
length
()
!=
0
)
{
if
(!
json
.
contains
(
data
.
get
(
"msg"
).
toString
()))
{
result
=
result
&&
false
;
failReason
=
failReason
+
"msg is expected "
+
data
.
get
(
"msg"
).
toString
()
+
" but actually "
+
jp
.
getString
(
"message"
)
+
"."
;
}
if
(
data
.
get
(
"custom"
)
!=
null
&&
json
!=
null
)
{
// 如果自定义结果包含多个希望结果,也就是有逗号,那么就切割,包含比较。
if
(
data
.
get
(
"custom"
).
toString
().
contains
(
","
))
{
String
[]
strCustomStrings
=
data
.
get
(
"custom"
).
toString
()
.
split
(
","
);
// System.out.println(strCustomStrings.length);
for
(
int
i
=
0
;
i
<
strCustomStrings
.
length
;
i
++)
{
if
(!
json
.
contains
(
strCustomStrings
[
i
]))
{
result
=
result
&&
false
;
failReason
=
failReason
+
"custom is expected "
+
data
.
get
(
"custom"
).
toString
()
+
" but actually "
+
strCustomStrings
[
i
]
+
"."
;
break
;
}
}
}
else
{
// 如果只有一个希望结果,就直接包含比较。
if
(!
json
.
contains
(
data
.
get
(
"custom"
).
toString
()))
{
result
=
result
&&
false
;
failReason
=
failReason
+
"custom is expected "
+
data
.
get
(
"custom"
).
toString
()
+
" but actually "
+
data
.
get
(
"custom"
).
toString
()
+
"."
;
}
}
}
if
(
"0"
.
equals
(
jp
.
getString
(
"retcode"
))){
//是否验证数据库
}
}
if
(
result
)
return
"Pass"
;
else
return
"Fail:"
+
failReason
;
}
}
package
com
.
offcn
.
api
.
nwn
.
service
;
import
io.restassured.path.json.JsonPath
;
import
io.restassured.response.Response
;
import
java.io.UnsupportedEncodingException
;
import
java.sql.ResultSet
;
import
java.sql.SQLException
;
import
java.sql.Statement
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.Random
;
import
org.json.simple.JSONArray
;
import
com.offcn.TestUnti.HttpRequest
;
import
com.offcn.TestUnti.Log
;
import
com.offcn.TestUnti.MapUtil
;
import
com.offcn.TestUnti.RequestDataUtils
;
import
com.offcn.TestUnti.StringUtils
;
import
com.offcn.api.nwn.md5.nwngetsign
;
import
com.offcn.interfaces.API
;
import
com.offcn.process.NWN
;
import
com.offcn.system.MyRequest
;
import
com.offcn.TestUnti.ListUtil
;
/**
* 获取直播列表
*
* @author liyy
*
*/
public
class
programLevel
extends
NWN
implements
API
{
public
String
parameter
;
// 参数集合
public
String
t_id
;
//
public
String
t_id_getdatabase
;
@Override
public
void
initialize
(
HashMap
<
String
,
Object
>
data
)
{
// try {
// Thread.sleep(20000);
// } catch (InterruptedException e) {
// // TODO Auto-generated catch block
// e.printStackTrace();
// }
}
@Override
public
HashMap
<
String
,
Object
>
handleInput
(
HashMap
<
String
,
Object
>
data
)
{
// 获取parameter对应的内容
return
data
;
}
@Override
public
Response
SendRequest
(
HashMap
<
String
,
Object
>
data
,
String
Url
,
String
Request
)
{
Map
<
String
,
String
>
cookies
=
new
HashMap
<
String
,
String
>();
cookies
.
put
(
"PHPSESSID"
,
PHPSESSID
);
cookies
.
put
(
"admin_login_ssid"
,
admin_login_ssid
);
cookies
.
put
(
"admin_31_encode"
,
admin_31_encode
);
MyRequest
myRequest
=
new
MyRequest
();
myRequest
.
setParameter
(
parameter
);
myRequest
.
setUrl
(
Url
);
myRequest
.
setRequest
(
Request
);
myRequest
.
setCookies
(
cookies
);
Response
re
=
RequestDataUtils
.
RestAssuredApi
(
data
,
myRequest
);
return
re
;
}
@Override
public
String
handleOutput
(
Response
re
,
HashMap
<
String
,
Object
>
data
)
{
JsonPath
jp
=
new
JsonPath
(
re
.
asString
());
System
.
out
.
println
(
"jp===="
+
jp
);
boolean
result
=
true
;
String
failReason
=
""
;
String
json
=
re
.
asString
();
json
=
StringUtils
.
decodeUnicode
(
json
);
if
((
data
.
get
(
"statusCode"
)
!=
null
)
&&
(!
data
.
get
(
"statusCode"
).
toString
()
.
equals
(
String
.
valueOf
(
re
.
getStatusCode
()))))
{
result
=
result
&&
false
;
failReason
=
failReason
+
"statusCode is expected "
+
data
.
get
(
"statusCode"
).
toString
()
+
" but actually "
+
String
.
valueOf
(
re
.
getStatusCode
())
+
". "
;
}
if
(
json
.
length
()
!=
0
)
{
if
(!
json
.
contains
(
data
.
get
(
"msg"
).
toString
()))
{
result
=
result
&&
false
;
failReason
=
failReason
+
"msg is expected "
+
data
.
get
(
"msg"
).
toString
()
+
" but actually "
+
jp
.
getString
(
"message"
)
+
"."
;
}
if
(
data
.
get
(
"custom"
)
!=
null
&&
json
!=
null
)
{
// 如果自定义结果包含多个希望结果,也就是有逗号,那么就切割,包含比较。
if
(
data
.
get
(
"custom"
).
toString
().
contains
(
","
))
{
String
[]
strCustomStrings
=
data
.
get
(
"custom"
).
toString
()
.
split
(
","
);
// System.out.println(strCustomStrings.length);
for
(
int
i
=
0
;
i
<
strCustomStrings
.
length
;
i
++)
{
if
(!
json
.
contains
(
strCustomStrings
[
i
]))
{
result
=
result
&&
false
;
failReason
=
failReason
+
"custom is expected "
+
data
.
get
(
"custom"
).
toString
()
+
" but actually "
+
strCustomStrings
[
i
]
+
"."
;
break
;
}
}
}
else
{
// 如果只有一个希望结果,就直接包含比较。
if
(!
json
.
contains
(
data
.
get
(
"custom"
).
toString
()))
{
result
=
result
&&
false
;
failReason
=
failReason
+
"custom is expected "
+
data
.
get
(
"custom"
).
toString
()
+
" but actually "
+
data
.
get
(
"custom"
).
toString
()
+
"."
;
}
}
}
if
(
"0"
.
equals
(
jp
.
getString
(
"retcode"
))){
//是否验证数据库
}
}
if
(
result
)
return
"Pass"
;
else
return
"Fail:"
+
failReason
;
}
}
nwn_Api_auto_test/src/com/offcn/api/nwn/shop/add.java
View file @
84ac91ce
package
com
.
offcn
.
api
.
nwn
.
shop
;
import
io.restassured.path.json.JsonPath
;
import
io.restassured.response.Response
;
import
java.util.HashMap
;
import
java.util.Map
;
import
com.offcn.TestUnti.MapUtil
;
import
com.offcn.TestUnti.RequestDataUtils
;
import
com.offcn.TestUnti.StringUtils
;
import
com.offcn.interfaces.API
;
import
com.offcn.process.NWN
;
import
com.offcn.system.MyRequest
;
/**
*
* @Description: 36.3保存是否回放
* @author: liyy
* @date: 2021年3月18日 上午9:55:38
* @version V1.0
*/
public
class
add
extends
NWN
implements
API
{
public
String
parameter
;
//参数集合
public
String
record_id
;
//标识id
// public String phone;//层级包id
@Override
public
void
initialize
(
HashMap
<
String
,
Object
>
data
)
{
}
@Override
public
HashMap
<
String
,
Object
>
handleInput
(
HashMap
<
String
,
Object
>
data
)
{
// 获取parameter对应的内容
parameter
=
MapUtil
.
getValue
(
"parameter"
,
data
);
record_id
=
MapUtil
.
getParameter
(
parameter
,
"record_id"
).
trim
();
if
((!
record_id
.
equals
(
""
))
&&
record_id
.
equals
(
"code"
))
{
record_id
=
"1"
;
parameter
=
parameter
.
replace
(
"\"record_id\":code"
,
"\"record_id\":"
+
record_id
);
}
data
.
put
(
"parameter"
,
parameter
);
return
data
;
}
@Override
public
Response
SendRequest
(
HashMap
<
String
,
Object
>
data
,
String
Url
,
String
Request
)
{
Map
<
String
,
String
>
cookies
=
new
HashMap
<
String
,
String
>();
System
.
out
.
println
(
"admin_32_encode 脚本用的时候="
+
admin_32_encode
);
cookies
.
put
(
"admin_32_encode"
,
admin_32_encode
);
System
.
out
.
println
(
"go_session_id 脚本用的时候="
+
go_session_id
);
cookies
.
put
(
"go_session_id"
,
go_session_id
);
cookies
.
put
(
"admin_login_ssid"
,
admin_login_ssid
);
//System.out.println("admin_login_ssid 脚本用的时候=" + admin_login_ssid);
Map
<
String
,
String
>
headers
=
new
HashMap
<
String
,
String
>();
headers
.
put
(
"Cookie"
,
"go_session_id="
+
go_session_id
);
headers
.
put
(
"Content-Type"
,
"application/json"
);
MyRequest
myRequest
=
new
MyRequest
();
myRequest
.
setUrl
(
Url
);
myRequest
.
setCookies
(
cookies
);
myRequest
.
setHeaders
(
headers
);
myRequest
.
setRequest
(
Request
);
Response
re
=
RequestDataUtils
.
RestAssuredApi
(
data
,
myRequest
);
return
re
;
}
@Override
public
String
handleOutput
(
Response
re
,
HashMap
<
String
,
Object
>
data
)
{
JsonPath
jp
=
re
.
body
().
jsonPath
();
boolean
result
=
true
;
String
failReason
=
""
;
String
json
=
re
.
asString
();
// System.out.println("response=========="+StringUtils.decodeUnicode(json));
if
((
data
.
get
(
"statusCode"
)
!=
null
)
&&
(!
data
.
get
(
"statusCode"
).
toString
()
.
equals
(
String
.
valueOf
(
re
.
getStatusCode
()))))
{
result
=
result
&&
false
;
failReason
=
failReason
+
"statusCode is expected "
+
data
.
get
(
"statusCode"
).
toString
()
+
" but actually "
+
String
.
valueOf
(
re
.
getStatusCode
())
+
". "
;
}
if
(
json
.
length
()
!=
0
)
{
String
msg
=
StringUtils
.
decodeUnicode
(
getMsg
(
re
));
String
code
=
getCode
(
re
);
if
((
data
.
get
(
"code"
)
!=
null
)
&&
(
code
!=
null
)
&&
(!
code
.
equals
(
data
.
get
(
"code"
).
toString
())))
{
result
=
result
&&
false
;
failReason
=
failReason
+
"code is expected "
+
data
.
get
(
"code"
).
toString
()
+
" but actually "
+
jp
.
getString
(
"retcode"
)
+
"."
;
}
/*System.out.println((data.get("msg") != null));
System.out.println((msg != null));
System.out.println(data.get("msg").toString().length());
System.out.println(msg.length());
*/
if
((
data
.
get
(
"msg"
)
!=
null
)
&&
(
msg
!=
null
)
&&
(!
msg
.
equals
(
data
.
get
(
"msg"
).
toString
())))
{
result
=
result
&&
false
;
failReason
=
failReason
+
"msg is expected "
+
data
.
get
(
"msg"
).
toString
()
+
" but actually "
+
jp
.
getString
(
"msg"
)
+
"."
;
}
if
(
data
.
get
(
"custom"
)
!=
null
&&
jp
.
getString
(
"data"
)!=
null
){
String
custom
=
data
.
get
(
"custom"
).
toString
();
String
[]
ArrayString
=
StringUtils
.
getArrayString
(
custom
,
","
);
// System.out.println(jp.getString("custom"));
// System.out.println(Arrays.toString(ArrayString));
if
(!
StringUtils
.
VerificationString
(
jp
.
getString
(
"data"
),
ArrayString
)){
result
=
result
&&
false
;
failReason
=
failReason
+
"custom is expected "
+
data
.
get
(
"custom"
).
toString
()
+
" but actually "
+
jp
.
getString
(
"data"
)
+
"."
;
}
}
/*if (code.equals("5020")) {
go_session_id = re.getCookie("go_session_id");
System.out.println("5020时候go_session_id==" + go_session_id);
}*/
}
if
(
result
)
return
"Pass"
;
else
return
"Fail:"
+
failReason
;
}
}
package
com
.
offcn
.
api
.
nwn
.
shop
;
import
io.restassured.path.json.JsonPath
;
import
io.restassured.response.Response
;
import
java.util.HashMap
;
import
java.util.Map
;
import
com.offcn.TestUnti.MapUtil
;
import
com.offcn.TestUnti.RequestDataUtils
;
import
com.offcn.TestUnti.StringUtils
;
import
com.offcn.interfaces.API
;
import
com.offcn.process.NWN
;
import
com.offcn.system.MyRequest
;
/**
*
* @Description: 36.3保存是否回放
* @author: liyy
* @date: 2021年3月18日 上午9:55:38
* @version V1.0
*/
public
class
add
extends
NWN
implements
API
{
public
String
parameter
;
//参数集合
public
String
record_id
;
//标识id
// public String phone;//层级包id
@Override
public
void
initialize
(
HashMap
<
String
,
Object
>
data
)
{
}
@Override
public
HashMap
<
String
,
Object
>
handleInput
(
HashMap
<
String
,
Object
>
data
)
{
// 获取parameter对应的内容
parameter
=
MapUtil
.
getValue
(
"parameter"
,
data
);
record_id
=
MapUtil
.
getParameter
(
parameter
,
"record_id"
).
trim
();
if
((!
record_id
.
equals
(
""
))
&&
record_id
.
equals
(
"code"
))
{
record_id
=
"1"
;
parameter
=
parameter
.
replace
(
"\"record_id\":code"
,
"\"record_id\":"
+
record_id
);
}
data
.
put
(
"parameter"
,
parameter
);
return
data
;
}
@Override
public
Response
SendRequest
(
HashMap
<
String
,
Object
>
data
,
String
Url
,
String
Request
)
{
Map
<
String
,
String
>
cookies
=
new
HashMap
<
String
,
String
>();
System
.
out
.
println
(
"admin_32_encode 脚本用的时候="
+
admin_32_encode
);
cookies
.
put
(
"admin_32_encode"
,
admin_32_encode
);
System
.
out
.
println
(
"go_session_id 脚本用的时候="
+
go_session_id
);
cookies
.
put
(
"go_session_id"
,
go_session_id
);
cookies
.
put
(
"admin_login_ssid"
,
admin_login_ssid
);
//System.out.println("admin_login_ssid 脚本用的时候=" + admin_login_ssid);
Map
<
String
,
String
>
headers
=
new
HashMap
<
String
,
String
>();
headers
.
put
(
"Cookie"
,
"go_session_id="
+
go_session_id
);
headers
.
put
(
"Content-Type"
,
"application/json"
);
MyRequest
myRequest
=
new
MyRequest
();
myRequest
.
setUrl
(
Url
);
myRequest
.
setCookies
(
cookies
);
myRequest
.
setHeaders
(
headers
);
myRequest
.
setRequest
(
Request
);
Response
re
=
RequestDataUtils
.
RestAssuredApi
(
data
,
myRequest
);
return
re
;
}
@Override
public
String
handleOutput
(
Response
re
,
HashMap
<
String
,
Object
>
data
)
{
JsonPath
jp
=
re
.
body
().
jsonPath
();
boolean
result
=
true
;
String
failReason
=
""
;
String
json
=
re
.
asString
();
// System.out.println("response=========="+StringUtils.decodeUnicode(json));
if
((
data
.
get
(
"statusCode"
)
!=
null
)
&&
(!
data
.
get
(
"statusCode"
).
toString
()
.
equals
(
String
.
valueOf
(
re
.
getStatusCode
()))))
{
result
=
result
&&
false
;
failReason
=
failReason
+
"statusCode is expected "
+
data
.
get
(
"statusCode"
).
toString
()
+
" but actually "
+
String
.
valueOf
(
re
.
getStatusCode
())
+
". "
;
}
if
(
json
.
length
()
!=
0
)
{
String
msg
=
StringUtils
.
decodeUnicode
(
getMsg
(
re
));
String
code
=
getCode
(
re
);
if
((
data
.
get
(
"code"
)
!=
null
)
&&
(
code
!=
null
)
&&
(!
code
.
equals
(
data
.
get
(
"code"
).
toString
())))
{
result
=
result
&&
false
;
failReason
=
failReason
+
"code is expected "
+
data
.
get
(
"code"
).
toString
()
+
" but actually "
+
jp
.
getString
(
"retcode"
)
+
"."
;
}
/*System.out.println((data.get("msg") != null));
System.out.println((msg != null));
System.out.println(data.get("msg").toString().length());
System.out.println(msg.length());
*/
if
((
data
.
get
(
"msg"
)
!=
null
)
&&
(
msg
!=
null
)
&&
(!
msg
.
equals
(
data
.
get
(
"msg"
).
toString
())))
{
result
=
result
&&
false
;
failReason
=
failReason
+
"msg is expected "
+
data
.
get
(
"msg"
).
toString
()
+
" but actually "
+
jp
.
getString
(
"msg"
)
+
"."
;
}
if
(
data
.
get
(
"custom"
)
!=
null
&&
jp
.
getString
(
"data"
)!=
null
){
String
custom
=
data
.
get
(
"custom"
).
toString
();
String
[]
ArrayString
=
StringUtils
.
getArrayString
(
custom
,
","
);
// System.out.println(jp.getString("custom"));
// System.out.println(Arrays.toString(ArrayString));
if
(!
StringUtils
.
VerificationString
(
jp
.
getString
(
"data"
),
ArrayString
)){
result
=
result
&&
false
;
failReason
=
failReason
+
"custom is expected "
+
data
.
get
(
"custom"
).
toString
()
+
" but actually "
+
jp
.
getString
(
"data"
)
+
"."
;
}
}
/*if (code.equals("5020")) {
go_session_id = re.getCookie("go_session_id");
System.out.println("5020时候go_session_id==" + go_session_id);
}*/
}
if
(
result
)
return
"Pass"
;
else
return
"Fail:"
+
failReason
;
}
}
nwn_Api_auto_test/src/com/offcn/process/NWN.java
View file @
84ac91ce
...
...
@@ -25,11 +25,9 @@ public class NWN extends BasicsGM{
public
static
String
url
=
""
;
//后台登录得到的nwn登录地址
public
static
String
nwn_url
=
""
;
//后台登录得到的nwn登录地址
public
static
String
PHPSESSID
=
""
;
//后台登录nwn,最终得到的PHPSESSID
public
static
String
go_session_id
=
""
;
//后台登录电商,最终得到的go_session_id
public
static
String
Content_Length
=
""
;
//后台登录电商,最终得到的go_session_id
public
static
String
admin_32_encode
=
""
;
//后台登录nwn,最终得到的admin_32_encode
public
static
String
admin_31_encode
=
""
;
//后台登录nwn,最终得到的PHPSESSID
public
static
String
location
=
""
;
//后台登录nwn,最终得到的PHPSESSID
public
static
String
admin_32_encode
=
""
;
//后台登录电商,最终得到的PHPSESSID
public
static
String
go_session_id
=
""
;
//后台登录电商,最终得到的PHPSESSID
public
static
List
<
String
>
n_package_idList
=
new
ArrayList
<
String
>();
//n_package的id
public
static
List
<
String
>
n_admin_card_no_List
=
new
ArrayList
<
String
>();
//n_admin的card_no
...
...
nwn_Api_auto_test/src/com/offcn/test/APITest_nwn.java
View file @
84ac91ce
package
com
.
offcn
.
test
;
import
io.restassured.response.Response
;
import
java.sql.SQLException
;
import
java.util.HashMap
;
import
java.util.Iterator
;
import
java.util.Map
;
import
java.util.Map.Entry
;
import
java.util.Set
;
import
net.sf.json.JSONObject
;
import
org.testng.Assert
;
import
org.testng.annotations.AfterClass
;
import
com.offcn.TestData.offcn_api_testData
;
import
com.offcn.TestUnti.Log
;
import
com.offcn.TestUnti.Mail
;
import
com.offcn.TestUnti.MapUtil
;
import
com.offcn.TestUnti.ReadProperties
;
import
com.offcn.TestUnti.Reflect_api
;
import
com.offcn.TestUnti.SheetUtils
;
import
com.offcn.TestUnti.StringUtils
;
import
com.offcn.TestUnti.XMLread
;
import
com.offcn.api.nwn.md5.nwngetsign
;
import
com.offcn.interfaces.API
;
import
com.offcn.listener.MyTestListener
;
import
com.offcn.listener.ProcessTestng
;
import
com.offcn.listener.ResultTestng
;
import
com.offcn.listener.SkipIInvokedMethodListener
;
import
com.offcn.process.BasicsGM
;
import
com.offcn.process.NWN
;
import
org.testng.annotations.BeforeClass
;
import
org.testng.annotations.Listeners
;
import
org.testng.annotations.Test
;
import
io.restassured.response.Response
;
import
java.util.HashMap
;
import
java.util.Iterator
;
import
java.util.Map
;
import
java.util.Map.Entry
;
import
java.util.Set
;
import
org.testng.Assert
;
import
org.testng.annotations.AfterClass
;
import
org.testng.annotations.BeforeClass
;
import
org.testng.annotations.Listeners
;
import
org.testng.annotations.Test
;
import
com.offcn.TestData.offcn_api_testData
;
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.XMLread
;
import
com.offcn.api.nwn.md5.nwngetsign
;
import
com.offcn.interfaces.API
;
import
com.offcn.listener.MyTestListener
;
import
com.offcn.listener.SkipIInvokedMethodListener
;
import
com.offcn.process.BasicsGM
;
import
com.offcn.process.NWN
;
@Listeners
({
MyTestListener
.
class
,
SkipIInvokedMethodListener
.
class
})
public
class
APITest_nwn
extends
NWN
{
...
...
@@ -75,10 +61,12 @@ public class APITest_nwn extends NWN{
data
=
obj
.
handleInput
(
data
);
String
parameter
=
MapUtil
.
getValue
(
"parameter"
,
data
);
// System.out.println(!data.get("Request").toString().contains("get"));
// System.out.println(data.get("system").toString().equals("nwn_service"));
System
.
out
.
println
(!
data
.
get
(
"Request"
).
toString
().
contains
(
"get"
));
System
.
out
.
println
(
data
.
get
(
"system"
).
toString
().
equals
(
"nwn_service"
));
if
(
data
.
get
(
"system"
).
toString
().
equals
(
"nwn_service"
)
){
//静态和动态参数自动添加
...
...
nwn_Api_auto_test/src/resources/map.txt
View file @
84ac91ce
<font size='4' color='#FF0000'>流程错误列表</font><table border='1'><th>URL</th><th>错误次数</th>
<tr><td>/sso/login/sign/417d2b66db1b65ba0779d28f94fe7f71</td><td>错误了1次。</td></tr>
<tr><td>/admin/package/edu/task/addDocTask/sign/99f6e91b2587b086cb7038f9a48bbbb0</td><td>错误了1次。</td></tr>
</table>
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