Examples of addActiveProfile()


Examples of org.springframework.core.env.ConfigurableEnvironment.addActiveProfile()

  private static AnnotationConfigApplicationContext context = null;

  public static void initialize() throws IOException {
    context = new AnnotationConfigApplicationContext();
    ConfigurableEnvironment environment = context.getEnvironment();
    environment.addActiveProfile("cryson_logging");
    PropertyPlaceholderConfigurer configurer = new PropertyPlaceholderConfigurer();
    configurer.setLocations(new Resource[]{context.getResource("advancedcrysondiary.properties"), context.getResource("cryson.properties")});
    context.addBeanFactoryPostProcessor(configurer);
    context.scan(Spring.class.getPackage().getName(), CrysonServer.class.getPackage().getName());
    context.refresh();
View Full Code Here

Examples of org.springframework.core.env.ConfigurableEnvironment.addActiveProfile()

  }

  private static void configureProfiles() {
    ConfigurableEnvironment environment = context.getEnvironment();
    if ("true".equals(getProperty("cryson.httpserver.enabled"))) {
      environment.addActiveProfile("cryson_httpserver");
    }
    if ("true".equals(getProperty("cryson.database.enabled"))) {
      environment.addActiveProfile("cryson_database");
    }
    if ("true".equals(getProperty("cryson.security.enabled"))) {
View Full Code Here

Examples of org.springframework.core.env.ConfigurableEnvironment.addActiveProfile()

    ConfigurableEnvironment environment = context.getEnvironment();
    if ("true".equals(getProperty("cryson.httpserver.enabled"))) {
      environment.addActiveProfile("cryson_httpserver");
    }
    if ("true".equals(getProperty("cryson.database.enabled"))) {
      environment.addActiveProfile("cryson_database");
    }
    if ("true".equals(getProperty("cryson.security.enabled"))) {
      environment.addActiveProfile("cryson_security");
    }
    if ("true".equals(getProperty("cryson.logging.enabled"))) {
View Full Code Here

Examples of org.springframework.core.env.ConfigurableEnvironment.addActiveProfile()

    }
    if ("true".equals(getProperty("cryson.database.enabled"))) {
      environment.addActiveProfile("cryson_database");
    }
    if ("true".equals(getProperty("cryson.security.enabled"))) {
      environment.addActiveProfile("cryson_security");
    }
    if ("true".equals(getProperty("cryson.logging.enabled"))) {
      environment.addActiveProfile("cryson_logging");
    }
  }
View Full Code Here

Examples of org.springframework.core.env.ConfigurableEnvironment.addActiveProfile()

    }
    if ("true".equals(getProperty("cryson.security.enabled"))) {
      environment.addActiveProfile("cryson_security");
    }
    if ("true".equals(getProperty("cryson.logging.enabled"))) {
      environment.addActiveProfile("cryson_logging");
    }
  }

  public static String getProperty(String propertyName) {
    if (properties == null) {
View Full Code Here

Examples of org.springframework.core.env.StandardEnvironment.addActiveProfile()

  @Test @Ignore
  public void testAdminFailsWithMismatchedQueue() throws Exception {
    ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext();
    context.setConfigLocation("org/springframework/amqp/rabbit/config/MismatchedQueueDeclarationTests-context.xml");
    StandardEnvironment env = new StandardEnvironment();
    env.addActiveProfile("basicAdmin");
    env.addActiveProfile("basic");
    context.setEnvironment(env);
    context.refresh();
    context.getBean(CachingConnectionFactory.class).createConnection();
    context.destroy();
View Full Code Here

Examples of org.springframework.core.env.StandardEnvironment.addActiveProfile()

  public void testAdminFailsWithMismatchedQueue() throws Exception {
    ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext();
    context.setConfigLocation("org/springframework/amqp/rabbit/config/MismatchedQueueDeclarationTests-context.xml");
    StandardEnvironment env = new StandardEnvironment();
    env.addActiveProfile("basicAdmin");
    env.addActiveProfile("basic");
    context.setEnvironment(env);
    context.refresh();
    context.getBean(CachingConnectionFactory.class).createConnection();
    context.destroy();
    Channel channel = this.connectionFactory.createConnection().createChannel(false);
View Full Code Here

Examples of org.springframework.core.env.StandardEnvironment.addActiveProfile()

    this.admin.deleteQueue("mismatch.bar");
    assertNotNull(this.admin.getQueueProperties("mismatch.foo"));
    assertNull(this.admin.getQueueProperties("mismatch.bar"));

    env = new StandardEnvironment();
    env.addActiveProfile("basicAdmin");
    env.addActiveProfile("ttl");
    context.setEnvironment(env);
    context.refresh();
    channel = this.connectionFactory.createConnection().createChannel(false);
    try {
View Full Code Here

Examples of org.springframework.core.env.StandardEnvironment.addActiveProfile()

    assertNotNull(this.admin.getQueueProperties("mismatch.foo"));
    assertNull(this.admin.getQueueProperties("mismatch.bar"));

    env = new StandardEnvironment();
    env.addActiveProfile("basicAdmin");
    env.addActiveProfile("ttl");
    context.setEnvironment(env);
    context.refresh();
    channel = this.connectionFactory.createConnection().createChannel(false);
    try {
      context.getBean(CachingConnectionFactory.class).createConnection();
View Full Code Here

Examples of org.springframework.core.env.StandardEnvironment.addActiveProfile()

  @Test
  public void testAdminSkipsMismatchedQueue() throws Exception {
    ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext();
    context.setConfigLocation("org/springframework/amqp/rabbit/config/MismatchedQueueDeclarationTests-context.xml");
    StandardEnvironment env = new StandardEnvironment();
    env.addActiveProfile("advancedAdmin");
    env.addActiveProfile("basic");
    context.setEnvironment(env);
    context.refresh();
    context.getBean(CachingConnectionFactory.class).createConnection();
    context.destroy();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.