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.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionfinal classAssertions that a note, warning, or error was found at a given column.final classAssertions that a note, warning, or error was found in a given file.final classAssertions that a note, warning, or error was found on a given line.Nested classes/interfaces inherited from class com.google.common.truth.Subject
com.google.common.truth.Subject.Factory<SubjectT,ActualT> -
Method Summary
Modifier and TypeMethodDescriptionstatic CompilationSubjectassertThat(Compilation actual) Starts making assertions about aCompilation.static com.google.common.truth.Subject.Factory<CompilationSubject, Compilation> Returns aSubject.Factoryfor aCompilation.voidfailed()Asserts that the compilation failed.generatedFile(JavaFileManager.Location location, String path) Asserts that compilation generated a file atpath.generatedFile(JavaFileManager.Location location, String packageName, String fileName) Asserts that compilation generated a file namedfileNamein packagepackageName.generatedSourceFile(String qualifiedName) Asserts that compilation generated a source file for a type with a given qualified name.hadErrorContaining(String expectedSubstring) Asserts that there was at least one error containingexpectedSubstring.hadErrorContainingMatch(String expectedPattern) Asserts that there was at least one error containing a match forexpectedPattern.hadErrorContainingMatch(Pattern expectedPattern) Asserts that there was at least one error containing a match forexpectedPattern.voidhadErrorCount(int expectedCount) Asserts that the compilation had exactlyexpectedCounterrors.hadNoteContaining(String expectedSubstring) Asserts that there was at least one note containingexpectedSubstring.hadNoteContainingMatch(String expectedPattern) Asserts that there was at least one note containing a match forexpectedPattern.hadNoteContainingMatch(Pattern expectedPattern) Asserts that there was at least one note containing a match forexpectedPattern.voidhadNoteCount(int expectedCount) Asserts that the compilation had exactlyexpectedCountnotes.hadWarningContaining(String expectedSubstring) Asserts that there was at least one warning containingexpectedSubstring.hadWarningContainingMatch(String expectedPattern) Asserts that there was at least one warning containing a match forexpectedPattern.hadWarningContainingMatch(Pattern expectedPattern) Asserts that there was at least one warning containing a match forexpectedPattern.voidhadWarningCount(int expectedCount) Asserts that the compilation had exactlyexpectedCountwarnings.voidAsserts that the compilation succeeded.voidAsserts that the compilation succeeded without warnings.Methods inherited from class com.google.common.truth.Subject
actual, actualAsString, actualCustomStringRepresentation, check, equals, fail, fail, fail, failComparing, failComparing, failWithBadResults, failWithCustomSubject, failWithoutActual, failWithoutSubject, failWithRawMessage, failWithRawMessageAndCause, getDisplaySubject, getSubject, hashCode, ignoreCheck, internalCustomName, isAnyOf, isEqualTo, isIn, isInstanceOf, isNoneOf, isNotEqualTo, isNotIn, isNotInstanceOf, isNotNull, isNotSameAs, isNull, isSameAs, named
-
Method Details
-
compilations
public static com.google.common.truth.Subject.Factory<CompilationSubject, Compilation> compilations()Returns aSubject.Factoryfor aCompilation. -
assertThat
Starts making assertions about aCompilation. -
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 exactlyexpectedCounterrors. -
hadErrorContaining
@CanIgnoreReturnValue public CompilationSubject.DiagnosticInFile hadErrorContaining(String expectedSubstring) Asserts that there was at least one error containingexpectedSubstring. -
hadErrorContainingMatch
@CanIgnoreReturnValue public CompilationSubject.DiagnosticInFile hadErrorContainingMatch(String expectedPattern) Asserts that there was at least one error containing a match forexpectedPattern. -
hadErrorContainingMatch
@CanIgnoreReturnValue public CompilationSubject.DiagnosticInFile hadErrorContainingMatch(Pattern expectedPattern) Asserts that there was at least one error containing a match forexpectedPattern. -
hadWarningCount
public void hadWarningCount(int expectedCount) Asserts that the compilation had exactlyexpectedCountwarnings. -
hadWarningContaining
@CanIgnoreReturnValue public CompilationSubject.DiagnosticInFile hadWarningContaining(String expectedSubstring) Asserts that there was at least one warning containingexpectedSubstring. -
hadWarningContainingMatch
@CanIgnoreReturnValue public CompilationSubject.DiagnosticInFile hadWarningContainingMatch(String expectedPattern) Asserts that there was at least one warning containing a match forexpectedPattern. -
hadWarningContainingMatch
@CanIgnoreReturnValue public CompilationSubject.DiagnosticInFile hadWarningContainingMatch(Pattern expectedPattern) Asserts that there was at least one warning containing a match forexpectedPattern. -
hadNoteCount
public void hadNoteCount(int expectedCount) Asserts that the compilation had exactlyexpectedCountnotes. -
hadNoteContaining
@CanIgnoreReturnValue public CompilationSubject.DiagnosticInFile hadNoteContaining(String expectedSubstring) Asserts that there was at least one note containingexpectedSubstring. -
hadNoteContainingMatch
@CanIgnoreReturnValue public CompilationSubject.DiagnosticInFile hadNoteContainingMatch(String expectedPattern) Asserts that there was at least one note containing a match forexpectedPattern. -
hadNoteContainingMatch
@CanIgnoreReturnValue public CompilationSubject.DiagnosticInFile hadNoteContainingMatch(Pattern expectedPattern) Asserts that there was at least one note containing a match forexpectedPattern. -
generatedFile
@CanIgnoreReturnValue public JavaFileObjectSubject generatedFile(JavaFileManager.Location location, String packageName, String fileName) Asserts that compilation generated a file namedfileNamein packagepackageName. -
generatedFile
@CanIgnoreReturnValue public JavaFileObjectSubject generatedFile(JavaFileManager.Location location, String path) Asserts that compilation generated a file atpath. -
generatedSourceFile
Asserts that compilation generated a source file for a type with a given qualified name.
-