1
2
3
4
5
6
7
8
9
10
11 package psiprobe.model;
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 DataSourceInfoTest {
22
23
24
25
26 @Test
27 void javabeanTester() {
28 JavaBeanTester.builder(DataSourceInfo.class).loadData().test();
29 }
30
31
32
33
34 @Test
35 void busyScore() {
36 final DataSourceInfo dataSourceInfo = new DataSourceInfo();
37 dataSourceInfo.setBusyConnections(1);
38 dataSourceInfo.setMaxConnections(5);
39 Assertions.assertEquals(20, dataSourceInfo.getBusyScore());
40 }
41
42
43
44
45 @Test
46 void establishedScore() {
47 final DataSourceInfo dataSourceInfo = new DataSourceInfo();
48 dataSourceInfo.setEstablishedConnections(1);
49 dataSourceInfo.setMaxConnections(5);
50 Assertions.assertEquals(20, dataSourceInfo.getEstablishedScore());
51 }
52
53 }