org.etlunit.feature.sql_server_database.SqlServerDatabaseFeatureModule Maven / Gradle / Ivy
package org.etlunit.feature.sql_server_database;
import javax.inject.Inject;
import com.google.inject.Injector;
import com.google.inject.name.Named;
import org.etlunit.feature.Feature;
import org.etlunit.feature.FeatureModule;
import org.etlunit.feature.AbstractFeature;
import org.etlunit.feature.database.DatabaseFeatureModule;
import org.etlunit.io.FileBuilder;
import org.etlunit.parser.ETLTestValueObject;
import java.io.File;
import java.util.Arrays;
import java.util.List;
@FeatureModule
public class SqlServerDatabaseFeatureModule extends AbstractFeature {
private static final List prerequisites = Arrays.asList("logging", "database");
private DatabaseFeatureModule databaseFeatureModule;
@Inject
public void setDatabaseFeature(DatabaseFeatureModule feature)
{
databaseFeatureModule = feature;
}
@Override
public void initialize(Injector inj) {
ETLTestValueObject value = configuration.query("vendor-binary-directory");
if (value == null)
{
throw new IllegalArgumentException("Configuration property 'vendor-binary-directory' not present");
}
File path = new FileBuilder(value.getValueAsString()).subdir("SqlServer").subdir("2008_R2_x86").file();
databaseFeatureModule.addDatabaseImplementation(postCreate(new SqlServerDatabaseImplementation()));
}
@Override
public List getPrerequisites() {
return prerequisites;
}
public String getFeatureName() {
return "sql-server-database";
}
}