Search in sources :

Example 31 with Config

use of com.hortonworks.streamline.common.Config in project streamline by hortonworks.

the class HiveServiceRegistrarTest method testRegister_requiredPropertyNotPresent.

@Test
public void testRegister_requiredPropertyNotPresent() throws Exception {
    Cluster cluster = getTestCluster(1L);
    HiveServiceRegistrar registrar = initializeServiceRegistrar();
    try (InputStream is = getClass().getClassLoader().getResourceAsStream(HIVE_SITE_XML_BADCASE_FILE_PATH)) {
        ManualServiceRegistrar.ConfigFileInfo hiveSiteXml = new ManualServiceRegistrar.ConfigFileInfo(HIVE_SITE_XML, is);
        registrar.register(cluster, new Config(), Lists.newArrayList(hiveSiteXml));
        fail("Should throw IllegalArgumentException");
    } catch (IllegalArgumentException e) {
        // OK
        Service hiveService = environmentService.getServiceByName(cluster.getId(), Constants.Hive.SERVICE_NAME);
        assertNull(hiveService);
    }
}
Also used : ManualServiceRegistrar(com.hortonworks.streamline.streams.cluster.register.ManualServiceRegistrar) InputStream(java.io.InputStream) Config(com.hortonworks.streamline.common.Config) Cluster(com.hortonworks.streamline.streams.cluster.catalog.Cluster) Service(com.hortonworks.streamline.streams.cluster.catalog.Service) Test(org.junit.Test)

Example 32 with Config

use of com.hortonworks.streamline.common.Config in project streamline by hortonworks.

the class HiveServiceRegistrarTest method testRegister_hive_site_xml_notPresent.

@Test
public void testRegister_hive_site_xml_notPresent() throws Exception {
    Cluster cluster = getTestCluster(1L);
    HiveServiceRegistrar registrar = initializeServiceRegistrar();
    try {
        registrar.register(cluster, new Config(), Lists.newArrayList());
        fail("Should throw IllegalArgumentException");
    } catch (IllegalArgumentException e) {
        // OK
        Service hiveService = environmentService.getServiceByName(cluster.getId(), Constants.Hive.SERVICE_NAME);
        assertNull(hiveService);
    }
}
Also used : Config(com.hortonworks.streamline.common.Config) Cluster(com.hortonworks.streamline.streams.cluster.catalog.Cluster) Service(com.hortonworks.streamline.streams.cluster.catalog.Service) Test(org.junit.Test)

Example 33 with Config

use of com.hortonworks.streamline.common.Config in project streamline by hortonworks.

the class StormServiceRegistrarTest method testRegister_component_nimbus_notPresent.

@Test
public void testRegister_component_nimbus_notPresent() throws Exception {
    Cluster cluster = getTestCluster(1L);
    StormServiceRegistrar registrar = initializeServiceRegistrar();
    try {
        Config config = new Config();
        // no nimbus params
        config.put(StormServiceRegistrar.PARAM_UI_HOST, "storm-1");
        config.put(StormServiceRegistrar.PARAM_UI_PORT, (Object) 8080);
        registrar.register(cluster, config, Collections.emptyList());
        fail("Should throw IllegalArgumentException");
    } catch (IllegalArgumentException e) {
        // OK
        Service stormService = environmentService.getServiceByName(cluster.getId(), Constants.Storm.SERVICE_NAME);
        assertNull(stormService);
    }
}
Also used : Config(com.hortonworks.streamline.common.Config) Cluster(com.hortonworks.streamline.streams.cluster.catalog.Cluster) Service(com.hortonworks.streamline.streams.cluster.catalog.Service) Test(org.junit.Test)

Example 34 with Config

use of com.hortonworks.streamline.common.Config in project streamline by hortonworks.

the class ZookeeperServiceRegistrarTest method testRegisterZookeeperServerPropertyNotPresent.

@Test
public void testRegisterZookeeperServerPropertyNotPresent() throws Exception {
    Cluster cluster = getTestCluster(1L);
    ZookeeperServiceRegistrar registrar = initializeServiceRegistrar();
    try {
        registrar.register(cluster, new Config(), Collections.emptyList());
        fail("Should throw IllegalArgumentException");
    } catch (IllegalArgumentException e) {
        // OK
        Service zkService = environmentService.getServiceByName(cluster.getId(), Constants.Zookeeper.SERVICE_NAME);
        assertNull(zkService);
    }
}
Also used : Config(com.hortonworks.streamline.common.Config) Cluster(com.hortonworks.streamline.streams.cluster.catalog.Cluster) Service(com.hortonworks.streamline.streams.cluster.catalog.Service) Test(org.junit.Test)

Example 35 with Config

use of com.hortonworks.streamline.common.Config in project streamline by hortonworks.

the class DruidServiceRegistrarTest method testRegister_zookeeper_connection_notPresent.

@Test
public void testRegister_zookeeper_connection_notPresent() throws Exception {
    Cluster cluster = getTestCluster(1L);
    DruidServiceRegistrar registerer = initializeServiceRegistrar();
    try {
        Config config = new Config();
        config.put(DruidServiceRegistrar.PARAM_INDEXING_SERVICE_NAME, "druid/overlord");
        config.put(DruidServiceRegistrar.PARAM_DISCOVERY_CURATOR_PATH, "/prod/discovery");
        registerer.register(cluster, config, Collections.emptyList());
        fail("Should throw IllegalArgumentException");
    } catch (IllegalArgumentException e) {
        // OK
        Service druidService = environmentService.getServiceByName(cluster.getId(), Constants.Druid.SERVICE_NAME);
        assertNull(druidService);
    }
}
Also used : Config(com.hortonworks.streamline.common.Config) Cluster(com.hortonworks.streamline.streams.cluster.catalog.Cluster) Service(com.hortonworks.streamline.streams.cluster.catalog.Service) Test(org.junit.Test)

Aggregations

Config (com.hortonworks.streamline.common.Config)41 Cluster (com.hortonworks.streamline.streams.cluster.catalog.Cluster)25 Service (com.hortonworks.streamline.streams.cluster.catalog.Service)25 Test (org.junit.Test)24 ServiceConfiguration (com.hortonworks.streamline.streams.cluster.catalog.ServiceConfiguration)15 ManualServiceRegistrar (com.hortonworks.streamline.streams.cluster.register.ManualServiceRegistrar)9 InputStream (java.io.InputStream)9 Component (com.hortonworks.streamline.streams.cluster.catalog.Component)8 Map (java.util.Map)8 ComponentProcess (com.hortonworks.streamline.streams.cluster.catalog.ComponentProcess)7 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)6 Constants (com.hortonworks.streamline.streams.cluster.Constants)5 ComponentPropertyPattern (com.hortonworks.streamline.streams.cluster.discovery.ambari.ComponentPropertyPattern)5 Collections (java.util.Collections)5 List (java.util.List)4 Collectors.toList (java.util.stream.Collectors.toList)4 JsonProcessingException (com.fasterxml.jackson.core.JsonProcessingException)3 ServiceConfigurations (com.hortonworks.streamline.streams.cluster.discovery.ambari.ServiceConfigurations)3 Stream (com.hortonworks.streamline.streams.layout.component.Stream)3 HashMap (java.util.HashMap)3