mirror of
https://github.com/PowerJob/PowerJob.git
synced 2025-07-17 00:00:04 +08:00
31 lines
746 B
Java
31 lines
746 B
Java
import com.github.kfcfans.powerjob.common.PowerJobDKey;
|
|
import com.github.kfcfans.powerjob.common.utils.NetUtils;
|
|
import org.junit.jupiter.api.Test;
|
|
|
|
/**
|
|
* NetUtilsTest
|
|
*
|
|
* @author tjq
|
|
* @since 2020/8/8
|
|
*/
|
|
public class NetUtilsTest {
|
|
|
|
@Test
|
|
public void testOrigin() {
|
|
System.out.println(NetUtils.getLocalHost());
|
|
}
|
|
|
|
@Test
|
|
public void testPreferredNetworkInterface() {
|
|
System.setProperty(PowerJobDKey.PREFERRED_NETWORK_INTERFACE, "en5");
|
|
System.out.println(NetUtils.getLocalHost());
|
|
}
|
|
|
|
@Test
|
|
public void testIgnoredNetworkInterface() {
|
|
System.setProperty(PowerJobDKey.IGNORED_NETWORK_INTERFACE_REGEX, "utun.|llw.");
|
|
System.out.println(NetUtils.getLocalHost());
|
|
}
|
|
|
|
}
|