Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
test-platform
Project
Project
Details
Activity
Releases
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
马博
test-platform
Commits
4ffd0141
Commit
4ffd0141
authored
Nov 08, 2018
by
赵然
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
zr
parent
cd0348a4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
53 additions
and
12 deletions
+53
-12
中奖发奖限制.java
src/test/java/http/cases/NewActivityTest/中奖发奖限制.java
+7
-7
多奖项中奖限制_DuibaTest.java
...st/java/http/cases/NewActivityTest/多奖项中奖限制_DuibaTest.java
+3
-2
奖品发放限制_DuibaTest.java
...est/java/http/cases/NewActivityTest/奖品发放限制_DuibaTest.java
+43
-3
No files found.
src/test/java/http/cases/NewActivityTest/中奖发奖限制
_DuibaTest
.java
→
src/test/java/http/cases/NewActivityTest/中奖发奖限制.java
View file @
4ffd0141
...
...
@@ -25,7 +25,7 @@ import java.util.Map;
/**
* Created by zhaoran on 2018/07/10
*/
public
class
中奖发奖限制
_DuibaTest
extends
DuibaTestBase
{
public
class
中奖发奖限制
extends
DuibaTestBase
{
@Autowired
NewActivityService
newActivityService
;
...
...
@@ -57,10 +57,10 @@ public class 中奖发奖限制_DuibaTest extends DuibaTestBase {
public
void
after
()
throws
Exception
{
//数据库删除
try
{
jdbc
.
update
(
"delete from hdtool_conf.duiba_hdtool where title=?"
,
"【自动化】多奖项中奖限制"
+
data
);
jdbc
.
update
(
"delete from credits_dev.operating_activity where title=?"
,
"【自动化】多奖项中奖限制"
+
data
);
jdbc
.
update
(
"delete from hdtool_conf.duiba_hdtool where title=?"
,
"【自动化】奖品发放限制"
+
data2
);
jdbc
.
update
(
"delete from credits_dev.operating_activity where title=?"
,
"【自动化】奖品发放限制"
+
data2
);
jdbc
.
update
(
"delete from hdtool_conf.duiba_hdtool where title=?"
,
"【自动化】多奖项中奖限制
_DuibaTest
"
+
data
);
jdbc
.
update
(
"delete from credits_dev.operating_activity where title=?"
,
"【自动化】多奖项中奖限制
_DuibaTest
"
+
data
);
jdbc
.
update
(
"delete from hdtool_conf.duiba_hdtool where title=?"
,
"【自动化】奖品发放限制
_DuibaTest
"
+
data2
);
jdbc
.
update
(
"delete from credits_dev.operating_activity where title=?"
,
"【自动化】奖品发放限制
_DuibaTest
"
+
data2
);
}
catch
(
Exception
e
)
{
System
.
out
.
println
(
e
);
}
...
...
@@ -147,7 +147,7 @@ public class 中奖发奖限制_DuibaTest extends DuibaTestBase {
@Test
public
void
多奖项中奖限制测试
()
throws
Exception
{
data
=
PublicMethod
.
data
();
String
title
=
"【自动化】多奖项中奖限制"
+
data
;
String
title
=
"【自动化】多奖项中奖限制
_DuibaTest
"
+
data
;
this
.
创建并上架活动
(
title
);
...
...
@@ -182,7 +182,7 @@ public class 中奖发奖限制_DuibaTest extends DuibaTestBase {
@Test
public
void
奖品发放限制测试
()
throws
Exception
{
data2
=
PublicMethod
.
data
();
String
title
=
"【自动化】奖品发放限制"
+
data2
;
String
title
=
"【自动化】奖品发放限制
_DuibaTest
"
+
data2
;
this
.
创建并上架活动
2
(
title
);
//获取管理员后台活动信息
...
...
src/test/java/http/cases/NewActivityTest/多奖项中奖限制.java
→
src/test/java/http/cases/NewActivityTest/多奖项中奖限制
_DuibaTest
.java
View file @
4ffd0141
...
...
@@ -16,7 +16,7 @@ import org.testng.annotations.Test;
/**
* Created by zhaoran on 2018/07/10
*/
public
class
多奖项中奖限制
extends
DuibaTestBase
{
public
class
多奖项中奖限制
_DuibaTest
extends
DuibaTestBase
{
@Autowired
NewActivityService
newActivityService
;
...
...
@@ -33,6 +33,7 @@ public class 多奖项中奖限制 extends DuibaTestBase {
public
void
after
()
throws
Exception
{
//数据库删除
try
{
//case:[多奖项中奖限制测试_永久]数据处理:删除永久中奖记录
jdbc
.
update
(
"UPDATE ckvtable.tb_kvtable_0687 SET int_value = '0' WHERE vkey = 'activity-centerwinOptionNum_100025007_35869_hdtool25885'"
);
}
catch
(
Exception
e
)
{
System
.
out
.
println
(
e
);
...
...
@@ -41,7 +42,7 @@ public class 多奖项中奖限制 extends DuibaTestBase {
@Test
public
void
多奖项中奖限制测试
()
throws
Exception
{
public
void
多奖项中奖限制测试
_
永久
()
throws
Exception
{
//第一次抽奖
Response
response
=
this
.
新活动工具接口传参
(
"35869"
,
"adsdas"
,
"iOS"
);
...
...
src/test/java/http/cases/NewActivityTest/奖品发放限制.java
→
src/test/java/http/cases/NewActivityTest/奖品发放限制
_DuibaTest
.java
View file @
4ffd0141
...
...
@@ -12,11 +12,17 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.testng.Assert
;
import
org.testng.annotations.AfterClass
;
import
org.testng.annotations.Test
;
import
utils.HbaseService
;
import
java.text.SimpleDateFormat
;
import
java.util.Calendar
;
import
java.util.Date
;
import
java.util.Locale
;
/**
* Created by zhaoran on 2018/07/10
*/
public
class
奖品发放限制
extends
DuibaTestBase
{
public
class
奖品发放限制
_DuibaTest
extends
DuibaTestBase
{
@Autowired
NewActivityService
newActivityService
;
...
...
@@ -28,14 +34,20 @@ public class 奖品发放限制 extends DuibaTestBase {
CustomHdToolCtrlService
customHdToolCtrlService
;
@Autowired
ActivityService
activityService
;
@Autowired
HbaseService
hbaseService
;
private
static
DuibaLog
logger
=
DuibaLog
.
getLogger
();
@AfterClass
public
void
after
()
throws
Exception
{
//数据库删除
try
{
//case:[奖品发放限制测试_永久]数据处理:删除永久中奖记录
jdbc
.
update
(
"UPDATE ckvtable.tb_kvtable_0687 SET int_value = '0' WHERE vkey = 'activity-centerwinOptionNum_100025007_35868_hdtool25884'"
);
//case:[奖品发放限制测试_每日]数据处理:删除每日中奖记录
String
y_m_d
=
getTime2
(
0
);
String
key
=
"k05_PRIZE_K001_"
+
y_m_d
+
"_hdtool25933_100025007"
;
hbaseService
.
deleteHBASEKey2
(
key
);
}
catch
(
Exception
e
)
{
System
.
out
.
println
(
e
);
}
...
...
@@ -44,7 +56,7 @@ public class 奖品发放限制 extends DuibaTestBase {
@Test
public
void
奖品发放限制测试
()
throws
Exception
{
public
void
奖品发放限制测试
_
永久
()
throws
Exception
{
//第一次抽奖
Response
response
=
this
.
新活动工具接口传参
(
"35868"
,
"adsdas"
,
"iOS"
);
...
...
@@ -59,6 +71,21 @@ public class 奖品发放限制 extends DuibaTestBase {
}
@Test
public
void
奖品发放限制测试
_
每日
()
throws
Exception
{
//第一次抽奖
Response
response
=
this
.
新活动工具接口传参
(
"35920"
,
"adsdas"
,
"iOS"
);
Assert
.
assertEquals
(
String
.
valueOf
(
response
.
jsonPath
().
getString
(
"lottery.type"
)),
"phonebill"
,
"第一次抽奖出奖类型失败"
);
Assert
.
assertEquals
(
String
.
valueOf
(
response
.
jsonPath
().
getString
(
"lottery.title"
)),
"话费"
,
"第一次抽奖出奖title失败"
);
//第二次抽奖
response
=
this
.
新活动工具接口传参
(
"35920"
,
"adsdas"
,
"iOS"
);
Assert
.
assertEquals
(
String
.
valueOf
(
response
.
jsonPath
().
getString
(
"lottery.type"
)),
"lucky"
,
"第一次抽奖出奖类型失败"
);
Assert
.
assertEquals
(
String
.
valueOf
(
response
.
jsonPath
().
getString
(
"lottery.useBtnText"
)),
"马上使用"
,
"第一次抽奖出奖文案失败"
);
}
public
Response
新活动工具接口传参
(
String
activityId
,
String
token
,
String
device
)
throws
Exception
{
Response
response
=
newActivityService
.
doJoin2
(
activityId
,
token
);
...
...
@@ -79,4 +106,16 @@ public class 奖品发放限制 extends DuibaTestBase {
return
response
;
}
public
String
getTime2
(
int
amount
){
SimpleDateFormat
dateFormat
=
new
SimpleDateFormat
(
"YYYY-MM-dd"
,
Locale
.
ENGLISH
);
Date
date
=
new
Date
();
Calendar
calendar
=
Calendar
.
getInstance
();
calendar
.
setTime
(
date
);
calendar
.
add
(
Calendar
.
DAY_OF_MONTH
,
amount
);
date
=
calendar
.
getTime
();
// System.out.println(dateFormat.format(date));
String
time
=
dateFormat
.
format
(
date
);
// System.out.println(time);
return
time
;
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment