You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by GitBox <gi...@apache.org> on 2021/10/18 19:32:07 UTC

[GitHub] [logging-log4j2] barrynfleming commented on a change in pull request #588: LOG4J2-3172: buffer immutable log events in the SmtpManager

barrynfleming commented on a change in pull request #588:
URL: https://github.com/apache/logging-log4j2/pull/588#discussion_r731252556



##########
File path: log4j-core/src/test/java/org/apache/logging/log4j/core/net/SmtpManagerTest.java
##########
@@ -33,4 +45,41 @@ void testCreateManagerName() {
         assertEquals("SMTP:to:cc::from::LOG4J2-3107:proto:smtp.log4j.com:4711:username::filter", managerName);
     }
 
+    private void testAdd(LogEvent event) {
+        SmtpManager smtpManager = SmtpManager.getSmtpManager(null, "to", "cc", "bcc", "from", "replyTo", "subject", "protocol", "host", 0, "username", "password", false, "filterName", 10, null);
+        smtpManager.removeAllBufferedEvents(); // in case this smtpManager is reused

Review comment:
       @vy I added `removeAllBufferedEvents()` so I could assert that the messages that got buffered are immutable. I don't mind creating fresh manager instances as you say, but I'm not sure how to make the assertion without access to the buffered events. Any thoughts?
   
   I will update `changes.xml`.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org