Release version 1.13.7
[sdc.git] / asdctool / src / test / java / org / openecomp / sdc / asdctool / impl / GraphMLDataAnalyzerTest.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * SDC
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
10  *
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  *
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=========================================================
19  */
20
21 package org.openecomp.sdc.asdctool.impl;
22
23 import static org.junit.jupiter.api.Assertions.assertNotNull;
24 import static org.junit.jupiter.api.Assertions.assertNull;
25 import static org.junit.jupiter.api.Assertions.assertTrue;
26 import static org.openecomp.sdc.asdctool.impl.GraphMLDataAnalyzer.EXCEL_EXTENSION;
27 import static org.openecomp.sdc.asdctool.impl.GraphMLDataAnalyzer.GRAPH_ML_EXTENSION;
28
29 import org.junit.jupiter.api.Test;
30
31 class GraphMLDataAnalyzerTest {
32
33     private static final String FILE_NAME = "export";
34
35     @Test
36     void testAnalyzeGraphMLDataNoFile() {
37         final String[] args = new String[]{"noExistFile"};
38
39         // default test
40         final GraphMLDataAnalyzer graph = new GraphMLDataAnalyzer();
41         final String result = graph.analyzeGraphMLData(args);
42
43         assertNull(result);
44     }
45
46     @Test
47     void testAnalyzeGraphMLData() {
48         final String path = getClass().getClassLoader().getResource(FILE_NAME + GRAPH_ML_EXTENSION).getPath();
49         final String[] args = new String[]{path};
50
51         // default test
52         final GraphMLDataAnalyzer graph = new GraphMLDataAnalyzer();
53         final String result = graph.analyzeGraphMLData(args);
54
55         assertNotNull(result);
56         assertTrue(result.endsWith(EXCEL_EXTENSION));
57     }
58 }