Search in sources :

Example 1 with DataStoreBootstrapTemplate

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;
}
Also used : BootstrapConfiguration(io.fabric8.zookeeper.bootstrap.BootstrapConfiguration) ZkDataStoreImpl(io.fabric8.service.ZkDataStoreImpl) ComponentConfigurer(io.fabric8.service.ComponentConfigurer) DataStoreBootstrapTemplate(io.fabric8.zookeeper.bootstrap.DataStoreBootstrapTemplate) AbstractRuntimeProperties(io.fabric8.api.scr.AbstractRuntimeProperties)

Aggregations

AbstractRuntimeProperties (io.fabric8.api.scr.AbstractRuntimeProperties)1 ComponentConfigurer (io.fabric8.service.ComponentConfigurer)1 ZkDataStoreImpl (io.fabric8.service.ZkDataStoreImpl)1 BootstrapConfiguration (io.fabric8.zookeeper.bootstrap.BootstrapConfiguration)1 DataStoreBootstrapTemplate (io.fabric8.zookeeper.bootstrap.DataStoreBootstrapTemplate)1