Update the license for 2017-2018 license
[aai/traversal.git] / aai-traversal / src / test / java / org / onap / aai / rest / search / CountVnfByVnfTypeTest.java
1 /**
2  * ============LICENSE_START=======================================================
3  * org.onap.aai
4  * ================================================================================
5  * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
6  * ================================================================================
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  *    http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  * ============LICENSE_END=========================================================
19  */
20 /**
21 * ============LICENSE_START=======================================================
22 * org.onap.aai
23 * ================================================================================
24 * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
25 * ================================================================================
26 * Licensed under the Apache License, Version 2.0 (the "License");
27 * you may not use this file except in compliance with the License.
28 * You may obtain a copy of the License at
29 *
30 *    http://www.apache.org/licenses/LICENSE-2.0
31 *
32 * Unless required by applicable law or agreed to in writing, software
33 * distributed under the License is distributed on an "AS IS" BASIS,
34 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
35 * See the License for the specific language governing permissions and
36 * limitations under the License.
37 * ============LICENSE_END=========================================================
38 *
39 * ECOMP is a trademark and service mark of AT&T Intellectual Property.
40 */
41 package org.onap.aai.rest.search;
42
43 import static org.junit.Assert.*;
44
45 import java.util.HashMap;
46 import java.util.Map;
47
48 import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal;
49 import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;
50 import org.apache.tinkerpop.gremlin.structure.T;
51 import org.apache.tinkerpop.gremlin.structure.Vertex;
52 import org.junit.Test;
53 import org.onap.aai.exceptions.AAIException;
54 import org.onap.aai.serialization.db.exceptions.NoEdgeRuleFoundException;
55
56 public class CountVnfByVnfTypeTest extends QueryTest {
57
58         public CountVnfByVnfTypeTest() throws AAIException, NoEdgeRuleFoundException {
59                 super();
60     }
61
62     @Test
63     public void test() {
64         super.run(true);
65     }
66
67     @Override
68         protected void createGraph() throws AAIException, NoEdgeRuleFoundException {
69                 //Set up the test graph
70             Vertex genericVnfTypeA1 = graph.addVertex(T.label, "genric-vnf", T.id, "1", "aai-node-type", "generic-vnf", "vnf-id", "vnf-id-1", "vnf-name", "vnf-name-1", "vnf-type", "A");
71             Vertex genericVnfTypeB1 = graph.addVertex(T.label, "genric-vnf", T.id, "2", "aai-node-type", "generic-vnf", "vnf-id", "vnf-id-2", "vnf-name", "vnf-name-2", "vnf-type", "B");
72             Vertex genericVnfTypeC1 = graph.addVertex(T.label, "genric-vnf", T.id, "3", "aai-node-type", "generic-vnf", "vnf-id", "vnf-id-3", "vnf-name", "vnf-name-3", "vnf-type", "C");
73             Vertex genericVnfTypeA2 = graph.addVertex(T.label, "genric-vnf", T.id, "4", "aai-node-type", "generic-vnf", "vnf-id", "vnf-id-4", "vnf-name", "vnf-name-4", "vnf-type", "A");
74             Vertex genericVnfTypeB2 = graph.addVertex(T.label, "genric-vnf", T.id, "5", "aai-node-type", "generic-vnf", "vnf-id", "vnf-id-5", "vnf-name", "vnf-name-5", "vnf-type", "B");
75             Vertex genericVnfTypeA3 = graph.addVertex(T.label, "genric-vnf", T.id, "6", "aai-node-type", "generic-vnf", "vnf-id", "vnf-id-6", "vnf-name", "vnf-name-6", "vnf-type", "A");
76             Vertex genericVnfTypeA4 = graph.addVertex(T.label, "genric-vnf", T.id, "7", "aai-node-type", "generic-vnf", "vnf-id", "vnf-id-7", "vnf-name", "vnf-name-7", "vnf-type", "A");
77             
78             GraphTraversalSource g = graph.traversal();
79             
80             expectedResultForMaps = expectedResultForMaps + "[A=4, B=2, C=1]";
81         }
82
83     @Override
84         protected String getQueryName() {
85                 return "count-vnf-byVnfType";
86         }
87
88
89     @Override
90     protected void addStartNode(GraphTraversal<Vertex, Vertex> g) {
91         return;
92     }
93
94     @Override
95     protected void addParam(Map<String, Object> params) {
96         return;
97     }
98
99 }