Repository: logging-log4j2
Updated Branches:
  refs/heads/master 1c0359314 -> 6592b82d5


Try a different way to manage the temp output file since Maven fails
building with the previous technique, which worked from my IDE.

Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/6592b82d
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/6592b82d
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/6592b82d

Branch: refs/heads/master
Commit: 6592b82d5dde6c7b70bda683a7787c8cf0a129c2
Parents: 1c03593
Author: Gary Gregory <[email protected]>
Authored: Sat Sep 24 14:23:52 2016 -0700
Committer: Gary Gregory <[email protected]>
Committed: Sat Sep 24 14:23:52 2016 -0700

----------------------------------------------------------------------
 ...bstractLog4j1ConfigurationConverterTest.java | 24 ++++++++------------
 1 file changed, 10 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/6592b82d/log4j-1.2-api/src/test/java/org/apache/log4j/config/AbstractLog4j1ConfigurationConverterTest.java
----------------------------------------------------------------------
diff --git 
a/log4j-1.2-api/src/test/java/org/apache/log4j/config/AbstractLog4j1ConfigurationConverterTest.java
 
b/log4j-1.2-api/src/test/java/org/apache/log4j/config/AbstractLog4j1ConfigurationConverterTest.java
index fa4923c..32fe9a8 100644
--- 
a/log4j-1.2-api/src/test/java/org/apache/log4j/config/AbstractLog4j1ConfigurationConverterTest.java
+++ 
b/log4j-1.2-api/src/test/java/org/apache/log4j/config/AbstractLog4j1ConfigurationConverterTest.java
@@ -35,8 +35,6 @@ import org.junit.runners.Parameterized;
 @RunWith(Parameterized.class)
 public abstract class AbstractLog4j1ConfigurationConverterTest {
 
-    private static String outputFile = "target/log4j1-log4j2.txt";
-
     protected static List<Path> getPaths(final String root) throws IOException 
{
         final List<Path> paths = new ArrayList<>();
         Files.walkFileTree(Paths.get(root), new SimpleFileVisitor<Path>() {
@@ -50,24 +48,22 @@ public abstract class 
AbstractLog4j1ConfigurationConverterTest {
     }
 
     private final Path pathIn;
-    private final Path pathOut;
 
     public AbstractLog4j1ConfigurationConverterTest(final Path path) {
         super();
         this.pathIn = path;
-        this.pathOut = Paths.get(outputFile);
     }
 
-    @After
-    public void tearDown() throws IOException {
-        Files.deleteIfExists(pathOut);
-    }
-    
     @Test
-    public void test() {
-        final Log4j1ConfigurationConverter.CommandLineArguments cla = new 
Log4j1ConfigurationConverter.CommandLineArguments();
-        cla.setPathIn(pathIn);
-        cla.setPathOut(pathOut);
-        Log4j1ConfigurationConverter.run(cla);
+    public void test() throws IOException {
+        final Path tempFile = Files.createTempFile("log4j2", ".xml");
+        try {
+            final Log4j1ConfigurationConverter.CommandLineArguments cla = new 
Log4j1ConfigurationConverter.CommandLineArguments();
+            cla.setPathIn(pathIn);
+            cla.setPathOut(tempFile);
+            Log4j1ConfigurationConverter.run(cla);
+        } finally {
+            Files.deleteIfExists(tempFile);
+        }
     }
 }

Reply via email to