1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.spf4j.test.log;
17
18 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
19 import org.junit.Test;
20 import org.slf4j.Logger;
21 import org.slf4j.LoggerFactory;
22
23
24
25
26
27 @SuppressFBWarnings("LO_SUSPECT_LOG_CLASS")
28 public class TestGlobalErrorIgnore {
29
30 private static final Logger LOG = LoggerFactory.getLogger(TestGlobalErrorIgnore.class);
31
32 private static final Logger LOG2 = LoggerFactory.getLogger("a.b");
33
34 static {
35 java.util.logging.Logger.getLogger(TestGlobalErrorIgnore.class.getName())
36 .severe("This will not fail due to surefirre setup to ignore 0");
37 LOG.error("This will not fail due to surefire setup to ignore 1");
38 LOG2.error("l2");
39 }
40
41
42 @Test
43 @SuppressFBWarnings("UTAO_JUNIT_ASSERTION_ODDITIES_NO_ASSERT")
44
45 public void testSomeHandler() {
46 LOG.error("This will not fail due to surefirre setup to ignore 2");
47 java.util.logging.Logger.getLogger(TestGlobalErrorIgnore.class.getName())
48 .severe("This will not fail due to surefirre setup to ignore 3");
49 LOG2.error("l2");
50 }
51 }