function testExec() {
  var promiseResolver = goog.Promise.withResolver();

  var selectQuery = /** @type {!lf.query.SelectBuilder} */ (
      db.select().from(j));

  var observerCallback = function(changes) {
    // Expecting one "change" record for each insertion.
    assertEquals(ROW_COUNT, changes.length);
    changes.forEach(function(change) {
      assertEquals(1, change['addedCount']);
    });

    db.unobserve(selectQuery, observerCallback);
    promiseResolver.resolve();
  };

  insertSampleJobs().then(function() {
    // Start observing.
    db.observe(selectQuery, observerCallback);
    var observerTask = new lf.proc.ObserverQueryTask(
        hr.db.getGlobal(), [selectQuery.getObservableTaskItem()]);
    return observerTask.exec();
  }, function(e) {
    promiseResolver.reject(e);
  });

  return promiseResolver.promise;
}
Tests that registered observers are notified as a result of executing an
ObserveTask.
@return {!IThenable}