Search in sources :

Example 86 with SingletonAssembler

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

the class HelloWorldTest method setUp.

@Before
public void setUp() throws Exception {
    SingletonAssembler assembly = new SingletonAssembler() {

        @Override
        public void assemble(ModuleAssembly module) throws AssemblyException {
            module.transients(HelloWorldComposite.class);
        }
    };
    TransientBuilderFactory builderFactory = assembly.module();
    TransientBuilder<HelloWorldComposite> builder = builderFactory.newTransientBuilder(HelloWorldComposite.class);
    builder.prototype().name().set("Hello");
    builder.prototype().phrase().set("World");
    helloWorld = builder.newInstance();
}
Also used : ModuleAssembly(org.qi4j.bootstrap.ModuleAssembly) SingletonAssembler(org.qi4j.bootstrap.SingletonAssembler) TransientBuilderFactory(org.qi4j.api.composite.TransientBuilderFactory) Before(org.junit.Before)

Example 87 with SingletonAssembler

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

the class HelloWorldTest method setUp.

@Before
public void setUp() throws Exception {
    SingletonAssembler assembly = new SingletonAssembler() {

        @Override
        public void assemble(ModuleAssembly module) throws AssemblyException {
            module.transients(HelloWorldComposite.class);
        }
    };
    TransientBuilderFactory builderFactory = assembly.module();
    TransientBuilder<HelloWorldComposite> builder = builderFactory.newTransientBuilder(HelloWorldComposite.class);
    builder.prototype().name().set("Hello");
    builder.prototype().phrase().set("World");
    helloWorld = builder.newInstance();
}
Also used : ModuleAssembly(org.qi4j.bootstrap.ModuleAssembly) SingletonAssembler(org.qi4j.bootstrap.SingletonAssembler) TransientBuilderFactory(org.qi4j.api.composite.TransientBuilderFactory) Before(org.junit.Before)

Aggregations

ModuleAssembly (org.qi4j.bootstrap.ModuleAssembly)87 SingletonAssembler (org.qi4j.bootstrap.SingletonAssembler)87 Test (org.junit.Test)65 Module (org.qi4j.api.structure.Module)15 AssemblyException (org.qi4j.bootstrap.AssemblyException)14 EntityTestAssembler (org.qi4j.test.EntityTestAssembler)13 Before (org.junit.Before)11 Application (org.qi4j.api.structure.Application)10 UnitOfWork (org.qi4j.api.unitofwork.UnitOfWork)5 AmbiguousTypeException (org.qi4j.api.composite.AmbiguousTypeException)4 ServiceReference (org.qi4j.api.service.ServiceReference)4 ArrayList (java.util.ArrayList)3 TransientBuilderFactory (org.qi4j.api.composite.TransientBuilderFactory)3 ObjectFactory (org.qi4j.api.object.ObjectFactory)3 ValueBuilder (org.qi4j.api.value.ValueBuilder)3 UnitOfWorkDomainEventsValue (org.qi4j.library.eventsourcing.domain.api.UnitOfWorkDomainEventsValue)3 File (java.io.File)2 BeforeClass (org.junit.BeforeClass)2 Ignore (org.junit.Ignore)2 ServiceDeclaration (org.qi4j.bootstrap.ServiceDeclaration)2