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);
}
}
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);
}
}
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);
}
}
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);
}
}
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);
}
}
Aggregations