Package org.jclouds.http

Examples of org.jclouds.http.HttpCommandExecutorService


            .testProducesAndConsumesOnClass().get();
   }

   public void testAsyncDelegateIsLazyLoadedAndRequestIncludesEndpointVersionAndPathOptionalPresent()
         throws InterruptedException, ExecutionException {
      Injector child = injectorForCaller(new HttpCommandExecutorService() {

         @Override
         public ListenableFuture<HttpResponse> submit(HttpCommand command) {
            return Futures.immediateFuture(invoke(command));
         }
View Full Code Here


   }

   public void testAsyncDelegateIsLazyLoadedAndRequestIncludesEndpointVersionAndPathCanOverrideOptionalBehaviour()
         throws InterruptedException, ExecutionException {
      Injector child = injectorForCaller(new HttpCommandExecutorService() {

         @Override
         public ListenableFuture<HttpResponse> submit(HttpCommand command) {
            return Futures.immediateFuture(invoke(command));
         }
View Full Code Here

   }

   public void testDelegateIsLazyLoadedAndRequestIncludesEndpointVersionAndPath() throws InterruptedException,
         ExecutionException {
      Injector child = injectorForCaller(new HttpCommandExecutorService() {

         @Override
         public ListenableFuture<HttpResponse> submit(HttpCommand command) {
            return Futures.immediateFuture(invoke(command));
         }
View Full Code Here

      CalleeWithProducesAndConsumesOnClass getCalleeWithProducesAndConsumesOnClass();
   }

   public void testDelegateIsLazyLoadedAndRequestIncludesVersionAndPath() throws InterruptedException,
         ExecutionException {
      Injector child = injectorForCaller(new HttpCommandExecutorService() {
         int callCounter = 0;
         @Override
         public HttpResponse invoke(HttpCommand command) {
            if (callCounter == 1)
               assertEquals(command.getCurrentRequest().getRequestLine(),
View Full Code Here

      child.getInstance(Caller.class).getCallee().onePath("foo");
   }

   public void testDelegateWithPathParamIsLazyLoadedAndRequestIncludesEndpointVersionAndPath()
         throws InterruptedException, ExecutionException {
      Injector child = injectorForCaller(new HttpCommandExecutorService() {
         @Override
         public HttpResponse invoke(HttpCommand command) {
            assertEquals(command.getCurrentRequest().getRequestLine(),
                  "GET http://howdyboys/testing/testing/thepathparam/client/1/foo HTTP/1.1");
            return HttpResponse.builder().build();
View Full Code Here

      assertEquals(child.getInstance(Caller.class).getURI(), URI.create("http://localhost:1111"));
   }

   public void testDelegateWithHeaderParamIsLazyLoadedAndRequestIncludesEndpointVersionAndHeader()
         throws InterruptedException, ExecutionException {
      Injector child = injectorForCaller(new HttpCommandExecutorService() {
         @Override
         public HttpResponse invoke(HttpCommand command) {
            assertEquals(command.getCurrentRequest().getFirstHeaderOrNull("header"), "theheaderparam");
            return HttpResponse.builder().build();
         }
View Full Code Here

            .onePath("foo");
   }

   public void testDelegateWithoutProducesAndConsumes()
         throws InterruptedException, ExecutionException {
      Injector child = injectorForCaller(new HttpCommandExecutorService() {
         @Override
         public HttpResponse invoke(HttpCommand command) {
            assertEquals(
                  command.getCurrentRequest().getPayload().getContentMetadata().getContentType(),
                  APPLICATION_JSON);
View Full Code Here

      child.getInstance(Caller.class).getCalleeWithoutProducesAndConsumes().testWithoutProducesAndConsumes();
   }

   public void testDelegateWithProducesAndConsumesOnMethodIsLazyLoaded()
         throws InterruptedException, ExecutionException {
      Injector child = injectorForCaller(new HttpCommandExecutorService() {
         @Override
         public HttpResponse invoke(HttpCommand command) {
            assertEquals(
                  command.getCurrentRequest().getPayload().getContentMetadata().getContentType(),
                  APPLICATION_XML);
View Full Code Here

      child.getInstance(Caller.class).getCalleeWithProducesAndConsumesOnMethod().testProducesAndConsumesOnMethod();
   }

   public void testDelegateWithProducesAndConsumesOnClassIsLazyLoaded()
         throws InterruptedException, ExecutionException {
      Injector child = injectorForCaller(new HttpCommandExecutorService() {
         @Override
         public HttpResponse invoke(HttpCommand command) {
            assertEquals(
                  command.getCurrentRequest().getPayload().getContentMetadata().getContentType(),
                  APPLICATION_XML);
View Full Code Here

      child.getInstance(Caller.class).getCalleeWithProducesAndConsumesOnClass().testProducesAndConsumesOnClass();
   }

   public void testDelegateIsLazyLoadedAndRequestIncludesEndpointVersionAndPathOptionalPresent()
         throws InterruptedException, ExecutionException {
      Injector child = injectorForCaller(new HttpCommandExecutorService() {
         @Override
         public HttpResponse invoke(HttpCommand command) {
            assertEquals(command.getCurrentRequest().getRequestLine(), "GET http://howdyboys/client/1/foo HTTP/1.1");
            return HttpResponse.builder().build();
         }
View Full Code Here

TOP

Related Classes of org.jclouds.http.HttpCommandExecutorService

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.