code.append("}");
return code;
}
});
CompilationState state;
try {
state = CompilationStateBuilder.buildFrom(logger, new CompilerContext(), javaResources);
} catch (UnableToCompleteException e) {
throw new RuntimeException(e);
}
UnitTestTreeLogger.Builder builder = new UnitTestTreeLogger.Builder();
builder.setLowestLogLevel(TreeLogger.ERROR);
for (String expectedMsg : expected) {
builder.expectError(expectedMsg, null);
}
builder.expectError(RequestFactoryModel.poisonedMessage(), null);
UnitTestTreeLogger testLogger = builder.createLogger();
try {
new RequestFactoryModel(testLogger, state.getTypeOracle().findType(
"t.TestRequestFactory"));
fail("Should have complained");
} catch (UnableToCompleteException e) {
}
testLogger.assertCorrectLogEntries();