use of io.cdap.cdap.common.guice.ConfigModule in project cdap by caskdata.
the class SqlDefaultSecretStoreTest method setup.
@BeforeClass
public static void setup() throws Exception {
CConfiguration cConf = CConfiguration.create();
pg = PostgresInstantiator.createAndStart(cConf, TEMP_FOLDER.newFolder());
Injector injector = Guice.createInjector(new ConfigModule(cConf), new LocalLocationModule(), new SystemDatasetRuntimeModule().getInMemoryModules(), new StorageModule(), new AbstractModule() {
@Override
protected void configure() {
bind(MetricsCollectionService.class).to(NoOpMetricsCollectionService.class).in(Scopes.SINGLETON);
}
});
store = new DefaultSecretStore(injector.getInstance(TransactionRunner.class));
StoreDefinition.SecretStore.create(injector.getInstance(StructuredTableAdmin.class));
}
use of io.cdap.cdap.common.guice.ConfigModule in project cdap by caskdata.
the class SqlProgramHeartBeatTableTest method beforeClass.
@BeforeClass
public static void beforeClass() throws IOException, TableAlreadyExistsException {
CConfiguration cConf = CConfiguration.create();
pg = PostgresInstantiator.createAndStart(cConf, TEMP_FOLDER.newFolder());
Injector injector = Guice.createInjector(new ConfigModule(cConf), new LocalLocationModule(), new SystemDatasetRuntimeModule().getInMemoryModules(), new StorageModule(), new AbstractModule() {
@Override
protected void configure() {
bind(MetricsCollectionService.class).to(NoOpMetricsCollectionService.class).in(Scopes.SINGLETON);
}
});
transactionRunner = injector.getInstance(TransactionRunner.class);
StoreDefinition.createAllTables(injector.getInstance(StructuredTableAdmin.class));
}
use of io.cdap.cdap.common.guice.ConfigModule 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()));
}
use of io.cdap.cdap.common.guice.ConfigModule in project cdap by caskdata.
the class LevelDBMetricsTableTest method setup.
@BeforeClass
public static void setup() throws Exception {
CConfiguration conf = CConfiguration.create();
conf.set(Constants.CFG_LOCAL_DATA_DIR, tmpFolder.newFolder().getAbsolutePath());
Injector injector = Guice.createInjector(new ConfigModule(conf), new NonCustomLocationUnitTestModule(), new AuthorizationTestModule(), new AuthorizationEnforcementModule().getInMemoryModules(), new AuthenticationContextModules().getMasterModule(), new InMemoryDiscoveryModule(), new SystemDatasetRuntimeModule().getInMemoryModules(), new DataSetsModules().getInMemoryModules(), new DataFabricLevelDBModule(), new TransactionMetricsModule());
dsFramework = injector.getInstance(DatasetFramework.class);
}
use of io.cdap.cdap.common.guice.ConfigModule in project cdap by caskdata.
the class SqlUserConfigStoreTest method setup.
@BeforeClass
public static void setup() throws Exception {
CConfiguration cConf = CConfiguration.create();
// any plugin which requires transaction will be excluded
cConf.set(Constants.REQUIREMENTS_DATASET_TYPE_EXCLUDE, Joiner.on(",").join(Table.TYPE, KeyValueTable.TYPE));
pg = PostgresInstantiator.createAndStart(cConf, TEMP_FOLDER.newFolder());
Injector injector = Guice.createInjector(new ConfigModule(cConf), new LocalLocationModule(), new SystemDatasetRuntimeModule().getInMemoryModules(), new StorageModule(), new AbstractModule() {
@Override
protected void configure() {
bind(MetricsCollectionService.class).to(NoOpMetricsCollectionService.class).in(Scopes.SINGLETON);
}
});
admin = injector.getInstance(StructuredTableAdmin.class);
TransactionRunner transactionRunner = injector.getInstance(TransactionRunner.class);
configStore = new DefaultConfigStore(transactionRunner);
}
Aggregations