Search in sources :

Example 11 with OrgJsonValueSerializationAssembler

use of org.qi4j.valueserialization.orgjson.OrgJsonValueSerializationAssembler 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).withConfigVisibility(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).withConfigVisibility(Visibility.layer).assemble(module);
}
Also used : ModuleAssembly(org.qi4j.bootstrap.ModuleAssembly) DataSourceAssembler(org.qi4j.library.sql.assembly.DataSourceAssembler) H2SQLEntityStoreAssembler(org.qi4j.entitystore.sql.assembly.H2SQLEntityStoreAssembler) EntityTestAssembler(org.qi4j.test.EntityTestAssembler) DBCPDataSourceServiceAssembler(org.qi4j.library.sql.dbcp.DBCPDataSourceServiceAssembler) OrgJsonValueSerializationAssembler(org.qi4j.valueserialization.orgjson.OrgJsonValueSerializationAssembler)

Example 12 with OrgJsonValueSerializationAssembler

use of org.qi4j.valueserialization.orgjson.OrgJsonValueSerializationAssembler in project qi4j-sdk by Qi4j.

the class EntitySerializerTest method assemble.

public void assemble(ModuleAssembly module) throws AssemblyException {
    new EntityTestAssembler().assemble(module);
    new OrgJsonValueSerializationAssembler().assemble(module);
    module.entities(TestEntity.class);
    module.values(TestValue.class, Test2Value.class);
    module.objects(EntityStateSerializer.class, EntitySerializerTest.class);
}
Also used : EntityTestAssembler(org.qi4j.test.EntityTestAssembler) OrgJsonValueSerializationAssembler(org.qi4j.valueserialization.orgjson.OrgJsonValueSerializationAssembler)

Example 13 with OrgJsonValueSerializationAssembler

use of org.qi4j.valueserialization.orgjson.OrgJsonValueSerializationAssembler in project qi4j-sdk by Qi4j.

the class ContinuousIntegrationTest method assemble.

@Override
public void assemble(ModuleAssembly module) throws AssemblyException {
    // General setup of client and server
    new OrgJsonValueSerializationAssembler().assemble(module);
    new ClientAssembler().assemble(module);
    new ValueAssembler().assemble(module);
    new RestServerAssembler().assemble(module);
    module.objects(NullCommandResult.class);
    module.importedServices(CommandResult.class).importedBy(NEW_OBJECT);
    module.importedServices(MetadataService.class).importedBy(NEW_OBJECT);
    module.objects(MetadataService.class);
    // Test specific setup
    module.values(BuildSpec.class, BuildResult.class, ServerStatus.class, TagBuildCommand.class, RunBuildCommand.class);
    module.objects(RootRestlet.class, RootResource.class, RootContext.class);
}
Also used : RestServerAssembler(org.qi4j.library.rest.server.assembler.RestServerAssembler) ValueAssembler(org.qi4j.library.rest.common.ValueAssembler) OrgJsonValueSerializationAssembler(org.qi4j.valueserialization.orgjson.OrgJsonValueSerializationAssembler) MetadataService(org.restlet.service.MetadataService) NullCommandResult(org.qi4j.library.rest.server.restlet.NullCommandResult) CommandResult(org.qi4j.library.rest.server.spi.CommandResult)

Example 14 with OrgJsonValueSerializationAssembler

use of org.qi4j.valueserialization.orgjson.OrgJsonValueSerializationAssembler in project qi4j-sdk by Qi4j.

the class MemoryEntityStorePerformanceTest method createAssembler.

private static Assembler createAssembler() {
    return new Assembler() {

        public void assemble(ModuleAssembly module) throws AssemblyException {
            module.services(MemoryEntityStoreService.class);
            // module.services( MemoryEntityStoreService2.class );
            module.services(UuidIdentityGeneratorService.class);
            new OrgJsonValueSerializationAssembler().assemble(module);
        }
    };
}
Also used : ModuleAssembly(org.qi4j.bootstrap.ModuleAssembly) OrgJsonValueSerializationAssembler(org.qi4j.valueserialization.orgjson.OrgJsonValueSerializationAssembler) Assembler(org.qi4j.bootstrap.Assembler) OrgJsonValueSerializationAssembler(org.qi4j.valueserialization.orgjson.OrgJsonValueSerializationAssembler)

Example 15 with OrgJsonValueSerializationAssembler

use of org.qi4j.valueserialization.orgjson.OrgJsonValueSerializationAssembler in project qi4j-sdk by Qi4j.

the class StorageModule method assemble.

@Override
public void assemble(ModuleAssembly module) throws AssemblyException {
    module.services(MemoryEntityStoreService.class).visibleIn(Visibility.application);
    module.services(UuidIdentityGeneratorService.class).visibleIn(Visibility.application);
    new OrgJsonValueSerializationAssembler().visibleIn(Visibility.application).withValuesModuleFinder(new Function<Application, Module>() {

        @Override
        public Module map(Application app) {
            return app.findModule("DomainLayer", "RentalModule");
        }
    }).assemble(module);
}
Also used : MemoryEntityStoreService(org.qi4j.entitystore.memory.MemoryEntityStoreService) UuidIdentityGeneratorService(org.qi4j.spi.uuid.UuidIdentityGeneratorService) Function(org.qi4j.functional.Function) Application(org.qi4j.api.structure.Application) OrgJsonValueSerializationAssembler(org.qi4j.valueserialization.orgjson.OrgJsonValueSerializationAssembler)

Aggregations

OrgJsonValueSerializationAssembler (org.qi4j.valueserialization.orgjson.OrgJsonValueSerializationAssembler)31 ModuleAssembly (org.qi4j.bootstrap.ModuleAssembly)20 EntityTestAssembler (org.qi4j.test.EntityTestAssembler)20 DataSourceAssembler (org.qi4j.library.sql.assembly.DataSourceAssembler)5 DBCPDataSourceServiceAssembler (org.qi4j.library.sql.dbcp.DBCPDataSourceServiceAssembler)5 ValueAssembler (org.qi4j.library.rest.common.ValueAssembler)3 Application (org.qi4j.api.structure.Application)2 Assembler (org.qi4j.bootstrap.Assembler)2 JdbmEntityStoreAssembler (org.qi4j.entitystore.jdbm.assembly.JdbmEntityStoreAssembler)2 Function (org.qi4j.functional.Function)2 RestServerAssembler (org.qi4j.library.rest.server.assembler.RestServerAssembler)2 NullCommandResult (org.qi4j.library.rest.server.restlet.NullCommandResult)2 CommandResult (org.qi4j.library.rest.server.spi.CommandResult)2 MetadataService (org.restlet.service.MetadataService)2 HashMap (java.util.HashMap)1 Test (org.junit.Test)1 Module (org.qi4j.api.structure.Module)1 ApplicationAssembler (org.qi4j.bootstrap.ApplicationAssembler)1 ApplicationAssembly (org.qi4j.bootstrap.ApplicationAssembly)1 ApplicationAssemblyFactory (org.qi4j.bootstrap.ApplicationAssemblyFactory)1