Class AJavaCompileTest
java.lang.Object
de.xima.fc.testhelper.AJavaCompileTest
Base test for interface tests that check whether the contract of an interface has changed. Allows you to dynamically
compile Java source files during tests, e.g. test implementations of a plugin interface.
- Since:
- 7.0.0
- Author:
- XIMA MEDIA GmbH
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static Class<?> assertOuterClassCompiles(de.xima.simplecompiler.java.api.IJavaSourceFile sourceFile) Asserts the source file compiles.protected static <T> Class<? extends T> assertOuterClassCompiles(de.xima.simplecompiler.java.api.IJavaSourceFile sourceFile, Class<T> superClass) Asserts the source file compiles.protected de.xima.simplecompiler.java.api.IJavaSourceFilesourceFileFromResource(String path)
-
Constructor Details
-
AJavaCompileTest
public AJavaCompileTest()
-
-
Method Details
-
assertOuterClassCompiles
protected static Class<?> assertOuterClassCompiles(de.xima.simplecompiler.java.api.IJavaSourceFile sourceFile) throws ClassNotFoundException, LinkageError, de.xima.simplecompiler.java.api.CompilationException, IOException Asserts the source file compiles. Returns the main outer class of the given source.- Parameters:
sourceFile- Source to compile- Returns:
- The main outer class of the source.
- Throws:
ClassNotFoundException- When the class does not exist in the class path after compilation.IOException- When the source file could not be read.de.xima.simplecompiler.java.api.CompilationException- When the source file could not be compiled.LinkageError
-
assertOuterClassCompiles
protected static <T> Class<? extends T> assertOuterClassCompiles(de.xima.simplecompiler.java.api.IJavaSourceFile sourceFile, Class<T> superClass) throws ClassNotFoundException, LinkageError, de.xima.simplecompiler.java.api.CompilationException, IOException Asserts the source file compiles. Returns the main outer class of the given source.- Parameters:
sourceFile- Source to compilesuperClass- A super class of the class.- Returns:
- The main outer class of the source.
- Throws:
ClassNotFoundException- When the class does not exist in the class path after compilation.IOException- When the source file could not be read.de.xima.simplecompiler.java.api.CompilationException- When the source file could not be compiled.LinkageError
-
sourceFileFromResource
protected de.xima.simplecompiler.java.api.IJavaSourceFile sourceFileFromResource(String path) throws IOException - Throws:
IOException
-