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
78235e3e
Commit
78235e3e
authored
Jan 14, 2019
by
Li Yongyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nwn
parent
e4c3890b
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
21 additions
and
25 deletions
+21
-25
DataAll.xls
nwn_Api_auto_test/TestData/DataAll.xls
+0
-0
addAccount.java
nwn_Api_auto_test/src/com/offcn/api/nwn/addAccount.java
+4
-4
sign.java
nwn_Api_auto_test/src/com/offcn/api/nwn/process/sign.java
+1
-2
BasicsGM.java
nwn_Api_auto_test/src/com/offcn/process/BasicsGM.java
+6
-6
NWN.java
nwn_Api_auto_test/src/com/offcn/process/NWN.java
+1
-1
APITest_nwn.java
nwn_Api_auto_test/src/com/offcn/test/APITest_nwn.java
+9
-12
No files found.
nwn_Api_auto_test/TestData/DataAll.xls
View file @
78235e3e
No preview for this file type
nwn_Api_auto_test/src/com/offcn/api/nwn/addAccount.java
View file @
78235e3e
...
...
@@ -43,7 +43,7 @@ public class addAccount extends NWN implements API {
public
void
initialize
(
HashMap
<
String
,
Object
>
data
)
{
if
(!
isProduct
&&
data
.
get
(
"CleanDB"
).
toString
().
contains
(
"Y"
))
{
this
.
cleann_n_admin_card_no_List_FromDB
();
this
.
cleann_n_admin_card_no_List_FromDB_beforeTest
();
}
}
...
...
@@ -94,9 +94,9 @@ public class addAccount extends NWN implements API {
if
(
json
.
length
()
!=
0
)
{
String
msg
=
StringUtils
.
decodeUnicode
(
getMsg
(
re
));
String
code
=
getCode
(
re
);
String
ret
code
=
getCode
(
re
);
if
((
data
.
get
(
"code"
)
!=
null
)
&&
(
code
!=
null
)
&&
(!
code
.
equals
(
data
.
get
(
"code"
).
toString
())))
{
if
((
data
.
get
(
"code"
)
!=
null
)
&&
(
retcode
!=
null
)
&&
(!
ret
code
.
equals
(
data
.
get
(
"code"
).
toString
())))
{
result
=
result
&&
false
;
failReason
=
failReason
+
"code is expected "
+
data
.
get
(
"code"
).
toString
()
+
" but actually "
...
...
@@ -121,7 +121,7 @@ public class addAccount extends NWN implements API {
}
}
if
(
"
添加成功!"
.
equals
(
msg
)){
if
(
"
0"
.
equals
(
retcode
)){
//是否验证数据库
if
(!
isProduct
)
{
...
...
nwn_Api_auto_test/src/com/offcn/api/nwn/process/sign.java
View file @
78235e3e
...
...
@@ -50,12 +50,11 @@ public class sign extends NWN implements API {
// n_admin_username_List.clear();
// user_id_List.clear();
this
.
cleann_n_admin_card_no_List_FromDB
();
this
.
cleann_n_admin_card_no_List_FromDB_beforeTest
();
this
.
cleann_n_package_List_FromDB
();
this
.
cleann_user_id_List_FromDB
();
}
}
@Override
public
HashMap
<
String
,
Object
>
handleInput
(
HashMap
<
String
,
Object
>
data
)
{
return
data
;
...
...
nwn_Api_auto_test/src/com/offcn/process/BasicsGM.java
View file @
78235e3e
...
...
@@ -398,9 +398,9 @@ public abstract class BasicsGM {
}
try
{
String
code
=
JSONObject
.
fromObject
(
re
.
body
().
asString
()).
getString
(
"retcode"
);
if
(
StringIsNull
(
code
)){
return
code
;
String
ret
code
=
JSONObject
.
fromObject
(
re
.
body
().
asString
()).
getString
(
"retcode"
);
if
(
StringIsNull
(
ret
code
)){
return
ret
code
;
}
}
catch
(
Exception
e
)
{
}
...
...
@@ -426,9 +426,9 @@ public abstract class BasicsGM {
}
try
{
String
errmsg
=
JSONObject
.
fromObject
(
re
.
body
().
asString
()).
getString
(
"message"
);
if
(
StringIsNull
(
errmsg
)){
return
errmsg
;
String
message
=
JSONObject
.
fromObject
(
re
.
body
().
asString
()).
getString
(
"message"
);
if
(
StringIsNull
(
message
)){
return
message
;
}
}
catch
(
Exception
e
)
{
}
...
...
nwn_Api_auto_test/src/com/offcn/process/NWN.java
View file @
78235e3e
...
...
@@ -94,7 +94,7 @@ public class NWN extends BasicsGM{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
Log
.
logInfo
(
"清除数据失败n_admin_card_no_
List
"
);
Log
.
logInfo
(
"清除数据失败n_admin_card_no_
qty50636
"
);
}
...
...
nwn_Api_auto_test/src/com/offcn/test/APITest_nwn.java
View file @
78235e3e
package
com
.
offcn
.
test
;
import
io.restassured.response.Response
;
import
java.sql.SQLException
;
import
java.util.HashMap
;
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
;
...
...
@@ -23,28 +27,21 @@ import com.offcn.process.NWN;
import
com.offcn.process.TK
;
import
com.offcn.process.XYZB
;
import
org.testng.annotations.BeforeClass
;
import
org.testng.annotations.Listeners
;
import
org.testng.annotations.Test
;
@Listeners
({
ProcessTestng
.
class
,
ResultTestng
.
class
})
public
class
APITest_nwn
extends
NWN
{
@
After
Class
@
Before
Class
public
void
beforeClass
()
{
//测试结束删除测试所用的数据
if
(!
isClearMysql
)
{
System
.
out
.
println
(
"start del **************"
);
this
.
cleann_n_admin_card_no_List_FromDB_beforeTest
();
try
{
if
(
stmt
!=
null
){
stmt
.
close
();
}
if
(
conn
!=
null
){
conn
.
close
();
}
}
catch
(
SQLException
e
)
{
e
.
printStackTrace
();
}
System
.
out
.
println
(
"end del **************"
);
}
Log
.
logInfo
(
"========测试开始========"
);
...
...
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