Skip to content

Commit

Permalink
fixed #3889 + test
Browse files Browse the repository at this point in the history
  • Loading branch information
wolf4ood committed Apr 27, 2015
1 parent f70744d commit fc8a993
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
Expand Up @@ -917,7 +917,8 @@ public Iterable<Vertex> getVertices(final String label, final String[] iKey, Obj
} }
} }
// NO INDEX: EXECUTE A QUERY // NO INDEX: EXECUTE A QUERY
GraphQuery query = query(); OrientGraphQuery query = (OrientGraphQuery) query();
query.labels(label);
for (int i = 0; i < iKey.length; i++) { for (int i = 0; i < iKey.length; i++) {
query.has(iKey[i], iValue[i]); query.has(iKey[i], iValue[i]);
} }
Expand Down
Expand Up @@ -77,7 +77,7 @@ public void test() {
resultsAmount++; resultsAmount++;
} }


assertEquals(resultsAmount, 1); assertEquals(1, resultsAmount);


iterator = graph.getVertices("Person", singleKey, singleValue).iterator(); iterator = graph.getVertices("Person", singleKey, singleValue).iterator();


Expand Down Expand Up @@ -105,7 +105,7 @@ public void test() {
resultsAmount++; resultsAmount++;
} }


assertEquals(resultsAmount, 1); assertEquals(1, resultsAmount);


iterator = graph.getVertices("Person", singleKey, singleValue).iterator(); iterator = graph.getVertices("Person", singleKey, singleValue).iterator();


Expand Down Expand Up @@ -136,14 +136,25 @@ public void test() {
resultsAmount++; resultsAmount++;
} }


assertEquals(resultsAmount, 1); assertEquals(1, resultsAmount);


iterator = graph.getVertices("Person", keys, values).iterator(); iterator = graph.getVertices("Person", keys, values).iterator();


firstVertex = iterator.next(); firstVertex = iterator.next();
assertEquals(firstVertex.getProperty("person_id"), "03"); assertEquals(firstVertex.getProperty("person_id"), "03");
assertEquals(firstVertex.getProperty("name"), "Emanuel"); assertEquals(firstVertex.getProperty("name"), "Emanuel");


graph.createVertexType("PersonDummy");

Iterator<Vertex> personDummy = graph.getVertices("PersonDummy", singleKey, singleValue).iterator();

resultsAmount = 0;
while (personDummy.hasNext()) {
personDummy.next();
resultsAmount++;
}
assertEquals(0, resultsAmount);

} }


} }

0 comments on commit fc8a993

Please sign in to comment.