Package org.jclouds.rest.internal

Examples of org.jclouds.rest.internal.GeneratedHttpRequest


// surefire
@Test(groups = "unit", testName = "NATAsyncClientTest")
public class NATAsyncClientTest extends BaseCloudStackAsyncClientTest<NATAsyncClient> {
   public void testListIPForwardingRules() throws SecurityException, NoSuchMethodException, IOException {
      Invokable<?, ?> method = method(NATAsyncClient.class, "listIPForwardingRules", ListIPForwardingRulesOptions[].class);
      GeneratedHttpRequest httpRequest = processor.createRequest(method, ImmutableList.of());

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


   }

   public void testListIPForwardingRulesOptions() throws SecurityException, NoSuchMethodException, IOException {
      Invokable<?, ?> method = method(NATAsyncClient.class, "listIPForwardingRules", ListIPForwardingRulesOptions[].class);
      GeneratedHttpRequest httpRequest = processor.createRequest(method, ImmutableList.<Object> of(
            ListIPForwardingRulesOptions.Builder.virtualMachineId("3")));

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

   }

   public void testGetIPForwardingRule() throws SecurityException, NoSuchMethodException, IOException {
      Invokable<?, ?> method = method(NATAsyncClient.class, "getIPForwardingRule", String.class);
      GeneratedHttpRequest httpRequest = processor.createRequest(method, ImmutableList.<Object> of(5));

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

   public void testCreateIPForwardingRuleForVirtualMachine() throws SecurityException, NoSuchMethodException,
         IOException {
      Invokable<?, ?> method = method(NATAsyncClient.class, "createIPForwardingRule", String.class, String.class, int.class,
            CreateIPForwardingRuleOptions[].class);
      GeneratedHttpRequest httpRequest = processor.createRequest(method, ImmutableList.<Object> of(7, "tcp", 22));

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

   public void testCreateIPForwardingRuleForVirtualMachineOptions() throws SecurityException, NoSuchMethodException,
         IOException {
      Invokable<?, ?> method = method(NATAsyncClient.class, "createIPForwardingRule", String.class, String.class, int.class,
            CreateIPForwardingRuleOptions[].class);
      GeneratedHttpRequest httpRequest = processor.createRequest(method, ImmutableList.<Object> of(7, "tcp", 22,
            CreateIPForwardingRuleOptions.Builder.endPort(22)));

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

   }

   public void testEnableStaticNATForVirtualMachine() throws SecurityException, NoSuchMethodException, IOException {
      Invokable<?, ?> method = method(NATAsyncClient.class, "enableStaticNATForVirtualMachine", String.class, String.class);
      GeneratedHttpRequest httpRequest = processor.createRequest(method, ImmutableList.<Object> of(5, 6));

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

   }

   public void testDisableStaticNATOnPublicIP() throws SecurityException, NoSuchMethodException, IOException {
      Invokable<?, ?> method = method(NATAsyncClient.class, "disableStaticNATOnPublicIP", String.class);
      GeneratedHttpRequest httpRequest = processor.createRequest(method, ImmutableList.<Object> of(5));

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

   }

   public void testDeleteIPForwardingRule() throws SecurityException, NoSuchMethodException, IOException {
      Invokable<?, ?> method = method(NATAsyncClient.class, "deleteIPForwardingRule", String.class);
      GeneratedHttpRequest httpRequest = processor.createRequest(method, ImmutableList.<Object> of(5));

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

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

   public void testListVMGroups() throws SecurityException, NoSuchMethodException, IOException {
      Invokable<?, ?> method = method(VMGroupAsyncClient.class, "listInstanceGroups", ListVMGroupsOptions[].class);
      GeneratedHttpRequest httpRequest = processor.createRequest(method, ImmutableList.of());

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

   }

   public void testListVMGroupsOptions() throws SecurityException, NoSuchMethodException, IOException {
      Invokable<?, ?> method = method(VMGroupAsyncClient.class, "listInstanceGroups", ListVMGroupsOptions[].class);
      GeneratedHttpRequest httpRequest = processor.createRequest(method, ImmutableList.<Object> of(ListVMGroupsOptions.Builder.account("fred")
         .domainId("5").id("6")));

      assertRequestLineEquals(
         httpRequest,
         "GET http://localhost:8080/client/api?response=json&command=listInstanceGroups&listAll=true&account=fred&domainid=5&id=6 HTTP/1.1");
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.