Package liquibase.integration.spring

Examples of liquibase.integration.spring.SpringLiquibase$SpringResourceOpener


    }

    @Bean
    public SpringLiquibase liquibase(DataSource dataSource) {
        log.debug("Configuring Liquibase");
        SpringLiquibase liquibase = new SpringLiquibase();
        liquibase.setDataSource(dataSource);
        liquibase.setChangeLog("classpath:config/liquibase/master.xml");
        liquibase.setContexts("development, production");
        return liquibase;
    }
View Full Code Here


    setupTestData(new DriverManagerDataSource(nativeUrl, username, password));
  }

  public static void setupTestData(final DataSource dataSource) throws LiquibaseException {
    log.info("Setting up database for testing");
    SpringLiquibase liquibase = new SpringLiquibase();
    liquibase.setChangeLog("classpath:liquibase.xml");
    liquibase.setDataSource(dataSource);
    liquibase.setResourceLoader(new DefaultResourceLoader());
    liquibase.setDropFirst(true);
    liquibase.afterPropertiesSet();
  }
View Full Code Here

    }

    @Bean
    public SpringLiquibase liquibase(DataSource dataSource) {
        log.debug("Configuring Liquibase");
        SpringLiquibase liquibase = new SpringLiquibase();
        liquibase.setDataSource(dataSource);
        liquibase.setChangeLog("classpath:config/liquibase/master.xml");
        liquibase.setContexts("development, production");
        return liquibase;
    }
View Full Code Here

    @Autowired
    private DataSource dataSource;

    @Bean
    public SpringLiquibase liquibase() {
        SpringLiquibase liquibase = new SpringLiquibase();

        liquibase.setDataSource(dataSource);
        liquibase.setChangeLog(LIQUIBASE_CHANGELOG_FILE);
        liquibase.setContexts(LIQUIBASE_CONTEXT);

        return liquibase;
    }
View Full Code Here

          .getPackage().getName());
    }

    @Bean
    public SpringLiquibase liquibase() {
      SpringLiquibase liquibase = new SpringLiquibase();
      liquibase.setChangeLog(this.properties.getChangeLog());
      liquibase.setContexts(this.properties.getContexts());
      liquibase.setDataSource(getDataSource());
      liquibase.setDefaultSchema(this.properties.getDefaultSchema());
      liquibase.setDropFirst(this.properties.isDropFirst());
      liquibase.setShouldRun(this.properties.isEnabled());
      return liquibase;
    }
View Full Code Here

  public void testDefaultSpringLiquibase() throws Exception {
    this.context.register(EmbeddedDataSourceConfiguration.class,
        LiquibaseAutoConfiguration.class,
        PropertyPlaceholderAutoConfiguration.class);
    this.context.refresh();
    SpringLiquibase liquibase = this.context.getBean(SpringLiquibase.class);
    assertEquals("classpath:/db/changelog/db.changelog-master.yaml",
        liquibase.getChangeLog());
    assertNull(liquibase.getContexts());
    assertNull(liquibase.getDefaultSchema());
    assertFalse(liquibase.isDropFirst());
  }
View Full Code Here

        "liquibase.change-log:classpath:/db/changelog/db.changelog-override.xml");
    this.context.register(EmbeddedDataSourceConfiguration.class,
        LiquibaseAutoConfiguration.class,
        PropertyPlaceholderAutoConfiguration.class);
    this.context.refresh();
    SpringLiquibase liquibase = this.context.getBean(SpringLiquibase.class);
    assertEquals("classpath:/db/changelog/db.changelog-override.xml",
        liquibase.getChangeLog());
  }
View Full Code Here

        "liquibase.contexts:test, production");
    this.context.register(EmbeddedDataSourceConfiguration.class,
        LiquibaseAutoConfiguration.class,
        PropertyPlaceholderAutoConfiguration.class);
    this.context.refresh();
    SpringLiquibase liquibase = this.context.getBean(SpringLiquibase.class);
    assertEquals("test, production", liquibase.getContexts());
  }
View Full Code Here

        "liquibase.default-schema:public");
    this.context.register(EmbeddedDataSourceConfiguration.class,
        LiquibaseAutoConfiguration.class,
        PropertyPlaceholderAutoConfiguration.class);
    this.context.refresh();
    SpringLiquibase liquibase = this.context.getBean(SpringLiquibase.class);
    assertEquals("public", liquibase.getDefaultSchema());
  }
View Full Code Here

    EnvironmentTestUtils.addEnvironment(this.context, "liquibase.drop-first:true");
    this.context.register(EmbeddedDataSourceConfiguration.class,
        LiquibaseAutoConfiguration.class,
        PropertyPlaceholderAutoConfiguration.class);
    this.context.refresh();
    SpringLiquibase liquibase = this.context.getBean(SpringLiquibase.class);
    assertTrue(liquibase.isDropFirst());
  }
View Full Code Here

TOP

Related Classes of liquibase.integration.spring.SpringLiquibase$SpringResourceOpener

Copyright © 2018 www.massapicom. 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.