クラス 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[] locations, ClassSE<?>[] classes, StringSE[] activeProfiles, ContextLoader contextLoader) 指定されたパラメーターの新しいMergedContextConfigurationインスタンスを作成します。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) 指定されたパラメーターの新しい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インスタンスを作成します。メソッドのサマリー
修飾子と型メソッド説明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(ContextLoader contextLoader) protected static StringSE[]processStrings(StringSE[] array) toString()テストクラス、場所、アノテーション付きクラス、コンテキスト初期化クラス、アクティブなプロファイル、プロパティソース記述子、プロパティソースプロパティ、コンテキストカスタマイザー、ContextLoaderの名前、親構成の文字列表現を提供します。
コンストラクターの詳細
MergedContextConfiguration
public MergedContextConfiguration(ClassSE<?> testClass, @Nullable StringSE[] locations, @Nullable ClassSE<?>[] classes, @Nullable StringSE[] activeProfiles, ContextLoader contextLoader) 指定されたパラメーターの新しいMergedContextConfigurationインスタンスを作成します。- パラメーター:
testClass- 構成がマージされたテストクラスlocations- マージされたコンテキストリソースの場所classes- マージされたアノテーション付きクラスactiveProfiles- マージされたアクティブな Bean 定義プロファイルcontextLoader- 解決されたContextLoader
MergedContextConfiguration
public MergedContextConfiguration(ClassSE<?> testClass, @Nullable StringSE[] locations, @Nullable ClassSE<?>[] classes, @Nullable SetSE<ClassSE<? extends ApplicationContextInitializer<?>>> contextInitializerClasses, @Nullable StringSE[] activeProfiles, ContextLoader contextLoader) 指定されたパラメーターの新しいMergedContextConfigurationインスタンスを作成します。- パラメーター:
testClass- 構成がマージされたテストクラスlocations- マージされたコンテキストリソースの場所classes- マージされたアノテーション付きクラスcontextInitializerClasses- マージされたコンテキスト初期化子クラスactiveProfiles- マージされたアクティブな Bean 定義プロファイルcontextLoader- 解決されたContextLoader
MergedContextConfiguration
public MergedContextConfiguration(ClassSE<?> testClass, @Nullable StringSE[] locations, @Nullable ClassSE<?>[] classes, @Nullable SetSE<ClassSE<? extends ApplicationContextInitializer<?>>> contextInitializerClasses, @Nullable StringSE[] 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, @Nullable StringSE[] locations, @Nullable ClassSE<?>[] classes, @Nullable SetSE<ClassSE<? extends ApplicationContextInitializer<?>>> contextInitializerClasses, @Nullable StringSE[] activeProfiles, @Nullable StringSE[] propertySourceLocations, @Nullable StringSE[] 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, @Nullable StringSE[] locations, @Nullable ClassSE<?>[] classes, @Nullable SetSE<ClassSE<? extends ApplicationContextInitializer<?>>> contextInitializerClasses, @Nullable StringSE[] activeProfiles, @Nullable StringSE[] propertySourceLocations, @Nullable StringSE[] 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, @Nullable StringSE[] locations, @Nullable ClassSE<?>[] classes, @Nullable SetSE<ClassSE<? extends ApplicationContextInitializer<?>>> contextInitializerClasses, @Nullable StringSE[] activeProfiles, ListSE<PropertySourceDescriptor> propertySourceDescriptors, @Nullable StringSE[] 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
テストクラスのApplicationContext構成ファイルのマージされたリソースの場所を取得します。コンテキストリソースの場所は、通常、XML 構成ファイルまたは Groovy スクリプトを表します。
getClasses
テストクラスのマージされたアノテーション付きクラスを取得します。hasLocations
public boolean hasLocations()このMergedContextConfigurationインスタンスにパスベースのコンテキストリソースの場所があるかどうかを確認します。- 戻り値:
-
locations配列が空でない場合はtrue - 導入:
- 4.0.4
- 関連事項:
hasClasses
public boolean hasClasses()このMergedContextConfigurationインスタンスにクラスベースのリソースがあるかどうかを確認します。- 戻り値:
-
classes配列が空でない場合はtrue - 導入:
- 4.0.4
- 関連事項:
hasResources
public boolean hasResources()このMergedContextConfigurationインスタンスにパスベースのコンテキストリソースの場所またはクラスベースのリソースがあるかどうかを確認します。getContextInitializerClasses
テストクラスのマージされたApplicationContextInitializerクラスを取得します。getActiveProfiles
テストクラスのマージされたアクティブな Bean 定義プロファイルを取得します。- 関連事項:
getPropertySourceDescriptors
テストクラスのテストPropertySourcesのリソースの場所のマージされた記述子を取得します。プロパティは
EnvironmentのPropertySourcesのセットに読み込まれます。getPropertySourceLocations
使用すべきではありません。6.1 以降、getPropertySourceDescriptors()を推奨テストクラスのプロパティファイルのマージされたリソースの場所を取得します。getPropertySourceProperties
テストクラスのマージされたインラインプロパティを取得します。プロパティは
EnvironmentのPropertySourcesのセットに読み込まれます。getContextCustomizers
アプリケーションコンテキストが読み込まれたときに適用される、マージされたContextCustomizersを取得します。getContextLoader
テストクラスの解決されたContextLoaderを取得します。getParent
コンテキスト階層内の親アプリケーションコンテキストのMergedContextConfigurationを取得します。- 戻り値:
- 親構成、または親がない場合は
null - 導入:
- 3.2.2
- 関連事項:
getParentApplicationContext
このMergedContextConfigurationによって定義されたコンテキストの親ApplicationContextをコンテキストキャッシュから取得します。親コンテキストがまだ読み込まれていない場合は、読み込まれ、キャッシュに格納されてから返されます。
- 戻り値:
- 親がない場合は、親
ApplicationContextまたはnull - 導入:
- 3.2.2
- 関連事項:
equals
両方のオブジェクトの位置、アノテーション付きクラス、コンテキスト初期化クラス、アクティブなプロファイル、プロパティソース記述子、プロパティソースプロパティ、コンテキストカスタマイザ、親、およびContextLoadersの完全修飾名を比較することにより、指定されたオブジェクトがこのMergedContextConfigurationインスタンスと等しいかどうかを判断します。hashCode
public int hashCode()テストクラスを除く、このMergedContextConfigurationのすべてのプロパティに対して一意のハッシュコードを生成します。toString
テストクラス、場所、アノテーション付きクラス、コンテキスト初期化クラス、アクティブなプロファイル、プロパティソース記述子、プロパティソースプロパティ、コンテキストカスタマイザー、ContextLoaderの名前、親構成の文字列表現を提供します。processStrings
nullSafeClassName
MergedContextConfiguration(Class, String[], Class[], Set, String[], List, String[], Set, ContextLoader, CacheAwareContextLoaderDelegate, MergedContextConfiguration)を推奨