Add some integration tests for JUL
[lttng-ust-java-tests.git] / src / org / lttng / ust / agent / benchmarks / jul / handler / FileHandlerBenchmark.java
index d6095aa5bac1030d0a873e4622d44b77cae4b76d..167c7416446183523ac507515b47ee963f5a0cbd 100644 (file)
@@ -1,16 +1,28 @@
 package org.lttng.ust.agent.benchmarks.jul.handler;
 
 import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
 import java.util.logging.FileHandler;
 import java.util.logging.SimpleFormatter;
 
+import org.junit.After;
 import org.junit.Before;
 
 public class FileHandlerBenchmark extends AbstractJulBenchmark {
 
+    private Path outputFile;
+
     @Before
     public void testSetup() throws SecurityException, IOException {
-        handler = new FileHandler("/tmp/log", false);
+        outputFile = Files.createTempFile(this.getClass().getSimpleName(), null);
+
+        handler = new FileHandler(outputFile.toString(), false);
         handler.setFormatter(new SimpleFormatter());
     }
+
+    @After
+    public void testTeardown() throws IOException {
+        Files.deleteIfExists(outputFile);
+    }
 }
This page took 0.022314 seconds and 4 git commands to generate.