aboutsummaryrefslogtreecommitdiffstats
path: root/asdctool
diff options
context:
space:
mode:
Diffstat (limited to 'asdctool')
-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.java7
-rw-r--r--asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/utils/ReportManager.java7
-rw-r--r--asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/utils/ReportManagerTest.java13
4 files changed, 15 insertions, 14 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 d6a5d12a25..967a6c68e5 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
@@ -88,7 +88,7 @@ public class TopologyTemplateValidatorExecuter {
TXTFile reportFile,
String outputFilePath
) {
- ReportManager.reportStartValidatorRun(getName(), vertices.size(), outputFilePath);
+ reportFile.reportStartValidatorRun(getName(), vertices.size());
Set<String> failedTasks = new HashSet<>();
Set<String> successTasks = new HashSet<>();
boolean successAllVertices = true;
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 8b767662ee..936ec4b251 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
@@ -58,6 +58,13 @@ public class ReportFile {
writer.writeln("-----------------------Vertex: " + vertex.getUniqueId() +
", Task " + taskName + " Started-----------------------");
}
+
+ public void reportStartValidatorRun(String validatorName, int componentsNum) {
+ writer.writeln("");
+ writer.writeln("------ValidatorExecuter " +
+ validatorName + " Validation Started, on " +
+ componentsNum + " components---------");
+ }
}
/**
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 6e8e2de64a..63e7ebe071 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
@@ -90,13 +90,6 @@ public class ReportManager {
writeReportLineToFile(sb.toString(), outputFilePath);
}
- public static void reportStartValidatorRun(String validatorName, int componenentsNum, String outputFilePath) {
- StrBuilder sb = new StrBuilder();
- sb.appendln("------ValidatorExecuter " + validatorName + " Validation Started, on " + componenentsNum
- + " components---------");
- writeReportLineToFile(sb.toString(), outputFilePath);
- }
-
public static void reportEndOfToolRun(Report report, String outputFilePath) {
StrBuilder sb = new StrBuilder();
sb.appendln("-----------------------------------Validator Tool Summary-----------------------------------");
diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/utils/ReportManagerTest.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/utils/ReportManagerTest.java
index 53e56687a8..479421e118 100644
--- a/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/utils/ReportManagerTest.java
+++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/utils/ReportManagerTest.java
@@ -176,15 +176,16 @@ public class ReportManagerTest {
@Test
public void testReportStartValidatorRun() {
// when
- ReportManager.reportStartValidatorRun(VALIDATOR_NAME, COMPONENT_SUM, txtReportFilePath);
-
- List<String> reportOutputFile = ReportManagerHelper.getReportOutputFileAsList(txtReportFilePath);
+ List<String> reportTxtFile = ReportFileNioHelper.withTxtFile(txtReportFilePath, file -> {
+ file.reportStartValidatorRun(VALIDATOR_NAME, COMPONENT_SUM);
+ return ReportFileNioHelper.readFileAsList(txtReportFilePath);
+ });
// then
- assertNotNull(reportOutputFile);
- assertEquals(EXPECTED_OUTPUT_FILE_HEADER, reportOutputFile.get(0));
+ assertNotNull(reportTxtFile);
+ assertEquals(EXPECTED_OUTPUT_FILE_HEADER, reportTxtFile.get(0));
assertEquals("------ValidatorExecuter " + VALIDATOR_NAME + " Validation Started, on "
- + COMPONENT_SUM + " components---------", reportOutputFile.get(2));
+ + COMPONENT_SUM + " components---------", reportTxtFile.get(2));
}
@Test