use of org.qi4j.test.EntityTestAssembler in project qi4j-sdk by Qi4j.
the class DomainEventSourceResourceSample method main.
public static void main(String[] args) throws Exception {
Component component = new Component();
component.getServers().add(Protocol.HTTP, 8080);
SingletonAssembler assembler = new SingletonAssembler() {
public void assemble(ModuleAssembly module) throws AssemblyException {
new EntityTestAssembler().assemble(module);
module.values(DomainEventValue.class, UnitOfWorkDomainEventsValue.class);
module.services(MemoryEventStoreService.class).taggedWith("domain");
module.services(DomainEventFactoryService.class);
module.importedServices(CurrentUserUoWPrincipal.class).importedBy(ImportedServiceDeclaration.NEW_OBJECT);
module.objects(CurrentUserUoWPrincipal.class);
module.objects(DomainEventSourceResource.class, PingResource.class);
module.entities(TestEntity.class).withConcerns(DomainEventCreationConcern.class);
}
};
component.getDefaultHost().attach("/events", new TestApplication(assembler));
component.getDefaultHost().attach("/ping", assembler.module().newObject(PingResource.class));
component.start();
generateTestData(assembler.module());
}
use of org.qi4j.test.EntityTestAssembler in project qi4j-sdk by Qi4j.
the class DomainEventTest method assemble.
public void assemble(ModuleAssembly module) throws AssemblyException {
new EntityTestAssembler().assemble(module);
module.values(DomainEventValue.class, UnitOfWorkDomainEventsValue.class);
module.services(MemoryEventStoreService.class);
module.services(DomainEventFactoryService.class);
module.importedServices(CurrentUserUoWPrincipal.class).importedBy(ImportedServiceDeclaration.NEW_OBJECT);
module.objects(CurrentUserUoWPrincipal.class);
module.entities(TestEntity.class).withConcerns(DomainEventCreationConcern.class);
}
use of org.qi4j.test.EntityTestAssembler in project qi4j-sdk by Qi4j.
the class LibraryTest method assemble.
@Override
public void assemble(ModuleAssembly module) throws AssemblyException {
module.services(LibraryService.class);
module.values(Book.class);
module.objects(Consumer.class);
module.entities(LibraryConfiguration.class);
new EntityTestAssembler().assemble(module);
}
use of org.qi4j.test.EntityTestAssembler in project qi4j-sdk by Qi4j.
the class UnitOfWorkTemplateTest method assemble.
@Override
public void assemble(ModuleAssembly module) throws AssemblyException {
new EntityTestAssembler().assemble(module);
module.entities(TestEntity.class);
}
use of org.qi4j.test.EntityTestAssembler in project qi4j-sdk by Qi4j.
the class RemovalTest method assemble.
public void assemble(ModuleAssembly module) throws AssemblyException {
module.entities(TestEntity.class);
module.entities(PidRegulator.class);
new EntityTestAssembler().assemble(module);
}
Aggregations