Search in sources :

Example 1 with FileFetcherHttpHandlerInternal

use of io.cdap.cdap.gateway.handlers.FileFetcherHttpHandlerInternal in project cdap by caskdata.

the class FileFetcherHttpHandlerInternalTest method setup.

@BeforeClass
public static void setup() throws Exception {
    CConfiguration cConf = CConfiguration.create();
    cConf.set(Constants.CFG_LOCAL_DATA_DIR, TEMP_FOLDER.newFolder().getAbsolutePath());
    Injector injector = Guice.createInjector(new ConfigModule(cConf), new LocalLocationModule());
    FileFetcherHttpHandlerInternal handler = injector.getInstance(FileFetcherHttpHandlerInternal.class);
    httpService = NettyHttpService.builder("FileFetcherHttpHandlerInternalTest").setHttpHandlers(handler).setExceptionHandler(new HttpExceptionHandler()).build();
    httpService.start();
    InetSocketAddress addr = httpService.getBindAddress();
    baseURL = new URL(String.format("http://%s:%d", addr.getHostName(), addr.getPort()));
}
Also used : LocalLocationModule(io.cdap.cdap.common.guice.LocalLocationModule) Injector(com.google.inject.Injector) ConfigModule(io.cdap.cdap.common.guice.ConfigModule) InetSocketAddress(java.net.InetSocketAddress) HttpExceptionHandler(io.cdap.cdap.common.HttpExceptionHandler) CConfiguration(io.cdap.cdap.common.conf.CConfiguration) URL(java.net.URL) FileFetcherHttpHandlerInternal(io.cdap.cdap.gateway.handlers.FileFetcherHttpHandlerInternal) BeforeClass(org.junit.BeforeClass)

Aggregations

Injector (com.google.inject.Injector)1 HttpExceptionHandler (io.cdap.cdap.common.HttpExceptionHandler)1 CConfiguration (io.cdap.cdap.common.conf.CConfiguration)1 ConfigModule (io.cdap.cdap.common.guice.ConfigModule)1 LocalLocationModule (io.cdap.cdap.common.guice.LocalLocationModule)1 FileFetcherHttpHandlerInternal (io.cdap.cdap.gateway.handlers.FileFetcherHttpHandlerInternal)1 InetSocketAddress (java.net.InetSocketAddress)1 URL (java.net.URL)1 BeforeClass (org.junit.BeforeClass)1