public final class CompilationSubject extends com.google.common.truth.Subject<CompilationSubject,Compilation>
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.SubjectFactory<CompilationSubject,Compilation> |
compilations()
Returns a
SubjectFactory 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.
|
actual, actualAsString, actualCustomStringRepresentation, check, equals, fail, fail, fail, failWithBadResults, failWithCustomSubject, failWithoutActual, failWithoutSubject, failWithRawMessage, getDisplaySubject, getSubject, hashCode, internalCustomName, isAnyOf, isEqualTo, isIn, isInstanceOf, isNoneOf, isNotEqualTo, isNotIn, isNotInstanceOf, isNotNull, isNotSameAs, isNull, isSameAs, namedpublic static com.google.common.truth.SubjectFactory<CompilationSubject,Compilation> compilations()
SubjectFactory 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.public CompilationSubject.DiagnosticInFile hadErrorContaining(String expectedSubstring)
expectedSubstring.public CompilationSubject.DiagnosticInFile hadErrorContainingMatch(String expectedPattern)
expectedPattern.public CompilationSubject.DiagnosticInFile hadErrorContainingMatch(Pattern expectedPattern)
expectedPattern.public void hadWarningCount(int expectedCount)
expectedCount warnings.public CompilationSubject.DiagnosticInFile hadWarningContaining(String expectedSubstring)
expectedSubstring.public CompilationSubject.DiagnosticInFile hadWarningContainingMatch(String expectedPattern)
expectedPattern.public CompilationSubject.DiagnosticInFile hadWarningContainingMatch(Pattern expectedPattern)
expectedPattern.public void hadNoteCount(int expectedCount)
expectedCount notes.public CompilationSubject.DiagnosticInFile hadNoteContaining(String expectedSubstring)
expectedSubstring.public CompilationSubject.DiagnosticInFile hadNoteContainingMatch(String expectedPattern)
expectedPattern.public CompilationSubject.DiagnosticInFile hadNoteContainingMatch(Pattern expectedPattern)
expectedPattern.public JavaFileObjectSubject generatedFile(JavaFileManager.Location location, String packageName, String fileName)
fileName in package packageName.public JavaFileObjectSubject generatedFile(JavaFileManager.Location location, String path)
path.public JavaFileObjectSubject generatedSourceFile(String qualifiedName)
Copyright © 2013-2017. All Rights Reserved.