Introduce AOT run-time support in the TestContext framework

This commit introduces initial AOT run-time support in the Spring
TestContext Framework.

- DefaultCacheAwareContextLoaderDelegate: when running in AOT mode, now
  loads a test's ApplicationContext via the AotContextLoader SPI
  instead of via the standard SmartContextLoader and ContextLoader SPIs.

- DependencyInjectionTestExecutionListener: when running in AOT mode,
  now injects dependencies into a test instance using a local instance
  of AutowiredAnnotationBeanPostProcessor instead of relying on
  AutowireCapableBeanFactory support.

Closes gh-28205
This commit is contained in:
Sam Brannen
2022-08-20 15:01:53 +02:00
parent ada0880f3c
commit 8a6c1ba198
4 changed files with 221 additions and 15 deletions

View File

@@ -16,6 +16,7 @@
<Logger name="org.springframework.test.context.ContextLoaderUtils" level="warn" />
<Logger name="org.springframework.test.context.aot" level="debug" />
<Logger name="org.springframework.test.context.cache" level="warn" />
<Logger name="org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate" level="info" />
<Logger name="org.springframework.test.context.junit4.rules" level="warn" />
<Logger name="org.springframework.test.context.transaction.TransactionalTestExecutionListener" level="warn" />
<Logger name="org.springframework.test.context.web" level="warn" />