use of liquibase.resource.ClassLoaderResourceAccessor in project liquibase by liquibase.
the class BaseLiquibaseTask method createResourceAccessor.
/**
* Creates a suitable ResourceAccessor for use in an Ant task..
*
* @param classLoader The ClassLoader to use in the ResourceAccessor. It is preferable that it is an AntClassLoader.
* @return A ResourceAccessor.
*/
private ResourceAccessor createResourceAccessor(ClassLoader classLoader) {
FileSystemResourceAccessor fileSystemResourceAccessor = new FileSystemResourceAccessor();
ClassLoaderResourceAccessor classLoaderResourceAccessor = new ClassLoaderResourceAccessor(classLoader);
return new CompositeResourceAccessor(fileSystemResourceAccessor, classLoaderResourceAccessor);
}
use of liquibase.resource.ClassLoaderResourceAccessor in project liquibase by liquibase.
the class TestContext method getTestResourceAccessor.
public ResourceAccessor getTestResourceAccessor() throws URISyntaxException, MalformedURLException {
if (resourceAccessor == null) {
File integrationJarsDir = new File(TestContext.getInstance().findIntegrationTestProjectRoot(), "src/test/resources/ext/jars");
/*File samples1 = new File(integrationJarsDir, "liquibase-samplesqlgenerator.jar");
File samples2 = new File(integrationJarsDir, "liquibase-changesample.jar");
if (!samples2.exists()) {
throw new RuntimeException("Could not find "+samples2.getAbsolutePath());
}*/
resourceAccessor = new ClassLoaderResourceAccessor(new URLClassLoader(new URL[] { //samples2.toURL(),
new File(TestContext.getInstance().findCoreJvmProjectRoot(), "/target/classes").toURL(), new File(TestContext.getInstance().findCoreProjectRoot(), "/target/classes").toURL() }));
}
return resourceAccessor;
}
use of liquibase.resource.ClassLoaderResourceAccessor in project api-core by ca-cwds.
the class ClientCountyDeterminationServiceTest method runLiquibaseScript.
private static void runLiquibaseScript(String script) throws LiquibaseException {
try {
final Liquibase liquibase = new Liquibase(script, new ClassLoaderResourceAccessor(), getDatabase());
liquibase.update((String) null);
} catch (Exception e) {
throw new LiquibaseException(e);
}
}
use of liquibase.resource.ClassLoaderResourceAccessor in project api-core by ca-cwds.
the class DatabaseHelper method runScript.
public void runScript(String script) throws LiquibaseException {
try {
Liquibase liquibase = new Liquibase(script, new ClassLoaderResourceAccessor(), getDatabase());
liquibase.update((String) null);
} catch (Exception e) {
throw new LiquibaseException(e);
}
}
use of liquibase.resource.ClassLoaderResourceAccessor in project microservice_framework by CJSCommonPlatform.
the class EventBufferIT method initDatabase.
private void initDatabase() throws Exception {
Liquibase liquibase = new Liquibase(LIQUIBASE_STREAM_STATUS_CHANGELOG_XML, new ClassLoaderResourceAccessor(), new JdbcConnection(dataSource.getConnection()));
liquibase.dropAll();
liquibase.update("");
}
Aggregations