package org.pitest.java8.verification;

import java.io.IOException;

import org.pitest.classpath.ClassPathRoot;
import org.pitest.classpath.CodeSource;
import org.pitest.classpath.PathFilter;
import org.pitest.classpath.ProjectClassPaths;
import org.pitest.coverage.CoverageGenerator;
import org.pitest.coverage.execute.CoverageOptions;
import org.pitest.coverage.execute.DefaultCoverageGenerator;
import org.pitest.coverage.export.NullCoverageExporter;
import org.pitest.functional.predicate.True;
import org.pitest.junit.JUnitCompatibleConfiguration;
import static org.pitest.mutationtest.DetectionStatus.KILLED;

import static org.junit.Assert.*;

import org.junit.Test;

import com.example.java8.AnonymousClassTest;
import com.example.java8.Java8ClassTest;
import com.example.java8.Java8InterfaceTest;
import com.example.java8.Java8LambdaExpressionTest;

import org.pitest.mutationtest.HistoryStore;
import org.pitest.mutationtest.ReportTestBase;
import org.pitest.mutationtest.config.SettingsFactory;
import org.pitest.mutationtest.engine.gregor.config.GregorEngineFactory;
import org.pitest.mutationtest.engine.gregor.config.Mutator;
import org.pitest.mutationtest.incremental.NullHistoryStore;
import org.pitest.mutationtest.tooling.JarCreatingJarFinder;
import org.pitest.mutationtest.tooling.MutationCoverage;
import org.pitest.mutationtest.tooling.MutationStrategies;
import org.pitest.process.DefaultJavaExecutableLocator;
import org.pitest.process.JavaAgent;
import org.pitest.process.LaunchOptions;
import org.pitest.testapi.Configuration;
import org.pitest.util.Timings;
import org.pitest.util.Unchecked;


public class VerifyJava8IT extends ReportTestBase { 

  // Java 8 support

  /**
   * @author iirekm@gmail.com
   */
  @Test
  public void worksWithJava8Bytecode() {
      this.data.setTargetTests(predicateFor(Java8ClassTest.class));
      this.data.setTargetClasses(predicateFor("com.example.java8.Java8Class*"));
      setMutators(Mutator.INCREMENTS);
      createAndRun();
      verifyResults(KILLED, KILLED);
  }

  /**
   * @author iirekm@gmail.com
   */
  @Test
  public void worksWithJava8DefaultInterfaceMethods() {
      this.data.setTargetTests(predicateFor(Java8InterfaceTest.class));
      this.data.setTargetClasses(predicateFor("com.example.java8.Java8Interface*"));
      setMutators(Mutator.INCREMENTS);
      createAndRun();
      verifyResults(KILLED, KILLED);
  }

  /**
   * @author iirekm@gmail.com
   *
   * Initial step for Java 8 lambda expressions: check if pure anonymous classes work.
   */
  @Test
  public void worksWithAnonymousClasses() {
      this.data.setTargetTests(predicateFor(AnonymousClassTest.class));
      this.data.setTargetClasses(predicateFor("com.example.java8.AnonymousClass*"));
      setMutators(Mutator.INCREMENTS);
      createAndRun();
      verifyResults(KILLED, KILLED);
  }

  /**
   * @author iirekm@gmail.com
   */
  @Test
  public void worksWithJava8LambdaExpressions() {
      this.data.setTargetTests(predicateFor(Java8LambdaExpressionTest.class));
      this.data.setTargetClasses(predicateFor("com.example.java8.Java8LambdaExpression*"));
      setMutators(Mutator.INCREMENTS);
      createAndRun();
      verifyResults(KILLED, KILLED);
  }
  
}

@@ -1943,32 +1943,25 @@
 setMutators(
-Mutator.
+%22
 INCREMENTS);
@@ -1950,32 +1950,33 @@
 tors(%22INCREMENTS
+%22
 );%0A      createA
@@ -2303,32 +2303,25 @@
 setMutators(
-Mutator.
+%22
 INCREMENTS);
@@ -2310,32 +2310,33 @@
 tors(%22INCREMENTS
+%22
 );%0A      createA
@@ -2743,32 +2743,25 @@
 setMutators(
-Mutator.
+%22
 INCREMENTS);
@@ -2750,32 +2750,33 @@
 tors(%22INCREMENTS
+%22
 );%0A      createA
@@ -3119,16 +3119,9 @@
 ors(
-Mutator.
+%22
 INCR
@@ -3126,16 +3126,17 @@
 CREMENTS
+%22
 );%0A     

fix build for java8