// Path: compiler/src/test/java/com/braisgabin/couchbaseliteorm/compiler/TestProcessors.java
// static Iterable<? extends javax.annotation.processing.Processor> processors() {
//   return Collections.singletonList(
//       new Processor()
//   );
// }


import com.google.testing.compile.JavaFileObjects;
import org.junit.Before;
import org.junit.Test;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Arrays;
import javax.tools.JavaFileObject;
import static com.braisgabin.couchbaseliteorm.compiler.TestProcessors.processors;
import static com.google.common.truth.Truth.ASSERT;
import static com.google.testing.compile.JavaSourceSubjectFactory.javaSource;
import static com.google.testing.compile.JavaSourcesSubjectFactory.javaSources;
    );
  }

  private static Path qualifiedNameToPath(String compilerPath, String sampleName, String fullyQualifiedName) {
    return Paths.get(compilerPath
        + "/../source-samples/"
        + sampleName
        + "/src/main/java/"
        + fullyQualifiedName.replaceAll("\\.", "/")
        + ".java");
  }

  @Before
  public void init() {
    // FIXME this is a workaround.
    this.compilerPath = System.getProperty("compilerProjectPath");
    if (this.compilerPath == null) {
      this.compilerPath = "./compiler";
    }
  }

  @Test
  public void simpleCompile() throws IOException {
    final String sampleName = "simple";
    final JavaFileObject inputFile = getJavaFileObject(compilerPath, sampleName, "com.samples.Person");
    final JavaFileObject expectedFile1 = getJavaFileObject(compilerPath, sampleName, "com.samples.Person$$Mapper");
    final JavaFileObject expectedFile2 = getJavaFileObject(compilerPath, sampleName, "com.braisgabin.couchbaseliteorm.CouchbaseLiteOrmInternal");

    ASSERT.about(javaSource())
        .that(inputFile)
// Path: compiler/src/test/java/com/braisgabin/couchbaseliteorm/compiler/TestProcessors.java
// static Iterable<? extends javax.annotation.processing.Processor> processors() {
//   return Collections.singletonList(
//       new Processor()
//   );
// }


// Path: compiler/src/test/java/com/braisgabin/couchbaseliteorm/compiler/ProcessorTest.java
import com.google.testing.compile.JavaFileObjects;
import org.junit.Before;
import org.junit.Test;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Arrays;
import javax.tools.JavaFileObject;
import static com.braisgabin.couchbaseliteorm.compiler.TestProcessors.processors;
import static com.google.common.truth.Truth.ASSERT;
import static com.google.testing.compile.JavaSourceSubjectFactory.javaSource;
import static com.google.testing.compile.JavaSourcesSubjectFactory.javaSources;

    );
  }

  private static Path qualifiedNameToPath(String compilerPath, String sampleName, String fullyQualifiedName) {
    return Paths.get(compilerPath
        + "/../source-samples/"
        + sampleName
        + "/src/main/java/"
        + fullyQualifiedName.replaceAll("\\.", "/")
        + ".java");
  }

  @Before
  public void init() {
    // FIXME this is a workaround.
    this.compilerPath = System.getProperty("compilerProjectPath");
    if (this.compilerPath == null) {
      this.compilerPath = "./compiler";
    }
  }

  @Test
  public void simpleCompile() throws IOException {
    final String sampleName = "simple";
    final JavaFileObject inputFile = getJavaFileObject(compilerPath, sampleName, "com.samples.Person");
    final JavaFileObject expectedFile1 = getJavaFileObject(compilerPath, sampleName, "com.samples.Person$$Mapper");
    final JavaFileObject expectedFile2 = getJavaFileObject(compilerPath, sampleName, "com.braisgabin.couchbaseliteorm.CouchbaseLiteOrmInternal");

    ASSERT.about(javaSource())
        .that(inputFile)
        .processedWith(processors())