@Test public void shouldBeCancelledOnceAnyPromiseIsCancelled() throws Exception { setUpAwex(); setUpPromises(); mSecondPromise.cancelTask(); assertTrue(mAllOfPromise.isCancelled()); }
@Override public void cancelTask(boolean mayInterrupt) { synchronized (this) { super.cancelTask(mayInterrupt); for (Promise<T, P> promise : mPromises) { promise.cancelTask(mayInterrupt); } } }
AllOfPromise extends AwexPromise<Collection<T>, P> { @Override public void cancelTask(boolean mayInterrupt) { synchronized (this) { super.cancelTask(mayInterrupt); for (Promise<T, P> promise : mPromises) { promise.cancelTask(mayInterrupt); } } } }
AllOfPromise extends AwexPromise<Collection<T>, P> { @Override public void cancelTask(boolean mayInterrupt) { synchronized (this) { super.cancelTask(mayInterrupt); for (Promise<T, P> promise : mPromises) { promise.cancelTask(mayInterrupt); } } } @SuppressWarnings("unchecked")  AllOfPromise(Awex awex, Collection<Promise<T, P>> promises); }
AllOfPromise extends AwexPromise<Collection<T>, P> { @Override public void cancelTask(boolean mayInterrupt) { synchronized (this) { super.cancelTask(mayInterrupt); for (Promise<T, P> promise : mPromises) { promise.cancelTask(mayInterrupt); } } } @SuppressWarnings("unchecked")  AllOfPromise(Awex awex, Collection<Promise<T, P>> promises); @Override void cancelTask(boolean mayInterrupt); }
AllOfPromise extends AwexPromise<Collection<T>, P> { @Override public void cancelTask(boolean mayInterrupt) { synchronized (this) { super.cancelTask(mayInterrupt); for (Promise<T, P> promise : mPromises) { promise.cancelTask(mayInterrupt); } } } @SuppressWarnings("unchecked")  AllOfPromise(Awex awex, Collection<Promise<T, P>> promises); @Override void cancelTask(boolean mayInterrupt);  }