final AtomicLong timer = new AtomicLong();
final AtomicInteger counter = new AtomicInteger();
Runnable r = new Runnable() {
public void run() {
Connection c = f.getSource().getConnection(NoCredentials.INSTANCE);
Command cmd = c.createCommand("SELECT ?p ?o WHERE { <http://dbpedia.org/resource/Terry_Gilliam> ?p ?o }");
cmd.setTimeout(30);
try {
Solutions s = cmd.executeQuery();
Assert.assertNotNull(s);
try {
Assert.assertEquals(Arrays.asList("p", "o"), s.getVariables());
int count = 0;
while (s.next()) {
count++;
Assert.assertNotNull(s.getBinding("p"));
Assert.assertNotNull(s.getBinding("o"));
}
Assert.assertEquals(121, count);
} finally {
try {
s.close();
} catch (IOException e) {
throw new RuntimeException("Error closing solutions.", e);
}
}
} finally {
try {
c.close();
} catch (IOException e) {
throw new RuntimeException("Error closing connection.", e);
}
}
}