Search in sources :

Example 1 with LockFailedException

use of io.pravega.controller.store.task.LockFailedException in project pravega by pravega.

the class TaskTest method testLocking.

@Test
public void testLocking() {
    TestTasks testTasks = new TestTasks(taskMetadataStore, executor, HOSTNAME);
    CompletableFuture<Void> first = testTasks.testStreamLock(SCOPE, stream1);
    CompletableFuture<Void> second = testTasks.testStreamLock(SCOPE, stream1);
    try {
        first.getNow(null);
        second.getNow(null);
    } catch (CompletionException ce) {
        assertTrue(ce.getCause() instanceof LockFailedException);
    }
}
Also used : LockFailedException(io.pravega.controller.store.task.LockFailedException) CompletionException(java.util.concurrent.CompletionException) TestTasks(io.pravega.controller.task.Stream.TestTasks) Test(org.junit.Test)

Aggregations

LockFailedException (io.pravega.controller.store.task.LockFailedException)1 TestTasks (io.pravega.controller.task.Stream.TestTasks)1 CompletionException (java.util.concurrent.CompletionException)1 Test (org.junit.Test)1