You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 23, 2023. It is now read-only.
At some point during the migration to using Spring AOT for Spring TestContext Framework (TCF) support when executing tests within a native image, the TestExecutionListener implementations stopped being loaded.
Consequently, none of the native image tests for the sample applications actually loads an ApplicationContext. The reason is that a test ApplicationContext is only loaded if a registered TestExecutionListener invokes TestContext#getApplicationContext().
Analysis
TestExecutionListeners are configured via spring.factories and loaded reflectively.
The reason TestExecutionListener implementations are no longer loaded is that the DefaultFactoriesCodeContributor gets used for processing TestExecutionListener types in spring.factories, and that results in support being added to StaticSpringFactories for loading the TestExecutionListeners via SpringFactoriesLoader.loadFactories(). However, the TCF instead uses SpringFactoriesLoader.loadFactoryNames() and instantiates the TestExecutionListeners on its own via reflection.
Deliverables
Introduce a new FactoriesCodeContributor that handles TestExecutionListener implementations and generates the appropriate native image reflection configuration.
The text was updated successfully, but these errors were encountered:
Overview
At some point during the migration to using Spring AOT for Spring TestContext Framework (TCF) support when executing tests within a native image, the
TestExecutionListener
implementations stopped being loaded.Consequently, none of the native image tests for the sample applications actually loads an
ApplicationContext
. The reason is that a testApplicationContext
is only loaded if a registeredTestExecutionListener
invokesTestContext#getApplicationContext()
.Analysis
TestExecutionListeners are configured via
spring.factories
and loaded reflectively.The reason
TestExecutionListener
implementations are no longer loaded is that theDefaultFactoriesCodeContributor
gets used for processingTestExecutionListener
types inspring.factories
, and that results in support being added toStaticSpringFactories
for loading the TestExecutionListeners viaSpringFactoriesLoader.loadFactories()
. However, the TCF instead usesSpringFactoriesLoader.loadFactoryNames()
and instantiates the TestExecutionListeners on its own via reflection.Deliverables
FactoriesCodeContributor
that handlesTestExecutionListener
implementations and generates the appropriate native image reflection configuration.The text was updated successfully, but these errors were encountered: