You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by ma...@apache.org on 2022/01/29 07:45:53 UTC

[logging-log4j2] 02/02: Use test class's ClassLoader for locating test bundle

This is an automated email from the ASF dual-hosted git repository.

mattsicker pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git

commit bfcd1b3c85d9dfeb17c84c2a1f292dd3b3155dbd
Author: Matt Sicker <ma...@apache.org>
AuthorDate: Sat Jan 29 01:45:41 2022 -0600

    Use test class's ClassLoader for locating test bundle
    
    Signed-off-by: Matt Sicker <ma...@apache.org>
---
 .../org/apache/logging/log4j/message/LocalizedMessageFactoryTest.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/log4j-api-test/src/test/java/org/apache/logging/log4j/message/LocalizedMessageFactoryTest.java b/log4j-api-test/src/test/java/org/apache/logging/log4j/message/LocalizedMessageFactoryTest.java
index b0cc241..5de799a 100644
--- a/log4j-api-test/src/test/java/org/apache/logging/log4j/message/LocalizedMessageFactoryTest.java
+++ b/log4j-api-test/src/test/java/org/apache/logging/log4j/message/LocalizedMessageFactoryTest.java
@@ -35,7 +35,7 @@ public class LocalizedMessageFactoryTest {
     @Test
     public void testNewMessage() {
         final LocalizedMessageFactory localizedMessageFactory = new LocalizedMessageFactory(
-                ResourceBundle.getBundle("MF", Locale.US));
+                ResourceBundle.getBundle("MF", Locale.US, getClass().getClassLoader()));
         final Message message = localizedMessageFactory.newMessage("hello_world");
         assertEquals("Hello world.", message.getFormattedMessage());
     }