Package org.apache.whirr

Examples of org.apache.whirr.ClusterControllerFactory


      containsString("Please specify a script file to be executed."));
  }

  @Test
  public void testRunScriptByInstanceId() throws Exception {
    ClusterControllerFactory factory = mock(ClusterControllerFactory.class);
    ClusterController controller = mock(ClusterController.class);

    when(factory.create((String)any())).thenReturn(controller);

    RunScriptCommand command = new RunScriptCommand(factory);
    Map<String, File> keys = KeyPair.generateTemporaryFiles();

    int rc = command.run(null, out, System.err, Lists.newArrayList(
View Full Code Here


    assertThat(predicate.getValue().toString(), is(expected.toString()));
  }

  @Test
  public void testRunScriptByRole() throws Exception {
    ClusterControllerFactory factory = mock(ClusterControllerFactory.class);
    ClusterController controller = mock(ClusterController.class);
    when(factory.create((String)any())).thenReturn(controller);

    ClusterStateStore memStore = new MemoryClusterStateStore();
    memStore.save(createTestCluster(
      new String[]{"reg/A", "reg/B"}, new String[]{"A", "B"}));
View Full Code Here

        return siteXML;
    }

    private ClusterController createClusterController(String serviceName){
        ClusterControllerFactory factory = new ClusterControllerFactory();
        ClusterController controller = factory.create(serviceName);

        if(controller == null){
            logger.warn("Unable to find the service {0}, using default.", serviceName);
            controller = factory.create(null);
        }

        return controller;
    }
View Full Code Here

  }

  @Test
  public void testAllOptions() throws Exception {

    ClusterControllerFactory factory = mock(ClusterControllerFactory.class);
    ClusterController controller = mock(ClusterController.class);
    when(factory.create((String) any())).thenReturn(controller);

    NodeMetadata node1 = new NodeMetadataBuilder().name("name1").ids("id1")
        .location(new LocationBuilder().scope(LocationScope.PROVIDER)
          .id("location-id1").description("location-desc1").build())
        .imageId("image-id").status(NodeMetadata.Status.RUNNING)
View Full Code Here

public class AbstractClusterCommandTest {

  @Test
  public void testOverrides() throws Exception {
    AbstractClusterCommand clusterCommand = new AbstractClusterCommand("name",
        "description", new ClusterControllerFactory()) {
      @Override
      public int run(InputStream in, PrintStream out, PrintStream err,
          List<String> args) throws Exception {
        return 0;
      }
View Full Code Here

   * warning).
   */
  @Test
  public void testCreateServerWithInvalidClusterControllerName() throws Exception {
    AbstractClusterCommand clusterCommand = new AbstractClusterCommand("name",
        "description", new ClusterControllerFactory()) {
      @Override
      public int run(InputStream in, PrintStream out, PrintStream err,
          List<String> args) throws Exception {
        return 0;
      }
View Full Code Here

* A command to list the nodes in a cluster.
*/
public class ListClusterCommand extends AbstractClusterCommand {

  public ListClusterCommand() throws IOException {
    this(new ClusterControllerFactory());
  }
View Full Code Here

TOP

Related Classes of org.apache.whirr.ClusterControllerFactory

Copyright © 2018 www.massapicom. 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.