Java 类com.google.common.util.concurrent.AbstractFuture.TrustedFuture 实例源码

项目:guava-mock    文件:AbstractAbstractFutureTest.java   
@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);
}
项目:guava-mock    文件:AbstractAbstractFutureTest.java   
@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);
}
项目:googles-monorepo-demo    文件:AbstractAbstractFutureTest.java   
@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);
}
项目:googles-monorepo-demo    文件:AbstractAbstractFutureTest.java   
@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);
}
项目:guava-mock    文件:TrustedInputFutureTest.java   
@Override
AbstractFuture<Integer> newDelegate() {
  AbstractFuture<Integer> future = new TrustedFuture<Integer>() {};
  assertTrue(future instanceof TrustedFuture); // sanity check
  return future;
}
项目:guava-mock    文件:UntrustedInputFutureTest.java   
@Override
AbstractFuture<Integer> newDelegate() {
  AbstractFuture<Integer> future = new AbstractFuture<Integer>() {};
  assertFalse(future instanceof TrustedFuture); // sanity check
  return future;
}
项目:googles-monorepo-demo    文件:TrustedInputFutureTest.java   
@Override
AbstractFuture<Integer> newDelegate() {
  AbstractFuture<Integer> future = new TrustedFuture<Integer>() {};
  assertTrue(future instanceof TrustedFuture); // sanity check
  return future;
}
项目:googles-monorepo-demo    文件:UntrustedInputFutureTest.java   
@Override
AbstractFuture<Integer> newDelegate() {
  AbstractFuture<Integer> future = new AbstractFuture<Integer>() {};
  assertFalse(future instanceof TrustedFuture); // sanity check
  return future;
}
项目:guava    文件:TrustedInputFutureTest.java   
@Override
AbstractFuture<Integer> newDelegate() {
  AbstractFuture<Integer> future = new TrustedFuture<Integer>() {};
  assertTrue(future instanceof TrustedFuture); // sanity check
  return future;
}
项目:guava    文件:UntrustedInputFutureTest.java   
@Override
AbstractFuture<Integer> newDelegate() {
  AbstractFuture<Integer> future = new AbstractFuture<Integer>() {};
  assertFalse(future instanceof TrustedFuture); // sanity check
  return future;
}
项目:guava    文件:TrustedInputFutureTest.java   
@Override
AbstractFuture<Integer> newDelegate() {
  AbstractFuture<Integer> future = new TrustedFuture<Integer>() {};
  assertTrue(future instanceof TrustedFuture); // sanity check
  return future;
}
项目:guava    文件:UntrustedInputFutureTest.java   
@Override
AbstractFuture<Integer> newDelegate() {
  AbstractFuture<Integer> future = new AbstractFuture<Integer>() {};
  assertFalse(future instanceof TrustedFuture); // sanity check
  return future;
}