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