use of com.yahoo.elide.datastores.aggregation.framework.AggregationDataStoreTestHarness in project elide by yahoo.
the class AggregationDataStoreIntegrationTest method createHarness.
@Override
protected DataStoreTestHarness createHarness() {
HikariConfig config = new HikariConfig(File.separator + "jpah2db.properties");
DataSource defaultDataSource = new HikariDataSource(config);
SQLDialect defaultDialect = SQLDialectFactory.getDefaultDialect();
ConnectionDetails defaultConnectionDetails = new ConnectionDetails(defaultDataSource, defaultDialect);
Properties prop = new Properties();
prop.put("javax.persistence.jdbc.driver", config.getDriverClassName());
prop.put("javax.persistence.jdbc.url", config.getJdbcUrl());
EntityManagerFactory emf = Persistence.createEntityManagerFactory("aggregationStore", prop);
Map<String, ConnectionDetails> connectionDetailsMap = new HashMap<>();
// Add an entry for "mycon" connection which is not from hjson
connectionDetailsMap.put("mycon", defaultConnectionDetails);
// Add connection details fetched from hjson
VALIDATOR.getElideSQLDBConfig().getDbconfigs().forEach(dbConfig -> connectionDetailsMap.put(dbConfig.getName(), new ConnectionDetails(getDataSource(dbConfig, getDBPasswordExtractor()), SQLDialectFactory.getDialect(dbConfig.getDialect()))));
return new AggregationDataStoreTestHarness(emf, defaultConnectionDetails, connectionDetailsMap, VALIDATOR);
}
use of com.yahoo.elide.datastores.aggregation.framework.AggregationDataStoreTestHarness in project elide by yahoo.
the class MetaDataStoreIntegrationTest method createHarness.
@Override
protected DataStoreTestHarness createHarness() {
HikariConfig config = new HikariConfig(File.separator + "jpah2db.properties");
DataSource defaultDataSource = new HikariDataSource(config);
SQLDialect defaultDialect = SQLDialectFactory.getDefaultDialect();
ConnectionDetails defaultConnectionDetails = new ConnectionDetails(defaultDataSource, defaultDialect);
Properties prop = new Properties();
prop.put("javax.persistence.jdbc.driver", config.getDriverClassName());
prop.put("javax.persistence.jdbc.url", config.getJdbcUrl());
EntityManagerFactory emf = Persistence.createEntityManagerFactory("aggregationStore", prop);
Map<String, ConnectionDetails> connectionDetailsMap = new HashMap<>();
// Add an entry for "mycon" connection which is not from hjson
connectionDetailsMap.put("mycon", defaultConnectionDetails);
// Add connection details fetched from hjson
VALIDATOR.getElideSQLDBConfig().getDbconfigs().forEach(dbConfig -> connectionDetailsMap.put(dbConfig.getName(), new ConnectionDetails(getDataSource(dbConfig, getDBPasswordExtractor()), SQLDialectFactory.getDialect(dbConfig.getDialect()))));
return new AggregationDataStoreTestHarness(emf, defaultConnectionDetails, connectionDetailsMap, VALIDATOR);
}
Aggregations