summaryrefslogtreecommitdiffstats
path: root/aai-core
diff options
context:
space:
mode:
authorDileep Ranganathan <dileep.ranganathan@intel.com>2017-08-18 16:02:02 -0700
committerDileep Ranganathan <dileep.ranganathan@intel.com>2017-08-18 16:02:02 -0700
commit553b604905f2985e3989d837c01dceace991638d (patch)
treeabd6fc125eed9575ffd09121760fb4b2053f09e1 /aai-core
parentfc8b9a23b483ed680632e5297fb798967240169e (diff)
Add hook to delete temporary json file on exit
Change-Id: I1f5cbcec04d66cd47ee39f14a2cc00e48c9aa6f5 Issue-Id: AAI-197 Signed-off-by: Dileep Ranganathan <dileep.ranganathan@intel.com>
Diffstat (limited to 'aai-core')
-rw-r--r--aai-core/src/test/java/org/openecomp/aai/dbmodel/DbEdgeRulesConverterTest.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/aai-core/src/test/java/org/openecomp/aai/dbmodel/DbEdgeRulesConverterTest.java b/aai-core/src/test/java/org/openecomp/aai/dbmodel/DbEdgeRulesConverterTest.java
index 1310a05b..3a1d9cc1 100644
--- a/aai-core/src/test/java/org/openecomp/aai/dbmodel/DbEdgeRulesConverterTest.java
+++ b/aai-core/src/test/java/org/openecomp/aai/dbmodel/DbEdgeRulesConverterTest.java
@@ -73,15 +73,18 @@ public class DbEdgeRulesConverterTest {
.putAll("baz|quux",
"treatsVeryKindly,IN,One2One,true,true,true,true")
.build();
-
+
try {
dberCon.setup(dest);
File result = new File(outFile);
+ //Add delete hook to delete the temporary result file on exit/
+ result.deleteOnExit();
FileOutputStream writeStream = new FileOutputStream(result);
Writer writer = new OutputStreamWriter(writeStream);
dberCon.convert(EdgeRules, writer);
File compare = new File("src/test/resources/dbEdgeRulesConversion/conversionTestCompare.json");
assertTrue(FileUtils.contentEquals(result, compare));
+ writer.close();
} catch (IOException e) {
e.printStackTrace();
fail("IOException on setup");