Skip to content

Commit

Permalink
Fixed two unit tests: first index is now 1, and no longer 0; the resu…
Browse files Browse the repository at this point in the history
…lts may return multiple rows, so we check all if it is the expected one
  • Loading branch information
egonw committed Nov 12, 2011
1 parent 5d27f01 commit 77bdcdb
Showing 1 changed file with 10 additions and 4 deletions.
Expand Up @@ -49,7 +49,7 @@ public void testCreateStore() {
pellet.isRDFType(store, "http://www.example.com/bar");
Assert.assertEquals(1, results.getRowCount());
Assert.assertEquals(
"http://www.example.com/foo", results.get(0, "o")
"http://www.example.com/foo", results.get(1, "o")
);
}

Expand All @@ -62,9 +62,15 @@ public void testCreateStore() {
);
StringMatrix results =
pellet.allAbout(store, "http://www.example.com/foo");
Assert.assertEquals(1, results.getRowCount());
Assert.assertEquals("http://www.example.com/x", results.get(1, "p"));
Assert.assertEquals("http://www.example.com/bar", results.get(1, "s"));
System.out.println(results);
Assert.assertTrue(results.getRowCount() > 0);
for (int row=1; row<=results.getRowCount(); row++) {
if ("http://www.example.com/x".equals(results.get(row, "p"))) {
Assert.assertEquals("http://www.example.com/bar", results.get(row, "s"));
return;
}
}
Assert.fail("Could not find the expected triple");
}

@Test public void testReason() throws Exception {
Expand Down

0 comments on commit 77bdcdb

Please sign in to comment.