diff options
author | James Guistwite <jguistwite@iconectiv.com> | 2019-04-29 10:27:29 -0400 |
---|---|---|
committer | James Guistwite <jguistwite@iconectiv.com> | 2019-04-29 10:28:20 -0400 |
commit | 51dde1590f590ad5aff7792dc3d49f6bc10a0e93 (patch) | |
tree | e5d5f2cb49a53ce4a0ada6fb5a29ab5c09b8d49a /vnfmarket-be | |
parent | a103da5713863ea0f4adda7c37d6c5d0b4d523d5 (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')
4 files changed, 23 insertions, 17 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() { diff --git a/vnfmarket-be/vnf-sdk-marketplace/src/test/java/org/onap/vtp/scenario/model/VTPTestCaseTest.java b/vnfmarket-be/vnf-sdk-marketplace/src/test/java/org/onap/vtp/scenario/model/VTPTestCaseTest.java index 6c0e9027..67e85d7e 100644 --- a/vnfmarket-be/vnf-sdk-marketplace/src/test/java/org/onap/vtp/scenario/model/VTPTestCaseTest.java +++ b/vnfmarket-be/vnf-sdk-marketplace/src/test/java/org/onap/vtp/scenario/model/VTPTestCaseTest.java @@ -38,14 +38,14 @@ public class VTPTestCaseTest { List<VTPTestCase.VTPTestCaseInput> list= new ArrayList<>(); List<VTPTestCase.VTPTestCaseOutput> list1=new ArrayList<>(); vtpTestCase.setAuthor("abc"); - vtpTestCase.setDescripton("abc"); + vtpTestCase.setDescription("abc"); vtpTestCase.setInputs(null); vtpTestCase.setOutputs(null); vtpTestCase.setScenario("abc"); vtpTestCase.setTestCaseName("abc"); vtpTestCase.setTestSuiteName("abc"); assertEquals(vtpTestCase.getAuthor(),"abc"); - assertEquals(vtpTestCase.getDescripton(),"abc"); + assertEquals(vtpTestCase.getDescription(),"abc"); assertNull(vtpTestCase.getInputs()); assertNull(vtpTestCase.getOutputs()); assertEquals(vtpTestCase.getTestCaseName(),"abc"); |