View Javadoc
1   /*
2    * Copyright 2022 The OSHI Project Contributors
3    * SPDX-License-Identifier: MIT
4    */
5   package oshi.driver.unix.solaris.kstat;
6   
7   import static org.hamcrest.MatcherAssert.assertThat;
8   import static org.hamcrest.Matchers.greaterThan;
9   import static org.hamcrest.Matchers.lessThanOrEqualTo;
10  
11  import org.junit.jupiter.api.Test;
12  import org.junit.jupiter.api.condition.EnabledOnOs;
13  import org.junit.jupiter.api.condition.OS;
14  
15  import oshi.util.tuples.Pair;
16  
17  @EnabledOnOs(OS.SOLARIS)
18  class SystemPagesTest {
19      @Test
20      void testQueryAvailableTotal() {
21          Pair<Long, Long> availTotal = SystemPages.queryAvailableTotal();
22          assertThat("Total should be a positive number", availTotal.getB().longValue(), greaterThan(0L));
23          assertThat("Available should not exceed total", availTotal.getA().longValue(),
24                  lessThanOrEqualTo(availTotal.getB().longValue()));
25      }
26  }