mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
fix code
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
package cn.hutool.extra.system;
|
||||
package cn.hutool.extra.management;
|
||||
|
||||
import cn.hutool.core.lang.Console;
|
||||
import cn.hutool.extra.system.oshi.OshiUtil;
|
||||
import cn.hutool.extra.management.oshi.OshiUtil;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
@@ -1,8 +1,8 @@
|
||||
package cn.hutool.extra.system;
|
||||
package cn.hutool.extra.management;
|
||||
|
||||
import cn.hutool.core.lang.Console;
|
||||
import cn.hutool.extra.system.oshi.CpuInfo;
|
||||
import cn.hutool.extra.system.oshi.OshiUtil;
|
||||
import cn.hutool.extra.management.oshi.CpuInfo;
|
||||
import cn.hutool.extra.management.oshi.OshiUtil;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
@@ -1,4 +1,4 @@
|
||||
package cn.hutool.extra.system;
|
||||
package cn.hutool.extra.management;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.Ignore;
|
||||
@@ -11,43 +11,43 @@ public class SystemUtilTest {
|
||||
@Test
|
||||
@Ignore
|
||||
public void dumpTest() {
|
||||
SystemUtil.dumpSystemInfo();
|
||||
ManagementUtil.dumpSystemInfo();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getCurrentPidTest() {
|
||||
long pid = SystemUtil.getCurrentPID();
|
||||
long pid = ManagementUtil.getCurrentPID();
|
||||
Assert.assertTrue(pid > 0);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getJavaInfoTest() {
|
||||
JavaInfo javaInfo = SystemUtil.getJavaInfo();
|
||||
JavaInfo javaInfo = ManagementUtil.getJavaInfo();
|
||||
Assert.assertNotNull(javaInfo);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getJavaRuntimeInfoTest() {
|
||||
JavaRuntimeInfo info = SystemUtil.getJavaRuntimeInfo();
|
||||
JavaRuntimeInfo info = ManagementUtil.getJavaRuntimeInfo();
|
||||
Assert.assertNotNull(info);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getOsInfoTest() {
|
||||
OsInfo osInfo = SystemUtil.getOsInfo();
|
||||
OsInfo osInfo = ManagementUtil.getOsInfo();
|
||||
Assert.assertNotNull(osInfo);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getHostInfo() {
|
||||
HostInfo hostInfo = SystemUtil.getHostInfo();
|
||||
HostInfo hostInfo = ManagementUtil.getHostInfo();
|
||||
Assert.assertNotNull(hostInfo);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getUserInfoTest(){
|
||||
// https://gitee.com/dromara/hutool/issues/I3NM39
|
||||
final UserInfo userInfo = SystemUtil.getUserInfo();
|
||||
final UserInfo userInfo = ManagementUtil.getUserInfo();
|
||||
Assert.assertTrue(userInfo.getTempDir().endsWith(File.separator));
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user