1 package org.openecomp.sdc.asdctool.impl;
3 import com.thinkaurelius.titan.core.TitanGraph;
4 import org.apache.commons.lang3.tuple.ImmutablePair;
5 import org.apache.tinkerpop.gremlin.structure.Element;
11 public class GraphMLConverterTest {
13 public GraphMLConverter createTestSubject() {
14 return new GraphMLConverter();
18 public void createGraphTestSubject() {
19 converter = new GraphMLConverter();
20 openGraph = converter.openGraph("src/main/resources/config/titan.properties");
24 public void destroyGraphTestSubject() {
25 converter = new GraphMLConverter();
26 converter.clearGraph(openGraph);
30 public void testImportGraph() throws Exception {
31 GraphMLConverter testSubject;
32 String[] args = new String[] { "" };
36 testSubject = createTestSubject();
37 result = testSubject.importGraph(args);
41 public void testExportGraph() throws Exception {
42 GraphMLConverter testSubject;
43 String[] args = new String[] { "" };
47 testSubject = createTestSubject();
48 result = testSubject.exportGraph(args);
52 public void testExportGraphMl() throws Exception {
53 GraphMLConverter testSubject;
54 String[] args = new String[] { "" };
58 testSubject = createTestSubject();
59 result = testSubject.exportGraphMl(args);
63 public void testFindErrorInJsonGraph() throws Exception {
64 GraphMLConverter testSubject;
65 String[] args = new String[] { "" };
69 testSubject = createTestSubject();
70 result = testSubject.findErrorInJsonGraph(args);
73 @Test(expected=IllegalArgumentException.class)
74 public void testOpenGraph() throws Exception {
75 GraphMLConverter testSubject;
76 String titanFileLocation = "";
80 testSubject = createTestSubject();
81 result = testSubject.openGraph("src/main/resources/config/titan.properties");
84 @Test(expected=NullPointerException.class)
85 public void testExportJsonGraph() throws Exception {
86 GraphMLConverter testSubject;
87 TitanGraph graph = null;
88 String outputDirectory = "";
92 testSubject = createTestSubject();
93 result = testSubject.exportJsonGraph(graph, outputDirectory);
96 @Test(expected=NullPointerException.class)
97 public void testExportGraphMl_1() throws Exception {
98 GraphMLConverter testSubject;
99 TitanGraph graph = null;
100 String outputDirectory = "";
104 testSubject = createTestSubject();
105 result = testSubject.exportGraphMl(graph, outputDirectory);
109 public void testImportJsonGraph() throws Exception {
110 GraphMLConverter testSubject;
111 TitanGraph graph = null;
112 String graphJsonFile = "";
113 List<ImmutablePair<String, String>> propertiesCriteriaToDelete = null;
117 testSubject = createTestSubject();
118 result = testSubject.importJsonGraph(graph, graphJsonFile, propertiesCriteriaToDelete);
121 @Test(expected=NullPointerException.class)
122 public void testFindErrorInJsonGraph_1() throws Exception {
123 GraphMLConverter testSubject;
124 TitanGraph graph = null;
125 String outputDirectory = "";
129 testSubject = createTestSubject();
130 result = testSubject.findErrorInJsonGraph(graph, outputDirectory);
134 public void testClearGraph() throws Exception {
135 TitanGraph graph = null;
138 //GraphMLConverter.clearGraph("src/main/resources/config/titan.properties");
141 @Test(expected=NullPointerException.class)
142 public void testExportUsers() throws Exception {
143 GraphMLConverter testSubject;
144 TitanGraph graph = null;
145 String outputDirectory = "";
149 testSubject = createTestSubject();
150 result = testSubject.exportUsers(graph, outputDirectory);
153 @Test(expected=NullPointerException.class)
154 public void testGetProperties() throws Exception {
155 GraphMLConverter testSubject;
156 Element element = null;
157 Map<String, Object> result;
160 testSubject = createTestSubject();
161 result = testSubject.getProperties(element);
165 public void testExportUsers_1() throws Exception {
166 GraphMLConverter testSubject;
167 String[] args = new String[] { "" };
171 testSubject = createTestSubject();
172 result = testSubject.exportUsers(args);