# Class JavaSourcesSubject.SingleSourceAdapter

java.lang.Object
com.google.common.truth.Subject<JavaSourcesSubject.SingleSourceAdapter, JavaFileObject>
com.google.testing.compile.JavaSourcesSubject.SingleSourceAdapter

All Implemented Interfaces:
  `CompileTester, ProcessedCompileTesterFactory`

Enclosing class:
  `JavaSourcesSubject`

public static final class JavaSourcesSubject.SingleSourceAdapter extends com.google.common.truth.Subject<JavaSourcesSubject.SingleSourceAdapter, JavaFileObject> implements CompileTester, ProcessedCompileTesterFactory

Author:
  Gregory Kick

## Nested Class Summary

### Nested classes/interfaces inherited from class com.google.common.truth.Subject

`com.google.common.truth.Subject.Factory<SubjectT,ActualT>`

### Nested classes/interfaces inherited from interface CompileTester

`CompileTester.ChainingClause<T>, CompileTester.CleanCompilationClause, CompileTester.ColumnClause<T>, CompileTester.CompilationWithNotesClause<T>, CompileTester.CompilationWithWarningsClause<T>, CompileTester.FileClause<T>, CompileTester.GeneratedPredicateClause<T>, CompileTester.LineClause<T>, CompileTester.SuccessfulCompilationClause, CompileTester.SuccessfulFileClause<T>, CompileTester.UnsuccessfulCompilationClause`

## Method Summary

Modifier and Type
Method
Description
`CompileTester.SuccessfulCompilationClause`
`compilesWithoutError()`
The clause in the fluent API that tests for successful compilation without errors.
`CompileTester.CleanCompilationClause`
`compilesWithoutWarnings()`
The clause in the fluent API that tests for successful compilation without warnings or errors.
`CompileTester.UnsuccessfulCompilationClause`
`failsToCompile()`
The clause in the fluent API that tests for unsuccessful compilation.
`void`
`parsesAs(JavaFileObject first, JavaFileObject... rest)`
The clause in the fluent API that tests that the code parses equivalently to the specified code.
`CompileTester`
`processedWith(Iterable<? extends Processor> processors)`
Adds annotation processors to the compilation being tested.
`CompileTester`
`processedWith(Processor first, Processor... rest)`
Adds annotation processors to the compilation being tested.
`JavaSourcesSubject`
`withClasspath(Iterable<File> classPath)`
Sets the compilation classpath.
`JavaSourcesSubject`
`withClasspathFrom(ClassLoader classLoader)`
Deprecated.
prefer `withClasspath(Iterable)`.
`JavaSourcesSubject`
`withCompilerOptions(Iterable<String> options)`
Adds options that will be passed to the compiler.
`JavaSourcesSubject`
`withCompilerOptions(String... options)`
Adds options that will be passed to the compiler.

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

### withCompilerOptions

public JavaSourcesSubject withCompilerOptions(Iterable<String> options)
Description copied from interface: `ProcessedCompileTesterFactory`
Adds options that will be passed to the compiler. `-Xlint` is the first option, by default.

Specified by:
  `withCompilerOptions` in interface `ProcessedCompileTesterFactory`

### withCompilerOptions

public JavaSourcesSubject withCompilerOptions(String... options)
Description copied from interface: `ProcessedCompileTesterFactory`
Adds options that will be passed to the compiler. `-Xlint` is the first option, by default.

Specified by:
  `withCompilerOptions` in interface `ProcessedCompileTesterFactory`

### withClasspathFrom

@Deprecated public JavaSourcesSubject withClasspathFrom(ClassLoader classLoader)
Deprecated.
prefer `withClasspath(Iterable)`. This method only supports `URLClassLoader` and the default system classloader, and `File`s are usually a more natural way to expression compilation classpaths than class loaders.
Description copied from interface: `ProcessedCompileTesterFactory`
Attempts to extract the classpath from the classpath of the Classloader argument, including all its parents up to (and including) the System Classloader.

If not specified, we will use the System classpath for compilation.

Specified by:
  `withClasspathFrom` in interface `ProcessedCompileTesterFactory`

### withClasspath

public JavaSourcesSubject withClasspath(Iterable<File> classPath)
Description copied from interface: `ProcessedCompileTesterFactory`
Sets the compilation classpath.

If not specified, we will use the System classpath for compilation.

Specified by:
  `withClasspath` in interface `ProcessedCompileTesterFactory`

### processedWith

public CompileTester processedWith(Processor first, Processor... rest)
Description copied from interface: `ProcessedCompileTesterFactory`
Adds annotation processors to the compilation being tested.

Specified by:
  `processedWith` in interface `ProcessedCompileTesterFactory`

### processedWith

public CompileTester processedWith(Iterable<? extends Processor> processors)
Description copied from interface: `ProcessedCompileTesterFactory`
Adds annotation processors to the compilation being tested.

Specified by:
  `processedWith` in interface `ProcessedCompileTesterFactory`

### compilesWithoutError

@CanIgnoreReturnValue public CompileTester.SuccessfulCompilationClause compilesWithoutError()
Description copied from interface: `CompileTester`
The clause in the fluent API that tests for successful compilation without errors.

Specified by:
  `compilesWithoutError` in interface `CompileTester`

### compilesWithoutWarnings

@CanIgnoreReturnValue public CompileTester.CleanCompilationClause compilesWithoutWarnings()
Description copied from interface: `CompileTester`
The clause in the fluent API that tests for successful compilation without warnings or errors.

Specified by:
  `compilesWithoutWarnings` in interface `CompileTester`

### failsToCompile

@CanIgnoreReturnValue public CompileTester.UnsuccessfulCompilationClause failsToCompile()
Description copied from interface: `CompileTester`
The clause in the fluent API that tests for unsuccessful compilation.

Specified by:
  `failsToCompile` in interface `CompileTester`

### parsesAs

public void parsesAs(JavaFileObject first, JavaFileObject... rest)
Description copied from interface: `CompileTester`
The clause in the fluent API that tests that the code parses equivalently to the specified code.

Specified by:
  `parsesAs` in interface `CompileTester`