public final class JavaSourcesSubject extends com.google.common.truth.Subject<JavaSourcesSubject,java.lang.Iterable<? extends javax.tools.JavaFileObject>> implements CompileTester, ProcessedCompileTesterFactory
Subject that evaluates the result
of a javac compilation. See com.google.testing.compile for usage examples| Modifier and Type | Class and Description |
|---|---|
static class |
JavaSourcesSubject.SingleSourceAdapter |
com.google.common.truth.Subject.Factory<SubjectT extends com.google.common.truth.Subject<SubjectT,ActualT>,ActualT>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| Modifier and Type | Method and Description |
|---|---|
static JavaSourcesSubject |
assertThat(javax.tools.JavaFileObject javaFileObject) |
static JavaSourcesSubject |
assertThat(javax.tools.JavaFileObject javaFileObject,
javax.tools.JavaFileObject... javaFileObjects) |
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(javax.tools.JavaFileObject first,
javax.tools.JavaFileObject... rest)
The clause in the fluent API that tests that the code parses equivalently to the specified
code.
|
CompileTester |
processedWith(java.lang.Iterable<? extends javax.annotation.processing.Processor> processors)
Adds annotation processors to the compilation being tested.
|
CompileTester |
processedWith(javax.annotation.processing.Processor first,
javax.annotation.processing.Processor... rest)
Adds annotation processors to the compilation being tested.
|
JavaSourcesSubject |
withClasspath(java.lang.Iterable<java.io.File> classPath)
Sets the compilation classpath.
|
JavaSourcesSubject |
withClasspathFrom(java.lang.ClassLoader classLoader)
Deprecated.
prefer
withClasspath(Iterable). This method only supports URLClassLoader and the default system classloader, and Files are usually
a more natural way to expression compilation classpaths than class loaders. |
JavaSourcesSubject |
withCompilerOptions(java.lang.Iterable<java.lang.String> options)
Adds options that will be passed to the compiler.
|
JavaSourcesSubject |
withCompilerOptions(java.lang.String... options)
Adds options that will be passed to the compiler.
|
actual, actualAsString, actualCustomStringRepresentation, check, check, equals, fail, fail, fail, failWithActual, failWithActual, failWithBadResults, failWithCustomSubject, failWithoutActual, failWithoutActual, failWithoutSubject, getSubject, hashCode, ignoreCheck, internalCustomName, isAnyOf, isEqualTo, isIn, isInstanceOf, isNoneOf, isNotEqualTo, isNotIn, isNotInstanceOf, isNotNull, isNotSameAs, isNotSameInstanceAs, isNull, isSameAs, isSameInstanceAs, named, toStringpublic JavaSourcesSubject withCompilerOptions(java.lang.Iterable<java.lang.String> options)
ProcessedCompileTesterFactory-Xlint is the first option, by
default.withCompilerOptions in interface ProcessedCompileTesterFactorypublic JavaSourcesSubject withCompilerOptions(java.lang.String... options)
ProcessedCompileTesterFactory-Xlint is the first option, by
default.withCompilerOptions in interface ProcessedCompileTesterFactory@Deprecated public JavaSourcesSubject withClasspathFrom(java.lang.ClassLoader classLoader)
withClasspath(Iterable). This method only supports URLClassLoader and the default system classloader, and Files are usually
a more natural way to expression compilation classpaths than class loaders.ProcessedCompileTesterFactoryIf not specified, we will use the System classpath for compilation.
withClasspathFrom in interface ProcessedCompileTesterFactorypublic JavaSourcesSubject withClasspath(java.lang.Iterable<java.io.File> classPath)
ProcessedCompileTesterFactoryIf not specified, we will use the System classpath for compilation.
withClasspath in interface ProcessedCompileTesterFactorypublic CompileTester processedWith(javax.annotation.processing.Processor first, javax.annotation.processing.Processor... rest)
ProcessedCompileTesterFactoryprocessedWith in interface ProcessedCompileTesterFactorypublic CompileTester processedWith(java.lang.Iterable<? extends javax.annotation.processing.Processor> processors)
ProcessedCompileTesterFactoryprocessedWith in interface ProcessedCompileTesterFactorypublic void parsesAs(javax.tools.JavaFileObject first,
javax.tools.JavaFileObject... rest)
CompileTesterparsesAs in interface CompileTester@CanIgnoreReturnValue public CompileTester.SuccessfulCompilationClause compilesWithoutError()
CompileTestercompilesWithoutError in interface CompileTester@CanIgnoreReturnValue public CompileTester.CleanCompilationClause compilesWithoutWarnings()
CompileTestercompilesWithoutWarnings in interface CompileTester@CanIgnoreReturnValue public CompileTester.UnsuccessfulCompilationClause failsToCompile()
CompileTesterfailsToCompile in interface CompileTesterpublic static JavaSourcesSubject assertThat(javax.tools.JavaFileObject javaFileObject)
public static JavaSourcesSubject assertThat(javax.tools.JavaFileObject javaFileObject, javax.tools.JavaFileObject... javaFileObjects)
Copyright © 2013-2019. All Rights Reserved.