クラス 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
インスタンスにクラスベースのリソースがあるかどうかを確認します。int
hashCode()
テストクラスを除く、このMergedContextConfiguration
のすべてのプロパティに対して一意のハッシュコードを生成します。boolean
このMergedContextConfiguration
インスタンスにパスベースのコンテキストリソースの場所があるかどうかを確認します。boolean
このMergedContextConfiguration
インスタンスにパスベースのコンテキストリソースの場所またはクラスベースのリソースがあるかどうかを確認します。protected static StringSE
nullSafeClassName
(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
- 解決されたContextLoader
cacheAwareContextLoaderDelegate
- 親コンテキストを取得するためのキャッシュ対応コンテキストローダーデリゲート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
- 解決されたContextLoader
cacheAwareContextLoaderDelegate
- 親コンテキストを取得するためのキャッシュ対応コンテキストローダーデリゲート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
- 解決されたContextLoader
cacheAwareContextLoaderDelegate
- 親コンテキストを取得するためのキャッシュ対応コンテキストローダーデリゲート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