Package org.mapstruct.ap.testutil.compilation.model

Examples of org.mapstruct.ap.testutil.compilation.model.CompilationOutcomeDescriptor


    }

    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() );
    }
View Full Code Here

TOP

Related Classes of org.mapstruct.ap.testutil.compilation.model.CompilationOutcomeDescriptor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.