Skip to content

Commit

Permalink
Minor: improved output of test sharding testcase
Browse files Browse the repository at this point in the history
  • Loading branch information
lvca committed Aug 13, 2014
1 parent ad08452 commit 0749769
Showing 1 changed file with 6 additions and 2 deletions.
Expand Up @@ -4,6 +4,7 @@

import org.junit.Test;

import com.orientechnologies.orient.core.record.impl.ODocument;
import com.orientechnologies.orient.core.sql.OCommandSQL;
import com.tinkerpop.blueprints.Direction;
import com.tinkerpop.blueprints.Edge;
Expand Down Expand Up @@ -110,7 +111,8 @@ protected void executeTest() throws Exception {
Assert.assertEquals(e.getProperty("real"), true);

final OrientVertex explain = graph.command(new OCommandSQL("explain select from " + e.getIdentity())).execute();
System.out.println("explain select from " + e.getIdentity() + " -> " + explain.getRecord().toString());
System.out
.println("explain select from " + e.getIdentity() + " -> " + ((ODocument) explain.getRecord()).field("servers"));

result = graph.command(new OCommandSQL("select from " + e.getIdentity())).execute();

Expand All @@ -128,12 +130,14 @@ protected void executeTest() throws Exception {
OrientGraphFactory f = new OrientGraphFactory("plocal:target/server" + server + "/databases/" + getDatabaseName());
OrientGraphNoTx g = f.getNoTx();

System.out.println("Query from server " + server + "...");

try {
for (int cluster = 0; cluster < vertices.length; ++cluster) {
final String query = "select from cluster:client_" + cluster;

final OrientVertex explain = g.command(new OCommandSQL("explain " + query)).execute();
System.out.println("explain " + query + " -> " + explain.getRecord());
System.out.println("explain " + query + " -> " + ((ODocument) explain.getRecord()).field("servers"));

Iterable<OrientVertex> result = g.command(new OCommandSQL(query)).execute();
Assert.assertTrue("Error on query against 'cluster_" + cluster + "' on server '" + server + "': " + query, result
Expand Down

0 comments on commit 0749769

Please sign in to comment.