|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectjunit.framework.Assert
junit.framework.TestCase
JSR166TestCase
PhaserTest
public class PhaserTest
| Nested Class Summary |
|---|
| Field Summary |
|---|
| Fields inherited from class JSR166TestCase |
|---|
eight, expensiveTests, five, four, LONG_DELAY_MS, m1, m10, m2, m3, m4, m5, m6, MEDIUM_DELAY_MS, nine, one, seven, SHORT_DELAY_MS, six, SIZE, SMALL_DELAY_MS, TEST_STRING, three, two, zero |
| Constructor Summary | |
|---|---|
PhaserTest()
|
|
| Method Summary | |
|---|---|
protected void |
assertState(Phaser phaser,
int phase,
int parties,
int unarrived)
Checks state of unterminated phaser. |
protected void |
assertTerminated(Phaser phaser,
int maxPhase)
|
protected void |
assertTerminated(Phaser phaser,
int maxPhase,
int parties)
Checks state of terminated phaser. |
static void |
main(java.lang.String[] args)
|
static junit.framework.Test |
suite()
|
void |
testArrive1()
arrive() on a registered phaser increments phase. |
void |
testArrive2()
arriveAndDeregister does not wait for others to arrive at barrier |
void |
testArrive3()
arrive() returns a negative number if the Phaser is terminated |
void |
testArriveAndAwaitAdvance1()
arriveAndAwaitAdvance throws IllegalStateException with no unarrived parties |
void |
testArriveAndAwaitAdvance3()
arriveAndAwaitAdvance waits for all threads to arrive, the number of arrived parties is the same number that is accounted for when the main thread awaitsAdvance |
void |
testArriveAndAwaitAdvanceAfterInterrupt()
arriveAndAwaitAdvance continues waiting if interrupted before waiting |
void |
testArriveAndAwaitAdvanceBeforeInterrupt()
arriveAndAwaitAdvance continues waiting if interrupted while waiting |
void |
testArriveAndDeregister()
arriveAndDeregister does not wait for others to arrive at barrier |
void |
testArriveAndDeregister1()
arriveAndDeregister() throws IllegalStateException if number of registered or unarrived parties would become negative |
void |
testArriveAndDeregister2()
arriveAndDeregister reduces the number of arrived parties |
void |
testArriveAndDeregister3()
arriveAndDeregister arrives at the barrier on a phaser with a parent and when a deregistration occurs and causes the phaser to have zero parties its parent will be deregistered as well |
void |
testArriveAndDeregister4()
arriveAndDeregister deregisters one party from its parent when the number of parties of child is zero after deregistration |
void |
testArriveAndDeregister5()
arriveAndDeregister deregisters one party from its parent when the number of parties of root is nonzero after deregistration. |
void |
testArriveAndDeregister6()
arriveAndDeregister returns the phase in which it leaves the phaser in after deregistration |
void |
testAwaitAdvance1()
awaitAdvance succeeds upon advance |
void |
testAwaitAdvance2()
awaitAdvance with a negative parameter will return without affecting the phaser |
void |
testAwaitAdvance4()
awaitAdvance atomically waits for all parties within the same phase to complete before continuing |
void |
testAwaitAdvance5()
awaitAdvance returns the current phase |
void |
testAwaitAdvance6()
awaitAdvance returns when the phaser is externally terminated |
void |
testAwaitAdvanceAfterInterrupt()
awaitAdvance continues waiting if interrupted before waiting |
void |
testAwaitAdvanceBeforeInterrupt()
awaitAdvance continues waiting if interrupted while waiting |
void |
testAwaitAdvanceTieredPhaser()
awaitAdvance returns the current phase in child phasers |
void |
testBulkRegister1()
Invoking bulkRegister with a negative parameter throws an IllegalArgumentException |
void |
testBulkRegister2()
bulkRegister should correctly record the number of unarrived parties with the number of parties being registered |
void |
testBulkRegister3()
Registering with a number of parties greater than or equal to 1<<16 throws IllegalStateException. |
void |
testConstructor3()
The parent provided to the constructor should be returned from a later call to getParent |
void |
testConstructor5()
The parent being input into the parameter should equal the original parent when being returned |
void |
testConstructorDefaultValues()
Empty constructor builds a new Phaser with no parent, no registered parties and initial phase number of 0 |
void |
testConstructorNegativeParties()
Constructing with a negative number of parties throws IllegalArgumentException |
void |
testConstructorNegativeParties2()
Constructing with a negative number of parties throws IllegalArgumentException |
void |
testConstructorPartiesExceedsLimit()
Constructing with a number of parties > 65535 throws IllegalArgumentException |
void |
testPhaseIncrement1()
the phase number increments correctly when tripping the barrier |
void |
testRegister1()
register() will increment the number of unarrived parties by one and not affect its arrived parties |
void |
testRegister2()
Registering more than 65536 parties causes IllegalStateException |
void |
testRegister3()
register() correctly returns the current barrier phase number when invoked |
void |
testRegister4()
register causes the next arrive to not increment the phase rather retain the phase number |
| Methods inherited from class junit.framework.TestCase |
|---|
countTestCases, createResult, getName, run, run, runBare, setName, toString |
| Methods inherited from class junit.framework.Assert |
|---|
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame, format |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public PhaserTest()
| Method Detail |
|---|
public static void main(java.lang.String[] args)
public static junit.framework.Test suite()
protected void assertState(Phaser phaser,
int phase,
int parties,
int unarrived)
protected void assertTerminated(Phaser phaser,
int maxPhase,
int parties)
protected void assertTerminated(Phaser phaser,
int maxPhase)
public void testConstructorDefaultValues()
public void testConstructorNegativeParties()
public void testConstructorNegativeParties2()
public void testConstructorPartiesExceedsLimit()
public void testConstructor3()
public void testConstructor5()
public void testRegister1()
public void testRegister2()
public void testRegister3()
public void testRegister4()
public void testBulkRegister1()
public void testBulkRegister2()
public void testBulkRegister3()
public void testPhaseIncrement1()
public void testArrive1()
public void testArriveAndDeregister()
throws java.lang.InterruptedException
java.lang.InterruptedException
public void testArrive2()
throws java.lang.InterruptedException
java.lang.InterruptedExceptionpublic void testArrive3()
public void testArriveAndDeregister1()
public void testArriveAndDeregister2()
public void testArriveAndDeregister3()
public void testArriveAndDeregister4()
public void testArriveAndDeregister5()
public void testArriveAndDeregister6()
throws java.lang.InterruptedException
java.lang.InterruptedExceptionpublic void testAwaitAdvance1()
public void testAwaitAdvance2()
public void testAwaitAdvanceAfterInterrupt()
throws java.lang.InterruptedException
java.lang.InterruptedException
public void testAwaitAdvanceBeforeInterrupt()
throws java.lang.InterruptedException
java.lang.InterruptedException
public void testArriveAndAwaitAdvanceAfterInterrupt()
throws java.lang.InterruptedException
java.lang.InterruptedException
public void testArriveAndAwaitAdvanceBeforeInterrupt()
throws java.lang.InterruptedException
java.lang.InterruptedException
public void testAwaitAdvance4()
throws java.lang.InterruptedException
java.lang.InterruptedException
public void testAwaitAdvance5()
throws java.lang.InterruptedException
java.lang.InterruptedException
public void testAwaitAdvanceTieredPhaser()
throws java.lang.Exception
java.lang.Exception
public void testAwaitAdvance6()
throws java.lang.InterruptedException
java.lang.InterruptedExceptionpublic void testArriveAndAwaitAdvance1()
public void testArriveAndAwaitAdvance3()
throws java.lang.InterruptedException
java.lang.InterruptedException
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||