1 package org.openecomp.sdc.asdctool.impl;
6 import org.apache.commons.lang3.tuple.ImmutablePair;
7 import org.apache.tinkerpop.gremlin.structure.Element;
10 import com.thinkaurelius.titan.core.TitanGraph;
12 public class GraphMLConverterTest {
14 public GraphMLConverter createTestSubject() {
15 return new GraphMLConverter();
19 public void createGraphTestSubject() {
20 converter = new GraphMLConverter();
21 openGraph = converter.openGraph("src/main/resources/config/titan.properties");
25 public void destroyGraphTestSubject() {
26 converter = new GraphMLConverter();
27 converter.clearGraph(openGraph);
31 public void testImportGraph() throws Exception {
32 GraphMLConverter testSubject;
33 String[] args = new String[] { "" };
37 testSubject = createTestSubject();
38 result = testSubject.importGraph(args);
42 public void testExportGraph() throws Exception {
43 GraphMLConverter testSubject;
44 String[] args = new String[] { "" };
48 testSubject = createTestSubject();
49 result = testSubject.exportGraph(args);
53 public void testExportGraphMl() throws Exception {
54 GraphMLConverter testSubject;
55 String[] args = new String[] { "" };
59 testSubject = createTestSubject();
60 result = testSubject.exportGraphMl(args);
64 public void testFindErrorInJsonGraph() throws Exception {
65 GraphMLConverter testSubject;
66 String[] args = new String[] { "" };
70 testSubject = createTestSubject();
71 result = testSubject.findErrorInJsonGraph(args);
74 @Test(expected=IllegalArgumentException.class)
75 public void testOpenGraph() throws Exception {
76 GraphMLConverter testSubject;
77 String titanFileLocation = "";
81 testSubject = createTestSubject();
82 result = testSubject.openGraph("src/main/resources/config/titan.properties");
85 @Test(expected=NullPointerException.class)
86 public void testExportJsonGraph() throws Exception {
87 GraphMLConverter testSubject;
88 TitanGraph graph = null;
89 String outputDirectory = "";
93 testSubject = createTestSubject();
94 result = testSubject.exportJsonGraph(graph, outputDirectory);
97 @Test(expected=NullPointerException.class)
98 public void testExportGraphMl_1() throws Exception {
99 GraphMLConverter testSubject;
100 TitanGraph graph = null;
101 String outputDirectory = "";
105 testSubject = createTestSubject();
106 result = testSubject.exportGraphMl(graph, outputDirectory);
110 public void testImportJsonGraph() throws Exception {
111 GraphMLConverter testSubject;
112 TitanGraph graph = null;
113 String graphJsonFile = "";
114 List<ImmutablePair<String, String>> propertiesCriteriaToDelete = null;
118 testSubject = createTestSubject();
119 result = testSubject.importJsonGraph(graph, graphJsonFile, propertiesCriteriaToDelete);
122 @Test(expected=NullPointerException.class)
123 public void testFindErrorInJsonGraph_1() throws Exception {
124 GraphMLConverter testSubject;
125 TitanGraph graph = null;
126 String outputDirectory = "";
130 testSubject = createTestSubject();
131 result = testSubject.findErrorInJsonGraph(graph, outputDirectory);
135 public void testClearGraph() throws Exception {
136 TitanGraph graph = null;
139 //GraphMLConverter.clearGraph("src/main/resources/config/titan.properties");
142 @Test(expected=NullPointerException.class)
143 public void testExportUsers() throws Exception {
144 GraphMLConverter testSubject;
145 TitanGraph graph = null;
146 String outputDirectory = "";
150 testSubject = createTestSubject();
151 result = testSubject.exportUsers(graph, outputDirectory);
154 @Test(expected=NullPointerException.class)
155 public void testGetProperties() throws Exception {
156 GraphMLConverter testSubject;
157 Element element = null;
158 Map<String, Object> result;
161 testSubject = createTestSubject();
162 result = testSubject.getProperties(element);
166 public void testExportUsers_1() throws Exception {
167 GraphMLConverter testSubject;
168 String[] args = new String[] { "" };
172 testSubject = createTestSubject();
173 result = testSubject.exportUsers(args);