类 MergedContextConfiguration

java.lang.Object
cn.taketoday.test.context.MergedContextConfiguration
所有已实现的接口:
Serializable
直接已知子类:
AotMergedContextConfiguration, ReactiveWebMergedContextConfiguration, WebMergedContextConfiguration

public class MergedContextConfiguration extends Object implements Serializable
MergedContextConfiguration encapsulates the merged context configuration declared on a test class and all of its superclasses via @ContextConfiguration, @ActiveProfiles, and @TestPropertySource.

Merged context resource locations, annotated classes, active profiles, property resource locations, and in-lined properties represent all declared values in the test class hierarchy taking into consideration the semantics of the ContextConfiguration.inheritLocations(), ActiveProfiles.inheritProfiles(), TestPropertySource.inheritLocations(), and TestPropertySource.inheritProperties() flags.

A SmartContextLoader uses MergedContextConfiguration to load an ApplicationContext.

MergedContextConfiguration is also used by the ContextCache as the key for caching an ApplicationContext that was loaded using properties of this MergedContextConfiguration.

从以下版本开始:
4.0
作者:
Sam Brannen, Phillip Webb, Harry Yang
另请参阅:
  • 字段详细资料

    • serialVersionUID

      private static final long serialVersionUID
      另请参阅:
    • EMPTY_STRING_ARRAY

      private static final String[] EMPTY_STRING_ARRAY
    • EMPTY_CLASS_ARRAY

      private static final Class<?>[] EMPTY_CLASS_ARRAY
    • EMPTY_INITIALIZER_CLASSES

      private static final Set<Class<? extends cn.taketoday.context.ApplicationContextInitializer>> EMPTY_INITIALIZER_CLASSES
    • EMPTY_CONTEXT_CUSTOMIZERS

      private static final Set<ContextCustomizer> EMPTY_CONTEXT_CUSTOMIZERS
    • testClass

      private final Class<?> testClass
    • locations

      private final String[] locations
    • classes

      private final Class<?>[] classes
    • contextInitializerClasses

      private final Set<Class<? extends cn.taketoday.context.ApplicationContextInitializer>> contextInitializerClasses
    • activeProfiles

      private final String[] activeProfiles
    • propertySourceDescriptors

      private final List<cn.taketoday.core.io.PropertySourceDescriptor> propertySourceDescriptors
    • propertySourceLocations

      private final String[] propertySourceLocations
    • propertySourceProperties

      private final String[] propertySourceProperties
    • contextCustomizers

      private final Set<ContextCustomizer> contextCustomizers
    • contextLoader

      @Nullable private final ContextLoader contextLoader
    • cacheAwareContextLoaderDelegate

      @Nullable private final CacheAwareContextLoaderDelegate cacheAwareContextLoaderDelegate
    • parent

      @Nullable private final MergedContextConfiguration parent
  • 构造器详细资料

    • MergedContextConfiguration

      public MergedContextConfiguration(Class<?> testClass, @Nullable String[] locations, @Nullable Class<?>[] classes, @Nullable String[] activeProfiles, ContextLoader contextLoader)
      Create a new MergedContextConfiguration instance for the supplied parameters.
      参数:
      testClass - the test class for which the configuration was merged
      locations - the merged context resource locations
      classes - the merged annotated classes
      activeProfiles - the merged active bean definition profiles
      contextLoader - the resolved ContextLoader
    • MergedContextConfiguration

      public MergedContextConfiguration(Class<?> testClass, @Nullable String[] locations, @Nullable Class<?>[] classes, @Nullable Set<Class<? extends cn.taketoday.context.ApplicationContextInitializer>> contextInitializerClasses, @Nullable String[] activeProfiles, ContextLoader contextLoader)
      Create a new MergedContextConfiguration instance for the supplied parameters.
      参数:
      testClass - the test class for which the configuration was merged
      locations - the merged context resource locations
      classes - the merged annotated classes
      contextInitializerClasses - the merged context initializer classes
      activeProfiles - the merged active bean definition profiles
      contextLoader - the resolved ContextLoader
    • MergedContextConfiguration

      public MergedContextConfiguration(Class<?> testClass, @Nullable String[] locations, @Nullable Class<?>[] classes, @Nullable Set<Class<? extends cn.taketoday.context.ApplicationContextInitializer>> contextInitializerClasses, @Nullable String[] activeProfiles, ContextLoader contextLoader, @Nullable CacheAwareContextLoaderDelegate cacheAwareContextLoaderDelegate, @Nullable MergedContextConfiguration parent)
      Create a new MergedContextConfiguration instance for the supplied parameters.
      参数:
      testClass - the test class for which the configuration was merged
      locations - the merged context resource locations
      classes - the merged annotated classes
      contextInitializerClasses - the merged context initializer classes
      activeProfiles - the merged active bean definition profiles
      contextLoader - the resolved ContextLoader
      cacheAwareContextLoaderDelegate - a cache-aware context loader delegate with which to retrieve the parent ApplicationContext
      parent - the parent configuration or null if there is no parent
    • MergedContextConfiguration

      public MergedContextConfiguration(MergedContextConfiguration mergedConfig)
      Create a new MergedContextConfiguration instance by copying all fields from the supplied MergedContextConfiguration.
    • MergedContextConfiguration

      public MergedContextConfiguration(Class<?> testClass, @Nullable String[] locations, @Nullable Class<?>[] classes, @Nullable Set<Class<? extends cn.taketoday.context.ApplicationContextInitializer>> contextInitializerClasses, @Nullable String[] activeProfiles, @Nullable String[] propertySourceLocations, @Nullable String[] propertySourceProperties, ContextLoader contextLoader, @Nullable CacheAwareContextLoaderDelegate cacheAwareContextLoaderDelegate, @Nullable MergedContextConfiguration parent)
      Create a new MergedContextConfiguration instance for the supplied parameters.

      If a null value is supplied for locations, classes, activeProfiles, propertySourceLocations, or propertySourceProperties an empty array will be stored instead. If a null value is supplied for the contextInitializerClasses an empty set will be stored instead. Furthermore, active profiles will be sorted, and duplicate profiles will be removed.

      参数:
      testClass - the test class for which the configuration was merged
      locations - the merged context resource locations
      classes - the merged annotated classes
      contextInitializerClasses - the merged context initializer classes
      activeProfiles - the merged active bean definition profiles
      propertySourceLocations - the merged PropertySource locations
      propertySourceProperties - the merged PropertySource properties
      contextLoader - the resolved ContextLoader
      cacheAwareContextLoaderDelegate - a cache-aware context loader delegate with which to retrieve the parent ApplicationContext
      parent - the parent configuration or null if there is no parent
    • MergedContextConfiguration

      public MergedContextConfiguration(Class<?> testClass, @Nullable String[] locations, @Nullable Class<?>[] classes, @Nullable Set<Class<? extends cn.taketoday.context.ApplicationContextInitializer>> contextInitializerClasses, @Nullable String[] activeProfiles, @Nullable String[] propertySourceLocations, @Nullable String[] propertySourceProperties, @Nullable Set<ContextCustomizer> contextCustomizers, ContextLoader contextLoader, @Nullable CacheAwareContextLoaderDelegate cacheAwareContextLoaderDelegate, @Nullable MergedContextConfiguration parent)
      Create a new MergedContextConfiguration instance for the supplied parameters.

      If a null value is supplied for locations, classes, activeProfiles, propertySourceLocations, or propertySourceProperties an empty array will be stored instead. If a null value is supplied for contextInitializerClasses or contextCustomizers, an empty set will be stored instead. Furthermore, active profiles will be sorted, and duplicate profiles will be removed.

      参数:
      testClass - the test class for which the configuration was merged
      locations - the merged context resource locations
      classes - the merged annotated classes
      contextInitializerClasses - the merged context initializer classes
      activeProfiles - the merged active bean definition profiles
      propertySourceLocations - the merged PropertySource locations
      propertySourceProperties - the merged PropertySource properties
      contextCustomizers - the context customizers
      contextLoader - the resolved ContextLoader
      cacheAwareContextLoaderDelegate - a cache-aware context loader delegate with which to retrieve the parent ApplicationContext
      parent - the parent configuration or null if there is no parent
    • MergedContextConfiguration

      public MergedContextConfiguration(Class<?> testClass, @Nullable String[] locations, @Nullable Class<?>[] classes, @Nullable Set<Class<? extends cn.taketoday.context.ApplicationContextInitializer>> contextInitializerClasses, @Nullable String[] activeProfiles, List<cn.taketoday.core.io.PropertySourceDescriptor> propertySourceDescriptors, @Nullable String[] propertySourceProperties, @Nullable Set<ContextCustomizer> contextCustomizers, @Nullable ContextLoader contextLoader, @Nullable CacheAwareContextLoaderDelegate cacheAwareContextLoaderDelegate, @Nullable MergedContextConfiguration parent)
      Create a new MergedContextConfiguration instance for the supplied parameters.

      If a null value is supplied for locations, classes, activeProfiles, or propertySourceProperties an empty array will be stored instead. If a null value is supplied for contextInitializerClasses or contextCustomizers, an empty set will be stored instead. Furthermore, active profiles will be sorted, and duplicate profiles will be removed.

      参数:
      testClass - the test class for which the configuration was merged
      locations - the merged context resource locations
      classes - the merged annotated classes
      contextInitializerClasses - the merged context initializer classes
      activeProfiles - the merged active bean definition profiles
      propertySourceDescriptors - the merged property source descriptors
      propertySourceProperties - the merged inlined properties
      contextCustomizers - the context customizers
      contextLoader - the resolved ContextLoader
      cacheAwareContextLoaderDelegate - a cache-aware context loader delegate with which to retrieve the parent ApplicationContext
      parent - the parent configuration or null if there is no parent
  • 方法详细资料