Added oparent to sdc main
[sdc.git] / asdctool / src / test / java / org / openecomp / sdc / asdctool / impl / GraphMLConverterTest.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * SDC
4  * ================================================================================
5  * Copyright (C) 2019 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 package org.openecomp.sdc.asdctool.impl;
22
23 import org.janusgraph.core.JanusGraph;
24 import org.apache.commons.lang3.tuple.ImmutablePair;
25 import org.apache.tinkerpop.gremlin.structure.Element;
26 import org.junit.Test;
27
28 import java.util.List;
29 import java.util.Map;
30
31 public class GraphMLConverterTest {
32         
33         public GraphMLConverter createTestSubject() {
34                 return new GraphMLConverter();
35         }
36         
37         @Test
38         public void testImportGraph() throws Exception {
39                 GraphMLConverter testSubject;
40                 String[] args = new String[] { "" };
41                 boolean result;
42
43                 // default test
44                 testSubject = createTestSubject();
45                 result = testSubject.importGraph(args);
46         }
47
48         @Test
49         public void testExportGraph() throws Exception {
50                 GraphMLConverter testSubject;
51                 String[] args = new String[] { "" };
52                 boolean result;
53
54                 // default test
55                 testSubject = createTestSubject();
56                 result = testSubject.exportGraph(args);
57         }
58
59         @Test
60         public void testExportGraphMl() throws Exception {
61                 GraphMLConverter testSubject;
62                 String[] args = new String[] { "" };
63                 String result;
64
65                 // default test
66                 testSubject = createTestSubject();
67                 result = testSubject.exportGraphMl(args);
68         }
69
70         @Test
71         public void testFindErrorInJsonGraph() throws Exception {
72                 GraphMLConverter testSubject;
73                 String[] args = new String[] { "" };
74                 boolean result;
75
76                 // default test
77                 testSubject = createTestSubject();
78                 result = testSubject.findErrorInJsonGraph(args);
79         }
80
81         @Test(expected=IllegalArgumentException.class)
82         public void testOpenGraph() throws Exception {
83                 GraphMLConverter testSubject;
84                 String janusGraphFileLocation = "";
85                 JanusGraph result;
86
87                 // default test
88                 testSubject = createTestSubject();
89                 result = testSubject.openGraph("src/main/resources/config/janusgraph.properties");
90         }
91
92         @Test(expected=NullPointerException.class)
93         public void testExportJsonGraph() throws Exception {
94                 GraphMLConverter testSubject;
95                 JanusGraph graph = null;
96                 String outputDirectory = "";
97                 String result;
98
99                 // default test
100                 testSubject = createTestSubject();
101                 result = testSubject.exportJsonGraph(graph, outputDirectory);
102         }
103
104         @Test(expected=NullPointerException.class)
105         public void testExportGraphMl_1() throws Exception {
106                 GraphMLConverter testSubject;
107                 JanusGraph graph = null;
108                 String outputDirectory = "";
109                 String result;
110
111                 // default test
112                 testSubject = createTestSubject();
113                 result = testSubject.exportGraphMl(graph, outputDirectory);
114         }
115
116         @Test
117         public void testImportJsonGraph() throws Exception {
118                 GraphMLConverter testSubject;
119                 JanusGraph graph = null;
120                 String graphJsonFile = "";
121                 List<ImmutablePair<String, String>> propertiesCriteriaToDelete = null;
122                 boolean result;
123
124                 // default test
125                 testSubject = createTestSubject();
126                 result = testSubject.importJsonGraph(graph, graphJsonFile, propertiesCriteriaToDelete);
127         }
128
129         @Test(expected=NullPointerException.class)
130         public void testFindErrorInJsonGraph_1() throws Exception {
131                 GraphMLConverter testSubject;
132                 JanusGraph graph = null;
133                 String outputDirectory = "";
134                 String result;
135
136                 // default test
137                 testSubject = createTestSubject();
138                 result = testSubject.findErrorInJsonGraph(graph, outputDirectory);
139         }
140
141
142         @Test(expected=NullPointerException.class)
143         public void testExportUsers() throws Exception {
144                 GraphMLConverter testSubject;
145                 JanusGraph graph = null;
146                 String outputDirectory = "";
147                 String result;
148
149                 // default test
150                 testSubject = createTestSubject();
151                 result = testSubject.exportUsers(graph, outputDirectory);
152         }
153
154         @Test(expected=NullPointerException.class)
155         public void testGetProperties() throws Exception {
156                 GraphMLConverter testSubject;
157                 Element element = null;
158                 Map<String, Object> result;
159
160                 // default test
161                 testSubject = createTestSubject();
162                 result = testSubject.getProperties(element);
163         }
164
165         @Test
166         public void testExportUsers_1() throws Exception {
167                 GraphMLConverter testSubject;
168                 String[] args = new String[] { "" };
169                 boolean result;
170
171                 // default test
172                 testSubject = createTestSubject();
173                 result = testSubject.exportUsers(args);
174         }
175 }