Adding more unit tests for DR
[dmaap/datarouter.git] / datarouter-node / src / test / java / org / onap / dmaap / datarouter / node / LogManagerTest.java
index b95fb36..da69020 100644 (file)
@@ -26,9 +26,12 @@ import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
 
 import java.io.File;
+import java.io.IOException;
 import java.util.Timer;
+import org.apache.commons.io.FileUtils;
 import org.apache.commons.lang3.reflect.FieldUtils;
 import org.junit.After;
+import org.junit.AfterClass;
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -54,15 +57,10 @@ public class LogManagerTest {
         logManager = new LogManager(config);
     }
 
-    @After
-    public void tearDown() {
+    @AfterClass
+    public static void tearDown() throws IOException {
         File spoolDir = new File(System.getProperty("user.dir") + "/src/test/resources/.spool");
-        for (File file : spoolDir.listFiles()) {
-            if (file.exists()) {
-                file.delete();
-            }
-        }
-        spoolDir.delete();
+        FileUtils.deleteDirectory(spoolDir);
     }
 
     @Test