diff options
Diffstat (limited to 'asdctool/src/test/java/org')
-rw-r--r-- | asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/GraphMLDataAnalyzerTest.java | 45 |
1 files changed, 31 insertions, 14 deletions
diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/GraphMLDataAnalyzerTest.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/GraphMLDataAnalyzerTest.java index 7757b475bc..bffc0daee1 100644 --- a/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/GraphMLDataAnalyzerTest.java +++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/GraphMLDataAnalyzerTest.java @@ -7,9 +7,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -22,20 +22,37 @@ package org.openecomp.sdc.asdctool.impl; import org.junit.Test; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import static org.openecomp.sdc.asdctool.impl.GraphMLDataAnalyzer.EXCEL_EXTENSION; +import static org.openecomp.sdc.asdctool.impl.GraphMLDataAnalyzer.GRAPH_ML_EXTENSION; +import static org.testng.AssertJUnit.assertNotNull; + public class GraphMLDataAnalyzerTest { - private GraphMLDataAnalyzer createTestSubject() { - return new GraphMLDataAnalyzer(); - } + public static final String FILE_NAME = "export"; + + @Test + public void testAnalyzeGraphMLDataNoFile() { + String[] args = new String[]{"noExistFile"}; + + // default test + GraphMLDataAnalyzer graph = new GraphMLDataAnalyzer(); + String result = graph.analyzeGraphMLData(args); + + assertNull(result); + } + + @Test + public void testAnalyzeGraphMLData() { + String path = getClass().getClassLoader().getResource(FILE_NAME + GRAPH_ML_EXTENSION).getPath(); + String[] args = new String[]{path}; - @Test - public void testAnalyzeGraphMLData() throws Exception { - GraphMLDataAnalyzer testSubject; - String[] args = new String[] { "export", "src/main/resources/config/janusgraph.properties", "./" }; - String result; + // default test + GraphMLDataAnalyzer graph = new GraphMLDataAnalyzer(); + String result = graph.analyzeGraphMLData(args); - // default test - testSubject = createTestSubject(); - result = testSubject.analyzeGraphMLData(args); - } + assertNotNull(result); + assertTrue(result.endsWith(EXCEL_EXTENSION)); + } } |