Package org.jclouds.vcloud.director.v1_5.features

Examples of org.jclouds.vcloud.director.v1_5.features.TaskApi


      vApp = vAppApi.get(vApp.getId()); // reload, so it has the VMs
      List<Vm> vms = vApp.getChildren().getVms();
      Set<URI> vmHrefs = toHrefs(vms);

      // Method under test: do the query
      QueryResultRecords queryResult = queryApi.vmsQueryAll();
      Set<URI> hrefs = toHrefs(queryResult);

      assertRecordTypes(queryResult, Arrays.asList(VCloudDirectorMediaType.VM, null), QueryResultVMRecord.class);
      assertTrue(hrefs.containsAll(vmHrefs), "VMs query result should include vms " + vmHrefs + "; but only has "
               + hrefs);
View Full Code Here


  @Test(description = "GET /vms/query?filter", dependsOnMethods = { "testQueryAllVms" })
  public void testQueryAllVmsWithFilter() {
    List<Vm> vms = vApp.getChildren().getVms();
    Set<URI> vmHrefs = toHrefs(vms);

    QueryResultRecords queryResult = queryApi.vmsQuery(String.format(
        "containerName==%s", vApp.getName()));
    Set<URI> hrefs = toHrefs(queryResult);

    assertRecordTypes(queryResult,
        Arrays.asList(VCloudDirectorMediaType.VM, null),
View Full Code Here

        message);
  }

   @Test(description = "GET /mediaList/query")
   public void testQueryAllMedia() {
      QueryResultRecords queryResult = queryApi.mediaListQueryAll();

      assertRecordTypes(queryResult, Arrays.asList(VCloudDirectorMediaType.VAPP, null), QueryResultMediaRecord.class);
   }
View Full Code Here

   }

   @Test(description = "GET /mediaList/query?filter")
   public void testQueryMediaWithFilter() {
      String mediaName = "abc";
      QueryResultRecords queryResult = queryApi.mediaListQuery(String.format("name==%s", mediaName));

      assertRecordTypes(queryResult, Arrays.asList(VCloudDirectorMediaType.VAPP, null), QueryResultMediaRecord.class);
   }
View Full Code Here

      return params;
   }

   public static GuestCustomizationSection getGuestCustomizationSection() {
      GuestCustomizationSection section = GuestCustomizationSection.builder()
            .build();

      return section;
   }
View Full Code Here

   protected void assertTaskSucceedsLong(Task task) {
      assertTrue(retryTaskSuccessLong.apply(task), String.format(TASK_COMPLETE_TIMELY, task));
   }

   protected boolean taskStatusEventually(Task task, Task.Status running, ImmutableSet<Task.Status> immutableSet) {
      TaskApi taskApi = context.getApi().getTaskApi();
      TaskStatusEquals predicate = new TaskStatusEquals(taskApi, running, immutableSet);
      return retry(predicate, TASK_TIMEOUT_SECONDS * 1000L).apply(task);
   }
View Full Code Here

      assertTrue(taskStatusEventually(task, running, immutableSet),
               String.format("Task '%s' must reach status %s", task.getOperationName(), running));
   }

   protected boolean taskDoneEventually(Task task) {
      TaskApi taskApi = context.getApi().getTaskApi();
      TaskStatusEquals predicate = new TaskStatusEquals(taskApi, ImmutableSet.of(Task.Status.ABORTED,
               Task.Status.CANCELED, Task.Status.ERROR, Task.Status.SUCCESS), ImmutableSet.<Task.Status> of());
      return retry(predicate, TASK_TIMEOUT_SECONDS * 1000L).apply(task);
   }
View Full Code Here

   protected void assertTaskSucceedsLong(Task task) {
      assertTrue(retryTaskSuccessLong.apply(task), String.format(TASK_COMPLETE_TIMELY, task));
   }

   protected boolean taskStatusEventually(Task task, Task.Status running, ImmutableSet<Task.Status> immutableSet) {
      TaskApi taskApi = context.getApi().getTaskApi();
      TaskStatusEquals predicate = new TaskStatusEquals(taskApi, running, immutableSet);
      return retry(predicate, TASK_TIMEOUT_SECONDS * 1000L).apply(task);
   }
View Full Code Here

      assertTrue(taskStatusEventually(task, running, immutableSet),
               String.format("Task '%s' must reach status %s", task.getOperationName(), running));
   }

   protected boolean taskDoneEventually(Task task) {
      TaskApi taskApi = context.getApi().getTaskApi();
      TaskStatusEquals predicate = new TaskStatusEquals(taskApi, ImmutableSet.of(Task.Status.ABORTED,
               Task.Status.CANCELED, Task.Status.ERROR, Task.Status.SUCCESS), ImmutableSet.<Task.Status> of());
      return retry(predicate, TASK_TIMEOUT_SECONDS * 1000L).apply(task);
   }
View Full Code Here

   protected void assertTaskSucceedsLong(Task task) {
      assertTrue(retryTaskSuccessLong.apply(task), String.format(TASK_COMPLETE_TIMELY, task));
   }

   protected boolean taskStatusEventually(Task task, Task.Status running, ImmutableSet<Task.Status> immutableSet) {
      TaskApi taskApi = context.getApi().getTaskApi();
      TaskStatusEquals predicate = new TaskStatusEquals(taskApi, running, immutableSet);
      return retry(predicate, TASK_TIMEOUT_SECONDS * 1000L).apply(task);
   }
View Full Code Here

TOP

Related Classes of org.jclouds.vcloud.director.v1_5.features.TaskApi

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.