Search in sources :

Example 6 with EventModule

use of io.airlift.event.client.EventModule in project airlift by airlift.

the class TestHttpServerModule method testCanConstructServer.

@Test
public void testCanConstructServer() {
    Map<String, String> properties = new ImmutableMap.Builder<String, String>().put("http-server.http.port", "0").put("http-server.log.path", new File(tempDir, "http-request.log").getAbsolutePath()).build();
    Bootstrap app = new Bootstrap(new HttpServerModule(), new TestingNodeModule(), new EventModule(), binder -> binder.bind(Servlet.class).annotatedWith(TheServlet.class).to(DummyServlet.class));
    Injector injector = app.setRequiredConfigurationProperties(properties).doNotInitializeLogging().initialize();
    HttpServer server = injector.getInstance(HttpServer.class);
    assertNotNull(server);
}
Also used : EventModule(io.airlift.event.client.EventModule) InMemoryEventModule(io.airlift.event.client.InMemoryEventModule) TestingNodeModule(io.airlift.node.testing.TestingNodeModule) ImmutableMap(com.google.common.collect.ImmutableMap) Injector(com.google.inject.Injector) Bootstrap(io.airlift.bootstrap.Bootstrap) HttpServlet(javax.servlet.http.HttpServlet) Servlet(javax.servlet.Servlet) File(java.io.File) Test(org.testng.annotations.Test)

Aggregations

EventModule (io.airlift.event.client.EventModule)6 Injector (com.google.inject.Injector)5 Bootstrap (io.airlift.bootstrap.Bootstrap)5 ImmutableMap (com.google.common.collect.ImmutableMap)3 InMemoryEventModule (io.airlift.event.client.InMemoryEventModule)3 TestingNodeModule (io.airlift.node.testing.TestingNodeModule)3 File (java.io.File)3 Test (org.testng.annotations.Test)3 TypeLiteral (com.google.inject.TypeLiteral)2 LifeCycleManager (io.airlift.bootstrap.LifeCycleManager)2 JsonModule (io.airlift.json.JsonModule)2 Servlet (javax.servlet.Servlet)2 HttpServlet (javax.servlet.http.HttpServlet)2 MBeanModule (org.weakref.jmx.guice.MBeanModule)2 HiveAnalyzeProperties (com.facebook.presto.hive.HiveAnalyzeProperties)1 HiveConnector (com.facebook.presto.hive.HiveConnector)1 HiveMetadataFactory (com.facebook.presto.hive.HiveMetadataFactory)1 HiveProcedureModule (com.facebook.presto.hive.HiveProcedureModule)1 HiveSessionProperties (com.facebook.presto.hive.HiveSessionProperties)1 HiveTableProperties (com.facebook.presto.hive.HiveTableProperties)1