|
@@ 56-62 (lines=7) @@
|
| 53 |
|
$this->assertTrue($this->instance->isLocked('foo', ILockingProvider::LOCK_SHARED)); |
| 54 |
|
} |
| 55 |
|
|
| 56 |
|
public function testDoubleSharedLock() { |
| 57 |
|
$this->instance->acquireLock('foo', ILockingProvider::LOCK_SHARED); |
| 58 |
|
$this->assertFalse($this->instance->isLocked('foo', ILockingProvider::LOCK_EXCLUSIVE)); |
| 59 |
|
$this->assertTrue($this->instance->isLocked('foo', ILockingProvider::LOCK_SHARED)); |
| 60 |
|
$this->instance->acquireLock('foo', ILockingProvider::LOCK_SHARED); |
| 61 |
|
$this->assertTrue($this->instance->isLocked('foo', ILockingProvider::LOCK_SHARED)); |
| 62 |
|
} |
| 63 |
|
|
| 64 |
|
public function testReleaseSharedLock() { |
| 65 |
|
$this->instance->acquireLock('foo', ILockingProvider::LOCK_SHARED); |
|
@@ 85-91 (lines=7) @@
|
| 82 |
|
$this->instance->acquireLock('foo', ILockingProvider::LOCK_EXCLUSIVE); |
| 83 |
|
} |
| 84 |
|
|
| 85 |
|
public function testReleaseExclusiveLock() { |
| 86 |
|
$this->instance->acquireLock('foo', ILockingProvider::LOCK_EXCLUSIVE); |
| 87 |
|
$this->assertTrue($this->instance->isLocked('foo', ILockingProvider::LOCK_EXCLUSIVE)); |
| 88 |
|
$this->instance->releaseLock('foo', ILockingProvider::LOCK_EXCLUSIVE); |
| 89 |
|
$this->assertFalse($this->instance->isLocked('foo', ILockingProvider::LOCK_EXCLUSIVE)); |
| 90 |
|
$this->instance->acquireLock('foo', ILockingProvider::LOCK_EXCLUSIVE); |
| 91 |
|
} |
| 92 |
|
|
| 93 |
|
/** |
| 94 |
|
* @expectedException \OCP\Lock\LockedException |
|
@@ 102-108 (lines=7) @@
|
| 99 |
|
$this->instance->acquireLock('foo', ILockingProvider::LOCK_EXCLUSIVE); |
| 100 |
|
} |
| 101 |
|
|
| 102 |
|
public function testExclusiveLockAfterSharedReleased() { |
| 103 |
|
$this->instance->acquireLock('foo', ILockingProvider::LOCK_SHARED); |
| 104 |
|
$this->assertTrue($this->instance->isLocked('foo', ILockingProvider::LOCK_SHARED)); |
| 105 |
|
$this->instance->releaseLock('foo', ILockingProvider::LOCK_SHARED); |
| 106 |
|
$this->instance->acquireLock('foo', ILockingProvider::LOCK_EXCLUSIVE); |
| 107 |
|
$this->assertTrue($this->instance->isLocked('foo', ILockingProvider::LOCK_EXCLUSIVE)); |
| 108 |
|
} |
| 109 |
|
|
| 110 |
|
public function testReleaseAll() { |
| 111 |
|
$this->instance->acquireLock('foo', ILockingProvider::LOCK_SHARED); |