MCPcopy Create free account
hub / github.com/BoltsFramework/Bolts-Java / testContinueWhile

Method testContinueWhile

BoltsTest/src/bolts/TaskTest.java:439–460  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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);

Callers

nothing calls this directly

Calls 1

runTaskTestMethod · 0.95

Tested by

no test coverage detected