summaryrefslogtreecommitdiffstats
path: root/datarouter-node
diff options
context:
space:
mode:
authorefiacor <fiachra.corcoran@est.tech>2019-06-25 11:01:10 +0000
committerefiacor <fiachra.corcoran@est.tech>2019-06-25 11:01:10 +0000
commitc466fbd0026bfc715b4f51854186c62625e8cb61 (patch)
treeebc0ef5b7fad4516749ab5a5f477ffa742d4f0d9 /datarouter-node
parentcf55456bbe6ce4da723f9dfa64b573f02908ab24 (diff)
Adding to unit test coverage
Change-Id: Id8d07c94bb70952fb317bfc7824fc0d587087468 Issue-ID: DMAAP-1203 Signed-off-by: efiacor <fiachra.corcoran@est.tech>
Diffstat (limited to 'datarouter-node')
-rwxr-xr-xdatarouter-node/pom.xml4
-rw-r--r--datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/LogManagerTest.java11
2 files changed, 8 insertions, 7 deletions
diff --git a/datarouter-node/pom.xml b/datarouter-node/pom.xml
index a4de6f76..93c86864 100755
--- a/datarouter-node/pom.xml
+++ b/datarouter-node/pom.xml
@@ -53,6 +53,10 @@
<artifactId>commons-codec</artifactId>
</dependency>
<dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ </dependency>
+ <dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</dependency>
diff --git a/datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/LogManagerTest.java b/datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/LogManagerTest.java
index b95fb365..c890ed50 100644
--- a/datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/LogManagerTest.java
+++ b/datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/LogManagerTest.java
@@ -26,7 +26,9 @@ 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.Before;
@@ -55,14 +57,9 @@ public class LogManagerTest {
}
@After
- public void tearDown() {
+ public 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