use of io.cdap.cdap.internal.tethering.runtime.spi.provisioner.TetheringConf in project cdap by caskdata.
the class TetheringRuntimeJobManagerTest method setUp.
@BeforeClass
public static void setUp() throws IOException, TopicAlreadyExistsException {
CConfiguration cConf = CConfiguration.create();
cConf.set(Constants.Tethering.TOPIC_PREFIX, "prefix-");
cConf.set(Constants.CFG_LOCAL_DATA_DIR, TEMP_FOLDER.newFolder().getAbsolutePath());
Injector injector = Guice.createInjector(new ConfigModule(cConf), new InMemoryDiscoveryModule(), new LocalLocationModule(), new MessagingServerRuntimeModule().getInMemoryModules(), new AbstractModule() {
@Override
protected void configure() {
bind(MetricsCollectionService.class).to(NoOpMetricsCollectionService.class).in(Scopes.SINGLETON);
}
});
messagingService = injector.getInstance(MessagingService.class);
if (messagingService instanceof Service) {
((Service) messagingService).startAndWait();
}
TetheringConf conf = TetheringConf.fromProperties(PROPERTIES);
topicId = new TopicId(NamespaceId.SYSTEM.getNamespace(), cConf.get(Constants.Tethering.TOPIC_PREFIX) + TETHERED_INSTANCE_NAME);
messagingService.createTopic(new TopicMetadata(topicId, Collections.emptyMap()));
messageFetcher = new MultiThreadMessagingContext(messagingService).getMessageFetcher();
runtimeJobManager = new TetheringRuntimeJobManager(conf, cConf, messagingService);
}
Aggregations