use of co.cask.cdap.common.test.MockTwillContext in project cdap by caskdata.
the class DistributedLogFrameworkTest method createInjector.
private Injector createInjector() throws IOException {
CConfiguration cConf = CConfiguration.copy(KAFKA_TESTER.getCConf());
cConf.set(Constants.CFG_LOCAL_DATA_DIR, TEMP_FOLDER.newFolder().getAbsolutePath());
// The event delay cannot be too small, otherwise the events will be out of order, especially on slow machine
cConf.setLong(Constants.Logging.PIPELINE_EVENT_DELAY_MS, 2000);
cConf.setLong("log.process.pipeline.checkpoint.interval.ms", 2000);
return Guice.createInjector(new ConfigModule(cConf), new ZKClientModule(), new DiscoveryRuntimeModule().getInMemoryModules(), new KafkaClientModule(), new LocationRuntimeModule().getInMemoryModules(), new DistributedLogFrameworkModule(new MockTwillContext()), new DataSetsModules().getInMemoryModules(), new TransactionModules().getInMemoryModules(), new TransactionExecutorModule(), new SystemDatasetRuntimeModule().getInMemoryModules(), new NamespaceClientRuntimeModule().getInMemoryModules(), new AuthorizationTestModule(), new AuthorizationEnforcementModule().getInMemoryModules(), new AuthenticationContextModules().getNoOpModule(), new AbstractModule() {
@Override
protected void configure() {
bind(MetricsCollectionService.class).to(NoOpMetricsCollectionService.class);
bind(UGIProvider.class).to(CurrentUGIProvider.class);
bind(OwnerAdmin.class).to(DefaultOwnerAdmin.class);
}
});
}
Aggregations