mirror of
https://gitee.com/dromara/hutool.git
synced 2025-04-05 17:37:59 +08:00
commit
09e33610a2
@ -8,6 +8,7 @@ import org.junit.Test;
|
||||
|
||||
import java.net.HttpCookie;
|
||||
import java.net.InetAddress;
|
||||
import java.net.InetSocketAddress;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@ -79,4 +80,16 @@ public class NetUtilTest {
|
||||
public void getLocalHostNameTest() {
|
||||
Assert.assertNotNull(NetUtil.getLocalHostName());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void pingTest(){
|
||||
Assert.assertTrue(NetUtil.ping("127.0.0.1"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void isOpenTest(){
|
||||
InetSocketAddress address = new InetSocketAddress("www.hutool.cn", 443);
|
||||
Assert.assertTrue(NetUtil.isOpen(address, 200));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,3 @@
|
||||
# Auto Configure
|
||||
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
|
||||
cn.hutool.extra.spring.SpringUtil
|
Loading…
Reference in New Issue
Block a user