@Test public void testTimeout() throws Exception { final TimeoutStrategy strategy = new TimeoutStrategy(Time.of(1000L, TimeUnit.MILLISECONDS)); final RequestMethod<Integer> method = new RequestMethod<Integer>() { @Override public String getName() { return null; } @Override protected Integer runInternal(List<Object> parameters) throws Exception { return 0; } }; final Invocation<Integer> invocation = strategy.apply(method.toInvocation()); invocation.invoke(); }
@Override public <T> Invocation<T> apply(final Invocation<T> invocation) { assertNotNull(invocation, "Invocation must not null"); return new TimeoutInvocation<T>(timeout, invocation.getRequestMethod(), invocation.getParameters()); }
TimeoutStrategy implements InvocationStrategy { @Override public <T> Invocation<T> apply(final Invocation<T> invocation) { assertNotNull(invocation, "Invocation must not null"); return new TimeoutInvocation<T>(timeout, invocation.getRequestMethod(), invocation.getParameters()); } }
TimeoutStrategy implements InvocationStrategy { @Override public <T> Invocation<T> apply(final Invocation<T> invocation) { assertNotNull(invocation, "Invocation must not null"); return new TimeoutInvocation<T>(timeout, invocation.getRequestMethod(), invocation.getParameters()); }  }
TimeoutStrategy implements InvocationStrategy { @Override public <T> Invocation<T> apply(final Invocation<T> invocation) { assertNotNull(invocation, "Invocation must not null"); return new TimeoutInvocation<T>(timeout, invocation.getRequestMethod(), invocation.getParameters()); }  @Override Invocation<T> apply(final Invocation<T> invocation); }
TimeoutStrategy implements InvocationStrategy { @Override public <T> Invocation<T> apply(final Invocation<T> invocation) { assertNotNull(invocation, "Invocation must not null"); return new TimeoutInvocation<T>(timeout, invocation.getRequestMethod(), invocation.getParameters()); }  @Override Invocation<T> apply(final Invocation<T> invocation);  }