|
||||||||
| 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
SemaphoreTest
public class SemaphoreTest
| 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 | |
|---|---|
SemaphoreTest()
|
|
| Method Summary | |
|---|---|
static void |
main(java.lang.String[] args)
|
static junit.framework.Test |
suite()
|
void |
testAcquire_InterruptedException_fair()
A waiting acquire blocks interruptibly |
void |
testAcquire_InterruptedException()
A waiting acquire blocks interruptibly |
void |
testAcquireN_InterruptedException_fair()
A waiting acquire(n) blocks interruptibly |
void |
testAcquireReleaseInDifferentThreads_fair()
A release in one thread enables an acquire in another thread |
void |
testAcquireReleaseInDifferentThreads()
A release in one thread enables an acquire in another thread |
void |
testAcquireReleaseInSameThread_fair()
Acquire and release of semaphore succeed if initially available |
void |
testAcquireReleaseInSameThread()
Acquire and release of semaphore succeed if initially available |
void |
testAcquireReleaseNInDifferentThreads_fair()
release(n) in one thread enables acquire(n) in another thread |
void |
testAcquireReleaseNInDifferentThreads_fair2()
release(n) in one thread enables acquire(n) in another thread |
void |
testAcquireReleaseNInSameThread_fair()
Acquire(n) and release(n) of semaphore succeed if initially available |
void |
testAcquireUninterruptiblyReleaseInSameThread()
Uninterruptible acquire and release of semaphore succeed if initially available |
void |
testAcquireUninterruptiblyReleaseNInSameThread_fair()
Acquire(n) and release(n) of semaphore succeed if initially available |
void |
testConstructor_fair()
Zero, negative, and positive initial values are allowed in constructor |
void |
testConstructor()
Zero, negative, and positive initial values are allowed in constructor |
void |
testConstructor2()
Constructor without fairness argument behaves as nonfair |
void |
testDrainPermits()
drainPermits reports and removes given number of permits |
void |
testGetQueuedThreads()
getQueuedThreads includes waiting threads |
void |
testGetQueueLength_fair()
getQueueLength reports number of waiting threads |
void |
testGetQueueLength()
getQueueLength reports number of waiting threads |
void |
testHasQueuedThreads()
hasQueuedThreads reports whether there are waiting threads |
void |
testReducePermits()
reducePermits reduces number of permits |
void |
testSerialization_fair()
a deserialized serialized semaphore has same number of permits |
void |
testSerialization()
a deserialized serialized semaphore has same number of permits |
void |
testTimedAcquireReleaseInDifferentThreads_fair()
release in one thread enables timed acquire in another thread |
void |
testTimedAcquireReleaseInDifferentThreads()
A release in one thread enables a timed acquire in another thread |
void |
testTimedAcquireReleaseInSameThread_fair()
release in one thread enables timed acquire in another thread |
void |
testTimedAcquireReleaseInSameThread()
Timed Acquire and release of semaphore succeed if initially available |
void |
testTimedAcquireReleaseNInDifferentThreads_fair()
release(n) in one thread enables timed acquire(n) in another thread |
void |
testTimedAcquireReleaseNInSameThread_fair()
release(n) in one thread enables timed acquire(n) in another thread |
void |
testToString()
toString indicates current number of permits |
void |
testTryAcquire_InterruptedException_fair()
A waiting tryAcquire blocks interruptibly |
void |
testTryAcquire_InterruptedException()
A waiting timed acquire blocks interruptibly |
void |
testTryAcquireInSameThread_fair()
tryAcquire succeeds when sufficient permits, else fails |
void |
testTryAcquireInSameThread()
tryAcquire succeeds when sufficient permits, else fails |
void |
testTryAcquireN_InterruptedException_fair()
A waiting tryAcquire(n) blocks interruptibly |
void |
testTryAcquireNInSameThread_fair()
tryAcquire(n) succeeds when sufficient permits, else fails |
void |
testUninterruptibleAcquireReleaseInDifferentThreads()
A release in one thread enables an uninterruptible acquire in another thread |
| 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 SemaphoreTest()
| Method Detail |
|---|
public static void main(java.lang.String[] args)
public static junit.framework.Test suite()
public void testConstructor()
public void testConstructor2()
public void testTryAcquireInSameThread()
public void testAcquireReleaseInSameThread()
throws java.lang.InterruptedException
java.lang.InterruptedException
public void testAcquireUninterruptiblyReleaseInSameThread()
throws java.lang.InterruptedException
java.lang.InterruptedException
public void testTimedAcquireReleaseInSameThread()
throws java.lang.InterruptedException
java.lang.InterruptedException
public void testAcquireReleaseInDifferentThreads()
throws java.lang.InterruptedException
java.lang.InterruptedException
public void testUninterruptibleAcquireReleaseInDifferentThreads()
throws java.lang.InterruptedException
java.lang.InterruptedException
public void testTimedAcquireReleaseInDifferentThreads()
throws java.lang.InterruptedException
java.lang.InterruptedException
public void testAcquire_InterruptedException()
throws java.lang.InterruptedException
java.lang.InterruptedException
public void testTryAcquire_InterruptedException()
throws java.lang.InterruptedException
java.lang.InterruptedException
public void testHasQueuedThreads()
throws java.lang.InterruptedException
java.lang.InterruptedException
public void testGetQueueLength()
throws java.lang.InterruptedException
java.lang.InterruptedException
public void testGetQueuedThreads()
throws java.lang.InterruptedException
java.lang.InterruptedExceptionpublic void testDrainPermits()
public void testReducePermits()
public void testSerialization()
throws java.lang.Exception
java.lang.Exceptionpublic void testConstructor_fair()
public void testTryAcquireInSameThread_fair()
public void testTryAcquireNInSameThread_fair()
public void testAcquireReleaseInSameThread_fair()
throws java.lang.InterruptedException
java.lang.InterruptedException
public void testAcquireReleaseNInSameThread_fair()
throws java.lang.InterruptedException
java.lang.InterruptedExceptionpublic void testAcquireUninterruptiblyReleaseNInSameThread_fair()
public void testTimedAcquireReleaseNInSameThread_fair()
throws java.lang.InterruptedException
java.lang.InterruptedException
public void testTimedAcquireReleaseInSameThread_fair()
throws java.lang.InterruptedException
java.lang.InterruptedException
public void testAcquireReleaseInDifferentThreads_fair()
throws java.lang.InterruptedException
java.lang.InterruptedException
public void testAcquireReleaseNInDifferentThreads_fair()
throws java.lang.InterruptedException
java.lang.InterruptedException
public void testAcquireReleaseNInDifferentThreads_fair2()
throws java.lang.InterruptedException
java.lang.InterruptedException
public void testTimedAcquireReleaseInDifferentThreads_fair()
throws java.lang.InterruptedException
java.lang.InterruptedException
public void testTimedAcquireReleaseNInDifferentThreads_fair()
throws java.lang.InterruptedException
java.lang.InterruptedException
public void testAcquire_InterruptedException_fair()
throws java.lang.InterruptedException
java.lang.InterruptedException
public void testAcquireN_InterruptedException_fair()
throws java.lang.InterruptedException
java.lang.InterruptedException
public void testTryAcquire_InterruptedException_fair()
throws java.lang.InterruptedException
java.lang.InterruptedException
public void testTryAcquireN_InterruptedException_fair()
throws java.lang.InterruptedException
java.lang.InterruptedException
public void testGetQueueLength_fair()
throws java.lang.InterruptedException
java.lang.InterruptedException
public void testSerialization_fair()
throws java.lang.Exception
java.lang.Exceptionpublic void testToString()
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||