Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
haoban-manage3.0
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
haoban3.0
haoban-manage3.0
Commits
df407448
Commit
df407448
authored
Nov 25, 2020
by
fudahua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
未在绑定范围判断
parent
3fd65bee
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
12 deletions
+24
-12
pom.xml
haoban-manage3-service/pom.xml
+5
-0
DealSyncTest.java
haoban-manage3-service/src/test/java/DealSyncTest.java
+19
-12
No files found.
haoban-manage3-service/pom.xml
View file @
df407448
...
...
@@ -142,6 +142,11 @@
<artifactId>
gic-binlog-base
</artifactId>
<version>
1.0-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
cn.hutool
</groupId>
<artifactId>
hutool-all
</artifactId>
<version>
5.5.1
</version>
</dependency>
</dependencies>
<build>
...
...
haoban-manage3-service/src/test/java/DealSyncTest.java
View file @
df407448
import
cn.hutool.core.thread.ConcurrencyTester
;
import
cn.hutool.core.thread.ThreadUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.gic.haoban.base.api.common.ServiceResponse
;
...
...
@@ -59,24 +61,29 @@ public class DealSyncTest {
@Test
public
void
test
()
{
ConcurrencyTester
tester
=
ThreadUtil
.
concurrencyTest
(
10
,
()
->
{
List
<
String
>
res
=
memberUnionidRelatedApiService
.
listSelfExterialList
(
"ca66a01b79474c40b3e7c7f93daf1a3b"
,
"QiuWenMin"
);
System
.
out
.
println
(
JSON
.
toJSONString
(
res
));
});
ExecutorService
pool
=
Executors
.
newCachedThreadPool
();
List
<
String
>
res
=
memberUnionidRelatedApiService
.
listSelfExterialList
(
"ca66a01b79474c40b3e7c7f93daf1a3b"
,
"QiuWenMin"
);
System
.
out
.
println
(
JSON
.
toJSONString
(
res
));
// 初始化计数器为1
CountDownLatch
countDownLatch
=
new
CountDownLatch
(
1
);
new
Thread
(
new
CountDownLatchTest
(
memberUnionidRelatedApiService
,
"12"
,
countDownLatch
)).
start
();
new
Thread
(
new
CountDownLatchTest
(
memberUnionidRelatedApiService
,
"13989473881"
,
countDownLatch
)).
start
();
new
Thread
(
new
CountDownLatchTest
(
memberUnionidRelatedApiService
,
"1545shiyao"
,
countDownLatch
)).
start
();
new
Thread
(
new
CountDownLatchTest
(
memberUnionidRelatedApiService
,
"15757150876"
,
countDownLatch
)).
start
();;
new
Thread
(
new
CountDownLatchTest
(
memberUnionidRelatedApiService
,
"18758285875"
,
countDownLatch
)).
start
();
new
Thread
(
new
CountDownLatchTest
(
memberUnionidRelatedApiService
,
"2224324sdftgret90"
,
countDownLatch
)).
start
();
new
Thread
(
new
CountDownLatchTest
(
memberUnionidRelatedApiService
,
"2341578784"
,
countDownLatch
)).
start
();
new
Thread
(
new
CountDownLatchTest
(
memberUnionidRelatedApiService
,
"234324"
,
countDownLatch
)).
start
();
new
Thread
(
new
CountDownLatchTest
(
memberUnionidRelatedApiService
,
"niweizhong"
,
countDownLatch
)).
start
();
new
Thread
(
new
CountDownLatchTest
(
memberUnionidRelatedApiService
,
"QiuWenMin"
,
countDownLatch
)).
start
();
//
CountDownLatch countDownLatch = new CountDownLatch(1);
//
new Thread(new CountDownLatchTest(memberUnionidRelatedApiService,"12", countDownLatch)).start();
//
new Thread(new CountDownLatchTest(memberUnionidRelatedApiService,"13989473881", countDownLatch)).start();
//
new Thread(new CountDownLatchTest(memberUnionidRelatedApiService,"1545shiyao", countDownLatch)).start();
//
new Thread(new CountDownLatchTest(memberUnionidRelatedApiService,"15757150876", countDownLatch)).start();;
//
new Thread(new CountDownLatchTest(memberUnionidRelatedApiService,"18758285875", countDownLatch)).start();
//
new Thread(new CountDownLatchTest(memberUnionidRelatedApiService,"2224324sdftgret90", countDownLatch)).start();
//
new Thread(new CountDownLatchTest(memberUnionidRelatedApiService,"2341578784", countDownLatch)).start();
//
new Thread(new CountDownLatchTest(memberUnionidRelatedApiService,"234324", countDownLatch)).start();
//
new Thread(new CountDownLatchTest(memberUnionidRelatedApiService,"niweizhong", countDownLatch)).start();
//
new Thread(new CountDownLatchTest(memberUnionidRelatedApiService,"QiuWenMin", countDownLatch)).start();
// 启动多个线程
countDownLatch
.
countDown
();
//
countDownLatch.countDown();
}
}
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