Class TestAotProcessor

java.lang.Object
org.springframework.context.aot.AbstractAotProcessor<Void>
org.springframework.test.context.aot.TestAotProcessor

public abstract class TestAotProcessor extends org.springframework.context.aot.AbstractAotProcessor<Void>
Filesystem-based ahead-of-time (AOT) processing base implementation that scans the provided classpath roots for Spring integration test classes and then generates AOT artifacts for those test classes in the configured output directories.

Concrete implementations are typically used to kick off optimization of a test suite in a build tool.

Since:
6.0
Author:
Sam Brannen
See Also:
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.springframework.context.aot.AbstractAotProcessor

    org.springframework.context.aot.AbstractAotProcessor.Settings
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    TestAotProcessor(Set<Path> classpathRoots, org.springframework.context.aot.AbstractAotProcessor.Settings settings)
    Create a new processor for the specified test classpath roots and common settings.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected Void
    Trigger processing of the test classes by clearing output directories first and then performing AOT processing.
    protected Set<Path>
    Get the classpath roots to scan for test classes.
    protected void
    Perform ahead-of-time processing of Spring integration test classes.
    protected Stream<Class<?>>
    Scan the configured classpath roots for Spring integration test classes.

    Methods inherited from class org.springframework.context.aot.AbstractAotProcessor

    createFileSystemGeneratedFiles, deleteExistingOutput, getSettings, process, writeHints

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • TestAotProcessor

      protected TestAotProcessor(Set<Path> classpathRoots, org.springframework.context.aot.AbstractAotProcessor.Settings settings)
      Create a new processor for the specified test classpath roots and common settings.
      Parameters:
      classpathRoots - the classpath roots to scan for test classes
      settings - the settings to apply
  • Method Details

    • getClasspathRoots

      protected Set<Path> getClasspathRoots()
      Get the classpath roots to scan for test classes.
    • doProcess

      protected Void doProcess()
      Trigger processing of the test classes by clearing output directories first and then performing AOT processing.
      Specified by:
      doProcess in class org.springframework.context.aot.AbstractAotProcessor<Void>
    • performAotProcessing

      protected void performAotProcessing()
      Perform ahead-of-time processing of Spring integration test classes.

      Code, resources, and generated classes are stored in the configured output directories. In addition, run-time hints are registered for the application contexts used by the test classes as well as test infrastructure components used by the tests.

      See Also:
    • scanClasspathRoots

      protected Stream<Class<?>> scanClasspathRoots()
      Scan the configured classpath roots for Spring integration test classes.
      Returns:
      a stream of Spring integration test classes