summaryrefslogtreecommitdiffstats
path: root/asdctool/src/main/java/org
diff options
context:
space:
mode:
authorFrancis Toth <francis.toth@yoppworks.com>2020-06-18 15:35:05 -0400
committerFrancis Toth <francis.toth@yoppworks.com>2020-06-22 11:25:25 +0000
commitb29518ad6136fe628d7aff79d5fc607c5e890729 (patch)
treef38a2771f34628c1ca023246587aea2c872f48f0 /asdctool/src/main/java/org
parent051fcebef77e7f8c4536ef717a78f05ab1a002ff (diff)
Decouple TXT Report file writing and formatting logic (4/6)
This commit aims to move the reportValidatorTypeSummary function from ReportManager (deprecated) to ReportFile. Signed-off-by: Francis Toth <francis.toth@yoppworks.com> Change-Id: I30898d69bbcdb129a2dac917c4dee3c276556e91 Issue-ID: SDC-2499
Diffstat (limited to 'asdctool/src/main/java/org')
-rw-r--r--asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/executers/TopologyTemplateValidatorExecuter.java2
-rw-r--r--asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/report/ReportFile.java16
-rw-r--r--asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/utils/ReportManager.java10
3 files changed, 17 insertions, 11 deletions
diff --git a/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/executers/TopologyTemplateValidatorExecuter.java b/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/executers/TopologyTemplateValidatorExecuter.java
index 497e589234..52c8cb5f96 100644
--- a/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/executers/TopologyTemplateValidatorExecuter.java
+++ b/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/executers/TopologyTemplateValidatorExecuter.java
@@ -114,7 +114,7 @@ public class TopologyTemplateValidatorExecuter {
String componentScanStatus = successAllTasks ? "success" : "failed";
log.info("Topology Template " + vertex.getUniqueId() + " Validation finished with " + componentScanStatus);
}
- ReportManager.reportValidatorTypeSummary(getName(), failedTasks, successTasks, outputFilePath);
+ reportFile.reportValidatorTypeSummary(getName(), failedTasks, successTasks);
return successAllVertices;
}
}
diff --git a/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/report/ReportFile.java b/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/report/ReportFile.java
index f1f084e2a8..b22edb6cee 100644
--- a/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/report/ReportFile.java
+++ b/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/report/ReportFile.java
@@ -20,6 +20,8 @@
package org.openecomp.sdc.asdctool.impl.validator.report;
+import java.util.Set;
+import org.apache.commons.text.StrBuilder;
import org.openecomp.sdc.be.dao.jsongraph.GraphVertex;
/**
@@ -79,6 +81,20 @@ public class ReportFile {
"-----------------------"
);
}
+
+ public void reportValidatorTypeSummary(
+ String validatorName,
+ Set<String> failedTasksNames,
+ Set<String> successTasksNames
+ ) {
+ StrBuilder sb = new StrBuilder();
+ sb.appendln("-----------------------ValidatorExecuter " + validatorName
+ + " Validation Summary-----------------------");
+ sb.appendln("Failed tasks: " + failedTasksNames);
+ sb.appendln("Success tasks: " + successTasksNames);
+ writer.writeln("");
+ writer.write(sb.toString());
+ }
}
/**
diff --git a/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/utils/ReportManager.java b/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/utils/ReportManager.java
index 3149d049c1..a733eec38b 100644
--- a/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/utils/ReportManager.java
+++ b/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/utils/ReportManager.java
@@ -69,16 +69,6 @@ public class ReportManager {
}
}
- public static void reportValidatorTypeSummary(String validatorName, Set<String> failedTasksNames,
- Set<String> successTasksNames, String outputFilePath) {
- StrBuilder sb = new StrBuilder();
- sb.appendln(
- "-----------------------ValidatorExecuter " + validatorName + " Validation Summary-----------------------");
- sb.appendln("Failed tasks: " + failedTasksNames);
- sb.appendln("Success tasks: " + successTasksNames);
- writeReportLineToFile(sb.toString(), outputFilePath);
- }
-
public static void reportEndOfToolRun(Report report, String outputFilePath) {
StrBuilder sb = new StrBuilder();
sb.appendln("-----------------------------------Validator Tool Summary-----------------------------------");