public class DistributedLockServiceTest extends DistributedTestCase
| Modifier and Type | Class and Description |
|---|---|
static class |
DistributedLockServiceTest.BasicLockClient |
DistributedTestCase.ExpectedException, DistributedTestCase.WaitCriterion, DistributedTestCase.WaitCriterion2| Modifier and Type | Field and Description |
|---|---|
protected static int[] |
count_testFairness |
protected static com.gemstone.gemfire.distributed.DistributedLockService |
dls_testFairness |
protected static com.gemstone.gemfire.distributed.DistributedSystem |
dlstSystem |
protected static boolean[] |
done_testFairness |
protected static DistributedLockServiceTest.BasicLockClient |
lockClientSuspendLockingBehaves |
protected static java.lang.Object |
monitor |
protected static boolean |
stop_testFairness |
protected static DistributedLockServiceTest.BasicLockClient |
suspendClientSuspendLockingBehaves |
logPerTest, reconnect, system, testName| Constructor and Description |
|---|
DistributedLockServiceTest(java.lang.String name) |
| Modifier and Type | Method and Description |
|---|---|
protected static void |
becomeLockGrantor(java.lang.String serviceName)
Accessed via reflection.
|
static void |
caseSetUp() |
static void |
caseTearDown() |
protected static void |
connectDistributedSystem()
Connects a DistributedSystem, saves it in static variable "system"
|
static void |
destroyAllDLockServices() |
void |
doTestReleaseOrphanedGrant_Remote(boolean destroyLockService) |
void |
forNumVMsInvoke(int numVMs,
java.lang.String methodName,
java.lang.Object[] args)
Assumes there is only one host, and invokes the given method in
the first numVMs VMs that host knows about.
|
static java.lang.Integer |
get_count_testFairness(java.lang.Integer i)
Accessed by reflection.
|
java.util.Properties |
getDistributedSystemProperties()
Returns a
Properties object used to configure a
connection to a DistributedSystem. |
protected boolean |
getDone() |
static com.gemstone.gemfire.distributed.internal.membership.InternalDistributedMember |
identifyLockGrantor(java.lang.String serviceName)
Accessed via reflection.
|
protected void |
incCompletes() |
protected void |
incHits() |
static java.lang.Boolean |
isLockGrantor(java.lang.String serviceName)
Accessed via reflection.
|
protected static java.lang.Boolean |
lock(java.lang.String serviceName,
java.lang.Object name)
Accessed via reflection.
|
protected static void |
logInfo(java.lang.String msg) |
void |
notestSuspendLockingBehaves()
Test that suspend locking behaves under various usage patterns.
|
protected static void |
remoteCreateService(java.lang.String name)
Creates a new DistributedLockService in a remote VM.
|
static void |
remoteDumpAllDLockServices() |
protected void |
setDone(boolean done) |
protected void |
setGot(boolean got) |
void |
setUp()
Returns a previously created (or new, if this is the first
time this method is called in this VM) distributed system
which is somewhat configurable via hydra test parameters.
|
void |
tearDown2()
Tears down the test.
|
void |
testBasic() |
void |
testBasicGrantorRecovery() |
void |
testBecomeLockGrantor() |
void |
testBug32461()
Tests for 32461 R3 StuckLocks can occur on locks with an expiration lease
|
void |
testCreateDestroy() |
void |
testDepartedLastOwnerNoLease() |
void |
testDepartedLastOwnerWithLease() |
void |
testDestroyLockServiceAfterGrantResponse() |
void |
testDestroyLockServiceBeforeGrantRequest() |
void |
testFairness() |
void |
testGrantorSelection() |
void |
testGrantTokenCleanup() |
void |
testLeaseDoesntExpire() |
void |
testLeaseExpiresBeforeOtherLocks() |
void |
testLeaseExpiresWhileOtherLocks() |
void |
testLocalGetLockAndIncrement() |
void |
testLockDestroyedService()
Tests what happens when you attempt to lock a name on a lock
service that has been destroyed.
|
void |
testLockDifferentNames() |
void |
testLockExpireUnlock() |
void |
testLockFailover() |
void |
testLockInterruptiblyIsInterruptible() |
void |
testLockIsNotInterruptible() |
void |
testLockQuery() |
void |
testLockRecursion() |
void |
testLockRecursionWithExpiration() |
void |
testLockSameNameDifferentService() |
void |
testLockThenBecomeLockGrantor() |
void |
testLockUnlock() |
void |
testNoStuckLock() |
void |
testOneGetsAndOthersTimeOut() |
void |
testOneGetsThenOtherGets() |
void |
testReleaseOrphanedGrant_Local()
Client requests lock and then interrupts lock request before processing
the grant reply.
|
void |
testReleaseOrphanedGrant_Remote() |
void |
testReleaseOrphanedGrant_RemoteWithDestroy() |
void |
testRemoteGetLockAndIncrement() |
void |
testSuspendLockingAfterExpiration() |
void |
testSuspendLockingBasic()
Test DistributedLockService.acquireExclusiveLocking(), releaseExclusiveLocking()
|
void |
testSuspendLockingBlocksUntilNoLocks()
Test that exlusive locking prohibits locking activity
|
void |
testSuspendLockingInterruptiblyIsInterruptible() |
void |
testSuspendLockingIsNotInterruptible() |
void |
testSuspendLockingProhibitsLocking()
Test that exlusive locking prohibits locking activity
|
void |
testTokenCleanup() |
void |
testTryLock() |
protected static java.lang.Boolean |
tryLock(java.lang.String serviceName,
java.lang.Object name,
java.lang.Long wait)
Accessed via reflection.
|
protected static java.lang.Boolean |
tryToLock(java.lang.String serviceName)
Accessed via reflection.
|
protected static java.lang.Boolean |
unlock(java.lang.String serviceName,
java.lang.Object name)
Accessed via reflection.
|
addExpectedException, addExpectedException, addHydraProperties, attachDebugger, checkBBFlag, cleanupAllVms, clearBBFlag, crashDistributedSystem, crashDistributedSystem, createLogWriter, disconnectAllFromDS, disconnectFromDS, dumpAllStacks, dumpMyThreads, dumpStack, dumpStack, dumpStack, dumpStackTrace, fail, getAllDistributedSystemProperties, getDUnitLocatorAddress, getDUnitLocatorPort, getDUnitLocatorString, getDUnitLogLevel, getIPLiteral, getLogWriter, getLonerSystem, getMcastSystem, getMcastSystem, getRepeatTimeoutMs, getServerHostName, getSystem, getSystem, getTestClass, getTestName, getUniqueName, getVMCount, incBBFlag, invokeInEveryVM, invokeInEveryVM, invokeInEveryVM, invokeInEveryVM, invokeInEveryVMRepeatingIfNecessary, invokeInLocator, invokeRepeatingIfNecessary, isConnectedToDS, join, noteTiming, pause, pause, perVMSetUp, realTearDown, setDiskStoreForGateway, setSystem, setTestName, staticPause, tearDown, unregisterAllDataSerializersFromAllVms, unregisterDataSerializerInThisVM, unregisterInstantiatorsInThisVM, waitForBBFlag, waitForCriterion, waitMutexassertEquals, 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, toStringprotected static com.gemstone.gemfire.distributed.DistributedSystem dlstSystem
protected static java.lang.Object monitor
protected static com.gemstone.gemfire.distributed.DistributedLockService dls_testFairness
protected static int[] count_testFairness
protected static volatile boolean stop_testFairness
protected static volatile boolean[] done_testFairness
protected static DistributedLockServiceTest.BasicLockClient suspendClientSuspendLockingBehaves
protected static DistributedLockServiceTest.BasicLockClient lockClientSuspendLockingBehaves
public DistributedLockServiceTest(java.lang.String name)
public static void caseSetUp()
throws java.lang.Exception
java.lang.Exceptionpublic static void caseTearDown()
throws java.lang.Exception
java.lang.Exceptionpublic void setUp()
throws java.lang.Exception
setUp in class DistributedTestCasejava.lang.Exceptionpublic void tearDown2()
throws java.lang.Exception
DistributedTestCaseDistributedTestCase.tearDown() method, and should be over ridden in its place.tearDown2 in class DistributedTestCasejava.lang.Exceptionpublic static void destroyAllDLockServices()
public static void remoteDumpAllDLockServices()
public java.util.Properties getDistributedSystemProperties()
DistributedTestCaseProperties object used to configure a
connection to a DistributedSystem.
Unless overridden, this method will return an empty
Properties object.getDistributedSystemProperties in class DistributedTestCaseprotected static void connectDistributedSystem()
public void testBasic()
public void testCreateDestroy()
throws java.lang.Exception
java.lang.Exceptionpublic void testFairness()
throws java.lang.Exception
java.lang.Exceptionpublic static java.lang.Integer get_count_testFairness(java.lang.Integer i)
i - public void testOneGetsAndOthersTimeOut()
public static com.gemstone.gemfire.distributed.internal.membership.InternalDistributedMember identifyLockGrantor(java.lang.String serviceName)
serviceName - public static java.lang.Boolean isLockGrantor(java.lang.String serviceName)
serviceName - protected static void becomeLockGrantor(java.lang.String serviceName)
serviceName - public void testGrantorSelection()
public void testBasicGrantorRecovery()
public void testLockFailover()
public void testLockThenBecomeLockGrantor()
public void testBecomeLockGrantor()
public void testTryLock()
public void testOneGetsThenOtherGets()
public void testLockDifferentNames()
public void testLocalGetLockAndIncrement()
public void testRemoteGetLockAndIncrement()
public void testLockSameNameDifferentService()
public void testLeaseDoesntExpire()
throws java.lang.InterruptedException
java.lang.InterruptedExceptionpublic void testLockUnlock()
public void testLockExpireUnlock()
public void testLockRecursion()
public void testLockRecursionWithExpiration()
public void testLeaseExpiresBeforeOtherLocks()
throws java.lang.InterruptedException
java.lang.InterruptedExceptionpublic void testLeaseExpiresWhileOtherLocks()
throws java.lang.InterruptedException
java.lang.InterruptedExceptionpublic void testSuspendLockingAfterExpiration()
throws java.lang.Exception
java.lang.Exceptionpublic void testLockInterruptiblyIsInterruptible()
public void testLockIsNotInterruptible()
public void testSuspendLockingBasic()
throws java.lang.InterruptedException
java.lang.InterruptedExceptionpublic void testSuspendLockingProhibitsLocking()
public void notestSuspendLockingBehaves()
throws java.lang.Exception
java.lang.Exceptionpublic void testSuspendLockingBlocksUntilNoLocks()
throws java.lang.InterruptedException
java.lang.InterruptedExceptionpublic void testSuspendLockingInterruptiblyIsInterruptible()
public void testSuspendLockingIsNotInterruptible()
public void testLockDestroyedService()
public void testDepartedLastOwnerWithLease()
public void testDepartedLastOwnerNoLease()
public void testBug32461()
throws java.lang.Exception
VM-A locks/unlocks "lock", VM-B leases "lock" and disconnects, VM-C attempts to lock "lock" and old dlock throws StuckLockException. VM-C should now succeed in acquiring the lock.
java.lang.Exceptionpublic void testNoStuckLock()
public void testReleaseOrphanedGrant_Local()
public void testReleaseOrphanedGrant_Remote()
public void testReleaseOrphanedGrant_RemoteWithDestroy()
public void doTestReleaseOrphanedGrant_Remote(boolean destroyLockService)
public void testDestroyLockServiceAfterGrantResponse()
throws java.lang.Throwable
java.lang.Throwablepublic void testDestroyLockServiceBeforeGrantRequest()
throws java.lang.Throwable
java.lang.Throwableprotected boolean getDone()
protected void setDone(boolean done)
protected void setGot(boolean got)
protected static java.lang.Boolean lock(java.lang.String serviceName,
java.lang.Object name)
serviceName - name - protected static java.lang.Boolean tryLock(java.lang.String serviceName,
java.lang.Object name,
java.lang.Long wait)
protected static java.lang.Boolean unlock(java.lang.String serviceName,
java.lang.Object name)
protected static java.lang.Boolean tryToLock(java.lang.String serviceName)
numVMs - numThreadsPerVM - public void testTokenCleanup()
throws java.lang.Exception
java.lang.Exceptionpublic void testGrantTokenCleanup()
throws java.lang.Exception
java.lang.Exceptionpublic void testLockQuery()
throws java.lang.Exception
java.lang.Exceptionprotected static void remoteCreateService(java.lang.String name)
name - The name of the newly-created DistributedLockService. It is
recommended that the name of the Region be the DistributedTestCase.getUniqueName() of the test, or at least derive from it.protected void incHits()
protected void incCompletes()
protected static void logInfo(java.lang.String msg)
public void forNumVMsInvoke(int numVMs,
java.lang.String methodName,
java.lang.Object[] args)
Copyright © 2010-2015 Pivotal Software, Inc. All rights reserved.