// Path: 3_defect-analysis/3_aspectj/src/main/java/org/zalando/techtalks/hackingjava/defectanalysis/aspectj/frontend/IllBehavedFrontendClass.java
// public class IllBehavedFrontendClass implements IllBehaved {
//   public void illBehavedMethod() {
//     PersistenceTargetClass.dummy();
//   }
// }
// 
// Path: 3_defect-analysis/3_aspectj/src/main/java/org/zalando/techtalks/hackingjava/defectanalysis/aspectj/service/WellBehavedServiceClass.java
// public class WellBehavedServiceClass implements WellBehaved {
//   public void wellBehavedMethod() {
//     PersistenceTargetClass.dummy();
//   }
// }
// 
// 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/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.zalando.techtalks.hackingjava.defectanalysis.aspectj.frontend.IllBehavedFrontendClass;
import org.zalando.techtalks.hackingjava.defectanalysis.aspectj.service.WellBehavedServiceClass;
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.tests.AbstractDefectDetectionTest;
package org.zalando.techtalks.hackingjava.defectanalysis.aspectj;


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

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

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

  @Override protected String expectedErrorMessage() {
// Path: 3_defect-analysis/3_aspectj/src/main/java/org/zalando/techtalks/hackingjava/defectanalysis/aspectj/frontend/IllBehavedFrontendClass.java
// public class IllBehavedFrontendClass implements IllBehaved {
//   public void illBehavedMethod() {
//     PersistenceTargetClass.dummy();
//   }
// }
// 
// Path: 3_defect-analysis/3_aspectj/src/main/java/org/zalando/techtalks/hackingjava/defectanalysis/aspectj/service/WellBehavedServiceClass.java
// public class WellBehavedServiceClass implements WellBehaved {
//   public void wellBehavedMethod() {
//     PersistenceTargetClass.dummy();
//   }
// }
// 
// 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/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/3_aspectj/src/test/java/org/zalando/techtalks/hackingjava/defectanalysis/aspectj/AspectJArchitectureEnforcementTest.java
import org.zalando.techtalks.hackingjava.defectanalysis.aspectj.frontend.IllBehavedFrontendClass;
import org.zalando.techtalks.hackingjava.defectanalysis.aspectj.service.WellBehavedServiceClass;
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.tests.AbstractDefectDetectionTest;

package org.zalando.techtalks.hackingjava.defectanalysis.aspectj;


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

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

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

  @Override protected String expectedErrorMessage() {
    return "The persistence package may not be accessed from the frontend package";