OutboxTable outboxes = new OutboxTable();
outboxes.addOutbox(outbox);
JobRunner runner = new JobRunner(new JobEventTable(), outboxes);
// Perform a first compile. This should pass since all resources are valid.
Result result =
compileWithChanges(logger, runner, outbox, sourcePath, Lists.<MockResource> newArrayList());
assertTrue(result.isOk());
// Recompile should fail since the provided Foo is not compilable.
result = compileWithChanges(logger, runner, outbox, sourcePath,
Lists.<MockResource> newArrayList(nonCompilableFooResource));
assertFalse(result.isOk());
// Recompile with a modified entry point. This should fail again since Foo is still
// bad, but if transactionality protection failed on the minimalRebuildCache this compile will
// succeed because it will think that it has "already processed" Foo.
result = compileWithChanges(logger, runner, outbox, sourcePath,
Lists.<MockResource> newArrayList(referencesBarEntryPointResource));
assertFalse(result.isOk());
}