final ObjectIdQuery q1 = new ObjectIdQuery(
o.getObjectId(),
false,
ObjectIdQuery.CACHE);
clientServerInterceptor.runWithQueriesBlocked(new UnitTestClosure() {
public void execute() {
List<?> objects = clientContext.performQuery(q1);
assertEquals(1, objects.size());
assertSame(o, objects.get(0));
}
});
clientContext.commitChanges();
// fetch committed
final ObjectIdQuery q2 = new ObjectIdQuery(
o.getObjectId(),
false,
ObjectIdQuery.CACHE);
clientServerInterceptor.runWithQueriesBlocked(new UnitTestClosure() {
public void execute() {
List<?> objects = clientContext.performQuery(q2);
assertEquals(1, objects.size());
assertSame(o, objects.get(0));