Package org.apache.whirr.service

Examples of org.apache.whirr.service.ServiceFactory


  }
 
  @Test
  public void testAllOptions() throws Exception {
   
    ServiceFactory factory = mock(ServiceFactory.class);
    Service service = mock(Service.class);
    when(factory.create((String) any())).thenReturn(service);
    NodeMetadata node1 = new NodeMetadataImpl(null, "name1", "id1",
        new LocationImpl(LocationScope.PROVIDER, "location-id1",
            "location-desc1", null),
        null, Collections.<String,String>emptyMap(), null, null, "image-id",
        null, NodeState.RUNNING,
View Full Code Here


  }
 
  @Test
  public void testAllOptions() throws Exception {
   
    ServiceFactory factory = mock(ServiceFactory.class);
    Service service = mock(Service.class);
    when(factory.create((String) any())).thenReturn(service);
   
    DestroyClusterCommand command = new DestroyClusterCommand(factory);
    Map<String, File> keys = KeyPair.generateTemporaryFiles();
   
    int rc = command.run(null, out, null, Lists.newArrayList(
View Full Code Here

  }
 
  @Test
  public void testAllOptions() throws Exception {
   
    ServiceFactory factory = mock(ServiceFactory.class);
    Service service = mock(Service.class);
    Cluster cluster = mock(Cluster.class);
    when(factory.create((String) any())).thenReturn(service);
    when(service.launchCluster((ClusterSpec) any())).thenReturn(cluster);
   
    LaunchClusterCommand command = new LaunchClusterCommand(factory);
    Map<String, File> keys = KeyPair.generateTemporaryFiles();
   
View Full Code Here

      stream.printf("%" + maxLen + "s  %s\n", command.getName(),
          command.getDescription());
    }
    stream.println();
    stream.println("Available services:");
    ServiceFactory serviceFactory = new ServiceFactory();
    for (String serviceName : new TreeSet<String>(
        serviceFactory.availableServices())) {
      stream.println("  " + serviceName);
    }
  }
View Full Code Here

* A command to destroy a running cluster (terminate and cleanup).
*/
public class DestroyClusterCommand extends AbstractClusterSpecCommand {

  public DestroyClusterCommand() throws IOException {
    this(new ServiceFactory());
  }
View Full Code Here

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

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

* A command to launch a new cluster.
*/
public class LaunchClusterCommand extends AbstractClusterSpecCommand {

  public LaunchClusterCommand() throws IOException {
    this(new ServiceFactory());
  }
View Full Code Here

  }
 
  @Test
  public void testAllOptions() throws Exception {
   
    ServiceFactory factory = mock(ServiceFactory.class);
    Service service = mock(Service.class);
    when(factory.create((String) any())).thenReturn(service);
    NodeMetadata node1 = new NodeMetadataBuilder().name("name1").ids("id1")
        .location(new LocationBuilder().scope(LocationScope.PROVIDER)
          .id("location-id1").description("location-desc1").build())
        .imageId("image-id").state(NodeState.RUNNING)
        .publicAddresses(Lists.newArrayList("100.0.0.1"))
View Full Code Here

        " --instance-id <ID> [OPTIONS]"));
  }

  @Test
  public void testDestroyInstanceById() throws Exception {
    ServiceFactory factory = mock(ServiceFactory.class);
    Service service = mock(Service.class);
    when(factory.create((String) any())).thenReturn(service);

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

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

  }
 
  @Test
  public void testAllOptions() throws Exception {
   
    ServiceFactory factory = mock(ServiceFactory.class);
    Service service = mock(Service.class);
    Cluster cluster = mock(Cluster.class);
    when(factory.create((String) any())).thenReturn(service);
    when(service.launchCluster((ClusterSpec) any())).thenReturn(cluster);
   
    LaunchClusterCommand command = new LaunchClusterCommand(factory);
    Map<String, File> keys = KeyPair.generateTemporaryFiles();
   
View Full Code Here

TOP

Related Classes of org.apache.whirr.service.ServiceFactory

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.