クラス MergedContextConfiguration
- 実装されているすべてのインターフェース:
SerializableSE
- 既知の直属サブクラス
WebMergedContextConfiguration
MergedContextConfiguration は、テストクラスとそのすべてのスーパークラスで宣言されたマージされたコンテキスト構成をカプセル化し、@ContextConfiguration、@ActiveProfiles、@TestPropertySource を介してクラスを囲みます。 マージされたコンテキストリソースの場所、アノテーション付きクラス、アクティブプロファイル、プロパティリソースの場所、インラインプロパティは、ContextConfiguration.inheritLocations()、ActiveProfiles.inheritProfiles()、TestPropertySource.inheritLocations()、TestPropertySource.inheritProperties() フラグのセマンティクスを考慮して、テストクラス階層および囲みクラス階層で宣言されたすべての値を表します。
SmartContextLoader は MergedContextConfiguration を使用して ApplicationContext をロードします。
MergedContextConfiguration は、この MergedContextConfiguration のプロパティを使用してロードされた ApplicationContext をキャッシュするためのキーとして、ContextCache によっても使用されます。
- 導入:
- 3.1
- 作成者:
- Sam Brannen, Phillip Webb
- 関連事項:
コンストラクターの概要
コンストラクターコンストラクター説明MergedContextConfiguration(ClassSE<?> testClass, StringSE @Nullable [] locations, ClassSE<?> @Nullable [] classes, StringSE @Nullable [] activeProfiles, ContextLoader contextLoader) 指定されたパラメーターの新しいMergedContextConfigurationインスタンスを作成します。MergedContextConfiguration(ClassSE<?> testClass, StringSE @Nullable [] locations, ClassSE<?> @Nullable [] classes, @Nullable SetSE<ClassSE<? extends ApplicationContextInitializer<?>>> contextInitializerClasses, StringSE @Nullable [] activeProfiles, StringSE @Nullable [] propertySourceLocations, StringSE @Nullable [] propertySourceProperties, @Nullable SetSE<ContextCustomizer> contextCustomizers, ContextLoader contextLoader, @Nullable CacheAwareContextLoaderDelegate cacheAwareContextLoaderDelegate, @Nullable MergedContextConfiguration parent) 使用すべきではありません。MergedContextConfiguration(ClassSE<?> testClass, StringSE @Nullable [] locations, ClassSE<?> @Nullable [] classes, @Nullable SetSE<ClassSE<? extends ApplicationContextInitializer<?>>> contextInitializerClasses, StringSE @Nullable [] activeProfiles, StringSE @Nullable [] propertySourceLocations, StringSE @Nullable [] propertySourceProperties, ContextLoader contextLoader, @Nullable CacheAwareContextLoaderDelegate cacheAwareContextLoaderDelegate, @Nullable MergedContextConfiguration parent) MergedContextConfiguration(ClassSE<?> testClass, StringSE @Nullable [] locations, ClassSE<?> @Nullable [] classes, @Nullable SetSE<ClassSE<? extends ApplicationContextInitializer<?>>> contextInitializerClasses, StringSE @Nullable [] activeProfiles, ListSE<PropertySourceDescriptor> propertySourceDescriptors, StringSE @Nullable [] propertySourceProperties, @Nullable SetSE<ContextCustomizer> contextCustomizers, ContextLoader contextLoader, @Nullable CacheAwareContextLoaderDelegate cacheAwareContextLoaderDelegate, @Nullable MergedContextConfiguration parent) 指定されたパラメーターの新しいMergedContextConfigurationインスタンスを作成します。MergedContextConfiguration(ClassSE<?> testClass, StringSE @Nullable [] locations, ClassSE<?> @Nullable [] classes, @Nullable SetSE<ClassSE<? extends ApplicationContextInitializer<?>>> contextInitializerClasses, StringSE @Nullable [] activeProfiles, ContextLoader contextLoader) 指定されたパラメーターの新しいMergedContextConfigurationインスタンスを作成します。MergedContextConfiguration(ClassSE<?> testClass, StringSE @Nullable [] locations, ClassSE<?> @Nullable [] classes, @Nullable SetSE<ClassSE<? extends ApplicationContextInitializer<?>>> contextInitializerClasses, StringSE @Nullable [] activeProfiles, ContextLoader contextLoader, @Nullable CacheAwareContextLoaderDelegate cacheAwareContextLoaderDelegate, @Nullable MergedContextConfiguration parent) 指定されたパラメーターの新しいMergedContextConfigurationインスタンスを作成します。MergedContextConfiguration(MergedContextConfiguration mergedConfig) 提供されたMergedContextConfigurationからすべてのフィールドをコピーして、新しいMergedContextConfigurationインスタンスを作成します。メソッドのサマリー
修飾子と型メソッド説明boolean両方のオブジェクトの位置、アノテーション付きクラス、コンテキスト初期化クラス、アクティブなプロファイル、プロパティソース記述子、プロパティソースプロパティ、コンテキストカスタマイザ、親、およびContextLoadersの完全修飾名を比較することにより、指定されたオブジェクトがこのMergedContextConfigurationインスタンスと等しいかどうかを判断します。StringSE[]テストクラスのマージされたアクティブな Bean 定義プロファイルを取得します。ClassSE<?>[]テストクラスのマージされたアノテーション付きクラスを取得します。アプリケーションコンテキストが読み込まれたときに適用される、マージされたContextCustomizersを取得します。SetSE<ClassSE<? extends ApplicationContextInitializer<?>>> テストクラスのマージされたApplicationContextInitializerクラスを取得します。テストクラスの解決されたContextLoaderを取得します。StringSE[]テストクラスのApplicationContext構成ファイルのマージされたリソースの場所を取得します。コンテキスト階層内の親アプリケーションコンテキストのMergedContextConfigurationを取得します。このMergedContextConfigurationによって定義されたコンテキストの親ApplicationContextをコンテキストキャッシュから取得します。テストクラスのテストPropertySourcesのリソースの場所のマージされた記述子を取得します。StringSE[]使用すべきではありません。6.1 以降、getPropertySourceDescriptors()を推奨StringSE[]テストクラスのマージされたインラインプロパティを取得します。ClassSE<?> このMergedContextConfigurationに関連付けられているテストクラスSEを取得します。booleanこのMergedContextConfigurationインスタンスにクラスベースのリソースがあるかどうかを確認します。inthashCode()テストクラスを除く、このMergedContextConfigurationのすべてのプロパティに対して一意のハッシュコードを生成します。booleanこのMergedContextConfigurationインスタンスにパスベースのコンテキストリソースの場所があるかどうかを確認します。booleanこのMergedContextConfigurationインスタンスにパスベースのコンテキストリソースの場所またはクラスベースのリソースがあるかどうかを確認します。protected static StringSEnullSafeClassName(@Nullable ContextLoader contextLoader) protected static StringSE[]processStrings(StringSE @Nullable [] array) toString()テストクラス、場所、アノテーション付きクラス、コンテキスト初期化クラス、アクティブなプロファイル、プロパティソース記述子、プロパティソースプロパティ、コンテキストカスタマイザー、ContextLoaderの名前、親構成の文字列表現を提供します。
コンストラクターの詳細
MergedContextConfiguration
public MergedContextConfiguration(ClassSE<?> testClass, StringSE @Nullable [] locations, ClassSE<?> @Nullable [] classes, StringSE @Nullable [] activeProfiles, ContextLoader contextLoader) 指定されたパラメーターの新しいMergedContextConfigurationインスタンスを作成します。- パラメーター:
testClass- 構成がマージされたテストクラスlocations- マージされたコンテキストリソースの場所classes- マージされたアノテーション付きクラスactiveProfiles- マージされたアクティブな Bean 定義プロファイルcontextLoader- 解決されたContextLoader
MergedContextConfiguration
public MergedContextConfiguration(ClassSE<?> testClass, StringSE @Nullable [] locations, ClassSE<?> @Nullable [] classes, @Nullable SetSE<ClassSE<? extends ApplicationContextInitializer<?>>> contextInitializerClasses, StringSE @Nullable [] activeProfiles, ContextLoader contextLoader) 指定されたパラメーターの新しいMergedContextConfigurationインスタンスを作成します。- パラメーター:
testClass- 構成がマージされたテストクラスlocations- マージされたコンテキストリソースの場所classes- マージされたアノテーション付きクラスcontextInitializerClasses- マージされたコンテキスト初期化子クラスactiveProfiles- マージされたアクティブな Bean 定義プロファイルcontextLoader- 解決されたContextLoader
MergedContextConfiguration
public MergedContextConfiguration(ClassSE<?> testClass, StringSE @Nullable [] locations, ClassSE<?> @Nullable [] classes, @Nullable SetSE<ClassSE<? extends ApplicationContextInitializer<?>>> contextInitializerClasses, StringSE @Nullable [] activeProfiles, ContextLoader contextLoader, @Nullable CacheAwareContextLoaderDelegate cacheAwareContextLoaderDelegate, @Nullable MergedContextConfiguration parent) 指定されたパラメーターの新しいMergedContextConfigurationインスタンスを作成します。- パラメーター:
testClass- 構成がマージされたテストクラスlocations- マージされたコンテキストリソースの場所classes- マージされたアノテーション付きクラスcontextInitializerClasses- マージされたコンテキスト初期化子クラスactiveProfiles- マージされたアクティブな Bean 定義プロファイルcontextLoader- 解決されたContextLoadercacheAwareContextLoaderDelegate- 親ApplicationContextを取得するためのキャッシュ対応コンテキストローダーデリゲートparent- 親構成、または親がない場合はnull- 導入:
- 3.2.2
MergedContextConfiguration
提供されたMergedContextConfigurationからすべてのフィールドをコピーして、新しいMergedContextConfigurationインスタンスを作成します。- 導入:
- 4.1
MergedContextConfiguration
@DeprecatedSE(since="6.1") public MergedContextConfiguration(ClassSE<?> testClass, StringSE @Nullable [] locations, ClassSE<?> @Nullable [] classes, @Nullable SetSE<ClassSE<? extends ApplicationContextInitializer<?>>> contextInitializerClasses, StringSE @Nullable [] activeProfiles, StringSE @Nullable [] propertySourceLocations, StringSE @Nullable [] propertySourceProperties, ContextLoader contextLoader, @Nullable CacheAwareContextLoaderDelegate cacheAwareContextLoaderDelegate, @Nullable MergedContextConfiguration parent) 使用すべきではありません。指定されたパラメーターの新しいMergedContextConfigurationインスタンスを作成します。locations、classes、activeProfiles、propertySourceLocationsまたはpropertySourcePropertiesにnull値が指定されている場合は、代わりに空の配列が格納されます。contextInitializerClassesにnull値が指定されている場合は、代わりに空のセットが保存されます。さらに、アクティブなプロファイルがソートされ、重複するプロファイルが削除されます。- パラメーター:
testClass- 構成がマージされたテストクラスlocations- マージされたコンテキストリソースの場所classes- マージされたアノテーション付きクラスcontextInitializerClasses- マージされたコンテキスト初期化子クラスactiveProfiles- マージされたアクティブな Bean 定義プロファイルpropertySourceLocations- マージされたPropertySourceロケーションpropertySourceProperties- マージされたPropertySourceプロパティcontextLoader- 解決されたContextLoadercacheAwareContextLoaderDelegate- 親ApplicationContextを取得するためのキャッシュ対応コンテキストローダーデリゲートparent- 親構成、または親がない場合はnull- 導入:
- 4.1
MergedContextConfiguration
@DeprecatedSE(since="6.1") public MergedContextConfiguration(ClassSE<?> testClass, StringSE @Nullable [] locations, ClassSE<?> @Nullable [] classes, @Nullable SetSE<ClassSE<? extends ApplicationContextInitializer<?>>> contextInitializerClasses, StringSE @Nullable [] activeProfiles, StringSE @Nullable [] propertySourceLocations, StringSE @Nullable [] propertySourceProperties, @Nullable SetSE<ContextCustomizer> contextCustomizers, ContextLoader contextLoader, @Nullable CacheAwareContextLoaderDelegate cacheAwareContextLoaderDelegate, @Nullable MergedContextConfiguration parent) 使用すべきではありません。指定されたパラメーターの新しいMergedContextConfigurationインスタンスを作成します。locations、classes、activeProfiles、propertySourceLocationsまたはpropertySourcePropertiesにnull値が指定されている場合は、代わりに空の配列が格納されます。contextInitializerClassesまたはcontextCustomizersにnull値が指定されている場合は、代わりに空のセットが格納されます。さらに、アクティブなプロファイルがソートされ、重複するプロファイルが削除されます。- パラメーター:
testClass- 構成がマージされたテストクラスlocations- マージされたコンテキストリソースの場所classes- マージされたアノテーション付きクラスcontextInitializerClasses- マージされたコンテキスト初期化子クラスactiveProfiles- マージされたアクティブな Bean 定義プロファイルpropertySourceLocations- マージされたPropertySourceロケーションpropertySourceProperties- マージされたPropertySourceプロパティcontextCustomizers- コンテキストカスタマイザcontextLoader- 解決されたContextLoadercacheAwareContextLoaderDelegate- 親ApplicationContextを取得するためのキャッシュ対応コンテキストローダーデリゲートparent- 親構成、または親がない場合はnull- 導入:
- 4.3
MergedContextConfiguration
public MergedContextConfiguration(ClassSE<?> testClass, StringSE @Nullable [] locations, ClassSE<?> @Nullable [] classes, @Nullable SetSE<ClassSE<? extends ApplicationContextInitializer<?>>> contextInitializerClasses, StringSE @Nullable [] activeProfiles, ListSE<PropertySourceDescriptor> propertySourceDescriptors, StringSE @Nullable [] propertySourceProperties, @Nullable SetSE<ContextCustomizer> contextCustomizers, ContextLoader contextLoader, @Nullable CacheAwareContextLoaderDelegate cacheAwareContextLoaderDelegate, @Nullable MergedContextConfiguration parent) 指定されたパラメーターの新しいMergedContextConfigurationインスタンスを作成します。locations、classes、activeProfilesまたはpropertySourcePropertiesにnull値が指定された場合は、代わりに空の配列が格納されます。contextInitializerClassesまたはcontextCustomizersにnull値が指定された場合、代わりに空のセットが格納されます。さらに、アクティブなプロファイルが並べ替えられ、重複したプロファイルが削除されます。- パラメーター:
testClass- 構成がマージされたテストクラスlocations- マージされたコンテキストリソースの場所classes- マージされたアノテーション付きクラスcontextInitializerClasses- マージされたコンテキスト初期化子クラスactiveProfiles- マージされたアクティブな Bean 定義プロファイルpropertySourceDescriptors- マージされたプロパティのソース記述子propertySourceProperties- マージされたインライン化プロパティcontextCustomizers- コンテキストカスタマイザcontextLoader- 解決されたContextLoadercacheAwareContextLoaderDelegate- 親ApplicationContextを取得するためのキャッシュ対応コンテキストローダーデリゲートparent- 親構成、または親がない場合はnull- 導入:
- 6.1
メソッドの詳細
getTestClass
このMergedContextConfigurationに関連付けられているテストクラスSEを取得します。getLocations
getClasses
hasLocations
public boolean hasLocations()このMergedContextConfigurationインスタンスにパスベースのコンテキストリソースの場所があるかどうかを確認します。- 戻り値:
-
locations配列が空でない場合はtrue - 導入:
- 4.0.4
- 関連事項:
hasClasses
public boolean hasClasses()このMergedContextConfigurationインスタンスにクラスベースのリソースがあるかどうかを確認します。- 戻り値:
-
classes配列が空でない場合はtrue - 導入:
- 4.0.4
- 関連事項:
hasResources
getContextInitializerClasses
テストクラスのマージされたApplicationContextInitializerクラスを取得します。getActiveProfiles
getPropertySourceDescriptors
テストクラスのテストPropertySourcesのリソースの場所のマージされた記述子を取得します。プロパティは
EnvironmentのPropertySourcesのセットに読み込まれます。- 導入:
- 6.1
- 関連事項:
getPropertySourceLocations
getPropertySourceProperties
getContextCustomizers
アプリケーションコンテキストが読み込まれたときに適用される、マージされたContextCustomizersを取得します。getContextLoader
テストクラスの解決されたContextLoaderを取得します。getParent
コンテキスト階層内の親アプリケーションコンテキストのMergedContextConfigurationを取得します。- 戻り値:
- 親構成、または親がない場合は
null - 導入:
- 3.2.2
- 関連事項:
getParentApplicationContext
このMergedContextConfigurationによって定義されたコンテキストの親ApplicationContextをコンテキストキャッシュから取得します。親コンテキストがまだ読み込まれていない場合は、読み込まれ、キャッシュに格納されてから返されます。
- 戻り値:
- 親がない場合は、親
ApplicationContextまたはnull - 導入:
- 3.2.2
- 関連事項:
equals
両方のオブジェクトの位置、アノテーション付きクラス、コンテキスト初期化クラス、アクティブなプロファイル、プロパティソース記述子、プロパティソースプロパティ、コンテキストカスタマイザ、親、およびContextLoadersの完全修飾名を比較することにより、指定されたオブジェクトがこのMergedContextConfigurationインスタンスと等しいかどうかを判断します。hashCode
toString
テストクラス、場所、アノテーション付きクラス、コンテキスト初期化クラス、アクティブなプロファイル、プロパティソース記述子、プロパティソースプロパティ、コンテキストカスタマイザー、ContextLoaderの名前、親構成の文字列表現を提供します。processStrings
nullSafeClassName
MergedContextConfiguration(Class, String[], Class[], Set, String[], List, String[], Set, ContextLoader, CacheAwareContextLoaderDelegate, MergedContextConfiguration)を推奨