Class AJavaCompileTest

java.lang.Object
de.xima.fc.testhelper.AJavaCompileTest

public abstract class AJavaCompileTest extends Object
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 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 compile
      superClass - 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