1
2
3
4
5 package oshi.driver.mac;
6
7 import static org.hamcrest.MatcherAssert.assertThat;
8 import static org.hamcrest.Matchers.greaterThan;
9
10 import org.junit.jupiter.api.Test;
11 import org.junit.jupiter.api.condition.EnabledOnOs;
12 import org.junit.jupiter.api.condition.OS;
13
14 import oshi.SystemInfo;
15
16 @EnabledOnOs(OS.MAC)
17 class ThreadInfoTest {
18 @Test
19 void testQueryTaskThreads() {
20 int pid = new SystemInfo().getOperatingSystem().getProcessId();
21 assertThat("Processes should have at least one thread.", ThreadInfo.queryTaskThreads(pid).size(),
22 greaterThan(0));
23 }
24 }