aboutsummaryrefslogtreecommitdiffstats
path: root/openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src
diff options
context:
space:
mode:
authorVodafone <onap@vodafone.com>2019-03-18 15:08:33 +0530
committerOren Kleks <orenkle@amdocs.com>2019-04-01 09:09:37 +0000
commit84a209835820238f50d84ad5be5b9badaa5283c5 (patch)
tree19b986374820b4fb9ac723baf22a5161ceacf127 /openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src
parent8b8061e8b47703beb7a19174de5c9b29ccf1ca14 (diff)
List of Input Parameters for VSP
Change-Id: Ie913ead731e120bd69349a4ebec13f4521eaac4d Issue-ID: SDC-2049 Co-authored-by: jguistwite@iconectiv.com Signed-off-by: Vodafone <onap@vodafone.com>
Diffstat (limited to 'openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src')
-rw-r--r--openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/main/java/org/openecomp/core/externaltesting/api/ExternalTestingManager.java87
-rw-r--r--openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/main/java/org/openecomp/core/externaltesting/api/TestErrorBody.java50
-rw-r--r--openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/main/java/org/openecomp/core/externaltesting/api/TestTreeNode.java64
-rw-r--r--openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/main/java/org/openecomp/core/externaltesting/api/VtpNameDescriptionPair.java38
-rw-r--r--openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/main/java/org/openecomp/core/externaltesting/api/VtpTestCase.java42
-rw-r--r--openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/main/java/org/openecomp/core/externaltesting/api/VtpTestCaseInput.java42
-rw-r--r--openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/main/java/org/openecomp/core/externaltesting/api/VtpTestCaseOutput.java31
-rw-r--r--openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/main/java/org/openecomp/core/externaltesting/api/VtpTestExecutionRequest.java39
-rw-r--r--openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/main/java/org/openecomp/core/externaltesting/api/VtpTestExecutionResponse.java53
-rw-r--r--openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/main/java/org/openecomp/core/externaltesting/errors/ExternalTestingException.java51
-rw-r--r--openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/main/java/org/openecomp/core/externaltesting/errors/ExternalTestingInitializationException.java33
-rw-r--r--openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/main/java/org/openecomp/core/externaltesting/factory/ExternalTestingManagerFactory.java30
-rw-r--r--openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/main/resources/factoryConfiguration.json3
-rw-r--r--openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/test/data/executionrequest.json12
-rw-r--r--openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/test/data/priorexecution.json20
-rw-r--r--openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/test/data/testcase.json58
-rw-r--r--openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/test/data/testtree.json119
-rw-r--r--openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/test/java/org/openecomp/core/externaltesting/api/ErrorBodyTests.java42
-rw-r--r--openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/test/java/org/openecomp/core/externaltesting/api/ExecutionRequestTests.java110
-rw-r--r--openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/test/java/org/openecomp/core/externaltesting/api/ExternalTestingApiTests.java30
20 files changed, 954 insertions, 0 deletions
diff --git a/openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/main/java/org/openecomp/core/externaltesting/api/ExternalTestingManager.java b/openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/main/java/org/openecomp/core/externaltesting/api/ExternalTestingManager.java
new file mode 100644
index 0000000000..dc9b09c767
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/main/java/org/openecomp/core/externaltesting/api/ExternalTestingManager.java
@@ -0,0 +1,87 @@
+/*
+ * Copyright © 2019 iconectiv
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.openecomp.core.externaltesting.api;
+
+
+import java.util.List;
+
+public interface ExternalTestingManager {
+
+ /**
+ * Return the configuration of this feature that we want to
+ * expose to the client. Treated as a JSON blob for flexibility.
+ */
+ String getConfig();
+
+ /**
+ * Build a tree of all test cases for the client including all
+ * defined endpoints, scenarios, and test suites.
+ * @return test case tree.
+ */
+ TestTreeNode getTestCasesAsTree();
+
+ /**
+ * Get a list of testing endpoints with name and description.
+ */
+ List<VtpNameDescriptionPair> getEndpoints();
+
+ /**
+ * Get a list of scenarios from and endpoint.
+ */
+ List<VtpNameDescriptionPair> getScenarios(String endpoint);
+
+ /**
+ * Get a list of test suites given the endpoint and scenario.
+ */
+ List<VtpNameDescriptionPair> getTestSuites(String endpoint, String scenario);
+
+ /**
+ * Get a list of test cases.
+ * @param endpoint endpoint to contact (e.g. VTP)
+ * @param scenario test scenario to get tests for
+ * @return list of test cases.
+ */
+ List<VtpTestCase> getTestCases(String endpoint, String scenario);
+
+ /**
+ * Get the details about a particular test case.
+ * @param endpoint endpoint to contact (e.g. VTP)
+ * @param scenario test scenario to get tests for
+ * @param testSuite suite to get tests for
+ * @param testCaseName test case name to query.
+ * @return details about the test case.
+ */
+ VtpTestCase getTestCase(String endpoint, String scenario, String testSuite, String testCaseName);
+
+ /**
+ * Execute a collection of tests where the manager must distribute
+ * the tests to the appropriate endpoint and correlate the responses.
+ * @param requests collection of request items.
+ * @param requestId optional request ID provided from client.
+ * @return response from endpoint (don't bother to parse).
+ */
+ List<VtpTestExecutionResponse> execute(List<VtpTestExecutionRequest> requests, String requestId);
+
+ /**
+ * Return a previous results.
+ * @param endpoint endpoint to query
+ * @param executionId execution to query.
+ * @return response from endpoint.
+ */
+ VtpTestExecutionResponse getExecution(String endpoint, String executionId);
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/main/java/org/openecomp/core/externaltesting/api/TestErrorBody.java b/openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/main/java/org/openecomp/core/externaltesting/api/TestErrorBody.java
new file mode 100644
index 0000000000..79a3765596
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/main/java/org/openecomp/core/externaltesting/api/TestErrorBody.java
@@ -0,0 +1,50 @@
+/*
+ * Copyright © 2019 iconectiv
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.openecomp.core.externaltesting.api;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import io.swagger.annotations.ApiModel;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * Error body to return to client per IETF RFC 7807.
+ */
+@SuppressWarnings("unused")
+@JsonInclude(JsonInclude.Include.NON_NULL)
+@ApiModel("Body for errors such as http 500")
+@Data
+public class TestErrorBody implements Serializable {
+
+ private static final long serialVersionUID = 3504501412736665763L;
+
+ private String code;
+ private Integer httpStatus;
+ private String message;
+
+ TestErrorBody() {
+
+ }
+
+ public TestErrorBody(String code, Integer httpStatus, String message) {
+ this();
+ this.code = code;
+ this.httpStatus = httpStatus;
+ this.message = message;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/main/java/org/openecomp/core/externaltesting/api/TestTreeNode.java b/openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/main/java/org/openecomp/core/externaltesting/api/TestTreeNode.java
new file mode 100644
index 0000000000..42fa330d33
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/main/java/org/openecomp/core/externaltesting/api/TestTreeNode.java
@@ -0,0 +1,64 @@
+/*
+ * Copyright © 2019 iconectiv
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.openecomp.core.externaltesting.api;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Tree structure of tests. VTP does not provide an organized
+ * tree of tests. Here we define a tree node with tests and
+ * child nodes to represent our tree.
+ */
+@SuppressWarnings("unused")
+@JsonInclude(JsonInclude.Include.NON_EMPTY)
+@Data()
+@EqualsAndHashCode(callSuper=true)
+public class TestTreeNode extends VtpNameDescriptionPair {
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ private List<VtpTestCase> tests;
+
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ private List<TestTreeNode> children;
+
+ public TestTreeNode() {
+ super();
+ }
+
+ public TestTreeNode(String name, String description) {
+ super(name, description);
+ }
+
+ public void addTest(VtpTestCase test) {
+ if (tests == null) {
+ tests = new ArrayList<>();
+ }
+ tests.add(test);
+ }
+
+ public void addChild(TestTreeNode child) {
+ if (children == null) {
+ children = new ArrayList<>();
+ }
+ children.add(child);
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/main/java/org/openecomp/core/externaltesting/api/VtpNameDescriptionPair.java b/openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/main/java/org/openecomp/core/externaltesting/api/VtpNameDescriptionPair.java
new file mode 100644
index 0000000000..9a435de4ae
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/main/java/org/openecomp/core/externaltesting/api/VtpNameDescriptionPair.java
@@ -0,0 +1,38 @@
+/*
+ * Copyright © 2019 iconectiv
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.openecomp.core.externaltesting.api;
+
+import lombok.Data;
+
+/**
+ * Scenarios and Test Suites are simple name/description pairs.
+ */
+@Data
+public class VtpNameDescriptionPair {
+ private String name;
+ private String description;
+
+ VtpNameDescriptionPair() {
+
+ }
+
+ public VtpNameDescriptionPair(String name, String description) {
+ this();
+ this.name = name;
+ this.description = description;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/main/java/org/openecomp/core/externaltesting/api/VtpTestCase.java b/openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/main/java/org/openecomp/core/externaltesting/api/VtpTestCase.java
new file mode 100644
index 0000000000..ae39159f32
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/main/java/org/openecomp/core/externaltesting/api/VtpTestCase.java
@@ -0,0 +1,42 @@
+/*
+ * Copyright © 2019 iconectiv
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.openecomp.core.externaltesting.api;
+
+import lombok.Data;
+
+import java.util.List;
+
+
+@Data
+public class VtpTestCase {
+
+ private String scenario;
+ private String testCaseName;
+ private String testSuiteName;
+ private String description;
+ private String author;
+ private List<VtpTestCaseInput> inputs;
+ private List<VtpTestCaseOutput> outputs;
+
+ /**
+ * Extends VTP test case content with location where test case is defined.
+ * This value is populated by the SDC-BE for consumption by the front end.
+ * This allows the front end to tell the back end where to run the test.
+ */
+ private String endpoint;
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/main/java/org/openecomp/core/externaltesting/api/VtpTestCaseInput.java b/openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/main/java/org/openecomp/core/externaltesting/api/VtpTestCaseInput.java
new file mode 100644
index 0000000000..5c6db8eb72
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/main/java/org/openecomp/core/externaltesting/api/VtpTestCaseInput.java
@@ -0,0 +1,42 @@
+/*
+ * Copyright © 2019 iconectiv
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.openecomp.core.externaltesting.api;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.util.Map;
+
+
+@Data
+@EqualsAndHashCode(callSuper=true)
+public class VtpTestCaseInput extends VtpNameDescriptionPair {
+
+ private String type;
+ private String defaultValue;
+ private boolean isOptional;
+ private Map<String,Object> metadata;
+
+ /**
+ * The VTP API has a field called isOptional, not just optional so
+ * we need to add getter and setter.
+ */
+ @SuppressWarnings({"unused", "WeakerAccess"})
+ public boolean getIsOptional() {
+ return isOptional;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/main/java/org/openecomp/core/externaltesting/api/VtpTestCaseOutput.java b/openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/main/java/org/openecomp/core/externaltesting/api/VtpTestCaseOutput.java
new file mode 100644
index 0000000000..b7b66b7b0b
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/main/java/org/openecomp/core/externaltesting/api/VtpTestCaseOutput.java
@@ -0,0 +1,31 @@
+/*
+ * Copyright © 2019 iconectiv
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.openecomp.core.externaltesting.api;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import io.swagger.annotations.ApiModel;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+@JsonInclude(JsonInclude.Include.NON_NULL)
+@ApiModel("VtpTestSuite")
+@Data
+@EqualsAndHashCode(callSuper=true)
+class VtpTestCaseOutput extends VtpNameDescriptionPair {
+
+ private String type;
+}
diff --git a/openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/main/java/org/openecomp/core/externaltesting/api/VtpTestExecutionRequest.java b/openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/main/java/org/openecomp/core/externaltesting/api/VtpTestExecutionRequest.java
new file mode 100644
index 0000000000..481fd46906
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/main/java/org/openecomp/core/externaltesting/api/VtpTestExecutionRequest.java
@@ -0,0 +1,39 @@
+/*
+ * Copyright © 2019 iconectiv
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.openecomp.core.externaltesting.api;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import lombok.Data;
+
+import java.util.Map;
+
+@Data
+public class VtpTestExecutionRequest {
+
+ private String scenario;
+ private String testSuiteName;
+ private String testCaseName;
+
+ @JsonInclude(value = JsonInclude.Include.NON_NULL)
+ private String profile;
+
+ @JsonInclude(value = JsonInclude.Include.NON_NULL)
+ private Map<String,String> parameters;
+
+ @JsonInclude(value = JsonInclude.Include.NON_NULL)
+ private String endpoint;
+}
diff --git a/openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/main/java/org/openecomp/core/externaltesting/api/VtpTestExecutionResponse.java b/openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/main/java/org/openecomp/core/externaltesting/api/VtpTestExecutionResponse.java
new file mode 100644
index 0000000000..add85210cb
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/main/java/org/openecomp/core/externaltesting/api/VtpTestExecutionResponse.java
@@ -0,0 +1,53 @@
+/*
+ * Copyright © 2019 iconectiv
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.openecomp.core.externaltesting.api;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import lombok.Data;
+
+import java.util.Map;
+
+@Data
+public class VtpTestExecutionResponse {
+ private String scenario;
+ private String testCaseName;
+ private String testSuiteName;
+ private String executionId;
+ private Map<String,String> parameters;
+ private Object results;
+ private String status;
+ private String startTime; // don't bother to convert various ISO8601 formats.
+ private String endTime; // don't bother to convert various ISO8601 formats.
+
+ /**
+ * In the event on an error, code provided.
+ */
+ @JsonInclude(value= JsonInclude.Include.NON_NULL)
+ private String code;
+
+ /**
+ * Error message
+ */
+ @JsonInclude(value= JsonInclude.Include.NON_NULL)
+ private String message;
+
+ /**
+ * In the event of an unexpected status.
+ */
+ @JsonInclude(value= JsonInclude.Include.NON_NULL)
+ private Integer httpStatus;
+}
diff --git a/openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/main/java/org/openecomp/core/externaltesting/errors/ExternalTestingException.java b/openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/main/java/org/openecomp/core/externaltesting/errors/ExternalTestingException.java
new file mode 100644
index 0000000000..33fa0f4477
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/main/java/org/openecomp/core/externaltesting/errors/ExternalTestingException.java
@@ -0,0 +1,51 @@
+/*
+ * Copyright © 2019 iconectiv
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.openecomp.core.externaltesting.errors;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+
+@Data
+@EqualsAndHashCode(callSuper=false)
+public class ExternalTestingException extends RuntimeException {
+
+ private static final long serialVersionUID = -4357810130868566088L;
+
+ private final String title;
+ private final int code;
+ private final String detail;
+
+ public ExternalTestingException(String title, int code, String detail) {
+ super(title);
+ this.title = title;
+ this.code = code;
+ this.detail = detail;
+ }
+
+ public ExternalTestingException(String title, int code, String detail, Throwable parent) {
+ super(title, parent);
+ this.title = title;
+ this.code = code;
+ this.detail = detail;
+ }
+
+ @Override
+ public String toString() {
+ return ToStringBuilder.reflectionToString(this);
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/main/java/org/openecomp/core/externaltesting/errors/ExternalTestingInitializationException.java b/openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/main/java/org/openecomp/core/externaltesting/errors/ExternalTestingInitializationException.java
new file mode 100644
index 0000000000..28f40199ca
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/main/java/org/openecomp/core/externaltesting/errors/ExternalTestingInitializationException.java
@@ -0,0 +1,33 @@
+/*
+ * Copyright © 2019 iconectiv
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.openecomp.core.externaltesting.errors;
+
+import java.io.IOException;
+
+@SuppressWarnings("unused")
+public class ExternalTestingInitializationException extends IOException {
+
+ private static final long serialVersionUID = -2422448175010311433L;
+
+ public ExternalTestingInitializationException(String message) {
+ super(message);
+ }
+
+ public ExternalTestingInitializationException(String message, Throwable cause) {
+ super(message, cause);
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/main/java/org/openecomp/core/externaltesting/factory/ExternalTestingManagerFactory.java b/openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/main/java/org/openecomp/core/externaltesting/factory/ExternalTestingManagerFactory.java
new file mode 100644
index 0000000000..e84a4c86a1
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/main/java/org/openecomp/core/externaltesting/factory/ExternalTestingManagerFactory.java
@@ -0,0 +1,30 @@
+/*
+ * Copyright © 2019 iconectiv
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.openecomp.core.externaltesting.factory;
+
+import org.openecomp.core.factory.api.AbstractComponentFactory;
+import org.openecomp.core.factory.api.AbstractFactory;
+import org.openecomp.core.externaltesting.api.ExternalTestingManager;
+
+
+@SuppressWarnings("unused")
+public abstract class ExternalTestingManagerFactory extends AbstractComponentFactory<ExternalTestingManager> {
+
+ public static ExternalTestingManagerFactory getInstance() {
+ return AbstractFactory.getInstance(ExternalTestingManagerFactory.class);
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/main/resources/factoryConfiguration.json b/openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/main/resources/factoryConfiguration.json
new file mode 100644
index 0000000000..10449038bf
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/main/resources/factoryConfiguration.json
@@ -0,0 +1,3 @@
+{
+ "org.openecomp.core.externaltesting.factory.ExternalTestingManagerFactory":"org.openecomp.sdc.externaltesting.impl.ExternalTestingManagerFactoryImpl"
+}
diff --git a/openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/test/data/executionrequest.json b/openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/test/data/executionrequest.json
new file mode 100644
index 0000000000..05750b4aed
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/test/data/executionrequest.json
@@ -0,0 +1,12 @@
+{
+ "scenario": "compliance",
+ "testCaseName": "sriov",
+ "testSuiteName": "compliancetests",
+ "profile": "compliance",
+ "parameters": {
+ "vspId": "VSP-ID",
+ "vspVersion": "VSP-VER",
+ "allowSriov": "true"
+ },
+ "endpoint": "repository"
+}
diff --git a/openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/test/data/priorexecution.json b/openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/test/data/priorexecution.json
new file mode 100644
index 0000000000..f8e1db85df
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/test/data/priorexecution.json
@@ -0,0 +1,20 @@
+{
+ "scenario": "compliance",
+ "testCaseName": "computeflavors",
+ "testSuiteName": "compliancetests",
+ "executionId": "3053ed10-84e6-4f21-aa62-4ca66242d8d8",
+ "parameters": {
+ "vspId": "VSP-ID",
+ "vspVersion": "VSP-VER",
+ "allowSriov": "true",
+ "csp": "ZZFT",
+ "profilespec": "gsmafnw14",
+ "vnftype": "B"
+ },
+ "results": {
+ "hello": "world"
+ },
+ "status": "COMPLETED",
+ "startTime": 1550780567585,
+ "endTime": 1550780567585
+}
diff --git a/openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/test/data/testcase.json b/openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/test/data/testcase.json
new file mode 100644
index 0000000000..9a6a166b51
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/test/data/testcase.json
@@ -0,0 +1,58 @@
+{
+ "scenario": "compliance",
+ "testCaseName": "sriov",
+ "testSuiteName": "compliancetests",
+ "description": "SR-IOV Test",
+ "author": "Jim",
+ "endpoint": "vtp",
+ "outputs": [
+ {
+ "name": "something",
+ "description": "is produced",
+ "type": "integer"
+ }
+ ],
+ "inputs": [
+ {
+ "name": "vspId",
+ "description": "VSP ID",
+ "type": "text",
+ "defaultValue": "",
+ "metadata": {
+ "isDisabled": true,
+ "maxLength": "36",
+ "minLength": "1"
+ }
+ },
+ {
+ "name": "vspVersion",
+ "description": "VSP Version",
+ "type": "text",
+ "defaultValue": "",
+ "metadata": {
+ "isDisabled": true,
+ "maxLength": "36",
+ "minLength": "1"
+ }
+ },
+ {
+ "name": "allowSriov",
+ "description": "Allow SRIOV?",
+ "type": "select",
+ "defaultValue": "false",
+ "metadata": {
+ "isDisabled": true,
+ "choices": [
+ {
+ "key": "true",
+ "label": "Yes"
+ },
+ {
+ "key": "false",
+ "label": "No"
+ }
+ ]
+ }
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/test/data/testtree.json b/openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/test/data/testtree.json
new file mode 100644
index 0000000000..06b021077f
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/test/data/testtree.json
@@ -0,0 +1,119 @@
+{
+ "name": "root",
+ "description": "root",
+ "tests": [],
+ "children": [
+ {
+ "name": "certification",
+ "description": "Available Certification Queries",
+ "children": [
+ {
+ "name": "certificationtests",
+ "description": "Certification Tests",
+ "tests": [
+ {
+ "scenario": "certification",
+ "testCaseName": "certquery",
+ "testSuiteName": "certificationtests",
+ "description": "VSP Certifications",
+ "author": "jguistwite@iconectiv.com",
+ "inputs": [
+ {
+ "name": "vspId",
+ "description": "VSP ID",
+ "type": "text",
+ "defaultValue": "",
+ "isOptional": false,
+ "metadata": {
+ "maxLength": 36.0,
+ "minLength": 1.0,
+ "disabled": true
+ }
+ },
+ {
+ "name": "vspVersion",
+ "description": "Previous VSP Version",
+ "type": "text",
+ "defaultValue": "",
+ "isOptional": false,
+ "metadata": {
+ "maxLength": 36.0,
+ "minLength": 1.0,
+ "disabled": true
+ }
+ }
+ ],
+ "endpoint": "opnfv"
+ }
+ ],
+ "children": []
+ }
+ ]
+ },
+ {
+ "name": "compliance",
+ "description": "Available Compliance Tests",
+ "tests": [],
+ "children": [
+ {
+ "name": "compliancetests",
+ "description": "Compliance Tests",
+ "tests": [
+ {
+ "scenario": "compliance",
+ "testCaseName": "sriov",
+ "testSuiteName": "compliancetests",
+ "description": "SR-IOV Test",
+ "author": "Jim",
+ "inputs": [
+ {
+ "name": "vspId",
+ "description": "VSP ID",
+ "type": "text",
+ "isOptional": false,
+ "metadata": {
+ "isDisabled": true,
+ "maxLength": "36",
+ "minLength": "1"
+ }
+ },
+ {
+ "name": "vspVersion",
+ "description": "VSP Version",
+ "type": "text",
+ "isOptional": false,
+ "metadata": {
+ "isDisabled": true,
+ "maxLength": "36",
+ "minLength": "1"
+ }
+ },
+ {
+ "name": "allowSriov",
+ "description": "Allow SRIOV?",
+ "type": "select",
+ "defaultValue": "false",
+ "isOptional": false,
+ "metadata": {
+ "isDisabled": true,
+ "choices": [
+ {
+ "key": "true",
+ "label": "Yes"
+ },
+ {
+ "key": "false",
+ "label": "No"
+ }
+ ]
+ }
+ }
+ ],
+ "endpoint": "vtp"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/test/java/org/openecomp/core/externaltesting/api/ErrorBodyTests.java b/openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/test/java/org/openecomp/core/externaltesting/api/ErrorBodyTests.java
new file mode 100644
index 0000000000..216ff3599f
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/test/java/org/openecomp/core/externaltesting/api/ErrorBodyTests.java
@@ -0,0 +1,42 @@
+/*
+ * Copyright © 2019 iconectiv
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.openecomp.core.externaltesting.api;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+public class ErrorBodyTests {
+
+ @Test
+ public void testErrorBody() {
+ TestErrorBody b = new TestErrorBody();
+ b.setHttpStatus(404);
+ b.setMessage("message");
+ b.setCode("code");
+
+ Assert.assertEquals("code match", new Integer(404), b.getHttpStatus());
+ Assert.assertEquals("code message", "message", b.getMessage());
+ Assert.assertEquals("code code", "code", b.getCode());
+
+ TestErrorBody b2 = new TestErrorBody("code", 404, "message");
+
+ Assert.assertEquals("code match", new Integer(404), b2.getHttpStatus());
+ Assert.assertEquals("code message", "message", b2.getMessage());
+ Assert.assertEquals("code code", "code", b2.getCode());
+
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/test/java/org/openecomp/core/externaltesting/api/ExecutionRequestTests.java b/openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/test/java/org/openecomp/core/externaltesting/api/ExecutionRequestTests.java
new file mode 100644
index 0000000000..b10d3079d2
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/test/java/org/openecomp/core/externaltesting/api/ExecutionRequestTests.java
@@ -0,0 +1,110 @@
+/*
+ * Copyright © 2019 iconectiv
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.openecomp.core.externaltesting.api;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.junit.Assert;
+import org.junit.Test;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.Map;
+import java.util.UUID;
+
+public class ExecutionRequestTests {
+
+ @Test
+ public void testTestCase() throws Exception {
+ ObjectMapper mapper = new ObjectMapper();
+ VtpTestCase req = mapper.readValue(new File("src/test/data/testcase.json"), VtpTestCase.class);
+
+ Assert.assertEquals("Scenario must match", "compliance", req.getScenario());
+ Assert.assertEquals("Suite name must match", "compliancetests", req.getTestSuiteName());
+ Assert.assertEquals("Test case name must match", "sriov", req.getTestCaseName());
+ Assert.assertEquals("Description must match", "SR-IOV Test", req.getDescription());
+ Assert.assertEquals("Author must match", "Jim", req.getAuthor());
+ Assert.assertEquals("Endpoint must match", "vtp", req.getEndpoint());
+ Assert.assertEquals("Test must contain two inputs", 3, req.getInputs().size());
+ Assert.assertEquals("Test must contain one outputs", 1, req.getOutputs().size());
+
+ VtpTestCaseInput input1 = req.getInputs().get(0);
+ Assert.assertEquals("Name match", "vspId", input1.getName());
+ Assert.assertEquals("Description match", "VSP ID", input1.getDescription());
+ Assert.assertEquals("Input type match", "text", input1.getType());
+ Assert.assertEquals("Input default match", "", input1.getDefaultValue());
+ Assert.assertFalse("Input optional match", input1.getIsOptional());
+
+ VtpTestCaseOutput output1 = req.getOutputs().get(0);
+ Assert.assertEquals("Name match", "something", output1.getName());
+ Assert.assertEquals("Description match", "is produced", output1.getDescription());
+ Assert.assertEquals("Output type match", "integer", output1.getType());
+
+
+ Map<String,Object> meta = input1.getMetadata();
+ Assert.assertEquals("Metadata count", 3, meta.size());
+
+ VtpTestCase req2 = mapper.readValue(new File("src/test/data/testcase.json"), VtpTestCase.class);
+
+ Assert.assertEquals("test equality", req, req2);
+
+ }
+
+ @Test
+ public void testExecutionRequest() throws IOException {
+ ObjectMapper mapper = new ObjectMapper();
+ VtpTestExecutionRequest req = mapper.readValue(new File("src/test/data/executionrequest.json"), VtpTestExecutionRequest.class);
+ Assert.assertEquals("compliance", req.getScenario());
+ Assert.assertEquals("compliance", req.getProfile());
+ Assert.assertEquals("sriov", req.getTestCaseName());
+ Assert.assertEquals("compliancetests", req.getTestSuiteName());
+ Assert.assertEquals("repository", req.getEndpoint());
+
+ Assert.assertEquals(3, req.getParameters().size());
+ }
+
+ @Test
+ public void testExecutionResponse() throws IOException {
+ ObjectMapper mapper = new ObjectMapper();
+ VtpTestExecutionResponse rsp = mapper.readValue(new File("src/test/data/priorexecution.json"), VtpTestExecutionResponse.class);
+ Assert.assertEquals("compliance", rsp.getScenario());
+ Assert.assertEquals("computeflavors", rsp.getTestCaseName());
+ Assert.assertEquals("compliancetests", rsp.getTestSuiteName());
+ Assert.assertTrue(UUID.fromString(rsp.getExecutionId()).getLeastSignificantBits() != 0);
+ Assert.assertEquals("parameters", 6, rsp.getParameters().size());
+ Assert.assertNotNull(rsp.getResults());
+ Assert.assertEquals("COMPLETED", rsp.getStatus());
+ Assert.assertNotNull(rsp.getStartTime());
+ Assert.assertNotNull(rsp.getEndTime());
+ }
+
+ @Test
+ public void testTree() throws IOException {
+ ObjectMapper mapper = new ObjectMapper();
+ TestTreeNode tree = mapper.readValue(new File("src/test/data/testtree.json"), TestTreeNode.class);
+
+ Assert.assertEquals(2, tree.getChildren().size());
+ Assert.assertEquals(0, tree.getTests().size());
+
+ TestTreeNode manual = new TestTreeNode("root", "Root");
+
+ manual.addChild(new TestTreeNode("child", "child"));
+ manual.addTest(new VtpTestCase());
+ Assert.assertEquals(1, manual.getChildren().size());
+ Assert.assertEquals(1, manual.getTests().size());
+
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/test/java/org/openecomp/core/externaltesting/api/ExternalTestingApiTests.java b/openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/test/java/org/openecomp/core/externaltesting/api/ExternalTestingApiTests.java
new file mode 100644
index 0000000000..62b129c7c0
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-externaltesting-lib/openecomp-sdc-externaltesting-api/src/test/java/org/openecomp/core/externaltesting/api/ExternalTestingApiTests.java
@@ -0,0 +1,30 @@
+/*
+ * Copyright © 2019 iconectiv
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.openecomp.core.externaltesting.api;
+
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+
+@RunWith(Suite.class)
+@Suite.SuiteClasses({
+ ExecutionRequestTests.class,
+ ErrorBodyTests.class
+})
+public class ExternalTestingApiTests {
+ // nothing to do - just a placeholder.
+
+}