クラス 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インスタンスを作成します。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) 指定されたパラメーターの新しい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をコンテキストキャッシュから取得します。StringSE[]テストクラスのテストPropertySourcesのマージされたリソースの場所を取得します。StringSE[]テストクラスのマージされたテストPropertySourceプロパティを取得します。ClassSE<?>このMergedContextConfigurationに関連付けられているテストクラスSEを取得します。booleanこのMergedContextConfigurationインスタンスにクラスベースのリソースがあるかどうかを確認します。inthashCode()テストクラスを除く、このMergedContextConfigurationのすべてのプロパティに対して一意のハッシュコードを生成します。booleanこのMergedContextConfigurationインスタンスにパスベースのコンテキストリソースの場所があるかどうかを確認します。booleanこのMergedContextConfigurationインスタンスにパスベースのコンテキストリソースの場所またはクラスベースのリソースがあるかどうかを確認します。protected static StringSEnullSafeClassName(ContextLoader contextLoader) toString()テストクラス、場所、アノテーション付きクラス、コンテキスト初期化子クラス、アクティブプロファイル、プロパティソースの場所、プロパティソースプロパティ、コンテキストカスタマイザ、ContextLoaderの名前、親構成の String 表現を提供します。
コンストラクターの詳細
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- 親コンテキストを取得するためのキャッシュ対応コンテキストローダーデリゲートparent- 親構成、または親がない場合はnull- 導入:
- 3.2.2
MergedContextConfiguration
提供されたMergedContextConfigurationからすべてのフィールドをコピーして、新しいMergedContextConfigurationインスタンスを作成します。- 導入:
- 4.1
MergedContextConfiguration
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- 親コンテキストを取得するためのキャッシュ対応コンテキストローダーデリゲートparent- 親構成、または親がない場合はnull- 導入:
- 4.1
MergedContextConfiguration
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- 親コンテキストを取得するためのキャッシュ対応コンテキストローダーデリゲートparent- 親構成、または親がない場合はnull- 導入:
- 4.3
メソッドの詳細
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 定義プロファイルを取得します。- 関連事項:
getPropertySourceLocations
テストクラスのテストPropertySourcesのマージされたリソースの場所を取得します。getPropertySourceProperties
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の名前、親構成の String 表現を提供します。nullSafeClassName