2 * ============LICENSE_START=======================================================
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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=========================================================
21 package org.openecomp.sdc.asdctool.impl;
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;
28 import java.util.List;
31 public class GraphMLConverterTest {
33 public GraphMLConverter createTestSubject() {
34 return new GraphMLConverter();
38 public void testImportGraph() throws Exception {
39 GraphMLConverter testSubject;
40 String[] args = new String[] { "" };
44 testSubject = createTestSubject();
45 result = testSubject.importGraph(args);
49 public void testExportGraph() throws Exception {
50 GraphMLConverter testSubject;
51 String[] args = new String[] { "" };
55 testSubject = createTestSubject();
56 result = testSubject.exportGraph(args);
60 public void testExportGraphMl() throws Exception {
61 GraphMLConverter testSubject;
62 String[] args = new String[] { "" };
66 testSubject = createTestSubject();
67 result = testSubject.exportGraphMl(args);
71 public void testFindErrorInJsonGraph() throws Exception {
72 GraphMLConverter testSubject;
73 String[] args = new String[] { "" };
77 testSubject = createTestSubject();
78 result = testSubject.findErrorInJsonGraph(args);
81 @Test(expected=IllegalArgumentException.class)
82 public void testOpenGraph() throws Exception {
83 GraphMLConverter testSubject;
84 String janusGraphFileLocation = "";
88 testSubject = createTestSubject();
89 result = testSubject.openGraph("src/main/resources/config/janusgraph.properties");
92 @Test(expected=NullPointerException.class)
93 public void testExportJsonGraph() throws Exception {
94 GraphMLConverter testSubject;
95 JanusGraph graph = null;
96 String outputDirectory = "";
100 testSubject = createTestSubject();
101 result = testSubject.exportJsonGraph(graph, outputDirectory);
104 @Test(expected=NullPointerException.class)
105 public void testExportGraphMl_1() throws Exception {
106 GraphMLConverter testSubject;
107 JanusGraph graph = null;
108 String outputDirectory = "";
112 testSubject = createTestSubject();
113 result = testSubject.exportGraphMl(graph, outputDirectory);
117 public void testImportJsonGraph() throws Exception {
118 GraphMLConverter testSubject;
119 JanusGraph graph = null;
120 String graphJsonFile = "";
121 List<ImmutablePair<String, String>> propertiesCriteriaToDelete = null;
125 testSubject = createTestSubject();
126 result = testSubject.importJsonGraph(graph, graphJsonFile, propertiesCriteriaToDelete);
129 @Test(expected=NullPointerException.class)
130 public void testFindErrorInJsonGraph_1() throws Exception {
131 GraphMLConverter testSubject;
132 JanusGraph graph = null;
133 String outputDirectory = "";
137 testSubject = createTestSubject();
138 result = testSubject.findErrorInJsonGraph(graph, outputDirectory);
142 @Test(expected=NullPointerException.class)
143 public void testExportUsers() throws Exception {
144 GraphMLConverter testSubject;
145 JanusGraph 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);