// Path: 3_defect-analysis/x_baseline/src/main/java/org/zalando/techtalks/hackingjava/defectanalysis/baseline/engine/DefectAnalysisEngine.java
// public interface DefectAnalysisEngine {
//     CompilationResult compile(File sourceFile);
// }
// 
// Path: 3_defect-analysis/x_baseline/src/main/java/org/zalando/techtalks/hackingjava/defectanalysis/baseline/marker/IllBehaved.java
// public interface IllBehaved {}
// 
// Path: 3_defect-analysis/x_baseline/src/main/java/org/zalando/techtalks/hackingjava/defectanalysis/baseline/marker/WellBehaved.java
// public interface WellBehaved {
// }
// 
// Path: 3_defect-analysis/2_checker-framework/src/main/java/org/zalando/techtalks/hackingjava/defectanalysis/checkerframework/engine/CheckerFrameworkAnalysisEngine.java
// public class CheckerFrameworkAnalysisEngine implements DefectAnalysisEngine {
// 
//     private final Class<? extends BaseTypeChecker> checkerClass;
// 
//     public CheckerFrameworkAnalysisEngine(final Class<? extends BaseTypeChecker> checkerClass) {
//         this.checkerClass = checkerClass;
//     }
// 
//     @Override public CompilationResult compile(final File sourceFile) {
//         return new ForkedRun(CheckerFrameworkAnalysisEngine.class)
//                 .withAdditionalClassLoaderFromClass(AbstractUser.class)
//                 .withJavaC()
//                 .withArg("-d").tempDirAsArg()
//                 .withArg("-processor").withArg(checkerClass)
//                 .withArg(sourceFile.getAbsolutePath())
//                 .run();
//     }
// }
// 
// Path: 3_defect-analysis/x_tests/src/main/java/org/zalando/techtalks/hackingjava/defectanalysis/tests/AbstractDefectDetectionTest.java
// public abstract class AbstractDefectDetectionTest extends AbstractCompilerTest {
// 
//     protected abstract Class<? extends WellBehaved> wellBehavedClass();
// 
//     protected abstract Class<? extends IllBehaved> illBehavedClass();
// 
//     @Test
//     public void detectWellBehavedClass() {
//         final CompilationResult result = engine.compile(sourceFileFor(wellBehavedClass()));
//         assertThat(result, isSuccess());
//     }
// 
//     @Test
//     public void detectIllBehavedClass() {
//         final CompilationResult result = engine.compile(sourceFileFor(illBehavedClass()));
//         assertThat(result, isFailureWithExpectedMessage(expectedErrorMessage()));
//     }
// 
//     protected abstract String expectedErrorMessage();
// 
// }


import org.checkerframework.checker.nullness.NullnessChecker;
import org.zalando.techtalks.hackingjava.defectanalysis.baseline.engine.DefectAnalysisEngine;
import org.zalando.techtalks.hackingjava.defectanalysis.baseline.marker.IllBehaved;
import org.zalando.techtalks.hackingjava.defectanalysis.baseline.marker.WellBehaved;
import org.zalando.techtalks.hackingjava.defectanalysis.checkerframework.engine.CheckerFrameworkAnalysisEngine;
import org.zalando.techtalks.hackingjava.defectanalysis.tests.AbstractDefectDetectionTest;
package org.zalando.techtalks.hackingjava.defectanalysis.checkerframework.nullness;


/**
 * @author Sean Patrick Floyd (sean.floyd@zalando.de)
 * @since 21.01.2016
 */
public class CheckerFrameworkNullnessTest extends AbstractDefectDetectionTest {

    @Override protected Class<? extends WellBehaved> wellBehavedClass() {
        return WellbehavedNullness.class;
    }

    @Override protected Class<? extends IllBehaved> illBehavedClass() {
        return IllbehavedNullness.class;
    }

    @Override protected String expectedErrorMessage() {
        return "required: @Initialized @NonNull String";
    }

// Path: 3_defect-analysis/x_baseline/src/main/java/org/zalando/techtalks/hackingjava/defectanalysis/baseline/engine/DefectAnalysisEngine.java
// public interface DefectAnalysisEngine {
//     CompilationResult compile(File sourceFile);
// }
// 
// Path: 3_defect-analysis/x_baseline/src/main/java/org/zalando/techtalks/hackingjava/defectanalysis/baseline/marker/IllBehaved.java
// public interface IllBehaved {}
// 
// Path: 3_defect-analysis/x_baseline/src/main/java/org/zalando/techtalks/hackingjava/defectanalysis/baseline/marker/WellBehaved.java
// public interface WellBehaved {
// }
// 
// Path: 3_defect-analysis/2_checker-framework/src/main/java/org/zalando/techtalks/hackingjava/defectanalysis/checkerframework/engine/CheckerFrameworkAnalysisEngine.java
// public class CheckerFrameworkAnalysisEngine implements DefectAnalysisEngine {
// 
//     private final Class<? extends BaseTypeChecker> checkerClass;
// 
//     public CheckerFrameworkAnalysisEngine(final Class<? extends BaseTypeChecker> checkerClass) {
//         this.checkerClass = checkerClass;
//     }
// 
//     @Override public CompilationResult compile(final File sourceFile) {
//         return new ForkedRun(CheckerFrameworkAnalysisEngine.class)
//                 .withAdditionalClassLoaderFromClass(AbstractUser.class)
//                 .withJavaC()
//                 .withArg("-d").tempDirAsArg()
//                 .withArg("-processor").withArg(checkerClass)
//                 .withArg(sourceFile.getAbsolutePath())
//                 .run();
//     }
// }
// 
// Path: 3_defect-analysis/x_tests/src/main/java/org/zalando/techtalks/hackingjava/defectanalysis/tests/AbstractDefectDetectionTest.java
// public abstract class AbstractDefectDetectionTest extends AbstractCompilerTest {
// 
//     protected abstract Class<? extends WellBehaved> wellBehavedClass();
// 
//     protected abstract Class<? extends IllBehaved> illBehavedClass();
// 
//     @Test
//     public void detectWellBehavedClass() {
//         final CompilationResult result = engine.compile(sourceFileFor(wellBehavedClass()));
//         assertThat(result, isSuccess());
//     }
// 
//     @Test
//     public void detectIllBehavedClass() {
//         final CompilationResult result = engine.compile(sourceFileFor(illBehavedClass()));
//         assertThat(result, isFailureWithExpectedMessage(expectedErrorMessage()));
//     }
// 
//     protected abstract String expectedErrorMessage();
// 
// }


// Path: 3_defect-analysis/2_checker-framework/src/test/java/org/zalando/techtalks/hackingjava/defectanalysis/checkerframework/nullness/CheckerFrameworkNullnessTest.java
import org.checkerframework.checker.nullness.NullnessChecker;
import org.zalando.techtalks.hackingjava.defectanalysis.baseline.engine.DefectAnalysisEngine;
import org.zalando.techtalks.hackingjava.defectanalysis.baseline.marker.IllBehaved;
import org.zalando.techtalks.hackingjava.defectanalysis.baseline.marker.WellBehaved;
import org.zalando.techtalks.hackingjava.defectanalysis.checkerframework.engine.CheckerFrameworkAnalysisEngine;
import org.zalando.techtalks.hackingjava.defectanalysis.tests.AbstractDefectDetectionTest;

package org.zalando.techtalks.hackingjava.defectanalysis.checkerframework.nullness;


/**
 * @author Sean Patrick Floyd (sean.floyd@zalando.de)
 * @since 21.01.2016
 */
public class CheckerFrameworkNullnessTest extends AbstractDefectDetectionTest {

    @Override protected Class<? extends WellBehaved> wellBehavedClass() {
        return WellbehavedNullness.class;
    }

    @Override protected Class<? extends IllBehaved> illBehavedClass() {
        return IllbehavedNullness.class;
    }

    @Override protected String expectedErrorMessage() {
        return "required: @Initialized @NonNull String";
    }

    @Override protected DefectAnalysisEngine instantiateEngine() {