mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
fix http
This commit is contained in:
28
hutool-http/src/test/java/cn/hutool/http/test/HttpsTest.java
Normal file
28
hutool-http/src/test/java/cn/hutool/http/test/HttpsTest.java
Normal file
@@ -0,0 +1,28 @@
|
||||
package cn.hutool.http.test;
|
||||
|
||||
import cn.hutool.core.lang.Console;
|
||||
import cn.hutool.core.thread.ThreadUtil;
|
||||
import cn.hutool.http.HttpUtil;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
public class HttpsTest {
|
||||
|
||||
/**
|
||||
* 测试单例的SSLSocketFactory是否有线程安全问题
|
||||
*/
|
||||
@Test
|
||||
@Ignore
|
||||
public void getTest() {
|
||||
final AtomicInteger count = new AtomicInteger();
|
||||
for(int i =0; i < 100; i++){
|
||||
ThreadUtil.execute(()->{
|
||||
final String s = HttpUtil.get("https://www.baidu.com/");
|
||||
Console.log(count.incrementAndGet());
|
||||
});
|
||||
}
|
||||
ThreadUtil.sync(this);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user