Search in sources :

Example 1 with ZooKeeperService

use of org.apache.whirr.service.zookeeper.ZooKeeperService in project whirr by apache.

the class ZooKeeperServiceTest method setUp.

@Before
public void setUp() throws ConfigurationException, IOException {
    CompositeConfiguration config = new CompositeConfiguration();
    if (System.getProperty("config") != null) {
        config.addConfiguration(new PropertiesConfiguration(System.getProperty("config")));
    }
    config.addConfiguration(new PropertiesConfiguration("whirr-zookeeper-test.properties"));
    clusterSpec = ClusterSpec.fromConfiguration(config);
    Service s = new ServiceFactory().create(clusterSpec.getServiceName());
    assertThat(s, instanceOf(ZooKeeperService.class));
    service = (ZooKeeperService) s;
    cluster = service.launchCluster(clusterSpec);
    System.out.println(cluster.getHosts());
}
Also used : ServiceFactory(org.apache.whirr.service.ServiceFactory) ZooKeeperService(org.apache.whirr.service.zookeeper.ZooKeeperService) CompositeConfiguration(org.apache.commons.configuration.CompositeConfiguration) Service(org.apache.whirr.service.Service) ZooKeeperService(org.apache.whirr.service.zookeeper.ZooKeeperService) PropertiesConfiguration(org.apache.commons.configuration.PropertiesConfiguration) Before(org.junit.Before)

Aggregations

CompositeConfiguration (org.apache.commons.configuration.CompositeConfiguration)1 PropertiesConfiguration (org.apache.commons.configuration.PropertiesConfiguration)1 Service (org.apache.whirr.service.Service)1 ServiceFactory (org.apache.whirr.service.ServiceFactory)1 ZooKeeperService (org.apache.whirr.service.zookeeper.ZooKeeperService)1 Before (org.junit.Before)1