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