Search in sources :

Example 1 with ZooKeeperClusterBootstrap

use of io.fabric8.api.ZooKeeperClusterBootstrap in project fabric8 by jboss-fuse.

the class BootstrapServiceTest method testZooKeeperClusterBootstrapAvailable.

@Test
public void testZooKeeperClusterBootstrapAvailable() throws Exception {
    ZooKeeperClusterBootstrap bootstrap = ServiceLocator.getRequiredService(ZooKeeperClusterBootstrap.class);
    Assert.assertNotNull("ZooKeeperClusterBootstrap not null", bootstrap);
}
Also used : ZooKeeperClusterBootstrap(io.fabric8.api.ZooKeeperClusterBootstrap) Test(org.junit.Test)

Example 2 with ZooKeeperClusterBootstrap

use of io.fabric8.api.ZooKeeperClusterBootstrap in project fabric8 by jboss-fuse.

the class ContainerStartupTest method testLocalFabricCluster.

@Test
public void testLocalFabricCluster() throws Exception {
    Builder<?> builder = CreateEnsembleOptions.builder().agentEnabled(false).clean(true).zookeeperPassword(ADMIN_PASSWORD).waitForProvision(false);
    CreateEnsembleOptions options = builder.build();
    ZooKeeperClusterBootstrap bootstrap = ServiceLocator.getRequiredService(ZooKeeperClusterBootstrap.class);
    bootstrap.create(options);
    FabricService fabricService = ServiceLocator.getRequiredService(FabricService.class);
    Container[] containers = fabricService.getContainers();
    Assert.assertNotNull("Containers not null", containers);
    // Test that a provided default password exists
    ConfigurationAdmin configurationAdmin = ServiceLocator.getRequiredService(ConfigurationAdmin.class);
    org.osgi.service.cm.Configuration configuration = configurationAdmin.getConfiguration(io.fabric8.api.Constants.ZOOKEEPER_CLIENT_PID);
    Dictionary<String, Object> dictionary = configuration.getProperties();
    Assert.assertEquals("Expected provided zookeeper password", PasswordEncoder.encode(ADMIN_PASSWORD), dictionary.get("zookeeper.password"));
}
Also used : ZooKeeperClusterBootstrap(io.fabric8.api.ZooKeeperClusterBootstrap) CreateEnsembleOptions(io.fabric8.api.CreateEnsembleOptions) Container(io.fabric8.api.Container) FabricService(io.fabric8.api.FabricService) ConfigurationAdmin(org.osgi.service.cm.ConfigurationAdmin) Test(org.junit.Test)

Aggregations

ZooKeeperClusterBootstrap (io.fabric8.api.ZooKeeperClusterBootstrap)2 Test (org.junit.Test)2 Container (io.fabric8.api.Container)1 CreateEnsembleOptions (io.fabric8.api.CreateEnsembleOptions)1 FabricService (io.fabric8.api.FabricService)1 ConfigurationAdmin (org.osgi.service.cm.ConfigurationAdmin)1