List of Input Parameters for VSP
[sdc.git] / openecomp-be / lib / openecomp-sdc-externaltesting-lib / openecomp-sdc-externaltesting-api / src / main / java / org / openecomp / core / externaltesting / api / TestTreeNode.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 import com.fasterxml.jackson.annotation.JsonInclude;
20 import lombok.Data;
21 import lombok.EqualsAndHashCode;
22
23 import java.util.ArrayList;
24 import java.util.List;
25
26 /**
27  * Tree structure of tests.   VTP does not provide an organized
28  * tree of tests.  Here we define a tree node with tests and
29  * child nodes to represent our tree.
30  */
31 @SuppressWarnings("unused")
32 @JsonInclude(JsonInclude.Include.NON_EMPTY)
33 @Data()
34 @EqualsAndHashCode(callSuper=true)
35 public class TestTreeNode extends VtpNameDescriptionPair {
36
37   @JsonInclude(JsonInclude.Include.NON_EMPTY)
38   private List<VtpTestCase> tests;
39
40   @JsonInclude(JsonInclude.Include.NON_EMPTY)
41   private List<TestTreeNode> children;
42
43   public TestTreeNode() {
44     super();
45   }
46
47   public TestTreeNode(String name, String description) {
48     super(name, description);
49   }
50
51   public void addTest(VtpTestCase test) {
52     if (tests == null) {
53       tests = new ArrayList<>();
54     }
55     tests.add(test);
56   }
57
58   public void addChild(TestTreeNode child) {
59     if (children == null) {
60       children = new ArrayList<>();
61     }
62     children.add(child);
63   }
64 }