use of org.qi4j.library.sql.dbcp.DBCPDataSourceServiceAssembler in project qi4j-sdk by Qi4j.
the class SQLiteEntityStoreTest method assemble.
@Override
public // START SNIPPET: assembly
void assemble(ModuleAssembly module) throws AssemblyException {
// END SNIPPET: assembly
super.assemble(module);
ModuleAssembly config = module.layer().module("config");
new EntityTestAssembler().assemble(config);
new OrgJsonValueSerializationAssembler().assemble(module);
// START SNIPPET: assembly
// DataSourceService
new DBCPDataSourceServiceAssembler().identifiedBy("sqlite-datasource-service").visibleIn(Visibility.module).withConfig(config, Visibility.layer).assemble(module);
// DataSource
new DataSourceAssembler().withDataSourceServiceIdentity("sqlite-datasource-service").identifiedBy("sqlite-datasource").visibleIn(Visibility.module).withCircuitBreaker().assemble(module);
// SQL EntityStore
new SQLiteEntityStoreAssembler().visibleIn(Visibility.application).withConfig(config, Visibility.layer).assemble(module);
}
use of org.qi4j.library.sql.dbcp.DBCPDataSourceServiceAssembler in project qi4j-sdk by Qi4j.
the class DerbySQLEntityStoreTest method assemble.
@Override
public // START SNIPPET: assembly
void assemble(ModuleAssembly module) throws AssemblyException {
// END SNIPPET: assembly
super.assemble(module);
ModuleAssembly config = module.layer().module("config");
new EntityTestAssembler().assemble(config);
new OrgJsonValueSerializationAssembler().assemble(module);
// START SNIPPET: assembly
// DataSourceService
new DBCPDataSourceServiceAssembler().identifiedBy("derby-datasource-service").visibleIn(Visibility.module).withConfig(config, Visibility.layer).assemble(module);
// DataSource
new DataSourceAssembler().withDataSourceServiceIdentity("derby-datasource-service").identifiedBy("derby-datasource").visibleIn(Visibility.module).withCircuitBreaker().assemble(module);
// SQL EntityStore
new DerbySQLEntityStoreAssembler().visibleIn(Visibility.application).withConfig(config, Visibility.layer).assemble(module);
}
use of org.qi4j.library.sql.dbcp.DBCPDataSourceServiceAssembler in project qi4j-sdk by Qi4j.
the class H2SQLEntityStoreTest method assemble.
@Override
public // START SNIPPET: assembly
void assemble(ModuleAssembly module) throws AssemblyException {
// END SNIPPET: assembly
super.assemble(module);
ModuleAssembly config = module.layer().module("config");
new EntityTestAssembler().assemble(config);
new OrgJsonValueSerializationAssembler().assemble(module);
// START SNIPPET: assembly
// DataSourceService
new DBCPDataSourceServiceAssembler().identifiedBy("h2-datasource-service").visibleIn(Visibility.module).withConfig(config, Visibility.layer).assemble(module);
// DataSource
new DataSourceAssembler().withDataSourceServiceIdentity("h2-datasource-service").identifiedBy("h2-datasource").visibleIn(Visibility.module).withCircuitBreaker().assemble(module);
// SQL EntityStore
new H2SQLEntityStoreAssembler().visibleIn(Visibility.application).withConfig(config, Visibility.layer).assemble(module);
}
use of org.qi4j.library.sql.dbcp.DBCPDataSourceServiceAssembler in project qi4j-sdk by Qi4j.
the class SQLTestHelper method doCommonAssembling.
protected static void doCommonAssembling(ModuleAssembly mainModule) throws AssemblyException {
ModuleAssembly config = mainModule.layer().module("config");
new EntityTestAssembler().assemble(config);
// START SNIPPET: assembly
// DataSourceService
new DBCPDataSourceServiceAssembler().identifiedBy("postgres-datasource-service").visibleIn(Visibility.module).withConfig(config, Visibility.layer).assemble(mainModule);
// DataSource
new DataSourceAssembler().withDataSourceServiceIdentity("postgres-datasource-service").identifiedBy("postgres-datasource").visibleIn(Visibility.module).withCircuitBreaker().assemble(mainModule);
// SQL Index/Query
new PostgreSQLIndexQueryAssembler().visibleIn(Visibility.module).withConfig(config, Visibility.layer).assemble(mainModule);
// END SNIPPET: assembly
// Always re-build schema in test scenarios because of possibly different app structure in
// various tests
mainModule.services(RebuildingStrategy.class).withMixins(RebuildingStrategy.AlwaysNeed.class).visibleIn(Visibility.module);
// Always re-index in test scenarios
mainModule.services(ReindexingStrategy.class).withMixins(ReindexingStrategy.AlwaysNeed.class).visibleIn(Visibility.module);
config.entities(ReindexerConfiguration.class).visibleIn(Visibility.layer);
}
use of org.qi4j.library.sql.dbcp.DBCPDataSourceServiceAssembler in project qi4j-sdk by Qi4j.
the class DerbySQLEntityStorePerformanceTest method createAssembler.
private static Assembler createAssembler() {
return new Assembler() {
@Override
public void assemble(ModuleAssembly module) throws AssemblyException {
ModuleAssembly config = module.layer().module("config");
new EntityTestAssembler().assemble(config);
new OrgJsonValueSerializationAssembler().assemble(module);
// DataSourceService
new DBCPDataSourceServiceAssembler().identifiedBy("derby-datasource-service").visibleIn(Visibility.module).withConfig(config, Visibility.layer).assemble(module);
// DataSource
new DataSourceAssembler().withDataSourceServiceIdentity("derby-datasource-service").identifiedBy("derby-datasource").withCircuitBreaker().assemble(module);
// SQL EntityStore
new DerbySQLEntityStoreAssembler().withConfig(config, Visibility.layer).assemble(module);
}
};
}
Aggregations