You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by gg...@apache.org on 2020/11/11 18:56:35 UTC
[logging-log4j2] branch release-2.x updated: Fix test.
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch release-2.x
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git
The following commit(s) were added to refs/heads/release-2.x by this push:
new 16844a0 Fix test.
16844a0 is described below
commit 16844a034f76ef2079507ed95d5935b333905468
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Wed Nov 11 13:56:29 2020 -0500
Fix test.
---
.../org/apache/logging/log4j/core/config/FileOutputTest.java | 12 ++++++------
log4j-core/src/test/resources/log4j-filetest.xml | 4 ++--
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/config/FileOutputTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/config/FileOutputTest.java
index 37fbe82..f5d2c84 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/config/FileOutputTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/config/FileOutputTest.java
@@ -16,22 +16,22 @@
*/
package org.apache.logging.log4j.core.config;
-import org.apache.logging.log4j.junit.CleanUpFiles;
-import org.apache.logging.log4j.junit.LoggerContextSource;
-import org.junit.jupiter.api.Test;
+import static org.junit.jupiter.api.Assertions.assertTrue;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
-import static org.junit.jupiter.api.Assertions.assertTrue;
+import org.apache.logging.log4j.junit.CleanUpFiles;
+import org.apache.logging.log4j.junit.LoggerContextSource;
+import org.junit.jupiter.api.Test;
-@CleanUpFiles("target/status.log")
+@CleanUpFiles("target/test.log") // File name MUST match the one in log4j-filetest.xml.
public class FileOutputTest {
@Test
- @LoggerContextSource("classpath:log4j-filetest.xml")
+ @LoggerContextSource(value="classpath:log4j-filetest.xml")
public void testConfig() throws IOException {
final Path logFile = Paths.get("target", "status.log");
assertTrue(Files.exists(logFile), "Status output file does not exist");
diff --git a/log4j-core/src/test/resources/log4j-filetest.xml b/log4j-core/src/test/resources/log4j-filetest.xml
index de49d0f..6e44a75 100644
--- a/log4j-core/src/test/resources/log4j-filetest.xml
+++ b/log4j-core/src/test/resources/log4j-filetest.xml
@@ -44,11 +44,11 @@
<KeyValuePair key="test" value="123"/>
</ThreadContextMapFilter>
<AppenderRef ref="STDOUT"/>
- </Logger>>
+ </Logger>
<Logger name="org.apache.logging.log4j.test2" level="debug" additivity="false">
<AppenderRef ref="File"/>
- </Logger>>
+ </Logger>
<Root level="error">
<AppenderRef ref="STDOUT"/>