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

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


            .statusCode(200)
            .build();
  
   @Test
   public void testCancelTaskHref() {
      VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse, cancel, cancelResponse);
      api.getTaskApi().cancel(taskHref);
   }
View Full Code Here


      api.getTaskApi().cancel(taskHref);
   }
  
   @Test
   public void testCancelTaskUrn() {
      VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse, resolveTask, resolveTaskResponse, cancel, cancelResponse);
      api.getTaskApi().cancel(taskHref);
   }
View Full Code Here

            .payload(payloadFromResourceWithContentType("/network/network.xml", ORG + ";version=1.5"))
            .build();
   
   @Test
   public void testGetNetworkHref() {
      VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse, get, getResponse);
      assertEquals(api.getNetworkApi().get(networkHref), network());
   }
View Full Code Here

   }
  
   @Test
   public void testGetNetworkHrefInvalidId() {
     
      VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
               get.toBuilder().endpoint(endpoint + "/network/NOTAUUID").build(),
               HttpResponse.builder()
                           .statusCode(400)
                           .payload(payloadFromResourceWithContentType("/network/error400.xml", ERROR + ";version=1.5"))
                           .build());
     
      Error expected = Error.builder()
         .message("validation error : EntityRef has incorrect type, expected type is com.vmware.vcloud.entity.network.")
         .majorErrorCode(400)
         .minorErrorCode("BAD_REQUEST")
         .build();

      try {
         api.getNetworkApi().get(URI.create(endpoint + "/network/NOTAUUID"));
         fail("Should give HTTP 400 error");
      } catch (VCloudDirectorException vde) {
         assertEquals(vde.getError(), expected);
      } catch (Exception e) {
         fail("Should have thrown a VCloudDirectorException");
View Full Code Here

      }
   }

   @Test
   public void testGetNetworkHrefCatalogId() {
      VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
               get.toBuilder().endpoint(endpoint + "/network/9e08c2f6-077a-42ce-bece-d5332e2ebb5c").build(),
               HttpResponse.builder()
                           .statusCode(403)
                           .payload(payloadFromResourceWithContentType("/network/error403-catalog.xml", ERROR + ";version=1.5"))
                           .build());
     
      assertNull(api.getNetworkApi().get(URI.create(endpoint + "/network/9e08c2f6-077a-42ce-bece-d5332e2ebb5c")));
   }
View Full Code Here

      assertNull(api.getNetworkApi().get(URI.create(endpoint + "/network/9e08c2f6-077a-42ce-bece-d5332e2ebb5c")));
   }

   @Test
   public void testGetNetworkHrefFakeId() {
      VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
               get.toBuilder().endpoint(endpoint + "/network/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee").build(),
               HttpResponse.builder()
                           .statusCode(403)
                           .payload(payloadFromResourceWithContentType("/network/error403-fake.xml", ERROR + ";version=1.5"))
                           .build());
     
      assertNull(api.getNetworkApi().get(URI.create(endpoint + "/network/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee")));
   }
View Full Code Here

           .payload(payloadFromStringWithContentType(networkEntity, ENTITY + ";version=1.5"))
           .build();
  
   @Test
   public void testGetNetworkUrn() {
      VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse, resolveNetwork, resolveNetworkResponse, get, getResponse);
      assertEquals(api.getNetworkApi().get(networkUrn), network());
   }
View Full Code Here

            .payload(payloadFromResourceWithContentType("/network/metadata.xml", METADATA))
            .build();

   @Test
   public void testGetNetworkMetadataHref() {
      VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse, getMetadata, getMetadataResponse);
      assertEquals(api.getMetadataApi(networkHref).get(), metadata());
   }
View Full Code Here

            .payload(payloadFromResourceWithContentType("/network/metadataValue.xml", METADATA_VALUE))
            .build();

   @Test
   public void testGetNetworkMetadataEntryHref() {
      VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse, getMetadataValue, getMetadataValueResponse);
      assertEquals(api.getMetadataApi(networkHref).get("KEY"), "value");
   }
View Full Code Here

   public void before() {
   }

   @Test(enabled = false)//TODO
   public void testGetVm() {
      VCloudDirectorApi api = orderedRequestsSendResponses(loginRequest, sessionResponse,
            new VcloudHttpRequestPrimer()
               .apiCommand("GET", vmId)
               .acceptMedia(VCloudDirectorMediaType.VM)
               .httpRequestBuilder().build(),
            new VcloudHttpResponsePrimer()
               .xmlFilePayload("/vm/vm.xml", VCloudDirectorMediaType.VM)
               .httpResponseBuilder().build());

      Vm expected = getVm();

      assertEquals(api.getVmApi().get(vmURI), expected);
   }
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.