aboutsummaryrefslogtreecommitdiffstats
path: root/sdc-distribution-ci
diff options
context:
space:
mode:
authorPavel Aharoni <pa0916@att.com>2017-05-17 15:10:58 +0300
committerPavel Aharoni <pa0916@att.com>2017-05-17 15:12:27 +0300
commite82432429b960c9de5be12360bded3e89c45ead3 (patch)
tree450905ec91cffecea5e3283393d0df8c4a2c05d9 /sdc-distribution-ci
parent0e4e255b8c69d55ccb1a73cdb4d8682fecd51620 (diff)
[SDC-20] fix toString loop and validation
Change-Id: I24f5cdc52bf1c054fed1557ecf877d87c1fa6a34 Signed-off-by: Pavel Aharoni <pa0916@att.com>
Diffstat (limited to 'sdc-distribution-ci')
-rw-r--r--sdc-distribution-ci/src/main/java/org/openecomp/test/CsarToscaTester.java21
1 files changed, 17 insertions, 4 deletions
diff --git a/sdc-distribution-ci/src/main/java/org/openecomp/test/CsarToscaTester.java b/sdc-distribution-ci/src/main/java/org/openecomp/test/CsarToscaTester.java
index 068ef24..b07de08 100644
--- a/sdc-distribution-ci/src/main/java/org/openecomp/test/CsarToscaTester.java
+++ b/sdc-distribution-ci/src/main/java/org/openecomp/test/CsarToscaTester.java
@@ -27,7 +27,8 @@ public class CsarToscaTester {
Date now = new Date();
SimpleDateFormat dateFormat = new SimpleDateFormat("d-MM-y-HH_mm_ss");
String time = dateFormat.format(now);
- File dir = new File(args[1].toString() + "/csar-reports-" + time);
+ String csarsDir = args[1].toString() + "/csar-reports-" + time;
+ File dir = new File(csarsDir);
dir.mkdir();
@@ -35,7 +36,10 @@ public class CsarToscaTester {
if (file.isFile()) {
System.out.println("File " + file.getAbsolutePath());
ExceptionCollector.clear();
-
+ String name = file.getName();
+ String currentCsarDir = csarsDir+"/"+name+"-"+time;
+ dir = new File(currentCsarDir);
+ dir.mkdir();
ISdcCsarHelper csarHelper = factory.getSdcCsarHelper(file.getAbsolutePath());
List<NodeTemplate> vflist = csarHelper.getServiceVfList();
List<Input> inputs = csarHelper.getServiceInputs();
@@ -44,18 +48,19 @@ public class CsarToscaTester {
List<String> warningsReport = ExceptionCollector.getWarningsReport();
//System.out.println("WARNINGS during CSAR parsing are: " + (warningsReport != null ? warningsReport.toString() : "none"));
+
if (!exceptionReport.isEmpty()) {
try {
- fw = new FileWriter(new File(dir + "/" + exceptionReport.size() / 2 + "-critical-" + file.getName() + ".txt"));
+ fw = new FileWriter(new File(currentCsarDir + "/" + exceptionReport.size() / 2 + "-critical-" + name +"-"+time + ".txt"));
for (String exception : exceptionReport) {
fw.write(exception);
fw.write("\r\n");
}
fw.close();
- fw = new FileWriter(new File(dir + "/" + warningsReport.size() / 2 + "-warning-" + file.getName() + ".txt"));
+ fw = new FileWriter(new File(currentCsarDir + "/" + warningsReport.size() / 2 + "-warning-" + name +"-"+time + ".txt"));
for (String warning : warningsReport) {
fw.write(warning);
fw.write("\r\n");
@@ -63,6 +68,14 @@ public class CsarToscaTester {
fw.close();
+ //TODO
+ fw = new FileWriter(new File(currentCsarDir + "/" + exceptionReport.size() / 2 + "-critical-" + name +"-"+time + ".txt"));
+ for (String critical : exceptionReport) {
+ fw.write(critical);
+ fw.write("\r\n");
+ }
+ fw.close();
+
} catch (IOException ex) {
ex.printStackTrace();
}