@GwtIncompatible // All GWT Futures behaves like TrustedFuture. public void testSetFutureDelegateAlreadyInterrupted() throws Exception { delegate.cancel(true /** mayInterruptIfRunning */); assertThat(future.setFuture(delegate)).isTrue(); /* * Interruption of the delegate propagates to us only if the delegate was a TrustedFuture. * TODO(cpovirk): Consider whether to stop copying this information from TrustedFuture so that * we're consistent. */ assertCancelled(future, delegate instanceof TrustedFuture); }
@GwtIncompatible // All GWT Futures behaves like TrustedFuture. public void testSetFutureDelegateLaterInterrupted() throws Exception { assertThat(future.setFuture(delegate)).isTrue(); delegate.cancel(true /** mayInterruptIfRunning */); // See previous method doc. assertCancelled(future, delegate instanceof TrustedFuture); }
@Override AbstractFuture<Integer> newDelegate() { AbstractFuture<Integer> future = new TrustedFuture<Integer>() {}; assertTrue(future instanceof TrustedFuture); // sanity check return future; }
@Override AbstractFuture<Integer> newDelegate() { AbstractFuture<Integer> future = new AbstractFuture<Integer>() {}; assertFalse(future instanceof TrustedFuture); // sanity check return future; }