public abstract class AbstractProcessorTest extends Object
Modifier and Type | Class and Description |
---|---|
class |
AbstractProcessorTest.Result
Container for miscfeatures results.
|
Constructor and Description |
---|
AbstractProcessorTest() |
Modifier and Type | Method and Description |
---|---|
void |
assertCompilationMessage(List<Diagnostic<? extends JavaFileObject>> diagnostics,
Diagnostic.Kind kind,
long line,
long col,
String message)
Assert that the given error message is contained in the compilation
diagnostics.
|
void |
assertFailedCompilation(List<Diagnostic<? extends JavaFileObject>> diagnostics)
Assert that compilation failed
|
void |
assertSuccessfulCompilation(List<Diagnostic<? extends JavaFileObject>> diagnostics)
Assert that compilation was successful
|
List<Diagnostic<? extends JavaFileObject>> |
compile(Processor annotationProcessor,
String... compilationUnits)
Compile a unit of source code with the specified annotation processor
|
String |
getExpectedSourceCode(String compilationUnit)
Retrieve the expected source code for a compilation unit
|
protected abstract AbstractErrorAbsorbingProcessor |
getProcessorUnderTest()
Returns the annotation processor being tested by the current test.
|
void |
shouldNotAllowClassNotFoundExceptionThrough()
Regression test for UF-44: Annotation Processors can put eclipse into an infinite loop.
|
public List<Diagnostic<? extends JavaFileObject>> compile(Processor annotationProcessor, String... compilationUnits)
annotationProcessor
- compilationUnits
- public String getExpectedSourceCode(String compilationUnit) throws FileNotFoundException
compilationUnit
- FileNotFoundException
public void assertSuccessfulCompilation(List<Diagnostic<? extends JavaFileObject>> diagnostics)
diagnostics
- public void assertFailedCompilation(List<Diagnostic<? extends JavaFileObject>> diagnostics)
diagnostics
- public void assertCompilationMessage(List<Diagnostic<? extends JavaFileObject>> diagnostics, Diagnostic.Kind kind, long line, long col, String message)
diagnostics
- the list of diagnostic messages from the compiler. Must not be null.kind
- the kind of message to search for, or null to search messages of
any kind.line
- the line number that must be attached to the message, or
Diagnostic.NOPOS
if line number is not important.col
- the column number that must be attached to the message, or
Diagnostic.NOPOS
if column number is not important.message
- the message to search for. If any otherwise matching message in
the given list contains this string, the assertion passes. Must not be null.protected abstract AbstractErrorAbsorbingProcessor getProcessorUnderTest()
Copyright © 2012–2019 JBoss by Red Hat. All rights reserved.