Package com.splunk.shuttl.archiver.bucketlock.BucketLocker

Examples of com.splunk.shuttl.archiver.bucketlock.BucketLocker.SharedLockBucketHandler


  }

  public void copyBucket_notGivenBucketLock_doesNothingWithDependencies() {
    final Runnable runnableForVerification = mock(Runnable.class);

    SharedLockBucketHandler locksBucketThenCallsCopyBucket = new SharedLockBucketHandler() {

      @Override
      public void handleSharedLockedBucket(Bucket bucket) {
        runnableForVerification.run();
        assertFalse(realBucketLocker.getLockForBucket(bucket)
View Full Code Here


    assertTrue(firstHandler.wasRun);
    assertTrue(secondHandler.wasRun);
  }

  public void callBucketHandlerUnderSharedLock_givenLockedBucketHandler_callsBucketHandlerToHandleTheBucket() {
    SharedLockBucketHandler bucketHandler = mock(SharedLockBucketHandler.class);
    bucketLocker.callBucketHandlerUnderSharedLock(bucket, bucketHandler);
    verify(bucketHandler).handleSharedLockedBucket(bucket);
  }
View Full Code Here

  public void callBucketHandlerWithBucketSharedLock_givenRunnableThatThrowsException_closesLock() {
    when(bucketLock.tryLockExclusive()).thenReturn(true);
    when(bucketLock.tryConvertExclusiveToSharedLock()).thenReturn(true);
    try {
      bucketLocker.callBucketHandlerUnderSharedLock(mock(Bucket.class),
          new SharedLockBucketHandler() {
            @Override
            public void handleSharedLockedBucket(Bucket bucket) {
              throw new FakeException();
            }
View Full Code Here

TOP

Related Classes of com.splunk.shuttl.archiver.bucketlock.BucketLocker.SharedLockBucketHandler

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.