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);
}
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);
}
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);
}
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);
}
}
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
}
Aggregations