Package org.jclouds.vcloud.director.v1_5.user

Examples of org.jclouds.vcloud.director.v1_5.user.VCloudDirectorApi


         assertEquals(api.getVAppApi().getOwner(vAppURI), expected);
   }

   @Test(enabled = false)
   public void testEditOwner() {
      VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
         new VcloudHttpRequestPrimer()
            .apiCommand("PUT", vAppId + "/owner")
            .xmlFilePayload("/vApp/editOwner.xml", VCloudDirectorMediaType.OWNER)
            .acceptAnyMedia()
            .httpRequestBuilder().build(),
         new VcloudHttpResponsePrimer()
            .httpResponseBuilder().statusCode(204).build());

      Owner owner = Owner.builder()
            .build();

    api.getVAppApi().editOwner(vAppURI, owner);
   }
View Full Code Here


    api.getVAppApi().editOwner(vAppURI, owner);
   }

   @Test(enabled = false)
   public void testGetProductSections() {
      VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
         new VcloudHttpRequestPrimer()
            .apiCommand("GET", vAppId + "/productSections")
            .acceptAnyMedia()
            .httpRequestBuilder().build(),
         new VcloudHttpResponsePrimer()
            .xmlFilePayload("/vApp/getProductSections.xml", VCloudDirectorMediaType.PRODUCT_SECTION_LIST)
            .httpResponseBuilder().build());

         ProductSectionList expected = getProductSections();

         assertEquals(api.getVAppApi().getProductSections(vAppURI), expected);
   }
View Full Code Here

         assertEquals(api.getVAppApi().getProductSections(vAppURI), expected);
   }

   @Test(enabled = false)
   public void testEditProductSections() {
      VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
         new VcloudHttpRequestPrimer()
            .apiCommand("PUT", vAppId + "/productSections")
            .xmlFilePayload("/vApp/editProductSections.xml", VCloudDirectorMediaType.PRODUCT_SECTION_LIST)
            .acceptAnyMedia()
            .httpRequestBuilder().build(),
         new VcloudHttpResponsePrimer()
            .xmlFilePayload("/vApp/editProductSections.xml", VCloudDirectorMediaType.VAPP)
            .httpResponseBuilder().build());

         Task expected = editProductSectionsTask();

         assertEquals(api.getVAppApi().editProductSections(vAppURI, null), expected);
   }
View Full Code Here

         assertEquals(api.getVAppApi().editProductSections(vAppURI, null), expected);
   }

   @Test(enabled = false)
   public void testGetStartupSection() {
      VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
         new VcloudHttpRequestPrimer()
            .apiCommand("GET", vAppId + "/startupSection")
            .acceptAnyMedia()
            .httpRequestBuilder().build(),
         new VcloudHttpResponsePrimer()
            .xmlFilePayload("/vApp/getStartupSection.xml", VCloudDirectorMediaType.STARTUP_SECTION)
            .httpResponseBuilder().build());

    StartupSection expected = getStartupSection();

    assertEquals(api.getVAppApi().getStartupSection(vAppURI), expected);
   }
View Full Code Here

    assertEquals(api.getVAppApi().getStartupSection(vAppURI), expected);
   }

   @Test(enabled = false)
   public void testEditStartupSection() {
      VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
         new VcloudHttpRequestPrimer()
            .apiCommand("PUT", vAppId + "/startupSection")
            .xmlFilePayload("/vApp/editStartupSection.xml", VCloudDirectorMediaType.STARTUP_SECTION)
            .acceptAnyMedia()
            .httpRequestBuilder().build(),
         new VcloudHttpResponsePrimer()
            .xmlFilePayload("/vApp/editStartupSectionTask.xml", VCloudDirectorMediaType.TASK)
            .httpResponseBuilder().build());

      StartupSection section = null; // getStartupSection().toBuilder()
//            .build();

    Task expected = editStartupSectionTask();

    assertEquals(api.getVAppApi().editStartupSection(vAppURI, section), expected);
   }
View Full Code Here

   //TODO: this inheritance is all wrong!!  the base client shouldn't inherit from the admin client tests!!
  
   public void testRestClientModuleWorksProperly() throws Exception {

      VCloudDirectorApi apiWhenSessionsExist = requestSendsResponse(loginRequest, sessionResponse);

      assertEquals(apiWhenSessionsExist.getCurrentSession(), SessionApiExpectTest.SESSION);
   }
View Full Code Here

  
   @Test
   public void testGetOwner() {
      URI mediaUri = URI.create(endpoint + "/media/794eb334-754e-4917-b5a0-5df85cbd61d1");

      VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
            new VcloudHttpRequestPrimer()
               .apiCommand("GET", "/media/794eb334-754e-4917-b5a0-5df85cbd61d1/owner")
               .acceptAnyMedia()
               .httpRequestBuilder().build(),
            new VcloudHttpResponsePrimer()
               .xmlFilePayload("/media/owner.xml", VCloudDirectorMediaType.OWNER)
               .httpResponseBuilder().build());
     
      Owner expected = owner().toBuilder()
               .link(Link.builder()
                        .rel("up")
                        .type("application/vnd.vmware.vcloud.media+xml")
                        .href(URI.create("https://mycloud.greenhousedata.com/api/media/794eb334-754e-4917-b5a0-5df85cbd61d1"))
                        .build())
               .build();
     
      assertEquals(api.getMediaApi().getOwner(mediaUri), expected);
   }
View Full Code Here

            .payload(payloadFromResourceWithContentType("/task/tasksList.xml", TASKS_LIST + ";version=1.5"))
            .build();
   
   @Test
   public void testGetTasksListHref() {
      VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse, getTasksList, getTasksListResponse);
      assertEquals(api.getTaskApi().getTasksList(tasksListHref), tasksList());
   }
View Full Code Here

            .payload(payloadFromResourceWithContentType("/task/task.xml", TASK + ";version=1.5"))
            .build();
   
   @Test
   public void testGetTaskHref() {
      VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse, get, getResponse);
      assertEquals(api.getTaskApi().get(taskHref), task());
   }
View Full Code Here

           .payload(payloadFromStringWithContentType(taskEntity, ENTITY + ";version=1.5"))
           .build();
  
   @Test
   public void testGetTaskUrn() {
      VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse, resolveTask, resolveTaskResponse, get, getResponse);
      assertEquals(api.getTaskApi().get(taskUrn), task());
   }
View Full Code Here

TOP

Related Classes of org.jclouds.vcloud.director.v1_5.user.VCloudDirectorApi

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.