public final class CompilationSubject
extends com.google.common.truth.Subject
Truth subject for a Compilation.| Modifier and Type | Class and Description |
|---|---|
class |
CompilationSubject.DiagnosticAtColumn
Assertions that a note, warning, or error was found at a given column.
|
class |
CompilationSubject.DiagnosticInFile
Assertions that a note, warning, or error was found in a given file.
|
class |
CompilationSubject.DiagnosticOnLine
Assertions that a note, warning, or error was found on a given line.
|
| Modifier and Type | Method and Description |
|---|---|
static CompilationSubject |
assertThat(Compilation actual)
Starts making assertions about a
Compilation. |
static com.google.common.truth.Subject.Factory<CompilationSubject,Compilation> |
compilations()
Returns a
Subject.Factory for a Compilation. |
void |
failed()
Asserts that the compilation failed.
|
JavaFileObjectSubject |
generatedFile(JavaFileManager.Location location,
String path)
Asserts that compilation generated a file at
path. |
JavaFileObjectSubject |
generatedFile(JavaFileManager.Location location,
String packageName,
String fileName)
Asserts that compilation generated a file named
fileName in package packageName. |
JavaFileObjectSubject |
generatedSourceFile(String qualifiedName)
Asserts that compilation generated a source file for a type with a given qualified name.
|
CompilationSubject.DiagnosticInFile |
hadErrorContaining(String expectedSubstring)
Asserts that there was at least one error containing
expectedSubstring. |
CompilationSubject.DiagnosticInFile |
hadErrorContainingMatch(Pattern expectedPattern)
Asserts that there was at least one error containing a match for
expectedPattern. |
CompilationSubject.DiagnosticInFile |
hadErrorContainingMatch(String expectedPattern)
Asserts that there was at least one error containing a match for
expectedPattern. |
void |
hadErrorCount(int expectedCount)
Asserts that the compilation had exactly
expectedCount errors. |
CompilationSubject.DiagnosticInFile |
hadNoteContaining(String expectedSubstring)
Asserts that there was at least one note containing
expectedSubstring. |
CompilationSubject.DiagnosticInFile |
hadNoteContainingMatch(Pattern expectedPattern)
Asserts that there was at least one note containing a match for
expectedPattern. |
CompilationSubject.DiagnosticInFile |
hadNoteContainingMatch(String expectedPattern)
Asserts that there was at least one note containing a match for
expectedPattern. |
void |
hadNoteCount(int expectedCount)
Asserts that the compilation had exactly
expectedCount notes. |
CompilationSubject.DiagnosticInFile |
hadWarningContaining(String expectedSubstring)
Asserts that there was at least one warning containing
expectedSubstring. |
CompilationSubject.DiagnosticInFile |
hadWarningContainingMatch(Pattern expectedPattern)
Asserts that there was at least one warning containing a match for
expectedPattern. |
CompilationSubject.DiagnosticInFile |
hadWarningContainingMatch(String expectedPattern)
Asserts that there was at least one warning containing a match for
expectedPattern. |
void |
hadWarningCount(int expectedCount)
Asserts that the compilation had exactly
expectedCount warnings. |
void |
succeeded()
Asserts that the compilation succeeded.
|
void |
succeededWithoutWarnings()
Asserts that the compilation succeeded without warnings.
|
actualCustomStringRepresentation, check, equals, failWithActual, failWithActual, failWithoutActual, hashCode, ignoreCheck, isAnyOf, isEqualTo, isIn, isInstanceOf, isNoneOf, isNotEqualTo, isNotIn, isNotInstanceOf, isNotNull, isNotSameInstanceAs, isNull, isSameInstanceAs, toStringpublic static com.google.common.truth.Subject.Factory<CompilationSubject,Compilation> compilations()
Subject.Factory for a Compilation.public static CompilationSubject assertThat(Compilation actual)
Compilation.public void succeeded()
public void succeededWithoutWarnings()
public void failed()
public void hadErrorCount(int expectedCount)
expectedCount errors.@CanIgnoreReturnValue public CompilationSubject.DiagnosticInFile hadErrorContaining(String expectedSubstring)
expectedSubstring.@CanIgnoreReturnValue public CompilationSubject.DiagnosticInFile hadErrorContainingMatch(String expectedPattern)
expectedPattern.@CanIgnoreReturnValue public CompilationSubject.DiagnosticInFile hadErrorContainingMatch(Pattern expectedPattern)
expectedPattern.public void hadWarningCount(int expectedCount)
expectedCount warnings.@CanIgnoreReturnValue public CompilationSubject.DiagnosticInFile hadWarningContaining(String expectedSubstring)
expectedSubstring.@CanIgnoreReturnValue public CompilationSubject.DiagnosticInFile hadWarningContainingMatch(String expectedPattern)
expectedPattern.@CanIgnoreReturnValue public CompilationSubject.DiagnosticInFile hadWarningContainingMatch(Pattern expectedPattern)
expectedPattern.public void hadNoteCount(int expectedCount)
expectedCount notes.@CanIgnoreReturnValue public CompilationSubject.DiagnosticInFile hadNoteContaining(String expectedSubstring)
expectedSubstring.@CanIgnoreReturnValue public CompilationSubject.DiagnosticInFile hadNoteContainingMatch(String expectedPattern)
expectedPattern.@CanIgnoreReturnValue public CompilationSubject.DiagnosticInFile hadNoteContainingMatch(Pattern expectedPattern)
expectedPattern.@CanIgnoreReturnValue public JavaFileObjectSubject generatedFile(JavaFileManager.Location location, String packageName, String fileName)
fileName in package packageName.@CanIgnoreReturnValue public JavaFileObjectSubject generatedFile(JavaFileManager.Location location, String path)
path.@CanIgnoreReturnValue public JavaFileObjectSubject generatedSourceFile(String qualifiedName)
Copyright © 2013–2020. All rights reserved.