}
protected void generateMapperImplementation() throws Exception {
CompilationResultHolder compilationResult = compile( getTestClasses(), getProcessorOptions() );
CompilationOutcomeDescriptor actualResult =
CompilationOutcomeDescriptor.forResult(
sourceDir,
compilationResult.compilationSuccessful,
compilationResult.diagnostics.getDiagnostics()
);
CompilationOutcomeDescriptor expectedResult =
CompilationOutcomeDescriptor.forExpectedCompilationResult(
method.getAnnotation( ExpectedCompilationOutcome.class )
);
if ( expectedResult.getCompilationResult() == CompilationResult.SUCCEEDED ) {
assertThat( actualResult.getCompilationResult() ).describedAs(
"Compilation failed. Diagnostics: " + compilationResult.diagnostics.getDiagnostics()
).isEqualTo(
CompilationResult.SUCCEEDED
);
}
else {
assertThat( actualResult.getCompilationResult() ).describedAs(
"Compilation succeeded but should have failed."
).isEqualTo( CompilationResult.FAILED );
}
assertDiagnostics( actualResult.getDiagnostics(), expectedResult.getDiagnostics() );
}