# 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 Classes
Modifier and Type
Class
Description
`final class`
`CompilationSubject.DiagnosticAtColumn`
Assertions that a note, warning, or error was found at a given column.
`final class`
`CompilationSubject.DiagnosticInFile`
Assertions that a note, warning, or error was found in a given file.
`final class`
`CompilationSubject.DiagnosticOnLine`
Assertions 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 Type
Method
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(String expectedPattern)`
Asserts that there was at least one error containing a match for `expectedPattern`.
`CompilationSubject.DiagnosticInFile`
`hadErrorContainingMatch(Pattern 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(String expectedPattern)`
Asserts that there was at least one note containing a match for `expectedPattern`.
`CompilationSubject.DiagnosticInFile`
`hadNoteContainingMatch(Pattern 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(String expectedPattern)`
Asserts that there was at least one warning containing a match for `expectedPattern`.
`CompilationSubject.DiagnosticInFile`
`hadWarningContainingMatch(Pattern 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.

### 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`

### Methods inherited from class Object

`clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

## 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.