void verifyRead() throws Exception {
// read
String disA = "Gaithersburg";
String disB = "Carytown";
HDict recA = client.read("site and dis==\"" + disA + "\"");
HDict recB = client.read("site and dis==\"" + disB + "\"");
verifyEq(recA.dis(), disA);
verifyEq(client.read("badTagShouldBeThere", false), null);
try {
client.read("badTagShouldBeThere");
fail();
}
catch (UnknownRecException e) {
verifyException(e);
}
// readAll
HGrid grid = client.readAll("site");
verifyGridContains(grid, "dis", disA);
verifyGridContains(grid, "dis", disB);
verifyGridContains(grid, "id", recA.id());
verifyGridContains(grid, "id", recB.id());
// readAll limit
verify(grid.numRows() > 2);
verifyEq(client.readAll("site", 2).numRows(), 2);
// readById
HDict rec = client.readById(recA.id());
verifyEq(rec.dis(), disA);
HRef badId = HRef.make("badBadId");
verifyEq(client.readById(badId, false), null);
try {
client.readById(badId);
fail();