Unique identifier for test execution
[sdc.git] / openecomp-be / lib / openecomp-sdc-externaltesting-lib / openecomp-sdc-externaltesting-api / src / main / java / org / openecomp / core / externaltesting / api / ExternalTestingManager.java
1 /*
2  * Copyright © 2019 iconectiv
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 package org.openecomp.core.externaltesting.api;
18
19
20 import java.util.List;
21 import java.util.Map;
22
23 public interface ExternalTestingManager {
24
25     /**
26      * Return the configuration of this feature that we want to
27      * expose to the client.  Treated as a JSON blob for flexibility.
28      */
29     ClientConfiguration getConfig();
30
31     /**
32      * For testing purposes, set the client configuration.
33      */
34     ClientConfiguration setConfig(ClientConfiguration config);
35
36     /**
37      * Build a tree of all test cases for the client including all
38      * defined endpoints, scenarios, and test suites.
39      *
40      * @return test case tree.
41      */
42     TestTreeNode getTestCasesAsTree();
43
44     /**
45      * Get a list of testing endpoints.
46      */
47     List<RemoteTestingEndpointDefinition> getEndpoints();
48
49
50     /**
51      * For functional testing purposes, allow the endpoint configuration
52      * to be provisioned to the BE.
53      */
54     List<RemoteTestingEndpointDefinition> setEndpoints(List<RemoteTestingEndpointDefinition> endpoints);
55
56     /**
57      * Get a list of scenarios from and endpoint.
58      */
59     List<VtpNameDescriptionPair> getScenarios(String endpoint);
60
61     /**
62      * Get a list of test suites given the endpoint and scenario.
63      */
64     List<VtpNameDescriptionPair> getTestSuites(String endpoint, String scenario);
65
66     /**
67      * Get a list of test cases.
68      *
69      * @param endpoint endpoint to contact (e.g. VTP)
70      * @param scenario test scenario to get tests for
71      * @return list of test cases.
72      */
73     List<VtpTestCase> getTestCases(String endpoint, String scenario);
74
75     /**
76      * Get the details about a particular test case.
77      *
78      * @param endpoint     endpoint to contact (e.g. VTP)
79      * @param scenario     test scenario to get tests for
80      * @param testSuite    suite to get tests for
81      * @param testCaseName test case name to query.
82      * @return details about the test case.
83      */
84     VtpTestCase getTestCase(String endpoint, String scenario, String testSuite, String testCaseName);
85
86     /**
87      * Execute a collection of tests where the manager must distribute
88      * the tests to the appropriate endpoint and correlate the responses.
89      *
90      * @param requests     collection of request items.
91      * @param requestId    optional request ID provided from client.
92      * @param vspVersionId vsp version id
93      * @param requestId    request id
94      * @param fileMap      file map
95      * @return response from endpoint (don't bother to parse).
96      */
97
98     List<VtpTestExecutionResponse> execute(List<VtpTestExecutionRequest> requests, String vspId, String vspVersionId,
99             String requestId, Map<String, byte[]> fileMap);
100
101
102     /**
103      * Return a previous results.
104      *
105      * @param endpoint    endpoint to query
106      * @param executionId execution to query.
107      * @return response from endpoint.
108      */
109     VtpTestExecutionResponse getExecution(String endpoint, String executionId);
110
111     /**
112      * Get ExceutionIds by requestId
113      *
114      * @param endpoint
115      * @param requestId
116      * @return response from endpoint
117      */
118     List<VtpTestExecutionOutput> getExecutionIds(String endpoint, String requestId);
119
120
121 }