use of liquibase.extension.testing.testsystem.TestSystem in project liquibase by liquibase.
the class LiquibaseIntegrationMethodInterceptor method startContainers.
private static void startContainers(List<FieldInfo> containers, IMethodInvocation invocation) throws Exception {
for (FieldInfo field : containers) {
TestSystem testSystem = readContainerFromField(field, invocation);
Assume.assumeTrue("Not running test against " + testSystem.getDefinition() + ": liquibase.sdk.testSystem.test is " + configuredTestSystems, testSystem.shouldTest());
testSystem.start();
}
}
use of liquibase.extension.testing.testsystem.TestSystem in project liquibase by liquibase.
the class TestSystemDownCommand method run.
@Override
public void run(CommandResultsBuilder resultsBuilder) throws Exception {
final TestSystem env = new TestSystemFactory().getTestSystem(resultsBuilder.getCommandScope().getConfiguredValue(NAME).getValue());
env.stop();
}
use of liquibase.extension.testing.testsystem.TestSystem in project liquibase by liquibase.
the class TestSystemUpCommand method run.
@Override
public void run(CommandResultsBuilder resultsBuilder) throws Exception {
final String name = resultsBuilder.getCommandScope().getConfiguredValue(NAME).getValue();
final String version = resultsBuilder.getCommandScope().getConfiguredValue(VERSION).getValue();
final String profiles = resultsBuilder.getCommandScope().getConfiguredValue(PROFILES).getValue();
final Boolean acceptLicenses = resultsBuilder.getCommandScope().getConfiguredValue(ACCEPT_LICENSES).getValue();
String definition = name;
if (profiles != null) {
definition = name + ":" + profiles;
}
if (version != null) {
definition += "?version=" + version;
}
final TestSystem testSystem = new TestSystemFactory().getTestSystem(definition);
Map<String, Object> scopeValues = new HashMap<>();
if (acceptLicenses) {
scopeValues.put("liquibase.sdk.testSystem.acceptLicenses", testSystem.getDefinition().getName());
}
Scope.child(scopeValues, testSystem::start);
}
Aggregations