クラスの使用
org.springframework.test.context.MergedContextConfiguration
MergedContextConfiguration を使用するパッケージ
パッケージ
説明
このパッケージには Spring TestContext フレームワークが含まれており、使用中の実際のテストフレームワークにとらわれないアノテーション駆動型ユニットおよび統合テストのサポートを提供します。
Spring TestContext フレームワークの事前 (AOT) サポート。
Spring TestContext フレームワーク内のコンテキストキャッシングのサポート。
Spring TestContext フレームワークのサポートクラス。
Web は、Spring TestContext フレームワークのクラスをサポートします。
org.springframework.test.context 内の MergedContextConfiguration 使用
修飾子と型メソッド説明TestContextBootstrapper.buildMergedContextConfiguration()
このブートストラップに関連付けられたBootstrapContext
内のテストクラスのマージされたコンテキスト構成を構築します。MergedContextConfiguration.getParent()
コンテキスト階層内の親アプリケーションコンテキストのMergedContextConfiguration
を取得します。型 MergedContextConfiguration のパラメーターを持つ org.springframework.test.context のメソッド修飾子と型メソッド説明void
CacheAwareContextLoaderDelegate.closeContext
(MergedContextConfiguration mergedConfig, DirtiesContext.HierarchyMode hierarchyMode) 提供されたMergedContextConfiguration
のアプリケーションコンテキストをContextCache
から削除し、それがConfigurableApplicationContext
のインスタンスである場合は閉じます。void
ContextCustomizer.customizeContext
(ConfigurableApplicationContext context, MergedContextConfiguration mergedConfig) Bean 定義がコンテキストになく、コンテキストがリフレッシュされた前にロードされた後に供給ConfigurableApplicationContext
をカスタマイズします。default boolean
CacheAwareContextLoaderDelegate.isContextLoaded
(MergedContextConfiguration mergedConfig) CacheAwareContextLoaderDelegate.loadContext
(MergedContextConfiguration mergedConfig) 指定されたMergedContextConfiguration
で構成されたContextLoader
に委譲することにより、提供されたMergedContextConfiguration
のアプリケーションコンテキストをロードします。SmartContextLoader.loadContext
(MergedContextConfiguration mergedConfig) 提供されたMergedContextConfiguration
に基づいて新しいApplicationContext
をロードし、コンテキストを構成して、完全にリフレッシュされた状態でコンテキストを返します。型 MergedContextConfiguration のパラメーターを持つ org.springframework.test.context のコンストラクター修飾子コンストラクター説明MergedContextConfiguration
(ClassSE<?> testClass, StringSE[] locations, ClassSE<?>[] classes, SetSE<ClassSE<? extends ApplicationContextInitializer<?>>> contextInitializerClasses, StringSE[] activeProfiles, StringSE[] propertySourceLocations, StringSE[] propertySourceProperties, SetSE<ContextCustomizer> contextCustomizers, ContextLoader contextLoader, CacheAwareContextLoaderDelegate cacheAwareContextLoaderDelegate, MergedContextConfiguration parent) 使用すべきではありません。MergedContextConfiguration
(ClassSE<?> testClass, StringSE[] locations, ClassSE<?>[] classes, SetSE<ClassSE<? extends ApplicationContextInitializer<?>>> contextInitializerClasses, StringSE[] activeProfiles, StringSE[] propertySourceLocations, StringSE[] propertySourceProperties, ContextLoader contextLoader, CacheAwareContextLoaderDelegate cacheAwareContextLoaderDelegate, MergedContextConfiguration parent) MergedContextConfiguration
(ClassSE<?> testClass, StringSE[] locations, ClassSE<?>[] classes, SetSE<ClassSE<? extends ApplicationContextInitializer<?>>> contextInitializerClasses, StringSE[] activeProfiles, ListSE<PropertySourceDescriptor> propertySourceDescriptors, StringSE[] propertySourceProperties, SetSE<ContextCustomizer> contextCustomizers, ContextLoader contextLoader, CacheAwareContextLoaderDelegate cacheAwareContextLoaderDelegate, MergedContextConfiguration parent) 指定されたパラメーターの新しいMergedContextConfiguration
インスタンスを作成します。MergedContextConfiguration
(ClassSE<?> testClass, StringSE[] locations, ClassSE<?>[] classes, SetSE<ClassSE<? extends ApplicationContextInitializer<?>>> contextInitializerClasses, StringSE[] activeProfiles, ContextLoader contextLoader, CacheAwareContextLoaderDelegate cacheAwareContextLoaderDelegate, MergedContextConfiguration parent) 指定されたパラメーターの新しいMergedContextConfiguration
インスタンスを作成します。MergedContextConfiguration
(MergedContextConfiguration mergedConfig) 提供されたMergedContextConfiguration
からすべてのフィールドをコピーして、新しいMergedContextConfiguration
インスタンスを作成します。org.springframework.test.context.aot 内の MergedContextConfiguration 使用
型 MergedContextConfiguration のパラメーターを持つ org.springframework.test.context.aot のメソッド修飾子と型メソッド説明default ApplicationContext
AotContextLoader.loadContextForAotProcessing
(MergedContextConfiguration mergedConfig) 非推奨、削除予定: この API 要素は、将来のバージョンで削除される可能性があります。Spring Framework 6.2.4 時点ではAotContextLoader.loadContextForAotProcessing(MergedContextConfiguration, RuntimeHints)
に置き換えられ、Spring Framework 8.0 で削除される予定default ApplicationContext
AotContextLoader.loadContextForAotProcessing
(MergedContextConfiguration mergedConfig, RuntimeHints runtimeHints) 提供されたMergedContextConfiguration
に基づいて AOT ビルド時の処理用に新しいApplicationContext
をロードし、コンテキストを構成して、コンテキストを返します。AotContextLoader.loadContextForAotRuntime
(MergedContextConfiguration mergedConfig, ApplicationContextInitializer<ConfigurableApplicationContext> initializer) 提供されたMergedContextConfiguration
およびApplicationContextInitializer
に基づいて、AOT ランタイム実行用に新しいApplicationContext
をロードします。org.springframework.test.context.cache 内の MergedContextConfiguration 使用
型 MergedContextConfiguration のパラメーターを持つ org.springframework.test.context.cache のメソッド修飾子と型メソッド説明void
DefaultCacheAwareContextLoaderDelegate.closeContext
(MergedContextConfiguration mergedConfig, DirtiesContext.HierarchyMode hierarchyMode) boolean
ContextCache.contains
(MergedContextConfiguration key) 指定されたキーのキャッシュされたコンテキストがあるかどうかを確認します。boolean
DefaultContextCache.contains
(MergedContextConfiguration key) ContextCache.get
(MergedContextConfiguration key) 指定されたキーのキャッシュされたApplicationContext
を取得します。DefaultContextCache.get
(MergedContextConfiguration key) default int
ContextCache.getFailureCount
(MergedContextConfiguration key) 指定されたキーの失敗回数を取得します。int
DefaultContextCache.getFailureCount
(MergedContextConfiguration key) default void
ContextCache.incrementFailureCount
(MergedContextConfiguration key) 指定されたキーの失敗回数を増やします。void
DefaultContextCache.incrementFailureCount
(MergedContextConfiguration key) boolean
DefaultCacheAwareContextLoaderDelegate.isContextLoaded
(MergedContextConfiguration mergedConfig) DefaultCacheAwareContextLoaderDelegate.loadContext
(MergedContextConfiguration mergedConfig) protected ApplicationContext
DefaultCacheAwareContextLoaderDelegate.loadContextInternal
(MergedContextConfiguration mergedConfig) 提供されたマージされたコンテキスト構成のApplicationContext
をロードします。void
ContextCache.put
(MergedContextConfiguration key, ApplicationContext context) 特定のキーにあるApplicationContext
インスタンスをキャッシュに明示的に追加します。これにより、カスタムの排除ポリシーが適用される可能性があります。void
DefaultContextCache.put
(MergedContextConfiguration key, ApplicationContext context) void
ContextCache.remove
(MergedContextConfiguration key, DirtiesContext.HierarchyMode hierarchyMode) 指定されたキーを持つコンテキストをキャッシュから削除し、ConfigurableApplicationContext
のインスタンスである場合は明示的に閉じます。void
DefaultContextCache.remove
(MergedContextConfiguration key, DirtiesContext.HierarchyMode hierarchyMode) org.springframework.test.context.support 内の MergedContextConfiguration 使用
修飾子と型メソッド説明AbstractTestContextBootstrapper.buildMergedContextConfiguration()
protected MergedContextConfiguration
AbstractTestContextBootstrapper.processMergedContextConfiguration
(MergedContextConfiguration mergedConfig) 提供され、新しくインスタンス化されたMergedContextConfiguration
インスタンスを処理します。型 MergedContextConfiguration のパラメーターを持つ org.springframework.test.context.support のメソッド修飾子と型メソッド説明protected void
AbstractContextLoader.customizeContext
(ConfigurableApplicationContext context, MergedContextConfiguration mergedConfig) Bean 定義がコンテキストになく、文脈をリフレッシュされる前にロードされた後、このContextLoader
によって作成されたConfigurableApplicationContext
をカスタマイズします。protected void
AbstractGenericContextLoader.loadBeanDefinitions
(GenericApplicationContext context, MergedContextConfiguration mergedConfig) 提供されたMergedContextConfiguration
の場所またはクラスから、提供されたcontext
に Bean 定義をロードします。protected void
AnnotationConfigContextLoader.loadBeanDefinitions
(GenericApplicationContext context, MergedContextConfiguration mergedConfig) 提供されたMergedContextConfiguration
のクラスから、提供されたcontext
のクラスを登録します。protected void
GenericGroovyXmlContextLoader.loadBeanDefinitions
(GenericApplicationContext context, MergedContextConfiguration mergedConfig) GroovyBeanDefinitionReader
を使用して、提供されたMergedContextConfiguration
の場所から提供されたcontext
に Bean 定義をロードします。final ApplicationContext
AbstractDelegatingSmartContextLoader.loadContext
(MergedContextConfiguration mergedConfig) ApplicationContext
をロードする適切な候補SmartContextLoader
にデリゲートします。final ApplicationContext
AbstractGenericContextLoader.loadContext
(MergedContextConfiguration mergedConfig) 提供されたMergedContextConfiguration
のGenericApplicationContext
をロードします。final ApplicationContext
AbstractDelegatingSmartContextLoader.loadContextForAotProcessing
(MergedContextConfiguration mergedConfig) 非推奨、削除予定: この API 要素は、将来のバージョンで削除される可能性があります。Spring Framework 6.2.4 時点ではAbstractDelegatingSmartContextLoader.loadContextForAotProcessing(MergedContextConfiguration, RuntimeHints)
に置き換えられ、Spring Framework 8.0 で削除される予定final ApplicationContext
AbstractDelegatingSmartContextLoader.loadContextForAotProcessing
(MergedContextConfiguration mergedConfig, RuntimeHints runtimeHints) AOT 処理のためにApplicationContext
をロードするために、適切な候補SmartContextLoader
に委譲します。AbstractGenericContextLoader.loadContextForAotProcessing
(MergedContextConfiguration mergedConfig) 非推奨、削除予定: この API 要素は、将来のバージョンで削除される可能性があります。Spring Framework 6.2.4 時点ではAbstractGenericContextLoader.loadContextForAotProcessing(MergedContextConfiguration, RuntimeHints)
に置き換えられ、Spring Framework 8.0 で削除される予定AbstractGenericContextLoader.loadContextForAotProcessing
(MergedContextConfiguration mergedConfig, RuntimeHints runtimeHints) 提供されたMergedContextConfiguration
に基づいて、AOT ビルド時の処理のためにGenericApplicationContext
をロードします。final ApplicationContext
AbstractDelegatingSmartContextLoader.loadContextForAotRuntime
(MergedContextConfiguration mergedConfig, ApplicationContextInitializer<ConfigurableApplicationContext> initializer) AOT ランタイム実行のためにApplicationContext
をロードするために、適切な候補SmartContextLoader
に委譲します。AbstractGenericContextLoader.loadContextForAotRuntime
(MergedContextConfiguration mergedConfig, ApplicationContextInitializer<ConfigurableApplicationContext> initializer) 提供されたMergedContextConfiguration
およびApplicationContextInitializer
に基づいて、AOT ランタイム実行用にGenericApplicationContext
をロードします。protected void
AbstractContextLoader.prepareContext
(ConfigurableApplicationContext context, MergedContextConfiguration mergedConfig) Bean 定義が読み取られる前に、このSmartContextLoader
によって作成されたConfigurableApplicationContext
を準備します。protected MergedContextConfiguration
AbstractTestContextBootstrapper.processMergedContextConfiguration
(MergedContextConfiguration mergedConfig) 提供され、新しくインスタンス化されたMergedContextConfiguration
インスタンスを処理します。protected void
AbstractGenericContextLoader.validateMergedContextConfiguration
(MergedContextConfiguration mergedConfig) このコンテキストローダーがサポートするものに関して、提供されたMergedContextConfiguration
を検証します。protected void
AnnotationConfigContextLoader.validateMergedContextConfiguration
(MergedContextConfiguration mergedConfig) 提供されたMergedContextConfiguration
にlocations
が含まれていないことを確認してください。protected void
GenericXmlContextLoader.validateMergedContextConfiguration
(MergedContextConfiguration mergedConfig) 提供されたMergedContextConfiguration
にclasses
が含まれていないことを確認してください。型 MergedContextConfiguration のパラメーターを持つ org.springframework.test.context.support のコンストラクター修飾子コンストラクター説明DefaultTestContext
(ClassSE<?> testClass, MergedContextConfiguration mergedConfig, CacheAwareContextLoaderDelegate cacheAwareContextLoaderDelegate) 指定された引数から新しいDefaultTestContext
を構築します。org.springframework.test.context.web 内の MergedContextConfiguration 使用
修飾子と型クラス説明class
WebMergedContextConfiguration
は、テストクラスとそのすべてのスーパークラス、および@ContextConfiguration
、@WebAppConfiguration
、@ActiveProfiles
、@TestPropertySource
を含むクラスで宣言されたマージされたコンテキスト構成をカプセル化します。修飾子と型メソッド説明protected MergedContextConfiguration
WebTestContextBootstrapper.processMergedContextConfiguration
(MergedContextConfiguration mergedConfig) 指定されたMergedContextConfiguration
のテストクラスに@WebAppConfiguration
のアノテーションが付けられている場合はWebMergedContextConfiguration
を返し、それ以外の場合は指定されたインスタンスを変更せずに返します。型 MergedContextConfiguration のパラメーターを持つ org.springframework.test.context.web のメソッド修飾子と型メソッド説明final ApplicationContext
AbstractGenericWebContextLoader.loadContext
(MergedContextConfiguration mergedConfig) 提供されたMergedContextConfiguration
のGenericWebApplicationContext
をロードします。AbstractGenericWebContextLoader.loadContextForAotProcessing
(MergedContextConfiguration mergedConfig) 非推奨、削除予定: この API 要素は、将来のバージョンで削除される可能性があります。Spring Framework 6.2.4 時点ではAbstractGenericWebContextLoader.loadContextForAotProcessing(MergedContextConfiguration, RuntimeHints)
に置き換えられ、Spring Framework 8.0 で削除される予定AbstractGenericWebContextLoader.loadContextForAotProcessing
(MergedContextConfiguration mergedConfig, RuntimeHints runtimeHints) 提供されたMergedContextConfiguration
に基づいて、AOT ビルド時の処理のためにGenericWebApplicationContext
をロードします。AbstractGenericWebContextLoader.loadContextForAotRuntime
(MergedContextConfiguration mergedConfig, ApplicationContextInitializer<ConfigurableApplicationContext> initializer) 提供されたMergedContextConfiguration
およびApplicationContextInitializer
に基づいて、AOT ランタイム実行用にGenericWebApplicationContext
をロードします。protected MergedContextConfiguration
WebTestContextBootstrapper.processMergedContextConfiguration
(MergedContextConfiguration mergedConfig) 指定されたMergedContextConfiguration
のテストクラスに@WebAppConfiguration
のアノテーションが付けられている場合はWebMergedContextConfiguration
を返し、それ以外の場合は指定されたインスタンスを変更せずに返します。型 MergedContextConfiguration のパラメーターを持つ org.springframework.test.context.web のコンストラクター修飾子コンストラクター説明WebMergedContextConfiguration
(ClassSE<?> testClass, StringSE[] locations, ClassSE<?>[] classes, SetSE<ClassSE<? extends ApplicationContextInitializer<?>>> contextInitializerClasses, StringSE[] activeProfiles, StringSE[] propertySourceLocations, StringSE[] propertySourceProperties, StringSE resourceBasePath, ContextLoader contextLoader, CacheAwareContextLoaderDelegate cacheAwareContextLoaderDelegate, MergedContextConfiguration parent) WebMergedContextConfiguration
(ClassSE<?> testClass, StringSE[] locations, ClassSE<?>[] classes, SetSE<ClassSE<? extends ApplicationContextInitializer<?>>> contextInitializerClasses, StringSE[] activeProfiles, StringSE[] propertySourceLocations, StringSE[] propertySourceProperties, SetSE<ContextCustomizer> contextCustomizers, StringSE resourceBasePath, ContextLoader contextLoader, CacheAwareContextLoaderDelegate cacheAwareContextLoaderDelegate, MergedContextConfiguration parent) WebMergedContextConfiguration
(ClassSE<?> testClass, StringSE[] locations, ClassSE<?>[] classes, SetSE<ClassSE<? extends ApplicationContextInitializer<?>>> contextInitializerClasses, StringSE[] activeProfiles, ListSE<PropertySourceDescriptor> propertySourceDescriptors, StringSE[] propertySourceProperties, SetSE<ContextCustomizer> contextCustomizers, StringSE resourceBasePath, ContextLoader contextLoader, CacheAwareContextLoaderDelegate cacheAwareContextLoaderDelegate, MergedContextConfiguration parent) 指定されたパラメーターの新しいWebMergedContextConfiguration
インスタンスを作成します。WebMergedContextConfiguration
(MergedContextConfiguration mergedConfig, StringSE resourceBasePath) 提供されたMergedContextConfiguration
からすべてのプロパティをコピーして、新しいWebMergedContextConfiguration
インスタンスを作成します。
MergedContextConfiguration(Class, String[], Class[], Set, String[], List, String[], Set, ContextLoader, CacheAwareContextLoaderDelegate, MergedContextConfiguration)
を推奨