use of com.tinkerpop.blueprints.impls.orient.OrientVertex in project orientdb by orientechnologies.
the class ODatabaseFailDueCloseTest method fillTheGraph.
private static void fillTheGraph(OrientGraph graph) {
OrientVertex riccardo = createPerson(graph, "riccardo", 32);
OrientVertex luca = createPerson(graph, "luca", 40);
OrientVertex luigi = createPerson(graph, "luigi", 30);
OrientVertex milano = createCity(graph, "milano", 1332516);
OrientVertex roma = createCity(graph, "roma", 1332516);
OrientVertex unknown = createCity(graph, "unknown", -1);
riccardo.addEdge("lives", milano);
luca.addEdge("lives", roma);
luigi.addEdge("lives", unknown);
}
use of com.tinkerpop.blueprints.impls.orient.OrientVertex in project orientdb by orientechnologies.
the class ODatabaseFailDueCloseTest method createCity.
private static OrientVertex createCity(OrientGraph graph, String localName, int population) {
OrientVertex a = graph.addVertex("class:City");
a.setProperties("localName", localName, "population", population);
return a;
}
use of com.tinkerpop.blueprints.impls.orient.OrientVertex in project orientdb by orientechnologies.
the class TestFailOperationOnRemovedElement method testPropertyTypeRemovedEdge.
@Test(expected = ORecordNotFoundException.class)
public void testPropertyTypeRemovedEdge() {
OrientVertex v = grap.addVertex(null);
OrientVertex v1 = grap.addVertex(null);
OrientEdge e = (OrientEdge) v.addEdge("test", v1);
grap.commit();
e.remove();
e.setProperty("test", "test", OType.STRING);
}
use of com.tinkerpop.blueprints.impls.orient.OrientVertex in project orientdb by orientechnologies.
the class TestFailOperationOnRemovedElement method testSetPropertyTypeOnRemovedVertex.
@Test(expected = ORecordNotFoundException.class)
public void testSetPropertyTypeOnRemovedVertex() {
OrientVertex v = grap.addVertex(null);
grap.commit();
v.remove();
v.setProperty("test", "aaaa", OType.STRING);
}
use of com.tinkerpop.blueprints.impls.orient.OrientVertex in project orientdb by orientechnologies.
the class ServerClusterQueryTest method checkShardedGroupBy.
private void checkShardedGroupBy() {
for (int s = 0; s < SERVERS; ++s) {
OrientGraphFactory factory = new OrientGraphFactory("plocal:target/server" + s + "/databases/" + getDatabaseName());
OrientGraphNoTx g = factory.getNoTx();
try {
Iterable<OrientVertex> result = g.command(new OCommandSQL("select from ( select amount, kind from v group by kind ) order by kind")).execute();
Iterator<OrientVertex> it = result.iterator();
Assert.assertTrue(it.hasNext());
OrientVertex r1 = it.next();
Assert.assertTrue(it.hasNext());
OrientVertex r2 = it.next();
Assert.assertFalse(it.hasNext());
Assert.assertEquals(r1.getProperty("kind"), "a");
Assert.assertEquals(r2.getProperty("kind"), "b");
} finally {
g.shutdown();
}
}
}
Aggregations