1
2
3
4
5
6
7
8
9
10
11 package psiprobe;
12
13 import com.codebox.bean.JavaBeanTester;
14
15 import org.junit.jupiter.api.Assertions;
16 import org.junit.jupiter.api.Test;
17
18
19
20
21 class UtilsBaseTest {
22
23
24
25
26 @Test
27 void calcPoolUsageScoreTest() {
28 Assertions.assertEquals(100, UtilsBase.calcPoolUsageScore(5, 5));
29 Assertions.assertEquals(0, UtilsBase.calcPoolUsageScore(0, 5));
30 }
31
32
33
34
35 @Test
36 void toIntTest() {
37 Assertions.assertEquals(5, UtilsBase.toInt("garbage", 5));
38 Assertions.assertEquals(3, UtilsBase.toInt("3", 5));
39 Assertions.assertEquals(5, UtilsBase.toInt("3 3", 5));
40 Assertions.assertEquals(5, UtilsBase.toInt((String) null, 5));
41 }
42
43
44
45
46 @Test
47 void javabeanTester() {
48 JavaBeanTester.builder(UtilsBase.class).testPrivateConstructor();
49 }
50
51 }