Examples of InvokeAndTransform


Examples of org.jclouds.rest.internal.InvokeHttpMethod.InvokeAndTransform

      verify(http, timeLimiter, fallback, config, future);
   }

   public void testMethodWithTimeoutRunsTimeLimiter() throws Exception {
      expect(config.getTimeoutNanos(get)).andReturn(Optional.of(250000000l));
      InvokeAndTransform invoke = invokeHttpMethod.new InvokeAndTransform("ns:get", getCommand);
      expect(timeLimiter.callWithTimeout(invoke, 250000000, TimeUnit.NANOSECONDS, true)).andReturn(response);
      replay(http, timeLimiter, fallback, config, future);
      invokeHttpMethod.apply(get);
   }
View Full Code Here

Examples of org.jclouds.rest.internal.InvokeHttpMethod.InvokeAndTransform

   }

   public void testTimeLimitedRunsFallbackCreateOrPropagate() throws Exception {
      IllegalStateException exception = new IllegalStateException();
      expect(config.getTimeoutNanos(get)).andReturn(Optional.of(250000000l));
      InvokeAndTransform invoke = invokeHttpMethod.new InvokeAndTransform("ns:get", getCommand);
      expect(timeLimiter.callWithTimeout(invoke, 250000000, TimeUnit.NANOSECONDS, true)).andThrow(exception);
      expect(fallback.createOrPropagate(exception)).andReturn(fallbackResponse);
      replay(http, timeLimiter, fallback, config, future);
      assertEquals(invokeHttpMethod.apply(get), fallbackResponse);
   }
View Full Code Here

Examples of org.jclouds.rest.internal.InvokeHttpMethod.InvokeAndTransform

      verify(http, timeLimiter, fallback, config, future);
   }

   public void testMethodWithTimeoutRunsTimeLimiter() throws Exception {
      expect(config.getTimeoutNanos(get)).andReturn(Optional.of(250000000l));
      InvokeAndTransform invoke = invokeHttpMethod.new InvokeAndTransform("ns:get", getCommand);
      expect(timeLimiter.callWithTimeout(invoke, 250000000, TimeUnit.NANOSECONDS, true)).andReturn(response);
      replay(http, timeLimiter, fallback, config, future);
      invokeHttpMethod.apply(get);
   }
View Full Code Here

Examples of org.jclouds.rest.internal.InvokeHttpMethod.InvokeAndTransform

   }

   public void testTimeLimitedRunsFallbackCreateOrPropagate() throws Exception {
      IllegalStateException exception = new IllegalStateException();
      expect(config.getTimeoutNanos(get)).andReturn(Optional.of(250000000l));
      InvokeAndTransform invoke = invokeHttpMethod.new InvokeAndTransform("ns:get", getCommand);
      expect(timeLimiter.callWithTimeout(invoke, 250000000, TimeUnit.NANOSECONDS, true)).andThrow(exception);
      expect(fallback.createOrPropagate(exception)).andReturn(fallbackResponse);
      replay(http, timeLimiter, fallback, config, future);
      assertEquals(invokeHttpMethod.apply(get), fallbackResponse);
   }
View Full Code Here

Examples of org.jclouds.rest.internal.InvokeHttpMethod.InvokeAndTransform

      verify(http, timeLimiter, fallback, config, future);
   }

   public void testMethodWithTimeoutRunsTimeLimiter() throws Exception {
      expect(config.getTimeoutNanos(get)).andReturn(Optional.of(250000000l));
      InvokeAndTransform invoke = invokeHttpMethod.new InvokeAndTransform("ns:get", getCommand);
      expect(timeLimiter.callWithTimeout(invoke, 250000000, TimeUnit.NANOSECONDS, true)).andReturn(response);
      replay(http, timeLimiter, fallback, config, future);
      invokeHttpMethod.apply(get);
   }
View Full Code Here

Examples of org.jclouds.rest.internal.InvokeHttpMethod.InvokeAndTransform

   }

   public void testTimeLimitedRunsFallbackCreateOrPropagate() throws Exception {
      IllegalStateException exception = new IllegalStateException();
      expect(config.getTimeoutNanos(get)).andReturn(Optional.of(250000000l));
      InvokeAndTransform invoke = invokeHttpMethod.new InvokeAndTransform("ns:get", getCommand);
      expect(timeLimiter.callWithTimeout(invoke, 250000000, TimeUnit.NANOSECONDS, true)).andThrow(exception);
      expect(fallback.createOrPropagate(exception)).andReturn(fallbackResponse);
      replay(http, timeLimiter, fallback, config, future);
      assertEquals(invokeHttpMethod.apply(get), fallbackResponse);
   }
View Full Code Here

Examples of org.jclouds.rest.internal.InvokeHttpMethod.InvokeAndTransform

      verify(http, timeLimiter, fallback, config, future);
   }

   public void testMethodWithTimeoutRunsTimeLimiter() throws Exception {
      expect(config.getTimeoutNanos(get)).andReturn(Optional.of(250000000l));
      InvokeAndTransform invoke = invokeHttpMethod.new InvokeAndTransform("ns:get", getCommand);
      expect(timeLimiter.callWithTimeout(invoke, 250000000, TimeUnit.NANOSECONDS, true)).andReturn(response);
      replay(http, timeLimiter, fallback, config, future);
      invokeHttpMethod.apply(get);
   }
View Full Code Here

Examples of org.jclouds.rest.internal.InvokeHttpMethod.InvokeAndTransform

   }

   public void testTimeLimitedRunsFallbackCreateOrPropagate() throws Exception {
      IllegalStateException exception = new IllegalStateException();
      expect(config.getTimeoutNanos(get)).andReturn(Optional.of(250000000l));
      InvokeAndTransform invoke = invokeHttpMethod.new InvokeAndTransform("ns:get", getCommand);
      expect(timeLimiter.callWithTimeout(invoke, 250000000, TimeUnit.NANOSECONDS, true)).andThrow(exception);
      expect(fallback.createOrPropagate(exception)).andReturn(fallbackResponse);
      replay(http, timeLimiter, fallback, config, future);
      assertEquals(invokeHttpMethod.apply(get), fallbackResponse);
   }
View Full Code Here

Examples of org.jclouds.rest.internal.InvokeSyncToAsyncHttpMethod.InvokeAndTransform

      verify(http, timeLimiter, fallback, config, future);
   }

   public void testMethodWithTimeoutRunsTimeLimiter() throws Exception {
      expect(config.getTimeoutNanos(asyncGet)).andReturn(Optional.of(250000000l));
      InvokeAndTransform invoke = invokeHttpMethod.new InvokeAndTransform("ns:get", getCommand);
      expect(timeLimiter.callWithTimeout(invoke, 250000000, TimeUnit.NANOSECONDS, true)).andReturn(response);
      replay(http, timeLimiter, fallback, config, future);
      invokeHttpMethod.apply(get);
   }
View Full Code Here

Examples of org.jclouds.rest.internal.InvokeSyncToAsyncHttpMethod.InvokeAndTransform

   }

   public void testTimeLimitedRunsFallbackCreateOrPropagate() throws Exception {
      IllegalStateException exception = new IllegalStateException();
      expect(config.getTimeoutNanos(asyncGet)).andReturn(Optional.of(250000000l));
      InvokeAndTransform invoke = invokeHttpMethod.new InvokeAndTransform("ns:get", getCommand);
      expect(timeLimiter.callWithTimeout(invoke, 250000000, TimeUnit.NANOSECONDS, true)).andThrow(exception);
      expect(fallback.createOrPropagate(exception)).andReturn(fallbackResponse);
      replay(http, timeLimiter, fallback, config, future);
      assertEquals(invokeHttpMethod.apply(get), fallbackResponse);
   }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.