Class ContextConfigurationAttributes

java.lang.Object
org.springframework.test.context.ContextConfigurationAttributes

public class ContextConfigurationAttributes extends Object
ContextConfigurationAttributes encapsulates the context configuration attributes declared via @ContextConfiguration.
Since:
3.1
Author:
Sam Brannen, Phillip Webb
See Also:
  • Constructor Details

    • ContextConfigurationAttributes

      public ContextConfigurationAttributes(Class<?> declaringClass)
      Construct a new ContextConfigurationAttributes instance with default values.
      Parameters:
      declaringClass - the test class that declared @ContextConfiguration, either explicitly or implicitly
      Since:
      4.3
    • ContextConfigurationAttributes

      public ContextConfigurationAttributes(Class<?> declaringClass, ContextConfiguration contextConfiguration)
      Construct a new ContextConfigurationAttributes instance for the supplied @ContextConfiguration annotation and the test class that declared it.
      Parameters:
      declaringClass - the test class that declared @ContextConfiguration
      contextConfiguration - the annotation from which to retrieve the attributes
    • ContextConfigurationAttributes

      public ContextConfigurationAttributes(Class<?> declaringClass, AnnotationAttributes annAttrs)
      Construct a new ContextConfigurationAttributes instance for the supplied AnnotationAttributes (parsed from a @ContextConfiguration annotation) and the test class that declared them.
      Parameters:
      declaringClass - the test class that declared @ContextConfiguration
      annAttrs - the annotation attributes from which to retrieve the attributes
    • ContextConfigurationAttributes

      public ContextConfigurationAttributes(Class<?> declaringClass, String[] locations, Class<?>[] classes, boolean inheritLocations, Class<? extends ApplicationContextInitializer<?>>[] initializers, boolean inheritInitializers, Class<? extends ContextLoader> contextLoaderClass)
      Construct a new ContextConfigurationAttributes instance for the test class that declared the @ContextConfiguration annotation and its corresponding attributes.
      Parameters:
      declaringClass - the test class that declared @ContextConfiguration
      locations - the resource locations declared via @ContextConfiguration
      classes - the annotated classes declared via @ContextConfiguration
      inheritLocations - the inheritLocations flag declared via @ContextConfiguration
      initializers - the context initializers declared via @ContextConfiguration
      inheritInitializers - the inheritInitializers flag declared via @ContextConfiguration
      contextLoaderClass - the ContextLoader class declared via @ContextConfiguration
      Throws:
      IllegalArgumentException - if the declaringClass or contextLoaderClass is null
    • ContextConfigurationAttributes

      public ContextConfigurationAttributes(Class<?> declaringClass, String[] locations, Class<?>[] classes, boolean inheritLocations, Class<? extends ApplicationContextInitializer<?>>[] initializers, boolean inheritInitializers, @Nullable String name, Class<? extends ContextLoader> contextLoaderClass)
      Construct a new ContextConfigurationAttributes instance for the test class that declared the @ContextConfiguration annotation and its corresponding attributes.
      Parameters:
      declaringClass - the test class that declared @ContextConfiguration
      locations - the resource locations declared via @ContextConfiguration
      classes - the annotated classes declared via @ContextConfiguration
      inheritLocations - the inheritLocations flag declared via @ContextConfiguration
      initializers - the context initializers declared via @ContextConfiguration
      inheritInitializers - the inheritInitializers flag declared via @ContextConfiguration
      name - the name of level in the context hierarchy, or null if not applicable
      contextLoaderClass - the ContextLoader class declared via @ContextConfiguration
      Throws:
      IllegalArgumentException - if the declaringClass or contextLoaderClass is null
  • Method Details