"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "log4j-core/src/test/java/org/apache/logging/log4j/core/pattern/RegexReplacementTest.java" between
apache-log4j-2.12.3-src.tar.gz and apache-log4j-2.12.4-src.tar.gz

About: Apache Log4j 2 is a logging library for Java. Source distribution (Java).
Caution: Release 2.12.3 is the last 2.x release to support Java 7 (Java 8 users should use 2.17.0 or greater) and have fixed a critical remote code execution vulnerability (CVE-2021-44228).

RegexReplacementTest.java  (apache-log4j-2.12.3-src):RegexReplacementTest.java  (apache-log4j-2.12.4-src)
skipping to change at line 74 skipping to change at line 74
assertNotNull(msgs); assertNotNull(msgs);
assertEquals("Incorrect number of messages. Should be 1 is " + msgs.size (), 1, msgs.size()); assertEquals("Incorrect number of messages. Should be 1 is " + msgs.size (), 1, msgs.size());
assertTrue("Replacement failed - expected ending " + EXPECTED + " Actual " + msgs.get(0), assertTrue("Replacement failed - expected ending " + EXPECTED + " Actual " + msgs.get(0),
msgs.get(0).endsWith(EXPECTED)); msgs.get(0).endsWith(EXPECTED));
app.clear(); app.clear();
ThreadContext.put("MyKey", "Apache"); ThreadContext.put("MyKey", "Apache");
logger.error("This is a test for ${ctx:MyKey}"); logger.error("This is a test for ${ctx:MyKey}");
msgs = app.getMessages(); msgs = app.getMessages();
assertNotNull(msgs); assertNotNull(msgs);
assertEquals("Incorrect number of messages. Should be 1 is " + msgs.size (), 1, msgs.size()); assertEquals("Incorrect number of messages. Should be 1 is " + msgs.size (), 1, msgs.size());
assertEquals("LoggerTest This is a test for ${ctx:MyKey}\n", msgs.get(0) ); assertEquals("LoggerTest This is a test for ${ctx:MyKey}", msgs.get(0).t rim());
} }
@Test @Test
public void testConverter() { public void testConverter() {
logger2.error(this.getClass().getName()); logger2.error(this.getClass().getName());
final List<String> msgs = app2.getMessages(); final List<String> msgs = app2.getMessages();
assertNotNull(msgs); assertNotNull(msgs);
assertEquals("Incorrect number of messages. Should be 1 is " + msgs.siz e(), 1, msgs.size()); assertEquals("Incorrect number of messages. Should be 1 is " + msgs.siz e(), 1, msgs.size());
assertTrue("Replacement failed - expected ending " + EXPECTED + " Actua l " + msgs.get(0), assertTrue("Replacement failed - expected ending " + EXPECTED + " Actua l " + msgs.get(0),
msgs.get(0).endsWith(EXPECTED)); msgs.get(0).endsWith(EXPECTED));
} }
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)