org.umlg.sqlg.test.mod.TestEdgeCreation Maven / Gradle / Ivy
package org.umlg.sqlg.test.mod;
import org.apache.tinkerpop.gremlin.structure.Vertex;
import org.junit.Test;
import org.umlg.sqlg.structure.SchemaManager;
import org.umlg.sqlg.test.BaseTest;
/**
* Date: 2014/07/12
* Time: 5:44 PM
*/
public class TestEdgeCreation extends BaseTest {
@Test
public void testCreateEdge() throws Exception {
Vertex v1 = sqlgGraph.addVertex();
Vertex v2 = sqlgGraph.addVertex();
v1.addEdge("label1", v2, "name", "marko");
sqlgGraph.tx().commit();
assertDb(SchemaManager.EDGE_PREFIX + "label1", 1);
assertDb(SchemaManager.VERTEX_PREFIX + "vertex", 2);
}
@Test
public void testCreateEdgeWithProperties() {
Vertex v1 = sqlgGraph.addVertex();
Vertex v2 = sqlgGraph.addVertex();
v1.addEdge("label1", v2, "name", "marko");
sqlgGraph.tx().commit();
assertDb(SchemaManager.EDGE_PREFIX + "label1", 1);
assertDb(SchemaManager.VERTEX_PREFIX + "vertex", 2);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy