summaryrefslogtreecommitdiffstats
path: root/vnfmarket-be/vnf-sdk-marketplace/src/main/java
diff options
context:
space:
mode:
authorJames Guistwite <jguistwite@iconectiv.com>2019-04-29 10:27:29 -0400
committerJames Guistwite <jguistwite@iconectiv.com>2019-04-29 10:28:20 -0400
commit51dde1590f590ad5aff7792dc3d49f6bc10a0e93 (patch)
treee5d5f2cb49a53ce4a0ada6fb5a29ab5c09b8d49a /vnfmarket-be/vnf-sdk-marketplace/src/main/java
parenta103da5713863ea0f4adda7c37d6c5d0b4d523d5 (diff)
Resubmit fixes for spelling error on top of latest code
Issue-ID: VNFSDK-392 Change-Id: Ibf0d08abab3e2beb543ec8a0c80c2c8915962894 Signed-off-by: James Guistwite <jguistwite@iconectiv.com>
Diffstat (limited to 'vnfmarket-be/vnf-sdk-marketplace/src/main/java')
-rw-r--r--vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vtp/execution/VTPExecutionResource.java24
-rw-r--r--vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vtp/scenario/VTPScenarioResource.java2
-rw-r--r--vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vtp/scenario/model/VTPTestCase.java10
3 files changed, 21 insertions, 15 deletions
diff --git a/vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vtp/execution/VTPExecutionResource.java b/vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vtp/execution/VTPExecutionResource.java
index 1f588c1f..e0513360 100644
--- a/vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vtp/execution/VTPExecutionResource.java
+++ b/vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vtp/execution/VTPExecutionResource.java
@@ -88,17 +88,23 @@ public class VTPExecutionResource extends VTPResource{
execution.setEndTime(endTime);
execution.setExecutionId(output.getAddonsMap().get("execution-id"));
+ // set execution status based on success from test.
if (output.getSuccess()) {
- execution.setStatus(VTPTestExecution.Status.COMPLETED.name());
+ execution.setStatus(VTPTestExecution.Status.COMPLETED.name());
+ }
+ else {
+ execution.setStatus(VTPTestExecution.Status.FAILED.name());
+ }
- ObjectMapper mapper = new ObjectMapper();
- JsonNode resultJson = mapper.readTree(output.getAttrsMap().get("results"));
- execution.setResults(resultJson);
- } else {
- execution.setStatus(VTPTestExecution.Status.FAILED.name());
- ObjectMapper mapper = new ObjectMapper();
- JsonNode resultJson = mapper.readTree(output.getAttrsMap().get("error"));
- execution.setResults(resultJson);
+ // set the results from what is available in the output independent of status.
+ // tests can fail but still produce results.
+ ObjectMapper mapper = new ObjectMapper();
+ Map<String,String> m = output.getAttrsMap();
+ if (m.containsKey("results")) {
+ execution.setResults(mapper.readTree(m.get("results")));
+ }
+ else if (m.containsKey("error")) {
+ execution.setResults(mapper.readTree(m.get("error")));
}
}
diff --git a/vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vtp/scenario/VTPScenarioResource.java b/vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vtp/scenario/VTPScenarioResource.java
index 66849f34..fda50ca4 100644
--- a/vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vtp/scenario/VTPScenarioResource.java
+++ b/vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vtp/scenario/VTPScenarioResource.java
@@ -198,7 +198,7 @@ public class VTPScenarioResource extends VTPResource{
VTPTestCase tc = new VTPTestCase();
tc.setTestCaseName(schema.get("name").asText());
- tc.setDescripton(schema.get("description").asText());
+ tc.setDescription(schema.get("description").asText());
tc.setTestSuiteName(schema.get("service").asText());
tc.setAuthor(schema.get("author").asText());
JsonNode inputsJson = schema.get("inputs");
diff --git a/vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vtp/scenario/model/VTPTestCase.java b/vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vtp/scenario/model/VTPTestCase.java
index f0ab2e38..8e7d76c2 100644
--- a/vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vtp/scenario/model/VTPTestCase.java
+++ b/vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vtp/scenario/model/VTPTestCase.java
@@ -27,7 +27,7 @@ public class VTPTestCase extends VTPModelBase{
private String scenario;
private String testCaseName;
private String testSuiteName;
- private String descripton;
+ private String description;
private String author;
private List<VTPTestCaseInput> inputs = new ArrayList<>();
private List<VTPTestCaseOutput> outputs = new ArrayList<>();
@@ -47,11 +47,11 @@ public class VTPTestCase extends VTPModelBase{
return this;
}
- public String getDescripton() {
- return descripton;
+ public String getDescription() {
+ return description;
}
- public void setDescripton(String descripton) {
- this.descripton = descripton;
+ public void setDescription(String description) {
+ this.description = description;
}
public List<VTPTestCaseInput> getInputs() {