public class TimedSemaphoreTest extends Object
| Constructor and Description |
|---|
TimedSemaphoreTest() |
| Modifier and Type | Method and Description |
|---|---|
void |
testAcquireLimit()
Tests the acquire() method if a limit is set.
|
void |
testAcquireMultiplePeriods()
Tests a bigger number of invocations that span multiple periods.
|
void |
testAcquireMultipleThreads()
Tests the acquire() method if more threads are involved than the limit.
|
void |
testAcquireNoLimit()
Tests the acquire() method if no limit is set.
|
void |
testGetAvailablePermits()
Tests whether the available non-blocking calls can be queried.
|
void |
testGetAverageCallsPerPeriod()
Tests the methods for statistics.
|
void |
testInit()
Tests creating a new instance.
|
void |
testInitDefaultService()
Tests whether a default executor service is created if no service is
provided.
|
void |
testInitInvalidPeriod()
Tries to create an instance with a negative period.
|
void |
testPassAfterShutdown()
Tries to call acquire() after shutdown().
|
void |
testShutdownMultipleTimes()
Tests multiple invocations of the shutdown() method.
|
void |
testShutdownOwnExecutor()
Tests the shutdown() method if the executor belongs to the semaphore.
|
void |
testShutdownSharedExecutorNoTask()
Tests the shutdown() method for a shared executor service before a task
was started.
|
void |
testShutdownSharedExecutorTask()
Tests the shutdown() method for a shared executor after the task was
started.
|
void |
testStartTimer()
Tests starting the timer.
|
public TimedSemaphoreTest()
public void testInit()
public void testInitInvalidPeriod()
public void testInitDefaultService()
public void testStartTimer() throws InterruptedException
InterruptedExceptionpublic void testShutdownOwnExecutor()
public void testShutdownSharedExecutorNoTask()
public void testShutdownSharedExecutorTask() throws InterruptedException
InterruptedExceptionpublic void testShutdownMultipleTimes() throws InterruptedException
InterruptedExceptionpublic void testAcquireLimit() throws InterruptedException
InterruptedExceptionpublic void testAcquireMultipleThreads() throws InterruptedException
InterruptedExceptionpublic void testAcquireNoLimit() throws InterruptedException
InterruptedExceptionpublic void testPassAfterShutdown() throws InterruptedException
InterruptedExceptionpublic void testAcquireMultiplePeriods() throws InterruptedException
InterruptedExceptionpublic void testGetAverageCallsPerPeriod() throws InterruptedException
InterruptedExceptionpublic void testGetAvailablePermits() throws InterruptedException
InterruptedExceptionCopyright © 2001-2013 The Apache Software Foundation. All Rights Reserved.