Commit df407448 by fudahua

未在绑定范围判断

parent 3fd65bee
......@@ -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>
......
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() {
ExecutorService pool = Executors. newCachedThreadPool();
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();
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment