Tabnine Logo
MergedContextConfiguration.getActiveProfiles
Code IndexAdd Tabnine to your IDE (free)

How to use
getActiveProfiles
method
in
org.springframework.test.context.MergedContextConfiguration

Best Java code snippets using org.springframework.test.context.MergedContextConfiguration.getActiveProfiles (Showing top 10 results out of 315)

origin: spring-projects/spring-framework

context.getEnvironment().setActiveProfiles(mergedConfig.getActiveProfiles());
TestPropertySourceUtils.addPropertiesFilesToEnvironment(context, mergedConfig.getPropertySourceLocations());
TestPropertySourceUtils.addInlinedPropertiesToEnvironment(context, mergedConfig.getPropertySourceProperties());
origin: spring-projects/spring-framework

void assertMergedConfig(
    MergedContextConfiguration mergedConfig,
    Class<?> expectedTestClass,
    String[] expectedLocations,
    Class<?>[] expectedClasses,
    Set<Class<? extends ApplicationContextInitializer<?>>> expectedInitializerClasses,
    Class<? extends ContextLoader> expectedContextLoaderClass) {
  assertNotNull(mergedConfig);
  assertEquals(expectedTestClass, mergedConfig.getTestClass());
  assertNotNull(mergedConfig.getLocations());
  assertArrayEquals(expectedLocations, mergedConfig.getLocations());
  assertNotNull(mergedConfig.getClasses());
  assertArrayEquals(expectedClasses, mergedConfig.getClasses());
  assertNotNull(mergedConfig.getActiveProfiles());
  if (expectedContextLoaderClass == null) {
    assertNull(mergedConfig.getContextLoader());
  }
  else {
    assertEquals(expectedContextLoaderClass, mergedConfig.getContextLoader().getClass());
  }
  assertNotNull(mergedConfig.getContextInitializerClasses());
  assertEquals(expectedInitializerClasses, mergedConfig.getContextInitializerClasses());
}
origin: webx/citrus

public final ConfigurableApplicationContext loadContext(MergedContextConfiguration mergedConfig) throws Exception {
  if (log.isDebugEnabled()) {
    log.debug("Loading ApplicationContext for merged context configuration [" + mergedConfig + "].");
  }
  ResourceLoadingXmlApplicationContext context = new ResourceLoadingXmlApplicationContext(mergedConfig.getLocations(), testResourceLoader, false);
  context.getEnvironment().setActiveProfiles(mergedConfig.getActiveProfiles());
  prepareContext(context);
  context.refresh();
  context.registerShutdownHook();
  return context;
}
origin: webx/citrus

public final ConfigurableApplicationContext loadContext(MergedContextConfiguration mergedConfig) throws Exception {
  if (log.isDebugEnabled()) {
    log.debug("Loading ApplicationContext for merged context configuration [" + mergedConfig + "].");
  }
  ResourceLoadingXmlApplicationContext context = new ResourceLoadingXmlApplicationContext(mergedConfig.getLocations(), testResourceLoader, false);
  context.getEnvironment().setActiveProfiles(mergedConfig.getActiveProfiles());
  prepareContext(context);
  context.refresh();
  context.registerShutdownHook();
  return context;
}
origin: org.tinygroup/org.tinygroup.tinyspringtest431

public TinyMergedContextConfiguration(ContextLoader contextLoader,
                   CacheAwareContextLoaderDelegate contextLoaderDelegate,
                   MergedContextConfiguration mergedContextConfiguration,
                   MergedContextConfiguration parentConfiguration) {
  super(mergedContextConfiguration.getTestClass(),
      mergedContextConfiguration.getLocations(),
      mergedContextConfiguration.getClasses(),
      mergedContextConfiguration.getActiveProfiles(), contextLoader);
  this.mergedContextConfiguration = mergedContextConfiguration;
  this.contextLoaderDelegate = contextLoaderDelegate;
  this.parentConfiguration = parentConfiguration;
}
origin: com.springsource.insight/insight-idk

public ApplicationContext loadContext(MergedContextConfiguration mergedConfig) throws Exception {
  if (logger.isDebugEnabled()) {
    logger.debug("Loading ApplicationContext for merged context configuration [" + mergedConfig + "].");
  }
  GenericWebApplicationContext context = new GenericWebApplicationContext();
  ConfigurableEnvironment         environment = context.getEnvironment(); 
  environment.setActiveProfiles(mergedConfig.getActiveProfiles());
  return loadContext(context, mergedConfig.getLocations());
}
origin: org.springframework.boot/spring-boot-test

application.getSources().addAll(Arrays.asList(configLocations));
ConfigurableEnvironment environment = getEnvironment();
if (!ObjectUtils.isEmpty(config.getActiveProfiles())) {
  setActiveProfiles(environment, config.getActiveProfiles());
origin: org.springframework.boot/spring-boot-test

/**
 * Create a new {@link MergedContextConfiguration} with different classes and
 * properties.
 * @param mergedConfig the source config
 * @param classes the replacement classes
 * @param propertySourceProperties the replacement properties
 * @return a new {@link MergedContextConfiguration}
 */
protected final MergedContextConfiguration createModifiedConfig(
    MergedContextConfiguration mergedConfig, Class<?>[] classes,
    String[] propertySourceProperties) {
  return new MergedContextConfiguration(mergedConfig.getTestClass(),
      mergedConfig.getLocations(), classes,
      mergedConfig.getContextInitializerClasses(),
      mergedConfig.getActiveProfiles(),
      mergedConfig.getPropertySourceLocations(), propertySourceProperties,
      mergedConfig.getContextCustomizers(), mergedConfig.getContextLoader(),
      getCacheAwareContextLoaderDelegate(), mergedConfig.getParent());
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.spring-test

context.getEnvironment().setActiveProfiles(mergedConfig.getActiveProfiles());
TestPropertySourceUtils.addPropertiesFilesToEnvironment(context, mergedConfig.getPropertySourceLocations());
TestPropertySourceUtils.addInlinedPropertiesToEnvironment(context, mergedConfig.getPropertySourceProperties());
origin: apache/servicemix-bundles

context.getEnvironment().setActiveProfiles(mergedConfig.getActiveProfiles());
TestPropertySourceUtils.addPropertiesFilesToEnvironment(context, mergedConfig.getPropertySourceLocations());
TestPropertySourceUtils.addInlinedPropertiesToEnvironment(context, mergedConfig.getPropertySourceProperties());
org.springframework.test.contextMergedContextConfigurationgetActiveProfiles

Javadoc

Get the merged active bean definition profiles for the #getTestClass().

Popular methods of MergedContextConfiguration

  • getLocations
    Get the merged resource locations for ApplicationContextconfiguration files for the #getTestClass().
  • getTestClass
    Get the Class associated with this MergedContextConfiguration.
  • getClasses
    Get the merged annotated classes for the #getTestClass().
  • getContextLoader
    Get the resolved ContextLoader for the #getTestClass().
  • <init>
    Create a new MergedContextConfiguration instance by copying all fields from the supplied MergedConte
  • getParent
    Get the MergedContextConfiguration for the parent application context in a context hierarchy.
  • getParentApplicationContext
    Get the parent ApplicationContext for the context defined by this MergedContextConfiguration from th
  • getContextInitializerClasses
    Get the merged ApplicationContextInitializer classes for the #getTestClass().
  • getPropertySourceProperties
    Get the merged test PropertySource properties for the #getTestClass().Properties will be loaded into
  • hasLocations
    Determine if this MergedContextConfiguration instance has path-based context resource locations.
  • getContextCustomizers
    Get the merged ContextCustomizer that will be applied when the application context is loaded.
  • getPropertySourceLocations
    Get the merged resource locations for test PropertySourcesfor the #getTestClass().
  • getContextCustomizers,
  • getPropertySourceLocations,
  • hasClasses,
  • hashCode,
  • equals,
  • nullSafeClassName,
  • processActiveProfiles,
  • processClasses,
  • processContextCustomizers

Popular in Java

  • Creating JSON documents from java classes using gson
  • setRequestProperty (URLConnection)
  • getApplicationContext (Context)
  • getResourceAsStream (ClassLoader)
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • ArrayList (java.util)
    ArrayList is an implementation of List, backed by an array. All optional operations including adding
  • NoSuchElementException (java.util)
    Thrown when trying to retrieve an element past the end of an Enumeration or Iterator.
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • Top 17 Free Sublime Text Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now