1
2
3
4
5
6
7
8
9
10
11
12
13
14 package ch.qos.logback.classic.spi;
15
16 import ch.qos.logback.classic.Logger;
17 import ch.qos.logback.classic.LoggerContext;
18 import org.junit.jupiter.api.BeforeEach;
19 import org.junit.jupiter.api.Test;
20
21 import static org.junit.jupiter.api.Assertions.assertEquals;
22
23 public class LoggerComparatorTest {
24
25 LoggerComparator comparator = new LoggerComparator();
26 LoggerContext lc = new LoggerContext();
27
28 Logger root = lc.getLogger("root");
29
30 Logger a = lc.getLogger("a");
31 Logger b = lc.getLogger("b");
32
33 @BeforeEach
34 public void setUp() throws Exception {
35
36 }
37
38 @Test
39 public void testSmoke() {
40 assertEquals(0, comparator.compare(a, a));
41 assertEquals(-1, comparator.compare(a, b));
42 assertEquals(1, comparator.compare(b, a));
43 assertEquals(-1, comparator.compare(root, a));
44
45 assertEquals(1, comparator.compare(a, root));
46 assertEquals(0, comparator.compare(root, root));
47 }
48 }