()
| 437 | } |
| 438 | |
| 439 | public void testContinueWhile() { |
| 440 | final AtomicInteger count = new AtomicInteger(0); |
| 441 | runTaskTest(new Callable<Task<?>>() { |
| 442 | public Task<?> call() throws Exception { |
| 443 | return Task.forResult(null).continueWhile(new Callable<Boolean>() { |
| 444 | public Boolean call() throws Exception { |
| 445 | return count.get() < 10; |
| 446 | } |
| 447 | }, new Continuation<Void, Task<Void>>() { |
| 448 | public Task<Void> then(Task<Void> task) throws Exception { |
| 449 | count.incrementAndGet(); |
| 450 | return null; |
| 451 | } |
| 452 | }).continueWith(new Continuation<Void, Void>() { |
| 453 | public Void then(Task<Void> task) throws Exception { |
| 454 | assertEquals(10, count.get()); |
| 455 | return null; |
| 456 | } |
| 457 | }); |
| 458 | } |
| 459 | }); |
| 460 | } |
| 461 | |
| 462 | public void testContinueWhileAsync() { |
| 463 | final AtomicInteger count = new AtomicInteger(0); |
nothing calls this directly
no test coverage detected