Search in sources :

Example 46 with EntityTestAssembler

use of org.qi4j.test.EntityTestAssembler 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);
    // START SNIPPET: assembly
    new OrgJsonValueSerializationAssembler().assemble(module);
    new FileEntityStoreAssembler().assemble(module);
    config.entities(FileEntityStoreConfiguration.class).visibleIn(Visibility.layer);
}
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 47 with EntityTestAssembler

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

the class MutualSecureJettyServiceTest method assemble.

public void assemble(ModuleAssembly module) throws AssemblyException {
    new EntityTestAssembler().assemble(module);
    new SecureJettyServiceAssembler().assemble(module);
    // START SNIPPET: config
    SecureJettyConfiguration config = module.forMixin(SecureJettyConfiguration.class).declareDefaults();
    config.hostName().set("127.0.0.1");
    config.port().set(HTTPS_PORT);
    config.keystorePath().set(SERVER_KEYSTORE_PATH);
    config.keystoreType().set("JCEKS");
    config.keystorePassword().set(KS_PASSWORD);
    config.truststorePath().set(TRUSTSTORE_PATH);
    config.truststoreType().set("JCEKS");
    config.truststorePassword().set(KS_PASSWORD);
    config.wantClientAuth().set(Boolean.TRUE);
    // END SNIPPET: config
    addServlets(serve("/hello").with(HelloWorldServletService.class)).to(module);
}
Also used : EntityTestAssembler(org.qi4j.test.EntityTestAssembler)

Example 48 with EntityTestAssembler

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

the class VirtualHostJettyServiceTest method assemble.

public void assemble(ModuleAssembly module) throws AssemblyException {
    new EntityTestAssembler().assemble(module);
    new JettyServiceAssembler().assemble(module);
    SecureJettyConfiguration config = module.forMixin(SecureJettyConfiguration.class).declareDefaults();
    config.hostName().set("127.0.0.1");
    config.port().set(HTTP_PORT);
    config.virtualHosts().set(HOST1 + "," + HOST2);
    addServlets(serve("/hello").with(HelloWorldServletService.class)).to(module);
}
Also used : EntityTestAssembler(org.qi4j.test.EntityTestAssembler)

Example 49 with EntityTestAssembler

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

the class JMXTest method main.

public static void main(String[] args) throws InterruptedException, ActivationException, AssemblyException {
    /*
         Logger logger = Logger.getLogger( "" );
         logger.setLevel( Level.FINE );
         Logger.getLogger("sun.rmi").setLevel( Level.WARNING );

         ConsoleHandler consoleHandler = new ConsoleHandler();
         consoleHandler.setLevel( Level.FINE );
         logger.addHandler( consoleHandler );
         */
    SingletonAssembler assembler = new SingletonAssembler() {

        // START SNIPPET: assembly
        public void assemble(ModuleAssembly module) throws AssemblyException {
            // END SNIPPET: assembly
            new EntityTestAssembler().assemble(module);
            module.services(TestService.class, TestService2.class, TestService3.class).instantiateOnStartup();
            module.entities(TestConfiguration.class);
            module.values(TestValue.class);
            module.objects(TestObject.class);
            // START SNIPPET: assembly
            new JMXAssembler().assemble(module);
            module.services(JMXConnectorService.class).instantiateOnStartup();
            module.entities(JMXConnectorConfiguration.class);
            module.forMixin(JMXConnectorConfiguration.class).declareDefaults().port().set(1099);
        }
    };
    // This allows user to connect using VisualVM/JConsole
    while (true) {
        Thread.sleep(10000);
    }
}
Also used : ModuleAssembly(org.qi4j.bootstrap.ModuleAssembly) SingletonAssembler(org.qi4j.bootstrap.SingletonAssembler) EntityTestAssembler(org.qi4j.test.EntityTestAssembler)

Example 50 with EntityTestAssembler

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

the class SecureJettyServiceTest method assemble.

public void assemble(ModuleAssembly module) throws AssemblyException {
    new EntityTestAssembler().assemble(module);
    // START SNIPPET: assemblyssl
    new SecureJettyServiceAssembler().assemble(module);
    // END SNIPPET: assemblyssl
    // START SNIPPET: configssl
    SecureJettyConfiguration config = module.forMixin(SecureJettyConfiguration.class).declareDefaults();
    config.hostName().set("127.0.0.1");
    config.port().set(HTTPS_PORT);
    config.keystorePath().set(SERVER_KEYSTORE_PATH);
    config.keystoreType().set("JCEKS");
    config.keystorePassword().set(KS_PASSWORD);
    // END SNIPPET: configssl
    // START SNIPPET: assemblyssl
    addServlets(serve("/hello").with(HelloWorldServletService.class)).to(module);
    addFilters(filter("/*").through(UnitOfWorkFilterService.class).on(REQUEST)).to(module);
// END SNIPPET: assemblyssl
}
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