@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
public class WhirrFunctionLoaderTest extends WhirrKarafTestSupport {
@Test
public void testServices() throws InterruptedException {
ServiceFunctionLoader loader = new ServiceFunctionLoader(bundleContext);
//Install all services
executeCommand("features:install whirr-cassandra");
executeCommand("features:install whirr-chef");
executeCommand("features:install whirr-elasticsearch");
executeCommand("features:install whirr-ganglia");
executeCommand("features:install whirr-hadoop");
executeCommand("features:install whirr-hama");
executeCommand("features:install whirr-hbase");
executeCommand("features:install whirr-puppet");
executeCommand("features:install whirr-pig");
executeCommand("features:install whirr-solr");
executeCommand("features:install whirr-mahout");
executeCommand("features:install whirr-yarn");
executeCommand("features:install whirr-zookeeper");
System.err.println(executeCommand("osgi:list"));
//Test that services properly register to OSGi service registry.
getOsgiService("org.apache.whirr.ClusterController", "(name=default)", SERVICE_TIMEOUT);
//Check Cassandra Functions
String function = loader.loadFunction("cleanup_cassandra", OsFamily.UNIX);
Assert.assertNotNull(function);
function = loader.loadFunction("configure_cassandra", OsFamily.UNIX);
Assert.assertNotNull(function);
function = loader.loadFunction("install_cassandra", OsFamily.UNIX);
Assert.assertNotNull(function);
function = loader.loadFunction("start_cassandra", OsFamily.UNIX);
Assert.assertNotNull(function);
function = loader.loadFunction("stop_cassandra", OsFamily.UNIX);
Assert.assertNotNull(function);
//Check Chef Functions
function = loader.loadFunction("install_chef", OsFamily.UNIX);
Assert.assertNotNull(function);
//Check Elastic Search Functions
function = loader.loadFunction("cleanup_elasticsearch", OsFamily.UNIX);
Assert.assertNotNull(function);
function = loader.loadFunction("configure_elasticsearch", OsFamily.UNIX);
Assert.assertNotNull(function);
function = loader.loadFunction("install_elasticsearch", OsFamily.UNIX);
Assert.assertNotNull(function);
function = loader.loadFunction("start_elasticsearch", OsFamily.UNIX);
Assert.assertNotNull(function);
function = loader.loadFunction("stop_elasticsearch", OsFamily.UNIX);
Assert.assertNotNull(function);
//Check Ganglia Functions
function = loader.loadFunction("configure_ganglia", OsFamily.UNIX);
Assert.assertNotNull(function);
function = loader.loadFunction("install_ganglia", OsFamily.UNIX);
Assert.assertNotNull(function);
//Check Hadoop Functions
function = loader.loadFunction("configure_hadoop", OsFamily.UNIX);
Assert.assertNotNull(function);
function = loader.loadFunction("install_hadoop", OsFamily.UNIX);
Assert.assertNotNull(function);
//Check Hama Functions
function = loader.loadFunction("configure_hama", OsFamily.UNIX);
Assert.assertNotNull(function);
function = loader.loadFunction("install_hama", OsFamily.UNIX);
Assert.assertNotNull(function);
function = loader.loadFunction("start_hama", OsFamily.UNIX);
Assert.assertNotNull(function);
//Check HBase Functions
function = loader.loadFunction("configure_hbase", OsFamily.UNIX);
Assert.assertNotNull(function);
function = loader.loadFunction("install_hbase", OsFamily.UNIX);
Assert.assertNotNull(function);
//Check Mahout Functions
function = loader.loadFunction("configure_mahout_client", OsFamily.UNIX);
Assert.assertNotNull(function);
//Check Pig Functions
function = loader.loadFunction("configure_pig_client", OsFamily.UNIX);
Assert.assertNotNull(function);
//Check Puppet Functions
function = loader.loadFunction("install_puppet", OsFamily.UNIX);
Assert.assertNotNull(function);
//Check Solr Functions
function = loader.loadFunction("configure_solr", OsFamily.UNIX);
Assert.assertNotNull(function);
function = loader.loadFunction("install_solr", OsFamily.UNIX);
Assert.assertNotNull(function);
function = loader.loadFunction("start_solr", OsFamily.UNIX);
Assert.assertNotNull(function);
function = loader.loadFunction("stop_solr", OsFamily.UNIX);
Assert.assertNotNull(function);
//Check Yarn Functions
function = loader.loadFunction("configure_hadoop_mr2", OsFamily.UNIX);
Assert.assertNotNull(function);
function = loader.loadFunction("install_hadoop_mr2", OsFamily.UNIX);
Assert.assertNotNull(function);
function = loader.loadFunction("start_mr_jobhistory", OsFamily.UNIX);
Assert.assertNotNull(function);
function = loader.loadFunction("start_yarn", OsFamily.UNIX);
Assert.assertNotNull(function);
function = loader.loadFunction("configure_yarn", OsFamily.UNIX);
Assert.assertNotNull(function);
//Check Zookeeper Functions
function = loader.loadFunction("cleanup_zookeeper", OsFamily.UNIX);
Assert.assertNotNull(function);
function = loader.loadFunction("configure_zookeeper", OsFamily.UNIX);
Assert.assertNotNull(function);
function = loader.loadFunction("install_zookeeper", OsFamily.UNIX);
Assert.assertNotNull(function);
function = loader.loadFunction("start_zookeeper", OsFamily.UNIX);
Assert.assertNotNull(function);
function = loader.loadFunction("stop_zookeeper", OsFamily.UNIX);
Assert.assertNotNull(function);
}