public class TestNonBlockingLockManagerWithNewDesign
extends junit.framework.TestCase
Modifier and Type | Class and Description |
---|---|
static class |
TestNonBlockingLockManagerWithNewDesign.Wait10ResourceTask<T>
Waits 10ms once it acquires its locks.
|
Modifier and Type | Field and Description |
---|---|
protected static boolean |
DEBUG |
protected static boolean |
INFO |
protected static org.apache.log4j.Logger |
log |
Constructor and Description |
---|
TestNonBlockingLockManagerWithNewDesign() |
TestNonBlockingLockManagerWithNewDesign(String name) |
Modifier and Type | Method and Description |
---|---|
protected <R extends Comparable<R>,T> |
assertLocksHeld(NonBlockingLockManagerWithNewDesign<R> service,
NonBlockingLockManagerWithNewDesign.LockFutureTask<R,T> task)
Succeeds if the task holds all of its declared locks.
|
protected <R extends Comparable<R>,T> |
assertLocksNotHeld(NonBlockingLockManagerWithNewDesign<R> service,
NonBlockingLockManagerWithNewDesign.LockFutureTask<R,T> task)
Succeeds if the task holds none of its declared locks.
|
void |
test_runOne()
Test ability to run a
Callable on the service, get() the result,
and then shutdown the service. |
void |
test_runOneThrowsException()
Test ability to run a
Callable on the service which throws an
exception, get() the result, and then shutdown the service. |
void |
test_runOneWithLock()
Test ability to obtain a lock, run a
Callable on the service,
get() the result, and then shutdown the service. |
void |
test_runOneWithLockAndReleaseLockFromTask()
Test ability to obtain a lock, run a
Callable on the service that
releases its locks during its computation, verify that the locks were
released, get() the result, and then shutdown the service. |
void |
test_shutdown()
Test startup and normal shutdown.
|
void |
test_shutdownNow()
Test startup and fast shutdown.
|
void |
test_submitOneThenCancel()
|
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, countTestCases, createResult, fail, fail, failNotEquals, failNotSame, failSame, format, getName, run, run, runBare, runTest, setName, setUp, tearDown, toString
protected static final org.apache.log4j.Logger log
protected static final boolean INFO
protected static final boolean DEBUG
public TestNonBlockingLockManagerWithNewDesign()
public TestNonBlockingLockManagerWithNewDesign(String name)
public void test_shutdownNow() throws InterruptedException, ExecutionException
public void test_shutdown() throws InterruptedException, ExecutionException
public void test_submitOneThenCancel() throws InterruptedException, ExecutionException
public void test_runOne() throws InterruptedException, ExecutionException, TimeoutException
Callable
on the service, get() the result,
and then shutdown the service.public void test_runOneThrowsException() throws InterruptedException, ExecutionException, TimeoutException
Callable
on the service which throws an
exception, get() the result, and then shutdown the service.protected <R extends Comparable<R>,T> void assertLocksHeld(NonBlockingLockManagerWithNewDesign<R> service, NonBlockingLockManagerWithNewDesign.LockFutureTask<R,T> task)
R
- T
- service
- task
- protected <R extends Comparable<R>,T> void assertLocksNotHeld(NonBlockingLockManagerWithNewDesign<R> service, NonBlockingLockManagerWithNewDesign.LockFutureTask<R,T> task)
R
- T
- service
- task
- public void test_runOneWithLock() throws InterruptedException, ExecutionException, TimeoutException
Callable
on the service,
get() the result, and then shutdown the service.public void test_runOneWithLockAndReleaseLockFromTask() throws InterruptedException, ExecutionException, TimeoutException
Callable
on the service that
releases its locks during its computation, verify that the locks were
released, get() the result, and then shutdown the service.Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.