use of io.fabric8.zookeeper.bootstrap.DataStoreBootstrapTemplate in project fabric8 by jboss-fuse.
the class GitDataStoreImplTestSupport method createGitDataStore.
protected GitDataStoreImpl createGitDataStore() throws Exception {
RuntimeProperties runtimeProperties = createMockRuntimeProperties();
CreateEnsembleOptions ensembleOptions = CreateEnsembleOptions.builder().zookeeperPassword("admin").build();
recursiveDelete(runtimeProperties.getDataPath().toFile());
BootstrapConfiguration.DataStoreOptions options = new BootstrapConfiguration.DataStoreOptions("root", new File("target/test-container"), zkURL, ensembleOptions);
runtimeProperties.putRuntimeAttribute(DataStoreTemplate.class, new DataStoreBootstrapTemplate(options));
FabricGitServiceImpl fabricGitService = new FabricGitServiceImpl();
fabricGitService.bindRuntimeProperties(runtimeProperties);
fabricGitService.activate();
ComponentConfigurer componentConfigurer = new ComponentConfigurer();
componentConfigurer.activate(null);
ZkDataStoreImpl zkDataStore = new ZkDataStoreImpl() {
@Override
public String getDefaultVersion() {
return "1.0";
}
};
zkDataStore.bindCurator(curator);
zkDataStore.bindRuntimeProperties(runtimeProperties);
zkDataStore.activateComponent();
final GitDataStoreImpl gitDataStore = new GitDataStoreImpl();
gitDataStore.bindConfigurer(componentConfigurer);
gitDataStore.bindGitService(fabricGitService);
gitDataStore.bindRuntimeProperties(runtimeProperties);
gitDataStore.bindGitProxyService(new GitProxyRegistrationHandler());
gitDataStore.bindCurator(curator);
gitDataStore.bindDataStore(zkDataStore);
gitDataStore.activate(new HashMap<String, Object>());
return gitDataStore;
}
Aggregations