Class CompilationSubject

java.lang.Object
com.google.common.truth.Subject<CompilationSubject, Compilation>
com.google.testing.compile.CompilationSubject

public final class CompilationSubject extends com.google.common.truth.Subject<CompilationSubject, Compilation>
A Truth subject for a Compilation.
  • Method Details

    • compilations

      public static com.google.common.truth.Subject.Factory<CompilationSubject, Compilation> compilations()
      Returns a Subject.Factory for a Compilation.
    • assertThat

      public static CompilationSubject assertThat(Compilation actual)
      Starts making assertions about a Compilation.
    • succeeded

      public void succeeded()
      Asserts that the compilation succeeded.
    • succeededWithoutWarnings

      public void succeededWithoutWarnings()
      Asserts that the compilation succeeded without warnings.
    • failed

      public void failed()
      Asserts that the compilation failed.
    • hadErrorCount

      public void hadErrorCount(int expectedCount)
      Asserts that the compilation had exactly expectedCount errors.
    • hadErrorContaining

      @CanIgnoreReturnValue public CompilationSubject.DiagnosticInFile hadErrorContaining(String expectedSubstring)
      Asserts that there was at least one error containing expectedSubstring.
    • hadErrorContainingMatch

      @CanIgnoreReturnValue public CompilationSubject.DiagnosticInFile hadErrorContainingMatch(String expectedPattern)
      Asserts that there was at least one error containing a match for expectedPattern.
    • hadErrorContainingMatch

      @CanIgnoreReturnValue public CompilationSubject.DiagnosticInFile hadErrorContainingMatch(Pattern expectedPattern)
      Asserts that there was at least one error containing a match for expectedPattern.
    • hadWarningCount

      public void hadWarningCount(int expectedCount)
      Asserts that the compilation had exactly expectedCount warnings.
    • hadWarningContaining

      @CanIgnoreReturnValue public CompilationSubject.DiagnosticInFile hadWarningContaining(String expectedSubstring)
      Asserts that there was at least one warning containing expectedSubstring.
    • hadWarningContainingMatch

      @CanIgnoreReturnValue public CompilationSubject.DiagnosticInFile hadWarningContainingMatch(String expectedPattern)
      Asserts that there was at least one warning containing a match for expectedPattern.
    • hadWarningContainingMatch

      @CanIgnoreReturnValue public CompilationSubject.DiagnosticInFile hadWarningContainingMatch(Pattern expectedPattern)
      Asserts that there was at least one warning containing a match for expectedPattern.
    • hadNoteCount

      public void hadNoteCount(int expectedCount)
      Asserts that the compilation had exactly expectedCount notes.
    • hadNoteContaining

      @CanIgnoreReturnValue public CompilationSubject.DiagnosticInFile hadNoteContaining(String expectedSubstring)
      Asserts that there was at least one note containing expectedSubstring.
    • hadNoteContainingMatch

      @CanIgnoreReturnValue public CompilationSubject.DiagnosticInFile hadNoteContainingMatch(String expectedPattern)
      Asserts that there was at least one note containing a match for expectedPattern.
    • hadNoteContainingMatch

      @CanIgnoreReturnValue public CompilationSubject.DiagnosticInFile hadNoteContainingMatch(Pattern expectedPattern)
      Asserts that there was at least one note containing a match for expectedPattern.
    • generatedFile

      @CanIgnoreReturnValue public JavaFileObjectSubject generatedFile(JavaFileManager.Location location, String packageName, String fileName)
      Asserts that compilation generated a file named fileName in package packageName.
    • generatedFile

      @CanIgnoreReturnValue public JavaFileObjectSubject generatedFile(JavaFileManager.Location location, String path)
      Asserts that compilation generated a file at path.
    • generatedSourceFile

      @CanIgnoreReturnValue public JavaFileObjectSubject generatedSourceFile(String qualifiedName)
      Asserts that compilation generated a source file for a type with a given qualified name.