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 2022/01/15 16:40:58 UTC
[logging-log4j2] branch release-2.x updated: Test should clean up after itself.
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 c74240c Test should clean up after itself.
c74240c is described below
commit c74240c931cfbcbb9cad4ed27d6c2fa3f6840c59
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sat Jan 15 11:40:55 2022 -0500
Test should clean up after itself.
---
.../log4j/config/PropertiesRollingWithPropertiesTest.java | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/log4j-1.2-api/src/test/java/org/apache/log4j/config/PropertiesRollingWithPropertiesTest.java b/log4j-1.2-api/src/test/java/org/apache/log4j/config/PropertiesRollingWithPropertiesTest.java
index cdb58a6..d70a52f 100644
--- a/log4j-1.2-api/src/test/java/org/apache/log4j/config/PropertiesRollingWithPropertiesTest.java
+++ b/log4j-1.2-api/src/test/java/org/apache/log4j/config/PropertiesRollingWithPropertiesTest.java
@@ -22,18 +22,18 @@ import java.io.File;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
-import org.junit.BeforeClass;
+import org.apache.logging.log4j.test.SystemPropertyTestRule;
+import org.junit.ClassRule;
import org.junit.Test;
+import org.junit.rules.TestRule;
/**
* Test configuration from Properties.
*/
public class PropertiesRollingWithPropertiesTest {
- @BeforeClass
- public static void setupClass() {
- System.setProperty("log4j.configuration", "target/test-classes/log4j1-rolling-properties.properties");
- }
+ @ClassRule
+ public static TestRule SP_RULE = SystemPropertyTestRule.create("log4j.configuration", "target/test-classes/log4j1-rolling-properties.properties");
@Test
public void testProperties() throws Exception {