358 |
|
phaseCount.incrementAndGet(); |
359 |
|
sleepTillInterrupted(SMALL_DELAY_MS); |
360 |
|
phaser.awaitAdvance(phase); |
361 |
< |
threadAssertTrue(phaseCount.get() == 4); |
361 |
> |
assertEquals(phaseCount.get(), 4); |
362 |
|
}})); |
363 |
|
} |
364 |
|
for (Thread thread : threads) |
381 |
|
phaser.arrive(); |
382 |
|
}})); |
383 |
|
phase = phaser.awaitAdvance(phaser.arrive()); |
384 |
< |
threadAssertEquals(phase, phaser.getPhase()); |
384 |
> |
assertEquals(phase, phaser.getPhase()); |
385 |
|
} |
386 |
|
for (Thread thread : threads) |
387 |
|
thread.join(); |
405 |
|
/* |
406 |
|
* This point is reached when force termination is called in which phase = -1 |
407 |
|
*/ |
408 |
< |
threadAssertTrue(phase < 0); |
409 |
< |
threadAssertTrue(phaser.isTerminated()); |
408 |
> |
assertTrue(phase < 0); |
409 |
> |
assertTrue(phaser.isTerminated()); |
410 |
|
}}); |
411 |
|
/* |
412 |
|
* This thread will cause the first thread run to wait, in doing so |
418 |
|
sleepTillInterrupted(MEDIUM_DELAY_MS); |
419 |
|
int p1 = phaser.arrive(); |
420 |
|
int phase = phaser.awaitAdvance(p1); |
421 |
< |
threadAssertTrue(phase < 0); |
422 |
< |
threadAssertTrue(phaser.isTerminated()); |
421 |
> |
assertTrue(phase < 0); |
422 |
> |
assertTrue(phaser.isTerminated()); |
423 |
|
}}); |
424 |
|
|
425 |
|
phaser.arrive(); |
480 |
|
arrivingCount.incrementAndGet(); |
481 |
|
//the + 1 adds to expectedArrive to account for the main threads arrival |
482 |
|
int expectedArrived = phaseNumber > 0 ? phaseNumber * six + 1 : phaser.getArrivedParties() + 1; |
483 |
< |
threadAssertEquals(expectedArrived, arrivingCount.get()); |
483 |
> |
assertEquals(expectedArrived, arrivingCount.get()); |
484 |
|
for (Thread thread : threads) |
485 |
|
thread.join(); |
486 |
|
} |