クラスの使用
org.springframework.test.context.MergedContextConfiguration
パッケージ
説明
このパッケージには Spring TestContext フレームワークが含まれており、使用中の実際のテストフレームワークにとらわれないアノテーション駆動型ユニットおよび統合テストのサポートを提供します。
Spring TestContext フレームワークの事前 (AOT) サポート。
Spring TestContext フレームワーク内のコンテキストキャッシングのサポート。
Spring TestContext フレームワークのサポートクラス。
Web は、Spring TestContext フレームワークのクラスをサポートします。
org.springframework.test.context 内の MergedContextConfiguration 使用
修飾子と型メソッド説明TestContextBootstrapper.buildMergedContextConfiguration()
このブートストラップに関連付けられたBootstrapContext
内のテストクラスのマージされたコンテキスト構成を構築します。MergedContextConfiguration.getParent()
コンテキスト階層内の親アプリケーションコンテキストのMergedContextConfiguration
を取得します。修飾子と型メソッド説明void
CacheAwareContextLoaderDelegate.closeContext
(MergedContextConfiguration mergedContextConfiguration, DirtiesContext.HierarchyMode hierarchyMode) 提供されたMergedContextConfiguration
のアプリケーションコンテキストをContextCache
から削除し、それがConfigurableApplicationContext
のインスタンスである場合は閉じます。void
ContextCustomizer.customizeContext
(ConfigurableApplicationContext context, MergedContextConfiguration mergedConfig) Bean 定義がコンテキストになく、コンテキストがリフレッシュされた前にロードされた後に供給ConfigurableApplicationContext
をカスタマイズします。default boolean
CacheAwareContextLoaderDelegate.isContextLoaded
(MergedContextConfiguration mergedContextConfiguration) CacheAwareContextLoaderDelegate.loadContext
(MergedContextConfiguration mergedContextConfiguration) 指定されたMergedContextConfiguration
で構成されたContextLoader
に委譲することにより、提供されたMergedContextConfiguration
のアプリケーションコンテキストをロードします。SmartContextLoader.loadContext
(MergedContextConfiguration mergedConfig) 提供されたMergedContextConfiguration
に基づいて新しいApplicationContext
をロードし、コンテキストを構成して、完全にリフレッシュされた状態でコンテキストを返します。修飾子コンストラクター説明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
インスタンスを作成します。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
インスタンスを作成します。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 使用
修飾子と型メソッド説明AotContextLoader.loadContextForAotProcessing
(MergedContextConfiguration mergedConfig) 提供されたMergedContextConfiguration
に基づいて AOT ビルド時の処理用に新しいApplicationContext
をロードし、コンテキストを構成して、コンテキストを返します。AotContextLoader.loadContextForAotRuntime
(MergedContextConfiguration mergedConfig, ApplicationContextInitializer<ConfigurableApplicationContext> initializer) 提供されたMergedContextConfiguration
およびApplicationContextInitializer
に基づいて、AOT ランタイム実行用に新しいApplicationContext
をロードします。org.springframework.test.context.cache 内の MergedContextConfiguration 使用
修飾子と型メソッド説明void
DefaultCacheAwareContextLoaderDelegate.closeContext
(MergedContextConfiguration mergedContextConfiguration, DirtiesContext.HierarchyMode hierarchyMode) boolean
ContextCache.contains
(MergedContextConfiguration key) 指定されたキーのキャッシュされたコンテキストがあるかどうかを確認します。boolean
DefaultContextCache.contains
(MergedContextConfiguration key) 指定されたキーのキャッシュされたコンテキストがあるかどうかを確認します。ContextCache.get
(MergedContextConfiguration key) 指定されたキーのキャッシュされたApplicationContext
を取得します。DefaultContextCache.get
(MergedContextConfiguration key) 指定されたキーのキャッシュされたApplicationContext
を取得します。boolean
DefaultCacheAwareContextLoaderDelegate.isContextLoaded
(MergedContextConfiguration mergedContextConfiguration) DefaultCacheAwareContextLoaderDelegate.loadContext
(MergedContextConfiguration mergedContextConfiguration) protected ApplicationContext
DefaultCacheAwareContextLoaderDelegate.loadContextInternal
(MergedContextConfiguration mergedContextConfiguration) 提供されたマージされたコンテキスト構成のApplicationContext
をロードします。void
ContextCache.put
(MergedContextConfiguration key, ApplicationContext context) 特定のキーにあるApplicationContext
インスタンスをキャッシュに明示的に追加します。これにより、カスタムの排除ポリシーが適用される可能性があります。void
DefaultContextCache.put
(MergedContextConfiguration key, ApplicationContext context) 特定のキーにあるApplicationContext
インスタンスをキャッシュに明示的に追加します。これにより、カスタムの排除ポリシーが適用される可能性があります。void
ContextCache.remove
(MergedContextConfiguration key, DirtiesContext.HierarchyMode hierarchyMode) 指定されたキーを持つコンテキストをキャッシュから削除し、ConfigurableApplicationContext
のインスタンスである場合は明示的に閉じます。void
DefaultContextCache.remove
(MergedContextConfiguration key, DirtiesContext.HierarchyMode hierarchyMode) 指定されたキーを持つコンテキストをキャッシュから削除し、ConfigurableApplicationContext
のインスタンスである場合は明示的に閉じます。org.springframework.test.context.support 内の MergedContextConfiguration 使用
修飾子と型メソッド説明AbstractTestContextBootstrapper.buildMergedContextConfiguration()
このブートストラップに関連付けられたBootstrapContext
内のテストクラスのマージされたコンテキスト構成を構築します。protected MergedContextConfiguration
AbstractTestContextBootstrapper.processMergedContextConfiguration
(MergedContextConfiguration mergedConfig) 提供され、新しくインスタンス化されたMergedContextConfiguration
インスタンスを処理します。修飾子と型メソッド説明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) AOT 処理のためにApplicationContext
をロードするために、適切な候補SmartContextLoader
に委譲します。AbstractGenericContextLoader.loadContextForAotProcessing
(MergedContextConfiguration mergedConfig) 提供された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
が含まれていないことを確認してください。修飾子コンストラクター説明DefaultTestContext
(ClassSE<?> testClass, MergedContextConfiguration mergedContextConfiguration, CacheAwareContextLoaderDelegate cacheAwareContextLoaderDelegate) 指定された引数から新しいDefaultTestContext
を構築します。org.springframework.test.context.web 内の MergedContextConfiguration 使用
修飾子と型クラス説明class
WebMergedContextConfiguration
は、テストクラスとそのすべてのスーパークラス、および@ContextConfiguration
、@WebAppConfiguration
、@ActiveProfiles
、@TestPropertySource
を含むクラスで宣言されたマージされたコンテキスト構成をカプセル化します。修飾子と型メソッド説明protected MergedContextConfiguration
WebTestContextBootstrapper.processMergedContextConfiguration
(MergedContextConfiguration mergedConfig) 指定されたMergedContextConfiguration
のテストクラスに@WebAppConfiguration
のアノテーションが付けられている場合はWebMergedContextConfiguration
を返し、それ以外の場合は指定されたインスタンスを変更せずに返します。修飾子と型メソッド説明final ApplicationContext
AbstractGenericWebContextLoader.loadContext
(MergedContextConfiguration mergedConfig) 提供されたMergedContextConfiguration
のGenericWebApplicationContext
をロードします。AbstractGenericWebContextLoader.loadContextForAotProcessing
(MergedContextConfiguration mergedConfig) 提供されたMergedContextConfiguration
に基づいて、AOT ビルド時の処理のためにGenericWebApplicationContext
をロードします。AbstractGenericWebContextLoader.loadContextForAotRuntime
(MergedContextConfiguration mergedConfig, ApplicationContextInitializer<ConfigurableApplicationContext> initializer) 提供されたMergedContextConfiguration
およびApplicationContextInitializer
に基づいて、AOT ランタイム実行用にGenericWebApplicationContext
をロードします。protected MergedContextConfiguration
WebTestContextBootstrapper.processMergedContextConfiguration
(MergedContextConfiguration mergedConfig) 指定されたMergedContextConfiguration
のテストクラスに@WebAppConfiguration
のアノテーションが付けられている場合はWebMergedContextConfiguration
を返し、それ以外の場合は指定されたインスタンスを変更せずに返します。修飾子コンストラクター説明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
インスタンスを作成します。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
インスタンスを作成します。WebMergedContextConfiguration
(MergedContextConfiguration mergedConfig, StringSE resourceBasePath) 提供されたMergedContextConfiguration
からすべてのプロパティをコピーして、新しいWebMergedContextConfiguration
インスタンスを作成します。