use of org.apache.whirr.ClusterSpec in project whirr by apache.
the class ChefServiceDryRunTest method testChefWithDefaultRecipe.
/**
* Tests that a simple recipe (the default recipe in a cookbook without any
* configuration parameters) is correctly loaded and executed.
*/
@Test
public void testChefWithDefaultRecipe() throws Exception {
ClusterSpec cookbookWithDefaultRecipe = newClusterSpecForProperties(ImmutableMap.of("whirr.instance-templates", "1 chef:java"));
DryRun dryRun = launchWithClusterSpec(cookbookWithDefaultRecipe);
assertScriptPredicateOnPhase(dryRun, "bootstrap", bootstrapPredicate());
// chef execution with a default cookbook recipe should contain a
// particular string
assertScriptPredicateOnPhase(dryRun, "configure", containsPattern("chef-solo -j /tmp/java::default"));
}
use of org.apache.whirr.ClusterSpec in project whirr by apache.
the class ChefServiceDryRunTest method testChefWithParticularRecipe.
/**
* Tests that a simple recipe (the default recipe in a cookbook without any
* configuration parameters) is correctly loaded and executed.
*/
@Test
public void testChefWithParticularRecipe() throws Exception {
ClusterSpec cookbookWithAttributes = newClusterSpecForProperties(ImmutableMap.<String, String>builder().put("whirr.instance-templates", "1 chef:java").put("java.url", "http://testurl").put("java.version", "1.5").put("java.flavor", "vanilla").build());
DryRun dryRun = launchWithClusterSpec(cookbookWithAttributes);
assertScriptPredicateOnPhase(dryRun, "bootstrap", bootstrapPredicate());
// chef execution with a default cookbook recipe should contain a
// particular string
assertScriptPredicateOnPhase(dryRun, "configure", contains(compile("{\"java\":{\"version\":\"1.5\",\"flavor\":\"vanilla\"}", LITERAL)));
}
use of org.apache.whirr.ClusterSpec in project whirr by apache.
the class HadoopDataNodeClusterActionHandler method afterConfigure.
@Override
protected void afterConfigure(ClusterActionEvent event) throws IOException, InterruptedException {
ClusterSpec clusterSpec = event.getClusterSpec();
Cluster cluster = event.getCluster();
// TODO: wait for TTs to come up (done in test for the moment)
LOG.info("Completed configuration of {} role {}", clusterSpec.getClusterName(), getRole());
// TODO: List data nodes + url to their WEB UI?
}
Aggregations