Created
June 17, 2013 14:30
-
-
Save okram/5797315 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void testUpdateValuesInIndexKeys() throws Exception { | |
KeyIndexableGraph graph = (KeyIndexableGraph) graphTest.generateGraph(); | |
graph.createKeyIndex("name", Vertex.class); | |
Vertex v1 = graph.addVertex(null); | |
v1.setProperty("name","marko"); | |
assertEquals(v1.getProperty("name"),"marko"); | |
vertexCount(graph, 1); | |
if(graph instanceof TransactionalGraph) | |
((TransactionalGraph)graph).commit(); | |
v1 = graph.getVertices("name","marko").iterator().next(); | |
assertEquals(v1.getProperty("name"),"marko"); | |
v1.setProperty("name","marko a. rodriguez"); | |
assertEquals(v1.getProperty("name"),"marko a. rodriguez"); | |
vertexCount(graph, 1); | |
if(graph instanceof TransactionalGraph) | |
((TransactionalGraph)graph).commit(); | |
assertFalse(graph.getVertices("name","marko").iterator().hasNext()); | |
v1 = graph.getVertices("name","marko a. rodriguez").iterator().next(); | |
assertEquals(v1.getProperty("name"),"marko a. rodriguez"); | |
vertexCount(graph, 1); | |
graph.shutdown(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment