Fix for radio buttons
[sdc.git] / catalog-dao / src / test / java / org / openecomp / sdc / be / dao / jsongraph / TitanDaoTest.java
1 package org.openecomp.sdc.be.dao.jsongraph;
2
3 import java.util.List;
4 import java.util.Map;
5
6 import org.apache.tinkerpop.gremlin.structure.Edge;
7 import org.apache.tinkerpop.gremlin.structure.Vertex;
8 import org.junit.Test;
9 import org.openecomp.sdc.be.dao.jsongraph.types.EdgeLabelEnum;
10 import org.openecomp.sdc.be.dao.jsongraph.types.EdgePropertyEnum;
11 import org.openecomp.sdc.be.dao.jsongraph.types.JsonParseFlagEnum;
12 import org.openecomp.sdc.be.dao.jsongraph.types.VertexTypeEnum;
13 import org.openecomp.sdc.be.dao.titan.TitanGraphClient;
14 import org.openecomp.sdc.be.dao.titan.TitanOperationStatus;
15 import org.openecomp.sdc.be.datatypes.enums.GraphPropertyEnum;
16
17 import com.thinkaurelius.titan.core.TitanGraph;
18
19 import fj.data.Either;
20
21
22 public class TitanDaoTest {
23
24         private TitanDao createTestSubject() {
25                 return new TitanDao(new TitanGraphClient());
26         }
27
28         
29         @Test
30         public void testCommit() throws Exception {
31                 TitanDao testSubject;
32                 TitanOperationStatus result;
33
34                 // default test
35                 testSubject = createTestSubject();
36                 result = testSubject.commit();
37         }
38
39         
40         @Test
41         public void testRollback() throws Exception {
42                 TitanDao testSubject;
43                 TitanOperationStatus result;
44
45                 // default test
46                 testSubject = createTestSubject();
47                 result = testSubject.rollback();
48         }
49
50         
51         @Test
52         public void testGetGraph() throws Exception {
53                 TitanDao testSubject;
54                 Either<TitanGraph, TitanOperationStatus> result;
55
56                 // default test
57                 testSubject = createTestSubject();
58                 result = testSubject.getGraph();
59         }
60
61         
62
63
64         
65         @Test
66         public void testGetVertexByPropertyAndLabel() throws Exception {
67                 TitanDao testSubject;
68                 GraphPropertyEnum name = null;
69                 Object value = null;
70                 VertexTypeEnum label = null;
71                 Either<GraphVertex, TitanOperationStatus> result;
72
73                 // default test
74                 testSubject = createTestSubject();
75                 result = testSubject.getVertexByPropertyAndLabel(name, value, label);
76         }
77
78         
79         @Test
80         public void testGetVertexByPropertyAndLabel_1() throws Exception {
81                 TitanDao testSubject;
82                 GraphPropertyEnum name = null;
83                 Object value = null;
84                 VertexTypeEnum label = null;
85                 JsonParseFlagEnum parseFlag = null;
86                 Either<GraphVertex, TitanOperationStatus> result;
87
88                 // default test
89                 testSubject = createTestSubject();
90                 result = testSubject.getVertexByPropertyAndLabel(name, value, label, parseFlag);
91         }
92
93         
94         @Test
95         public void testGetVertexById() throws Exception {
96                 TitanDao testSubject;
97                 String id = "";
98                 Either<GraphVertex, TitanOperationStatus> result;
99
100                 // default test
101                 testSubject = createTestSubject();
102                 result = testSubject.getVertexById(id);
103         }
104
105         
106         
107
108         
109
110
111         
112
113
114         
115
116
117         
118
119         
120         
121         @Test
122         public void testGetByCriteria() throws Exception {
123                 TitanDao testSubject;
124                 VertexTypeEnum type = null;
125                 Map<GraphPropertyEnum, Object> props = null;
126                 Either<List<GraphVertex>, TitanOperationStatus> result;
127
128                 // default test
129                 testSubject = createTestSubject();
130                 result = testSubject.getByCriteria(type, props);
131         }
132
133         
134         @Test
135         public void testGetByCriteria_1() throws Exception {
136                 TitanDao testSubject;
137                 VertexTypeEnum type = null;
138                 Map<GraphPropertyEnum, Object> props = null;
139                 JsonParseFlagEnum parseFlag = null;
140                 Either<List<GraphVertex>, TitanOperationStatus> result;
141
142                 // default test
143                 testSubject = createTestSubject();
144                 result = testSubject.getByCriteria(type, props, parseFlag);
145         }
146
147         
148         @Test
149         public void testGetByCriteria_2() throws Exception {
150                 TitanDao testSubject;
151                 VertexTypeEnum type = null;
152                 Map<GraphPropertyEnum, Object> props = null;
153                 Map<GraphPropertyEnum, Object> hasNotProps = null;
154                 JsonParseFlagEnum parseFlag = null;
155                 Either<List<GraphVertex>, TitanOperationStatus> result;
156
157                 // default test
158                 testSubject = createTestSubject();
159                 result = testSubject.getByCriteria(type, props, hasNotProps, parseFlag);
160         }
161
162         
163
164
165         
166         @Test
167         public void testGetChildVertex() throws Exception {
168                 TitanDao testSubject;
169                 GraphVertex parentVertex = null;
170                 EdgeLabelEnum edgeLabel = null;
171                 JsonParseFlagEnum parseFlag = null;
172                 Either<GraphVertex, TitanOperationStatus> result;
173
174                 // default test
175                 testSubject = createTestSubject();
176                 result = testSubject.getChildVertex(parentVertex, edgeLabel, parseFlag);
177         }
178
179         
180         @Test
181         public void testGetParentVertex() throws Exception {
182                 TitanDao testSubject;
183                 GraphVertex parentVertex = null;
184                 EdgeLabelEnum edgeLabel = null;
185                 JsonParseFlagEnum parseFlag = null;
186                 Either<GraphVertex, TitanOperationStatus> result;
187
188                 // default test
189                 testSubject = createTestSubject();
190                 result = testSubject.getParentVertex(parentVertex, edgeLabel, parseFlag);
191         }
192
193         
194         @Test
195         public void testGetChildrenVertecies() throws Exception {
196                 TitanDao testSubject;
197                 GraphVertex parentVertex = null;
198                 EdgeLabelEnum edgeLabel = null;
199                 JsonParseFlagEnum parseFlag = null;
200                 Either<List<GraphVertex>, TitanOperationStatus> result;
201
202                 // default test
203                 testSubject = createTestSubject();
204                 result = testSubject.getChildrenVertecies(parentVertex, edgeLabel, parseFlag);
205         }
206
207         
208         @Test
209         public void testGetParentVertecies() throws Exception {
210                 TitanDao testSubject;
211                 GraphVertex parentVertex = null;
212                 EdgeLabelEnum edgeLabel = null;
213                 JsonParseFlagEnum parseFlag = null;
214                 Either<List<GraphVertex>, TitanOperationStatus> result;
215
216                 // default test
217                 testSubject = createTestSubject();
218                 result = testSubject.getParentVertecies(parentVertex, edgeLabel, parseFlag);
219         }
220
221         
222
223
224
225         
226
227
228         
229
230
231         
232
233         
234
235
236         
237
238         
239
240         
241
242
243         
244
245         
246         @Test
247         public void testUpdateVertexMetadataPropertiesWithJson() throws Exception {
248                 TitanDao testSubject;
249                 Vertex vertex = null;
250                 Map<GraphPropertyEnum, Object> properties = null;
251                 TitanOperationStatus result;
252
253                 // default test
254                 testSubject = createTestSubject();
255                 result = testSubject.updateVertexMetadataPropertiesWithJson(vertex, properties);
256         }
257
258         
259
260         
261
262
263         
264         @Test
265         public void testGetProperty_1() throws Exception {
266                 TitanDao testSubject;
267                 Edge edge = null;
268                 EdgePropertyEnum key = null;
269                 Object result;
270
271                 // default test
272                 testSubject = createTestSubject();
273                 result = testSubject.getProperty(edge, key);
274         }
275
276         
277
278         
279         @Test
280         public void testGetBelongingEdgeByCriteria_1() throws Exception {
281                 TitanDao testSubject;
282                 String parentId = "";
283                 EdgeLabelEnum label = null;
284                 Map<GraphPropertyEnum, Object> properties = null;
285                 Either<Edge, TitanOperationStatus> result;
286
287                 // default test
288                 testSubject = createTestSubject();
289                 result = testSubject.getBelongingEdgeByCriteria(parentId, label, properties);
290         }
291 }