From 553b604905f2985e3989d837c01dceace991638d Mon Sep 17 00:00:00 2001 From: Dileep Ranganathan Date: Fri, 18 Aug 2017 16:02:02 -0700 Subject: Add hook to delete temporary json file on exit Change-Id: I1f5cbcec04d66cd47ee39f14a2cc00e48c9aa6f5 Issue-Id: AAI-197 Signed-off-by: Dileep Ranganathan --- .../java/org/openecomp/aai/dbmodel/DbEdgeRulesConverterTest.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'aai-core/src') 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"); -- cgit 1.2.3-korg