|
17 | 17 |
|
18 | 18 | import com.navercorp.pinpoint.it.plugin.utils.AgentPath;
|
19 | 19 | import com.navercorp.pinpoint.it.plugin.utils.PluginITConstants;
|
20 |
| -import com.navercorp.pinpoint.it.plugin.utils.StdoutRecorder; |
21 | 20 | import com.navercorp.pinpoint.test.plugin.Dependency;
|
22 | 21 | import com.navercorp.pinpoint.test.plugin.JvmArgument;
|
23 | 22 | import com.navercorp.pinpoint.test.plugin.JvmVersion;
|
24 | 23 | import com.navercorp.pinpoint.test.plugin.PinpointAgent;
|
25 | 24 | import com.navercorp.pinpoint.test.plugin.PinpointConfig;
|
26 | 25 | import com.navercorp.pinpoint.test.plugin.PluginForkedTest;
|
27 |
| -import org.apache.logging.log4j.LogManager; |
28 |
| -import org.apache.logging.log4j.Logger; |
29 |
| -import org.junit.jupiter.api.Assertions; |
30 | 26 | import org.junit.jupiter.api.Test;
|
31 | 27 |
|
32 | 28 | @PluginForkedTest
|
|
35 | 31 | @JvmVersion(11)
|
36 | 32 | @Dependency({"org.apache.logging.log4j:log4j-core:[2.20,2.22]", PluginITConstants.VERSION})
|
37 | 33 | @JvmArgument("-DtestLoggerEnable=false")
|
38 |
| -public class Log4j2Pattern_2_20_IT extends Log4j2TestBase { |
| 34 | +public class Log4J2Pattern_2_20_ITTest extends Log4j2PatternTestBase { |
39 | 35 |
|
40 | 36 | private String location;
|
41 | 37 | @Test
|
42 | 38 | public void patternUpdate() {
|
43 |
| - final String msg = "pattern"; |
44 |
| - |
45 |
| - StdoutRecorder stdoutRecorder = new StdoutRecorder(); |
46 |
| - String log = stdoutRecorder.record(new Runnable() { |
47 |
| - @Override |
48 |
| - public void run() { |
49 |
| - Logger logger = LogManager.getLogger("patternUpdateLog4j2Jvm7"); |
50 |
| - logger.error(msg); |
51 |
| - location = getLoggerJarLocation(logger); |
52 |
| - } |
53 |
| - }); |
54 |
| - |
55 |
| - System.out.println(log); |
56 |
| - Assertions.assertNotNull(log, "log null"); |
57 |
| - Assertions.assertTrue(log.contains(msg), "contains msg"); |
58 |
| - Assertions.assertTrue(log.contains("TxId"), "contains TxId"); |
59 |
| - |
60 |
| - Assertions.assertNotNull(location, "location null"); |
61 |
| - System.out.println("Log4j2 jar location:" + location); |
62 |
| - final String testVersion = getTestVersion(); |
63 |
| - Assertions.assertTrue(location.contains("/" + testVersion + "/"), "test version is not " + getTestVersion()); |
| 39 | + checkPatternUpdate(); |
64 | 40 | }
|
65 | 41 |
|
66 | 42 | }
|
0 commit comments