Search in sources :

Example 31 with ModuleAssembly

use of org.qi4j.bootstrap.ModuleAssembly in project qi4j-sdk by Qi4j.

the class TransientBuilderFactoryTest method newInstanceForNullType.

/**
     * Tests that a transient composite instance cannot be created for a 'null' type.
     *
     * @throws Exception expected
     */
@Test(expected = NullArgumentException.class)
public void newInstanceForNullType() throws Exception {
    SingletonAssembler assembler = new SingletonAssembler() {

        public void assemble(ModuleAssembly module) throws AssemblyException {
        }
    };
    assembler.module().newTransient(null);
}
Also used : ModuleAssembly(org.qi4j.bootstrap.ModuleAssembly) SingletonAssembler(org.qi4j.bootstrap.SingletonAssembler) Test(org.junit.Test)

Example 32 with ModuleAssembly

use of org.qi4j.bootstrap.ModuleAssembly in project qi4j-sdk by Qi4j.

the class InstanceImporterTest method assemble.

public void assemble(ModuleAssembly module) throws AssemblyException {
    ModuleAssembly serviceModule = module.layer().module("Service module");
    serviceModule.importedServices(TestInterface.class).setMetaInfo(new TestService()).visibleIn(Visibility.layer);
    module.objects(InstanceImporterTest.class);
}
Also used : ModuleAssembly(org.qi4j.bootstrap.ModuleAssembly)

Example 33 with ModuleAssembly

use of org.qi4j.bootstrap.ModuleAssembly in project qi4j-sdk by Qi4j.

the class FileEntityStoreTest method assemble.

@Override
public // START SNIPPET: assembly
void assemble(ModuleAssembly module) throws AssemblyException {
    // END SNIPPET: assembly
    super.assemble(module);
    module.services(FileConfigurationService.class);
    ModuleAssembly config = module.layer().module("config");
    new EntityTestAssembler().assemble(config);
    new OrgJsonValueSerializationAssembler().assemble(module);
    // START SNIPPET: assembly
    new FileEntityStoreAssembler().withConfig(config, Visibility.layer).assemble(module);
}
Also used : ModuleAssembly(org.qi4j.bootstrap.ModuleAssembly) FileEntityStoreAssembler(org.qi4j.entitystore.file.assembly.FileEntityStoreAssembler) EntityTestAssembler(org.qi4j.test.EntityTestAssembler) OrgJsonValueSerializationAssembler(org.qi4j.valueserialization.orgjson.OrgJsonValueSerializationAssembler)

Example 34 with ModuleAssembly

use of org.qi4j.bootstrap.ModuleAssembly in project qi4j-sdk by Qi4j.

the class EhCacheTest method assemble.

@Override
public // START SNIPPET: assembly
void assemble(ModuleAssembly module) throws AssemblyException {
    // END SNIPPET: assembly
    ModuleAssembly confModule = module.layer().module("confModule");
    new EntityTestAssembler().visibleIn(Visibility.layer).assemble(confModule);
    // START SNIPPET: assembly
    new EhCacheAssembler().withConfig(confModule, Visibility.layer).assemble(module);
}
Also used : ModuleAssembly(org.qi4j.bootstrap.ModuleAssembly) EntityTestAssembler(org.qi4j.test.EntityTestAssembler) EhCacheAssembler(org.qi4j.cache.ehcache.assembly.EhCacheAssembler)

Example 35 with ModuleAssembly

use of org.qi4j.bootstrap.ModuleAssembly in project qi4j-sdk by Qi4j.

the class RiakHttpMapEntityStoreTest 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
    new RiakHttpMapEntityStoreAssembler().withConfig(config, Visibility.layer).assemble(module);
}
Also used : ModuleAssembly(org.qi4j.bootstrap.ModuleAssembly) EntityTestAssembler(org.qi4j.test.EntityTestAssembler) OrgJsonValueSerializationAssembler(org.qi4j.valueserialization.orgjson.OrgJsonValueSerializationAssembler)

Aggregations

ModuleAssembly (org.qi4j.bootstrap.ModuleAssembly)191 SingletonAssembler (org.qi4j.bootstrap.SingletonAssembler)87 Test (org.junit.Test)82 EntityTestAssembler (org.qi4j.test.EntityTestAssembler)59 AssemblyException (org.qi4j.bootstrap.AssemblyException)27 Application (org.qi4j.api.structure.Application)26 OrgJsonValueSerializationAssembler (org.qi4j.valueserialization.orgjson.OrgJsonValueSerializationAssembler)24 Assembler (org.qi4j.bootstrap.Assembler)23 Module (org.qi4j.api.structure.Module)19 LayerAssembly (org.qi4j.bootstrap.LayerAssembly)15 Before (org.junit.Before)12 UnitOfWork (org.qi4j.api.unitofwork.UnitOfWork)12 Energy4Java (org.qi4j.bootstrap.Energy4Java)12 DataSourceAssembler (org.qi4j.library.sql.assembly.DataSourceAssembler)11 DBCPDataSourceServiceAssembler (org.qi4j.library.sql.dbcp.DBCPDataSourceServiceAssembler)9 IOException (java.io.IOException)8 ApplicationAssemblerAdapter (org.qi4j.bootstrap.ApplicationAssemblerAdapter)8 ApplicationAssembly (org.qi4j.bootstrap.ApplicationAssembly)8 File (java.io.File)7 OrgJsonValueSerializationService (org.qi4j.valueserialization.orgjson.OrgJsonValueSerializationService)7