1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 package net.sourceforge.acelogger.filter.test;
16
17 import org.testng.annotations.Test;
18
19 import net.sourceforge.acelogger.level.LogLevel;
20 import net.sourceforge.acelogger.level.filter.BaseLevelFilter;
21
22 import static org.testng.Assert.assertEquals;
23
24
25
26
27
28
29
30
31 @Test
32 public class BaseLevelFilterTest {
33
34 private static class LevelFilterTester extends BaseLevelFilter {
35
36 public LevelFilterTester(String identifier) {
37 super(identifier);
38 }
39
40 public boolean isSuitable(LogLevel level) {
41 return false;
42 }
43
44 }
45
46 @Test
47 public void testSetIdentifier() {
48 LevelFilterTester tester = new LevelFilterTester("filter.tester");
49 assertEquals(tester.getIdentifier(), "filter.tester");
50 }
51
52 @Test
53 public void testSetNullIdentifier() {
54 LevelFilterTester tester = new LevelFilterTester(null);
55 assertEquals(tester.getIdentifier(), "");
56 }
57
58 }