mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
fix code
This commit is contained in:
@@ -4,7 +4,11 @@ import cn.hutool.system.oshi.CpuInfo;
|
||||
import cn.hutool.system.oshi.OshiUtil;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
import oshi.software.os.OSProcess;
|
||||
|
||||
/**
|
||||
* 测试参考:https://github.com/oshi/oshi/blob/master/oshi-core/src/test/java/oshi/SystemInfoTest.java
|
||||
*/
|
||||
public class OshiTest {
|
||||
|
||||
@Test
|
||||
@@ -18,4 +22,10 @@ public class OshiTest {
|
||||
CpuInfo cpuInfo = OshiUtil.getCpuInfo();
|
||||
Assert.assertNotNull(cpuInfo);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getCurrentProcessTest() {
|
||||
final OSProcess currentProcess = OshiUtil.getCurrentProcess();
|
||||
Assert.assertEquals("java", currentProcess.getName());
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user