Package org.jclouds.rest.internal

Examples of org.jclouds.rest.internal.GeneratedHttpRequest


@Test(groups = "unit", testName = "GlobalStoragePoolAsyncClientTest")
public class GlobalStoragePoolAsyncClientTest extends BaseCloudStackAsyncClientTest<GlobalStoragePoolAsyncClient> {

   public void testListStoragePools() throws NoSuchMethodException {
      Invokable<?, ?> method = method(GlobalStoragePoolAsyncClient.class, "listStoragePools", ListStoragePoolsOptions[].class);
      GeneratedHttpRequest httpRequest = processor.createRequest(method, ImmutableList.of());

      assertRequestLineEquals(httpRequest,
         "GET http://localhost:8080/client/api?response=json&command=listStoragePools&listAll=true HTTP/1.1");
      assertNonPayloadHeadersEqual(httpRequest, "Accept: application/json\n");
      assertPayloadEquals(httpRequest, null, null, false);
View Full Code Here


      checkFilters(httpRequest);
   }

   public void testListStoragePoolsOptions() throws NoSuchMethodException {
      Invokable<?, ?> method = method(GlobalStoragePoolAsyncClient.class, "listStoragePools", ListStoragePoolsOptions[].class);
      GeneratedHttpRequest httpRequest = processor.createRequest(method, ImmutableList.<Object> of(ListStoragePoolsOptions.Builder.clusterId("3").id("4").ipAddress("192.168.42.42").keyword("fred").name("bob").path("/mnt/store42").podId("4").zoneId("5")));

      assertRequestLineEquals(httpRequest,
         "GET http://localhost:8080/client/api?response=json&command=listStoragePools&listAll=true&clusterid=3&id=4&ipaddress=192.168.42.42&keyword=fred&name=bob&path=/mnt/store42&podid=4&zoneid=5 HTTP/1.1");
      assertNonPayloadHeadersEqual(httpRequest, "Accept: application/json\n");
      assertPayloadEquals(httpRequest, null, null, false);
View Full Code Here

@Test(groups = "unit", testName = "LimitAsyncClientTest")
public class LimitAsyncClientTest extends BaseCloudStackAsyncClientTest<LimitAsyncClient> {

   public void testListResourceLimits() throws SecurityException, NoSuchMethodException, IOException {
      Invokable<?, ?> method = method(LimitAsyncClient.class, "listResourceLimits", ListResourceLimitsOptions[].class);
      GeneratedHttpRequest httpRequest = processor.createRequest(method, ImmutableList.of());

      assertRequestLineEquals(httpRequest,
            "GET http://localhost:8080/client/api?response=json&command=listResourceLimits&listAll=true HTTP/1.1");
      assertNonPayloadHeadersEqual(httpRequest, "Accept: application/json\n");
      assertPayloadEquals(httpRequest, null, null, false);
View Full Code Here

   }

   public void testListResourceLimitsOptions() throws SecurityException, NoSuchMethodException, IOException {
      Invokable<?, ?> method = method(LimitAsyncClient.class, "listResourceLimits", ListResourceLimitsOptions[].class);
      GeneratedHttpRequest httpRequest = processor.createRequest(method, ImmutableList.<Object> of(ListResourceLimitsOptions.Builder.account("jclouds" , "23")));

      assertRequestLineEquals(httpRequest,
            "GET http://localhost:8080/client/api?response=json&command=listResourceLimits&listAll=true&account=jclouds&domainid=23 HTTP/1.1");
      assertNonPayloadHeadersEqual(httpRequest, "Accept: application/json\n");
      assertPayloadEquals(httpRequest, null, null, false);
View Full Code Here

                                   .build();

   public void testCreateAccount() throws Exception {
      Invokable<?, ?> method = method(GlobalAccountAsyncClient.class, "createAccount", String.class, Account.Type.class,
         String.class, String.class, String.class, String.class, CreateAccountOptions[].class);
      GeneratedHttpRequest httpRequest = processor.createRequest(method, ImmutableList.<Object> of("user", Account.Type.USER, "email@example.com",
         "FirstName", "LastName", "hashed-password"));

      assertRequestLineEquals(httpRequest, create.getRequestLine());
      assertNonPayloadHeadersEqual(httpRequest, "Accept: application/json\n");
      assertPayloadEquals(httpRequest, null, null, false);
View Full Code Here

                                   .build();

   public void testUpdateAccount() throws Exception {
      Invokable<?, ?> method = method(GlobalAccountAsyncClient.class, "updateAccount", String.class, String.class,
         String.class, UpdateAccountOptions[].class);
      GeneratedHttpRequest httpRequest = processor.createRequest(method, ImmutableList.<Object> of("account", 42L, "new-account-name"));

      assertRequestLineEquals(httpRequest, update.getRequestLine());
      assertNonPayloadHeadersEqual(httpRequest, "Accept: application/json\n");
      assertPayloadEquals(httpRequest, null, null, false);
View Full Code Here

      checkFilters(httpRequest);
   }

   public void testDeleteAccount() throws Exception {
      Invokable<?, ?> method = method(GlobalAccountAsyncClient.class, "deleteAccount", String.class);
      GeneratedHttpRequest httpRequest = processor.createRequest(method, ImmutableList.<Object> of(42L));

      assertRequestLineEquals(httpRequest,
         "GET http://localhost:8080/client/api?response=json&command=deleteAccount&id=42 HTTP/1.1");
      assertNonPayloadHeadersEqual(httpRequest, "Accept: application/json\n");
      assertPayloadEquals(httpRequest, null, null, false);
View Full Code Here

@Test(groups = "unit", testName = "DomainLimitAsyncClientTest")
public class DomainLimitAsyncClientTest extends BaseCloudStackAsyncClientTest<DomainLimitAsyncClient> {

   public void testUpdateResourceLimit() throws SecurityException, NoSuchMethodException, IOException {
      Invokable<?, ?> method = method(DomainLimitAsyncClient.class, "updateResourceLimit", ResourceLimit.class);
      GeneratedHttpRequest httpRequest = processor.createRequest(method, ImmutableList.<Object> of(
            ResourceLimit.builder().resourceType(ResourceType.SNAPSHOT).account("foo").domainId("100").max(101).build()));

      assertRequestLineEquals(
            httpRequest,
            "GET http://localhost:8080/client/api?response=json&command=updateResourceLimit&resourcetype=3&account=foo&domainid=100&max=101 HTTP/1.1");
View Full Code Here

@Test(groups = "unit", testName = "NetworkAsyncClientTest")
public class NetworkAsyncClientTest extends BaseVCloudAsyncClientTest<NetworkAsyncClient> {

   public void testNetwork() throws SecurityException, NoSuchMethodException, IOException {
      Invokable<?, ?> method = method(NetworkAsyncClient.class, "getNetwork", URI.class);
      GeneratedHttpRequest request = processor.createRequest(method, ImmutableList.<Object> of(URI
               .create("https://vcenterprise.bluelock.com/api/v1.0/network/2")));

      assertRequestLineEquals(request, "GET https://vcenterprise.bluelock.com/api/v1.0/network/2 HTTP/1.1");
      assertNonPayloadHeadersEqual(request, "Accept: application/vnd.vmware.vcloud.network+xml\n");
      assertPayloadEquals(request, null, null, false);
View Full Code Here

   }

   public void testFindNetworkInOrgVDCNamed() throws SecurityException, NoSuchMethodException, IOException {
      Invokable<?, ?> method = method(NetworkAsyncClient.class, "findNetworkInOrgVDCNamed", String.class, String.class,
               String.class);
      GeneratedHttpRequest request = processor.createRequest(method, ImmutableList.<Object> of("org", "vdc", "network"));

      assertRequestLineEquals(request, "GET https://vcloud.safesecureweb.com/network/1990 HTTP/1.1");
      assertNonPayloadHeadersEqual(request, "Accept: application/vnd.vmware.vcloud.network+xml\n");
      assertPayloadEquals(request, null, null, false);
View Full Code Here

TOP

Related Classes of org.jclouds.rest.internal.GeneratedHttpRequest

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.