Search in sources :

Example 61 with EntityTestAssembler

use of org.qi4j.test.EntityTestAssembler in project qi4j-sdk by Qi4j.

the class PasswordDomainTest method assemble.

// END SNIPPET: domain
// START SNIPPET: assembly
@Override
public void assemble(ModuleAssembly module) throws AssemblyException {
    // END SNIPPET: assembly
    new EntityTestAssembler().assemble(module);
    new RdfMemoryStoreAssembler().assemble(module);
    ModuleAssembly configModule = module;
    // START SNIPPET: assembly
    new StandaloneShiroAssembler().withConfig(configModule).assemble(module);
    new PasswordDomainAssembler().withConfig(configModule).assemble(module);
    module.entities(User.class);
    module.services(UserFactory.class);
    // END SNIPPET: assembly
    configModule.forMixin(ShiroIniConfiguration.class).declareDefaults().iniResourcePath().set("classpath:standalone-shiro.ini");
// START SNIPPET: assembly
}
Also used : ModuleAssembly(org.qi4j.bootstrap.ModuleAssembly) ShiroIniConfiguration(org.qi4j.library.shiro.ini.ShiroIniConfiguration) RdfMemoryStoreAssembler(org.qi4j.index.rdf.assembly.RdfMemoryStoreAssembler) StandaloneShiroAssembler(org.qi4j.library.shiro.assembly.StandaloneShiroAssembler) EntityTestAssembler(org.qi4j.test.EntityTestAssembler) PasswordDomainAssembler(org.qi4j.library.shiro.assembly.PasswordDomainAssembler)

Example 62 with EntityTestAssembler

use of org.qi4j.test.EntityTestAssembler in project qi4j-sdk by Qi4j.

the class WebRealmServiceTest method assemble.

@Override
public void assemble(ModuleAssembly module) throws AssemblyException {
    try {
        new EntityTestAssembler().assemble(module);
        ModuleAssembly configModule = module;
        // START SNIPPET: assembly
        new JettyServiceAssembler().assemble(module);
        // END SNIPPET: assembly
        port = FreePortFinder.findFreePortOnLoopback();
        JettyConfiguration config = module.forMixin(JettyConfiguration.class).declareDefaults();
        config.hostName().set("127.0.0.1");
        config.port().set(port);
        // START SNIPPET: assembly
        new HttpShiroAssembler().withConfig(configModule).assemble(module);
        module.services(MyRealmService.class);
        // END SNIPPET: assembly
        configModule.forMixin(ShiroIniConfiguration.class).declareDefaults().iniResourcePath().set("classpath:web-shiro.ini");
        addServlets(serve("/*").with(MyServletService.class)).to(module);
    } catch (IOException ex) {
        throw new AssemblyException("Unable to find free port to bind to", ex);
    }
}
Also used : ModuleAssembly(org.qi4j.bootstrap.ModuleAssembly) AssemblyException(org.qi4j.bootstrap.AssemblyException) JettyConfiguration(org.qi4j.library.http.JettyConfiguration) ShiroIniConfiguration(org.qi4j.library.shiro.ini.ShiroIniConfiguration) HttpShiroAssembler(org.qi4j.library.shiro.web.assembly.HttpShiroAssembler) EntityTestAssembler(org.qi4j.test.EntityTestAssembler) JettyServiceAssembler(org.qi4j.library.http.JettyServiceAssembler) IOException(java.io.IOException)

Example 63 with EntityTestAssembler

use of org.qi4j.test.EntityTestAssembler in project qi4j-sdk by Qi4j.

the class StandaloneShiroTest method assemble.

@Override
public void assemble(ModuleAssembly module) throws AssemblyException {
    new EntityTestAssembler().assemble(module);
    ModuleAssembly configModule = module;
    // START SNIPPET: assembly
    new StandaloneShiroAssembler().withConfig(configModule).assemble(module);
    // END SNIPPET: assembly
    configModule.forMixin(ShiroIniConfiguration.class).declareDefaults().iniResourcePath().set("classpath:standalone-shiro.ini");
}
Also used : ModuleAssembly(org.qi4j.bootstrap.ModuleAssembly) ShiroIniConfiguration(org.qi4j.library.shiro.ini.ShiroIniConfiguration) StandaloneShiroAssembler(org.qi4j.library.shiro.assembly.StandaloneShiroAssembler) EntityTestAssembler(org.qi4j.test.EntityTestAssembler)

Example 64 with EntityTestAssembler

use of org.qi4j.test.EntityTestAssembler in project qi4j-sdk by Qi4j.

the class AssemblyMixinTest method assemble.

public void assemble(ModuleAssembly module) throws AssemblyException {
    new EntityTestAssembler().assemble(module);
    module.transients(FooComposite.class).withMixins(CustomFooMixin.class);
    module.entities(FooEntity.class).withMixins(FooMixin.class);
}
Also used : EntityTestAssembler(org.qi4j.test.EntityTestAssembler)

Example 65 with EntityTestAssembler

use of org.qi4j.test.EntityTestAssembler in project qi4j-sdk by Qi4j.

the class ImmutablePropertyTest method assemble.

public final void assemble(ModuleAssembly module) throws AssemblyException {
    module.transients(LocationComposite.class);
    module.entities(LocationEntity.class);
    new EntityTestAssembler().assemble(module);
}
Also used : EntityTestAssembler(org.qi4j.test.EntityTestAssembler)

Aggregations

EntityTestAssembler (org.qi4j.test.EntityTestAssembler)137 ModuleAssembly (org.qi4j.bootstrap.ModuleAssembly)51 OrgJsonValueSerializationAssembler (org.qi4j.valueserialization.orgjson.OrgJsonValueSerializationAssembler)20 SingletonAssembler (org.qi4j.bootstrap.SingletonAssembler)13 RdfMemoryStoreAssembler (org.qi4j.index.rdf.assembly.RdfMemoryStoreAssembler)10 Test (org.junit.Test)9 FileConfigurationService (org.qi4j.library.fileconfig.FileConfigurationService)8 DataSourceAssembler (org.qi4j.library.sql.assembly.DataSourceAssembler)8 NativeConfiguration (org.qi4j.library.rdf.repository.NativeConfiguration)7 AssemblyException (org.qi4j.bootstrap.AssemblyException)6 ShiroIniConfiguration (org.qi4j.library.shiro.ini.ShiroIniConfiguration)6 DBCPDataSourceServiceAssembler (org.qi4j.library.sql.dbcp.DBCPDataSourceServiceAssembler)6 File (java.io.File)5 UnitOfWork (org.qi4j.api.unitofwork.UnitOfWork)5 RdfNativeSesameStoreAssembler (org.qi4j.index.rdf.assembly.RdfNativeSesameStoreAssembler)5 Module (org.qi4j.api.structure.Module)4 JdbmConfiguration (org.qi4j.entitystore.jdbm.JdbmConfiguration)4 JdbmEntityStoreAssembler (org.qi4j.entitystore.jdbm.assembly.JdbmEntityStoreAssembler)4 ESFilesystemIndexQueryAssembler (org.qi4j.index.elasticsearch.assembly.ESFilesystemIndexQueryAssembler)4 CurrentUserUoWPrincipal (org.qi4j.library.eventsourcing.domain.factory.CurrentUserUoWPrincipal)4