use of com.tinkerpop.blueprints.impls.orient.OrientVertex in project orientdb by orientechnologies.
the class TestFailOperationOnRemovedElement method testDoubleRemoveVertex.
@Test(expected = ORecordNotFoundException.class)
public void testDoubleRemoveVertex() {
OrientVertex v = grap.addVertex(null);
grap.commit();
v.remove();
v.remove();
}
use of com.tinkerpop.blueprints.impls.orient.OrientVertex in project orientdb by orientechnologies.
the class TestFailOperationOnRemovedElement method testSetPropertiesRemovedEdge.
@Test(expected = ORecordNotFoundException.class)
public void testSetPropertiesRemovedEdge() {
OrientVertex v = grap.addVertex(null);
OrientVertex v1 = grap.addVertex(null);
OrientEdge e = (OrientEdge) v.addEdge("test", v1);
grap.commit();
e.remove();
e.setProperties("test", "test");
}
use of com.tinkerpop.blueprints.impls.orient.OrientVertex in project orientdb by orientechnologies.
the class TestGraphRecovering method init.
private void init(OrientBaseGraph g, boolean lightweight) {
g.setUseLightweightEdges(lightweight);
g.createVertexType("V1");
g.createVertexType("V2");
g.createEdgeType("E1");
g.createEdgeType("E2");
final OrientVertex v0 = g.addVertex(null, "key", 0);
final OrientVertex v1 = g.addVertex("class:V1", "key", 1);
final OrientVertex v2 = g.addVertex("class:V2", "key", 2);
v0.addEdge("E", v1);
v1.addEdge("E1", v2);
v2.addEdge("E2", v0);
}
use of com.tinkerpop.blueprints.impls.orient.OrientVertex in project orientdb by orientechnologies.
the class IndexAgainstEdges method indexes.
@Test
public void indexes() {
OrientGraph g = new OrientGraph(URL, "admin", "admin");
try {
if (g.getVertexType("Profile") == null)
g.createVertexType("Profile");
if (g.getEdgeType("Friend") == null) {
final OrientEdgeType f = g.createEdgeType("Friend");
f.createProperty("in", OType.LINK);
f.createProperty("out", OType.LINK);
f.createIndex("Friend.in_out", OClass.INDEX_TYPE.UNIQUE, "in", "out");
}
OrientVertex luca = g.addVertex("class:Profile", "name", "Luca");
OrientVertex jay = g.addVertex("class:Profile", "name", "Jay");
OrientEdge friend = (OrientEdge) luca.addEdge("Friend", jay);
assertFalse(friend.isLightweight());
} finally {
g.shutdown();
}
}
use of com.tinkerpop.blueprints.impls.orient.OrientVertex in project orientdb by orientechnologies.
the class OrientTestsAutoStartTx method noOConcurrentModificationExceptionSettingAFixedValueWithMultipleVertexObjects.
@Test
public void noOConcurrentModificationExceptionSettingAFixedValueWithMultipleVertexObjects() {
final int fixedValue = 113;
OrientVertex firstVertexHandle = graph.addVertex(null, PROPERTY_NAME, fixedValue);
graph.commit();
triggerException(graph);
Object recordId = firstVertexHandle.getId();
Vertex secondVertexHandle = graph.getVertex(recordId);
secondVertexHandle.setProperty(PROPERTY_NAME, fixedValue);
graph.commit();
try {
firstVertexHandle.setProperty(PROPERTY_NAME, fixedValue);
graph.commit();
} catch (OConcurrentModificationException o) {
Assert.fail("OConcurrentModificationException was thrown");
}
}
Aggregations