yangxk1 commented on code in PR #683: URL: https://github.com/apache/incubator-graphar/pull/683#discussion_r2113475867
########## maven-projects/info/src/test/java/org/apache/graphar/info/GraphInfoTest.java: ########## @@ -0,0 +1,252 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.graphar.info; + +import java.io.IOException; +import org.apache.graphar.info.loader.GraphLoader; +import org.apache.graphar.info.loader.LocalYamlGraphLoader; +import org.apache.graphar.proto.AdjListType; +import org.apache.graphar.proto.DataType; +import org.apache.graphar.proto.FileType; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +public class GraphInfoTest { + + private static GraphInfo graphInfo; + private static VertexInfo personVertexInfo; + private static EdgeInfo knowsEdgeInfo; + + @BeforeClass + public static void setUp() { + TestUtil.checkTestData(); + final GraphLoader graphLoader = new LocalYamlGraphLoader(); + final String GRAPH_PATH = TestUtil.getLdbcSampleGraphPath(); + try { + graphInfo = graphLoader.load(GRAPH_PATH); + } catch (IOException e) { + throw new RuntimeException(e); + } + personVertexInfo = graphInfo.getVertexInfos().get(0); + knowsEdgeInfo = graphInfo.getEdgeInfos().get(0); + } + + @AfterClass + public static void clean() {} + + @Test + public void testGraphInfoBasics() { + Assert.assertNotNull(graphInfo); + Assert.assertEquals("ldbc_sample", graphInfo.getName()); + Assert.assertEquals("", graphInfo.getPrefix()); // This shouldn't be an empty string + Assert.assertNotNull(graphInfo.getEdgeInfos()); + Assert.assertEquals(1, graphInfo.getEdgeInfos().size()); + Assert.assertNotNull(graphInfo.getVertexInfos()); + Assert.assertEquals(1, graphInfo.getVertexInfos().size()); + } + + @Test + public void testPersonVertexInfoBasics() { + VertexInfo personVertexInfo = graphInfo.getVertexInfos().get(0); + Assert.assertEquals("person", personVertexInfo.getType()); + Assert.assertEquals(100, personVertexInfo.getChunkSize()); + Assert.assertEquals("vertex/person/", personVertexInfo.getPrefix()); + Assert.assertEquals( + "vertex/person//vertex_count", + personVertexInfo.getVerticesNumFilePath()); // one more '/' + Assert.assertEquals("vertex/person//person.vertex.yaml", personVertexInfo.getVertexPath()); Review Comment: Waiting for the code that splices the paths to fix it together -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@graphar.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@graphar.apache.org For additional commands, e-mail: commits-h...@graphar.apache.org