Examples of DryRun


Examples of org.apache.whirr.service.DryRunModule.DryRun

    };
  }

  protected DryRun launchWithClusterSpec(ClusterSpec clusterSpec) throws IOException, InterruptedException {
    ClusterController controller = new ClusterController();
    DryRun dryRun = controller.getCompute().apply(clusterSpec).utils().injector().getInstance(DryRun.class);
    dryRun.reset();
    controller.launchCluster(clusterSpec);
    return dryRun;
  }
View Full Code Here

Examples of org.apache.whirr.service.DryRunModule.DryRun

   */
  @Test
  public void testBootstrapAndConfigure() throws Exception {
    ClusterSpec cookbookWithDefaultRecipe = newClusterSpecForProperties(ImmutableMap.of(
        "whirr.instance-templates", "1 " + Joiner.on("+").join(getInstanceRoles())));
    DryRun dryRun = launchWithClusterSpec(cookbookWithDefaultRecipe);

    assertScriptPredicateOnPhase(dryRun, "bootstrap", bootstrapPredicate());
    assertScriptPredicateOnPhase(dryRun, "configure", configurePredicate());
  }
View Full Code Here

Examples of org.apache.whirr.service.DryRunModule.DryRun

   * configuration parameters) is correctly loaded and executed.
   */
  @Test
  public void testChefOnly() throws Exception {
    ClusterSpec chefOnly = newClusterSpecForProperties(ImmutableMap.of("whirr.instance-templates", "1 chef"));
    DryRun dryRun = launchWithClusterSpec(chefOnly);
    assertScriptPredicateOnPhase(dryRun, "bootstrap", bootstrapPredicate());
    assertNoEntryForPhase(dryRun, "configure");
  }
View Full Code Here

Examples of org.apache.whirr.service.DryRunModule.DryRun

   */
  @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
View Full Code Here

Examples of org.apache.whirr.service.DryRunModule.DryRun

   */
  @Test
  public void testChefWithAttributes() throws Exception {
    ClusterSpec cookbookWithSpecificRecipe = newClusterSpecForProperties(ImmutableMap.of("whirr.instance-templates",
        "1 chef:java:sun"));
    DryRun dryRun = launchWithClusterSpec(cookbookWithSpecificRecipe);

    assertScriptPredicateOnPhase(dryRun, "bootstrap", bootstrapPredicate());

    // chef execution with a default cookbook recipe should contain a
    // particular string
View Full Code Here

Examples of org.apache.whirr.service.DryRunModule.DryRun

  @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
View Full Code Here

Examples of org.apache.whirr.service.DryRunModule.DryRun

    ClusterController controller = new ClusterController();

    controller.launchCluster(clusterSpec);
    controller.destroyCluster(clusterSpec);

    DryRun dryRun = DryRunModule.getDryRun();
    ListMultimap<NodeMetadata, RunScriptOnNode> perNodeExecutions = dryRun
        .getExecutions();
    List<RunScriptOnNode> totalExecutions = dryRun
        .getTotallyOrderedExecutions();

    // assert that all nodes executed all three phases and in the right order
    for (Entry<NodeMetadata, Collection<RunScriptOnNode>> entry : perNodeExecutions
        .asMap().entrySet()) {
View Full Code Here

Examples of org.apache.whirr.service.DryRunModule.DryRun

    return containsPattern("configure_kerberos_server");
  }

  @Test
  public void testKerberosRealm() throws Exception {
    DryRun dryRun = launchWithClusterSpec(newClusterSpecForProperties(ImmutableMap.of("whirr.instance-templates", "1 "
      + KerberosServerHandler.ROLE)));
    assertScriptPredicateOnPhase(dryRun, "bootstrap", bootstrapPredicate());
    assertScriptPredicateOnPhase(dryRun, "configure", configurePredicate());
  }
View Full Code Here

Examples of org.apache.whirr.service.DryRunModule.DryRun

    assertScriptPredicateOnPhase(dryRun, "configure", configurePredicate());
  }

  @Test
  public void testJavaInstalled() throws Exception {
    DryRun dryRun = launchWithClusterSpec(newClusterSpecForProperties(ImmutableMap.of("whirr.instance-templates", "1 "
        + KerberosServerHandler.ROLE + "+" + KerberosClientHandler.ROLE)));
    assertScriptPredicateOnPhase(dryRun, "bootstrap", bootstrapPredicate());
    assertScriptPredicateOnPhase(dryRun, "bootstrap", containsPattern("install_openjdk"));
  }
View Full Code Here

Examples of org.apache.whirr.service.DryRunModule.DryRun

    assertScriptPredicateOnPhase(dryRun, "bootstrap", containsPattern("install_openjdk"));
  }

  @Test
  public void testJavaInstalledFalse() throws Exception {
    DryRun dryRun = launchWithClusterSpec(newClusterSpecForProperties(ImmutableMap.of("whirr.instance-templates", "1 "
        + KerberosServerHandler.ROLE + "+" + KerberosClientHandler.ROLE, "whirr.env.jdk_installed", "false")));
    assertScriptPredicateOnPhase(dryRun, "bootstrap", bootstrapPredicate());
    assertScriptPredicateOnPhase(dryRun, "bootstrap", containsPattern("install_openjdk"));
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.