public class MergedContextConfiguration extends ObjectSE implements SerializableSE
MergedContextConfiguration は、@ContextConfiguration、@ActiveProfiles、@TestPropertySource を介して、テストクラスおよびそのすべてのスーパークラスで宣言されたマージされたコンテキスト構成をカプセル化します。 マージされたコンテキストリソースの場所、アノテーション付きクラス、アクティブプロファイル、プロパティリソースの場所、インラインプロパティは、ContextConfiguration.inheritLocations()、ActiveProfiles.inheritProfiles()、TestPropertySource.inheritLocations()、TestPropertySource.inheritProperties() フラグのセマンティクスを考慮して、テストクラス階層で宣言されたすべての値を表します。
SmartContextLoader は MergedContextConfiguration を使用して ApplicationContext をロードします。
MergedContextConfiguration は、この MergedContextConfiguration のプロパティを使用してロードされた ApplicationContext をキャッシュするためのキーとして、ContextCache によっても使用されます。
ContextConfiguration, ContextHierarchy, ActiveProfiles, TestPropertySource, ContextConfigurationAttributes, SmartContextLoader.loadContext(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(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, StringSE[] propertySourceLocations, StringSE[] propertySourceProperties, SetSE<ContextCustomizer> contextCustomizers, ContextLoader contextLoader, CacheAwareContextLoaderDelegate cacheAwareContextLoaderDelegate, MergedContextConfiguration parent) 指定されたパラメーターの新しい MergedContextConfiguration インスタンスを作成します。 |
MergedContextConfiguration(ClassSE<?> testClass, StringSE[] locations, ClassSE<?>[] classes, StringSE[] activeProfiles, ContextLoader contextLoader) 指定されたパラメーターの新しい MergedContextConfiguration インスタンスを作成します。 |
MergedContextConfiguration(MergedContextConfiguration mergedConfig) 提供された MergedContextConfiguration からすべてのフィールドをコピーして、新しい MergedContextConfiguration インスタンスを作成します。 |
| 修飾子と型 | メソッドと説明 |
|---|---|
boolean | equals(ObjectSE other) オブジェクトの場所、アノテーション付きクラス、コンテキスト初期化クラス、アクティブプロファイル、プロパティソースの場所、プロパティソースのプロパティ、親、および ContextLoaders の完全修飾名の両方を比較して、提供されたオブジェクトがこの MergedContextConfiguration インスタンスと等しいかどうかを判断します。 |
StringSE[] | getActiveProfiles() テストクラスのマージされたアクティブな Bean 定義プロファイルを取得します。 |
ClassSE<?>[] | getClasses() テストクラスのマージされたアノテーション付きクラスを取得します。 |
SetSE<ContextCustomizer> | getContextCustomizers() アプリケーションコンテキストが読み込まれたときに適用される、マージされた ContextCustomizers を取得します。 |
SetSE<ClassSE<? extends ApplicationContextInitializer<?>>> | getContextInitializerClasses() テストクラスのマージされた ApplicationContextInitializer クラスを取得します。 |
ContextLoader | getContextLoader() テストクラスの解決された ContextLoader を取得します。 |
StringSE[] | getLocations() テストクラスの ApplicationContext 構成ファイルのマージされたリソースの場所を取得します。 |
MergedContextConfiguration | getParent() コンテキスト階層内の親アプリケーションコンテキストの MergedContextConfiguration を取得します。 |
ApplicationContext | getParentApplicationContext() この MergedContextConfiguration によって定義されたコンテキストの親 ApplicationContext をコンテキストキャッシュから取得します。 |
StringSE[] | getPropertySourceLocations() テストクラスのテスト PropertySources のマージされたリソースの場所を取得します。 |
StringSE[] | getPropertySourceProperties() テストクラスのマージされたテスト PropertySource プロパティを取得します。 |
ClassSE<?> | getTestClass() この MergedContextConfiguration に関連付けられているテストクラスSEを取得します。 |
boolean | hasClasses() この MergedContextConfiguration インスタンスにクラスベースのリソースがあるかどうかを確認します。 |
int | hashCode() テストクラスを除く、この MergedContextConfiguration のすべてのプロパティに対して一意のハッシュコードを生成します。 |
boolean | hasLocations() この MergedContextConfiguration インスタンスにパスベースのコンテキストリソースの場所があるかどうかを確認します。 |
boolean | hasResources() この MergedContextConfiguration インスタンスにパスベースのコンテキストリソースの場所またはクラスベースのリソースがあるかどうかを確認します。 |
protected static StringSE | nullSafeClassName(ContextLoader contextLoader) |
StringSE | toString() テストクラス、場所、アノテーション付きクラス、コンテキスト初期化子クラス、アクティブプロファイル、プロパティソースの場所、プロパティソースプロパティ、コンテキストカスタマイザ、 ContextLoader の名前、親構成の String 表現を提供します。 |
cloneSE, finalizeSE, getClassSE, notifySE, notifyAllSE, waitSE, waitSE, waitSEpublic MergedContextConfiguration(ClassSE<?> testClass, StringSE[] locations, ClassSE<?>[] classes, StringSE[] activeProfiles, ContextLoader contextLoader)
MergedContextConfiguration インスタンスを作成します。testClass - 構成がマージされたテストクラス locations - マージされたコンテキストリソースの場所 classes - マージされたアノテーション付きクラス activeProfiles - マージされたアクティブな Bean 定義プロファイル contextLoader - 解決された ContextLoaderpublic MergedContextConfiguration(ClassSE<?> testClass, StringSE[] locations, ClassSE<?>[] classes, @Nullable SetSE<ClassSE<? extends ApplicationContextInitializer<?>>> contextInitializerClasses, StringSE[] activeProfiles, ContextLoader contextLoader)
MergedContextConfiguration インスタンスを作成します。testClass - 構成がマージされたテストクラス locations - マージされたコンテキストリソースの場所 classes - マージされたアノテーション付きクラス contextInitializerClasses - マージされたコンテキスト初期化子クラス activeProfiles - マージされたアクティブな Bean 定義プロファイル contextLoader - 解決された ContextLoaderpublic MergedContextConfiguration(ClassSE<?> testClass, StringSE[] locations, ClassSE<?>[] classes, @Nullable SetSE<ClassSE<? extends ApplicationContextInitializer<?>>> contextInitializerClasses, StringSE[] activeProfiles, ContextLoader contextLoader, @Nullable CacheAwareContextLoaderDelegate cacheAwareContextLoaderDelegate, @Nullable MergedContextConfiguration parent)
MergedContextConfiguration インスタンスを作成します。testClass - 構成がマージされたテストクラス locations - マージされたコンテキストリソースの場所 classes - マージされたアノテーション付きクラス contextInitializerClasses - マージされたコンテキスト初期化子クラス activeProfiles - マージされたアクティブな Bean 定義プロファイル contextLoader - 解決された ContextLoadercacheAwareContextLoaderDelegate - 親コンテキストを取得するためのキャッシュ対応コンテキストローダーデリゲート parent - 親構成、または親がない場合は null public MergedContextConfiguration(MergedContextConfiguration mergedConfig)
MergedContextConfiguration からすべてのフィールドをコピーして、新しい 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 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 public ClassSE<?> getTestClass()
MergedContextConfiguration に関連付けられているテストクラスSEを取得します。public StringSE[] getLocations()
ApplicationContext 構成ファイルのマージされたリソースの場所を取得します。コンテキストリソースの場所は、通常、XML 構成ファイルまたは Groovy スクリプトを表します。
public boolean hasLocations()
MergedContextConfiguration インスタンスにパスベースのコンテキストリソースの場所があるかどうかを確認します。locations 配列が空でない場合は true hasResources(), hasClasses()public boolean hasClasses()
MergedContextConfiguration インスタンスにクラスベースのリソースがあるかどうかを確認します。classes 配列が空でない場合は true hasResources(), hasLocations()public boolean hasResources()
MergedContextConfiguration インスタンスにパスベースのコンテキストリソースの場所またはクラスベースのリソースがあるかどうかを確認します。locations または classes 配列が空でない場合は true hasLocations(), hasClasses()public SetSE<ClassSE<? extends ApplicationContextInitializer<?>>> getContextInitializerClasses()
ApplicationContextInitializer クラスを取得します。public StringSE[] getActiveProfiles()
ActiveProfilespublic StringSE[] getPropertySourceLocations()
PropertySources のマージされたリソースの場所を取得します。public StringSE[] getPropertySourceProperties()
public SetSE<ContextCustomizer> getContextCustomizers()
ContextCustomizers を取得します。public ContextLoader getContextLoader()
ContextLoader を取得します。@Nullable public MergedContextConfiguration getParent()
MergedContextConfiguration を取得します。null getParentApplicationContext()@Nullable public ApplicationContext getParentApplicationContext()
MergedContextConfiguration によって定義されたコンテキストの親 ApplicationContext をコンテキストキャッシュから取得します。親コンテキストがまだ読み込まれていない場合は、読み込まれ、キャッシュに格納されてから返されます。
ApplicationContext または null getParent()public boolean equals(@Nullable ObjectSE other)
ContextLoaders の完全修飾名の両方を比較して、提供されたオブジェクトがこの MergedContextConfiguration インスタンスと等しいかどうかを判断します。public int hashCode()
MergedContextConfiguration のすべてのプロパティに対して一意のハッシュコードを生成します。ObjectSE の hashCodeSE public StringSE toString()
ContextLoader の名前、親構成の String 表現を提供します。ObjectSE の toStringSE protected static StringSE nullSafeClassName(@Nullable ContextLoader contextLoader)