1
2
3
4
5
6
7
8
9
10
11 package psiprobe.tools.logging.jdk;
12
13 import static org.junit.jupiter.api.Assertions.assertNotNull;
14
15 import java.util.List;
16
17 import org.junit.jupiter.api.BeforeEach;
18 import org.junit.jupiter.api.Test;
19
20 import psiprobe.tools.logging.LogDestination;
21
22
23
24
25 class Jdk14ManagerAccessorTest {
26
27
28 private ClassLoader classLoader;
29
30
31
32
33 @BeforeEach
34 void setUp() {
35 classLoader = getClass().getClassLoader();
36 }
37
38
39
40
41
42
43 @Test
44 void testConstructorAndGetRootLogger() throws Exception {
45 Jdk14ManagerAccessor accessor = new Jdk14ManagerAccessor(classLoader);
46 assertNotNull(accessor.getRootLogger());
47 }
48
49
50
51
52
53
54 @Test
55 void testGetLogger() throws Exception {
56 Jdk14ManagerAccessor accessor = new Jdk14ManagerAccessor(classLoader);
57 assertNotNull(accessor.getLogger(""));
58 assertNotNull(accessor.getLogger("global"));
59 }
60
61
62
63
64
65
66 @Test
67 void testGetHandlers() throws Exception {
68 Jdk14ManagerAccessor accessor = new Jdk14ManagerAccessor(classLoader);
69 List<LogDestination> handlers = accessor.getHandlers();
70 assertNotNull(handlers);
71 }
72
73 }