use of org.finos.legend.engine.plan.execution.stores.relational.config.TemporaryTestDbConfiguration in project legend-engine by finos.
the class TestLocalH2ConnectionState method setup.
@Before
public void setup() throws Exception {
// The manager is a singleton. Reset singleton to avoid interference from other tests
ConcurrentHashMap connectionPools = (ConcurrentHashMap) ReflectionUtils.getFieldUsingReflection(ConnectionStateManager.class, ConnectionStateManager.getInstance(), "connectionPools");
connectionPools.clear();
this.connectionManagerSelector = new ConnectionManagerSelector(new TemporaryTestDbConfiguration(-1), Collections.emptyList());
}
use of org.finos.legend.engine.plan.execution.stores.relational.config.TemporaryTestDbConfiguration in project legend-engine by finos.
the class RelationalStoreExecutorBuilder method build.
@Override
public StoreExecutor build(StoreExecutorConfiguration storeExecutorConfiguration) {
if (!(storeExecutorConfiguration instanceof RelationalExecutionConfiguration)) {
String message = String.format("Invalid argument. Expected %s but found %s", RelationalExecutionConfiguration.class.getCanonicalName(), storeExecutorConfiguration.getClass().getCanonicalName());
throw new RuntimeException(message);
}
RelationalExecutionConfiguration relationalExecutionConfiguration = (RelationalExecutionConfiguration) storeExecutorConfiguration;
if (relationalExecutionConfiguration.tempPath == null) {
relationalExecutionConfiguration.tempPath = DEFAULT_TEMP_PATH;
}
if (relationalExecutionConfiguration.temporarytestdb == null) {
relationalExecutionConfiguration.temporarytestdb = new TemporaryTestDbConfiguration(DEFAULT_PORT);
}
Optional<DatabaseAuthenticationFlowProvider> flowProviderHolder = this.configureDatabaseAuthenticationFlowProvider(relationalExecutionConfiguration);
RelationalStoreState state = new RelationalStoreState(relationalExecutionConfiguration.temporarytestdb, relationalExecutionConfiguration, flowProviderHolder);
return new RelationalStoreExecutor(state);
}
use of org.finos.legend.engine.plan.execution.stores.relational.config.TemporaryTestDbConfiguration in project legend-engine by finos.
the class TestExecutionScope method buildTestExecutor.
public static RelationalExecutor buildTestExecutor(int port) {
RelationalExecutionConfiguration relationalExecutionConfiguration = new RelationalExecutionConfiguration();
relationalExecutionConfiguration.tempPath = "/tmp/";
TemporaryTestDbConfiguration temporaryTestDbConfiguration = new TemporaryTestDbConfiguration();
temporaryTestDbConfiguration.port = port;
return new RelationalExecutor(temporaryTestDbConfiguration, relationalExecutionConfiguration);
}
use of org.finos.legend.engine.plan.execution.stores.relational.config.TemporaryTestDbConfiguration in project legend-engine by finos.
the class ExternalIntegration_TestConnectionAcquisitionWithFlowProvider_BigQuery method setup.
@Before
public void setup() {
LegendDefaultDatabaseAuthenticationFlowProvider flowProvider = new LegendDefaultDatabaseAuthenticationFlowProvider();
assertBigQueryFlowIsAvailable(flowProvider);
this.connectionManagerSelector = new ConnectionManagerSelector(new TemporaryTestDbConfiguration(-1), Collections.emptyList(), Optional.of(flowProvider));
}
use of org.finos.legend.engine.plan.execution.stores.relational.config.TemporaryTestDbConfiguration in project legend-engine by finos.
the class ExternalIntegration_TestConnectionAcquisitionWithFlowProvider_SqlServer method setup.
@Before
public void setup() throws Exception {
startMSSQLServerContainer();
LegendDefaultDatabaseAuthenticationFlowProvider flowProvider = new LegendDefaultDatabaseAuthenticationFlowProvider();
assertStaticSQLServerFlowProviderIsAvailable(flowProvider);
this.connectionManagerSelector = new ConnectionManagerSelector(new TemporaryTestDbConfiguration(-1), Collections.emptyList(), Optional.of(flowProvider));
Properties properties = new Properties();
properties.put("sqlServerAccount.user", "SA");
properties.put("sqlServerAccount.password", "A_Str0ng_Required_Password");
this.vaultImplementation = new PropertiesVaultImplementation(properties);
Vault.INSTANCE.registerImplementation(this.vaultImplementation);
}
Aggregations