use of co.cask.cdap.app.store.ServiceStore in project cdap by caskdata.
the class AppFabricTestBase method initializeAndStartServices.
protected static void initializeAndStartServices(CConfiguration cConf, @Nullable SConfiguration sConf) throws Exception {
injector = Guice.createInjector(Modules.override(new AppFabricTestModule(cConf, sConf)).with(new AbstractModule() {
@Override
protected void configure() {
// needed because we set Kerberos to true in DefaultNamespaceAdminTest
bind(UGIProvider.class).to(CurrentUGIProvider.class);
}
}));
messagingService = injector.getInstance(MessagingService.class);
if (messagingService instanceof Service) {
((Service) messagingService).startAndWait();
}
txManager = injector.getInstance(TransactionManager.class);
txManager.startAndWait();
dsOpService = injector.getInstance(DatasetOpExecutor.class);
dsOpService.startAndWait();
remoteSysOpService = injector.getInstance(RemoteSystemOperationsService.class);
remoteSysOpService.startAndWait();
datasetService = injector.getInstance(DatasetService.class);
datasetService.startAndWait();
appFabricServer = injector.getInstance(AppFabricServer.class);
appFabricServer.startAndWait();
DiscoveryServiceClient discoveryClient = injector.getInstance(DiscoveryServiceClient.class);
ServiceDiscovered appFabricHttpDiscovered = discoveryClient.discover(Constants.Service.APP_FABRIC_HTTP);
EndpointStrategy endpointStrategy = new RandomEndpointStrategy(appFabricHttpDiscovered);
port = endpointStrategy.pick(1, TimeUnit.SECONDS).getSocketAddress().getPort();
txClient = injector.getInstance(TransactionSystemClient.class);
metricsCollectionService = injector.getInstance(MetricsCollectionService.class);
metricsCollectionService.startAndWait();
metricsService = injector.getInstance(MetricsQueryService.class);
metricsService.startAndWait();
streamService = injector.getInstance(StreamService.class);
streamService.startAndWait();
serviceStore = injector.getInstance(ServiceStore.class);
serviceStore.startAndWait();
metadataService = injector.getInstance(MetadataService.class);
metadataService.startAndWait();
locationFactory = getInjector().getInstance(LocationFactory.class);
streamClient = new StreamClient(getClientConfig(discoveryClient, Constants.Service.STREAMS));
datasetClient = new DatasetClient(getClientConfig(discoveryClient, Constants.Service.DATASET_MANAGER));
createNamespaces();
}
Aggregations