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 Object |
monitor |
protected static boolean |
stop_testFairness |
protected static DistributedLockServiceTest.BasicLockClient |
suspendClientSuspendLockingBehaves |
logPerTest, reconnect, system, testName| Constructor and Description |
|---|
DistributedLockServiceTest(String name) |
| Modifier and Type | Method and Description |
|---|---|
protected static void |
becomeLockGrantor(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,
String methodName,
Object[] args)
Assumes there is only one host, and invokes the given method in
the first numVMs VMs that host knows about.
|
static Integer |
get_count_testFairness(Integer i)
Accessed by reflection.
|
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(String serviceName)
Accessed via reflection.
|
protected void |
incCompletes() |
protected void |
incHits() |
static Boolean |
isLockGrantor(String serviceName)
Accessed via reflection.
|
protected static Boolean |
lock(String serviceName,
Object name)
Accessed via reflection.
|
protected static void |
logInfo(String msg) |
void |
notestSuspendLockingBehaves()
Test that suspend locking behaves under various usage patterns.
|
protected static void |
remoteCreateService(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 Boolean |
tryLock(String serviceName,
Object name,
Long wait)
Accessed via reflection.
|
protected static Boolean |
tryToLock(String serviceName)
Accessed via reflection.
|
protected static Boolean |
unlock(String serviceName,
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 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(String name)
public void setUp()
throws Exception
setUp in class DistributedTestCaseExceptionpublic void tearDown2()
throws Exception
DistributedTestCaseDistributedTestCase.tearDown() method, and should be over ridden in its place.tearDown2 in class DistributedTestCaseExceptionpublic static void destroyAllDLockServices()
public static void remoteDumpAllDLockServices()
public 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 static Integer get_count_testFairness(Integer i)
i - public void testOneGetsAndOthersTimeOut()
public static com.gemstone.gemfire.distributed.internal.membership.InternalDistributedMember identifyLockGrantor(String serviceName)
serviceName - public static Boolean isLockGrantor(String serviceName)
serviceName - protected static void becomeLockGrantor(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 InterruptedException
InterruptedExceptionpublic void testLockUnlock()
public void testLockExpireUnlock()
public void testLockRecursion()
public void testLockRecursionWithExpiration()
public void testLeaseExpiresBeforeOtherLocks()
throws InterruptedException
InterruptedExceptionpublic void testLeaseExpiresWhileOtherLocks()
throws InterruptedException
InterruptedExceptionpublic void testSuspendLockingAfterExpiration()
throws Exception
Exceptionpublic void testLockInterruptiblyIsInterruptible()
public void testLockIsNotInterruptible()
public void testSuspendLockingBasic()
throws InterruptedException
InterruptedExceptionpublic void testSuspendLockingProhibitsLocking()
public void notestSuspendLockingBehaves()
throws Exception
Exceptionpublic void testSuspendLockingBlocksUntilNoLocks()
throws InterruptedException
InterruptedExceptionpublic void testSuspendLockingInterruptiblyIsInterruptible()
public void testSuspendLockingIsNotInterruptible()
public void testLockDestroyedService()
public void testDepartedLastOwnerWithLease()
public void testDepartedLastOwnerNoLease()
public void testBug32461()
throws 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.
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 Throwable
Throwablepublic void testDestroyLockServiceBeforeGrantRequest()
throws Throwable
Throwableprotected boolean getDone()
protected void setDone(boolean done)
protected void setGot(boolean got)
protected static Boolean lock(String serviceName, Object name)
serviceName - name - protected static Boolean tryLock(String serviceName, Object name, Long wait)
protected static Boolean unlock(String serviceName, Object name)
protected static Boolean tryToLock(String serviceName)
numVMs - numThreadsPerVM - protected static void remoteCreateService(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(String msg)
Copyright © 2010-2015 Pivotal Software, Inc. All rights reserved.