Search in sources :

Example 1 with Timeout

use of org.junit.rules.Timeout in project pravega by pravega.

the class StreamSegmentMapperTests method testCreateTransactionAlreadyExists.

/**
 * Tests the ability of the StreamSegmentMapper to create a new Transaction if the Transaction already exists (partially
 * or fully).
 */
@Test
public void testCreateTransactionAlreadyExists() {
    final String parentSegmentName = "NewSegment";
    final UUID txnId = UUID.randomUUID();
    final String txnName = StreamSegmentNameUtils.getTransactionNameFromId(parentSegmentName, txnId);
    testCreateAlreadyExists(txnName, (mapper, attributes) -> mapper.createNewStreamSegment(parentSegmentName, null, TIMEOUT).exceptionally(ex -> {
        if (Exceptions.unwrap(ex) instanceof StreamSegmentExistsException) {
            return null;
        }
        throw new CompletionException(ex);
    }).thenCompose(v -> mapper.createNewTransactionStreamSegment(parentSegmentName, txnId, attributes, TIMEOUT)));
}
Also used : Arrays(java.util.Arrays) Storage(io.pravega.segmentstore.storage.Storage) StreamSegmentInformation(io.pravega.segmentstore.contracts.StreamSegmentInformation) StreamSegmentNotExistsException(io.pravega.segmentstore.contracts.StreamSegmentNotExistsException) AssertExtensions(io.pravega.test.common.AssertExtensions) BiFunction(java.util.function.BiFunction) ContainerMetadata(io.pravega.segmentstore.server.ContainerMetadata) TimeoutException(java.util.concurrent.TimeoutException) Cleanup(lombok.Cleanup) UpdateableSegmentMetadata(io.pravega.segmentstore.server.UpdateableSegmentMetadata) SegmentProperties(io.pravega.segmentstore.contracts.SegmentProperties) AttributeUpdate(io.pravega.segmentstore.contracts.AttributeUpdate) SegmentHandle(io.pravega.segmentstore.storage.SegmentHandle) ByteArrayInputStream(java.io.ByteArrayInputStream) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) InMemoryStorageFactory(io.pravega.segmentstore.storage.mocks.InMemoryStorageFactory) Duration(java.time.Duration) Map(java.util.Map) Operation(io.pravega.segmentstore.server.logs.operations.Operation) Attributes(io.pravega.segmentstore.contracts.Attributes) Predicate(java.util.function.Predicate) Collection(java.util.Collection) InMemoryStorage(io.pravega.segmentstore.storage.mocks.InMemoryStorage) Set(java.util.Set) CompletionException(java.util.concurrent.CompletionException) UUID(java.util.UUID) Collectors(java.util.stream.Collectors) SegmentMetadataComparer(io.pravega.segmentstore.server.SegmentMetadataComparer) StreamSegmentNameUtils(io.pravega.shared.segment.StreamSegmentNameUtils) List(java.util.List) AsyncMap(io.pravega.common.util.AsyncMap) StreamSegmentExistsException(io.pravega.segmentstore.contracts.StreamSegmentExistsException) ThreadPooledTestSuite(io.pravega.test.common.ThreadPooledTestSuite) Futures(io.pravega.common.concurrent.Futures) MetadataBuilder(io.pravega.segmentstore.server.MetadataBuilder) SegmentRollingPolicy(io.pravega.segmentstore.storage.SegmentRollingPolicy) TooManyActiveSegmentsException(io.pravega.segmentstore.contracts.TooManyActiveSegmentsException) Exceptions(io.pravega.common.Exceptions) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) HashMap(java.util.HashMap) CompletableFuture(java.util.concurrent.CompletableFuture) Function(java.util.function.Function) Supplier(java.util.function.Supplier) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) UpdateableContainerMetadata(io.pravega.segmentstore.server.UpdateableContainerMetadata) SegmentMetadata(io.pravega.segmentstore.server.SegmentMetadata) Timeout(org.junit.rules.Timeout) StreamSegmentMapOperation(io.pravega.segmentstore.server.logs.operations.StreamSegmentMapOperation) MathHelpers(io.pravega.common.MathHelpers) Iterator(java.util.Iterator) Executor(java.util.concurrent.Executor) IntentionalException(io.pravega.test.common.IntentionalException) lombok.val(lombok.val) OperationLog(io.pravega.segmentstore.server.OperationLog) Test(org.junit.Test) Service(com.google.common.util.concurrent.Service) TimeUnit(java.util.concurrent.TimeUnit) AtomicLong(java.util.concurrent.atomic.AtomicLong) Rule(org.junit.Rule) AttributeUpdateType(io.pravega.segmentstore.contracts.AttributeUpdateType) DataCorruptionException(io.pravega.segmentstore.server.DataCorruptionException) Assert(org.junit.Assert) Collections(java.util.Collections) InputStream(java.io.InputStream) StreamSegmentExistsException(io.pravega.segmentstore.contracts.StreamSegmentExistsException) CompletionException(java.util.concurrent.CompletionException) UUID(java.util.UUID) Test(org.junit.Test)

Example 2 with Timeout

use of org.junit.rules.Timeout in project pravega by pravega.

the class StreamSegmentMapperTests method testCreateAlreadyExists.

/**
 * General test for verifying behavior when a Segment/Transaction is attempted to be created but it already exists.
 *
 * @param segmentName   The name of the segment/transaction to create.
 * @param createSegment A BiFunction that is given an instance of a StreamSegmentMapper and a Collection of AttributeUpdates
 *                      that, when invoked, will create the given segment.
 */
private void testCreateAlreadyExists(String segmentName, BiFunction<StreamSegmentMapper, Collection<AttributeUpdate>, CompletableFuture<?>> createSegment) {
    final String stateSegmentName = StreamSegmentNameUtils.getStateSegmentName(segmentName);
    final Map<UUID, Long> correctAttributes = Collections.singletonMap(UUID.randomUUID(), 123L);
    final Collection<AttributeUpdate> correctAttributeUpdates = correctAttributes.entrySet().stream().map(e -> new AttributeUpdate(e.getKey(), AttributeUpdateType.Replace, e.getValue())).collect(Collectors.toList());
    final Map<UUID, Long> badAttributes = Collections.singletonMap(UUID.randomUUID(), 456L);
    final Collection<AttributeUpdate> badAttributeUpdates = badAttributes.entrySet().stream().map(e -> new AttributeUpdate(e.getKey(), AttributeUpdateType.Replace, e.getValue())).collect(Collectors.toList());
    @Cleanup TestContext context = new TestContext();
    @Cleanup val storage = InMemoryStorageFactory.newStorage(executorService());
    storage.initialize(1);
    val store = new SegmentStateStore(storage, executorService());
    val mapper = new StreamSegmentMapper(context.metadata, context.operationLog, store, context.noOpMetadataCleanup, storage, executorService());
    // 1. Segment Exists, and so does State File (and it's not corrupted) -> Exception must be bubbled up.
    createSegment.apply(mapper, correctAttributeUpdates).join();
    AssertExtensions.assertThrows("createNewStreamSegment did not fail when Segment already exists.", () -> createSegment.apply(mapper, badAttributeUpdates), ex -> ex instanceof StreamSegmentExistsException);
    val state1 = store.get(segmentName, TIMEOUT).join();
    AssertExtensions.assertMapEquals("Unexpected attributes after failed attempt to recreate correctly created segment", correctAttributes, state1.getAttributes());
    // 2. Segment Exists, but with empty State File: State file re-created & no exception bubbled up.
    storage.openWrite(stateSegmentName).thenCompose(handle -> storage.delete(handle, TIMEOUT)).thenCompose(v -> storage.create(stateSegmentName, TIMEOUT)).join();
    Assert.assertNull("Expected a null SegmentState.", store.get(segmentName, TIMEOUT).join());
    createSegment.apply(mapper, correctAttributeUpdates).join();
    val state2 = store.get(segmentName, TIMEOUT).join();
    AssertExtensions.assertMapEquals("Unexpected attributes after successful attempt to complete segment creation (missing state file)", correctAttributes, state2.getAttributes());
    // 3. Segment Exists, but with corrupted State File: State file re-created & no exception bubbled up.
    storage.openWrite(stateSegmentName).thenCompose(handle -> storage.delete(handle, TIMEOUT)).thenCompose(v -> storage.create(stateSegmentName, TIMEOUT)).thenCompose(v -> storage.openWrite(stateSegmentName)).thenCompose(handle -> storage.write(handle, 0, new ByteArrayInputStream(new byte[1]), 1, TIMEOUT)).join();
    AssertExtensions.assertThrows("Expected a DataCorruptionException when reading a corrupted State File.", () -> store.get(segmentName, TIMEOUT), ex -> ex instanceof DataCorruptionException);
    createSegment.apply(mapper, correctAttributeUpdates).join();
    val state3 = store.get(segmentName, TIMEOUT).join();
    AssertExtensions.assertMapEquals("Unexpected attributes after successful attempt to complete segment creation (corrupted state file)", correctAttributes, state3.getAttributes());
    // 4. Segment Exists with non-zero length, but with empty/corrupted State File: State File re-created and exception thrown.
    storage.openWrite(stateSegmentName).thenCompose(handle -> storage.delete(handle, TIMEOUT)).thenCompose(v -> storage.create(stateSegmentName, TIMEOUT)).thenCompose(v -> storage.openWrite(segmentName)).thenCompose(handle -> storage.write(handle, 0, new ByteArrayInputStream(new byte[1]), 1, TIMEOUT)).join();
    AssertExtensions.assertThrows("createNewStreamSegment did not fail when Segment already exists (non-zero length, missing state file).", () -> createSegment.apply(mapper, correctAttributeUpdates), ex -> ex instanceof StreamSegmentExistsException);
    val state4 = store.get(segmentName, TIMEOUT).join();
    AssertExtensions.assertMapEquals("Unexpected attributes after failed attempt to recreate segment with non-zero length", correctAttributes, state4.getAttributes());
}
Also used : Arrays(java.util.Arrays) Storage(io.pravega.segmentstore.storage.Storage) StreamSegmentInformation(io.pravega.segmentstore.contracts.StreamSegmentInformation) StreamSegmentNotExistsException(io.pravega.segmentstore.contracts.StreamSegmentNotExistsException) AssertExtensions(io.pravega.test.common.AssertExtensions) BiFunction(java.util.function.BiFunction) ContainerMetadata(io.pravega.segmentstore.server.ContainerMetadata) TimeoutException(java.util.concurrent.TimeoutException) Cleanup(lombok.Cleanup) UpdateableSegmentMetadata(io.pravega.segmentstore.server.UpdateableSegmentMetadata) SegmentProperties(io.pravega.segmentstore.contracts.SegmentProperties) AttributeUpdate(io.pravega.segmentstore.contracts.AttributeUpdate) SegmentHandle(io.pravega.segmentstore.storage.SegmentHandle) ByteArrayInputStream(java.io.ByteArrayInputStream) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) InMemoryStorageFactory(io.pravega.segmentstore.storage.mocks.InMemoryStorageFactory) Duration(java.time.Duration) Map(java.util.Map) Operation(io.pravega.segmentstore.server.logs.operations.Operation) Attributes(io.pravega.segmentstore.contracts.Attributes) Predicate(java.util.function.Predicate) Collection(java.util.Collection) InMemoryStorage(io.pravega.segmentstore.storage.mocks.InMemoryStorage) Set(java.util.Set) CompletionException(java.util.concurrent.CompletionException) UUID(java.util.UUID) Collectors(java.util.stream.Collectors) SegmentMetadataComparer(io.pravega.segmentstore.server.SegmentMetadataComparer) StreamSegmentNameUtils(io.pravega.shared.segment.StreamSegmentNameUtils) List(java.util.List) AsyncMap(io.pravega.common.util.AsyncMap) StreamSegmentExistsException(io.pravega.segmentstore.contracts.StreamSegmentExistsException) ThreadPooledTestSuite(io.pravega.test.common.ThreadPooledTestSuite) Futures(io.pravega.common.concurrent.Futures) MetadataBuilder(io.pravega.segmentstore.server.MetadataBuilder) SegmentRollingPolicy(io.pravega.segmentstore.storage.SegmentRollingPolicy) TooManyActiveSegmentsException(io.pravega.segmentstore.contracts.TooManyActiveSegmentsException) Exceptions(io.pravega.common.Exceptions) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) HashMap(java.util.HashMap) CompletableFuture(java.util.concurrent.CompletableFuture) Function(java.util.function.Function) Supplier(java.util.function.Supplier) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) UpdateableContainerMetadata(io.pravega.segmentstore.server.UpdateableContainerMetadata) SegmentMetadata(io.pravega.segmentstore.server.SegmentMetadata) Timeout(org.junit.rules.Timeout) StreamSegmentMapOperation(io.pravega.segmentstore.server.logs.operations.StreamSegmentMapOperation) MathHelpers(io.pravega.common.MathHelpers) Iterator(java.util.Iterator) Executor(java.util.concurrent.Executor) IntentionalException(io.pravega.test.common.IntentionalException) lombok.val(lombok.val) OperationLog(io.pravega.segmentstore.server.OperationLog) Test(org.junit.Test) Service(com.google.common.util.concurrent.Service) TimeUnit(java.util.concurrent.TimeUnit) AtomicLong(java.util.concurrent.atomic.AtomicLong) Rule(org.junit.Rule) AttributeUpdateType(io.pravega.segmentstore.contracts.AttributeUpdateType) DataCorruptionException(io.pravega.segmentstore.server.DataCorruptionException) Assert(org.junit.Assert) Collections(java.util.Collections) InputStream(java.io.InputStream) lombok.val(lombok.val) AttributeUpdate(io.pravega.segmentstore.contracts.AttributeUpdate) Cleanup(lombok.Cleanup) StreamSegmentExistsException(io.pravega.segmentstore.contracts.StreamSegmentExistsException) ByteArrayInputStream(java.io.ByteArrayInputStream) AtomicLong(java.util.concurrent.atomic.AtomicLong) DataCorruptionException(io.pravega.segmentstore.server.DataCorruptionException) UUID(java.util.UUID)

Example 3 with Timeout

use of org.junit.rules.Timeout in project pravega by pravega.

the class SegmentStateMapperTests method testGetSegmentInfoFromStorage.

/**
 * Tests the ability to retrieve Segment Info from Storage (base info and its State).
 */
@Test
public void testGetSegmentInfoFromStorage() {
    final UUID attributeId = UUID.randomUUID();
    @Cleanup val s = createStorage();
    val stateStore = new InMemoryStateStore();
    val m = new SegmentStateMapper(stateStore, s);
    // Save some state.
    val info = s.create("s", TIMEOUT).thenCompose(si -> s.openWrite(si.getName())).thenCompose(handle -> s.write(handle, 0, new ByteArrayInputStream(new byte[10]), 10, TIMEOUT).thenCompose(v -> s.seal(handle, TIMEOUT)).thenCompose(v -> s.getStreamSegmentInfo(handle.getSegmentName(), TIMEOUT))).join();
    val expectedInfo = StreamSegmentInformation.from(info).startOffset(info.getLength() / 2).build();
    val attributes = Collections.singleton(new AttributeUpdate(attributeId, AttributeUpdateType.Replace, 100L));
    val expectedAttributes = Collections.singletonMap(attributeId, 100L);
    m.saveState(expectedInfo, attributes, TIMEOUT).join();
    // Retrieve the state and verify it.
    val actual = m.getSegmentInfoFromStorage(expectedInfo.getName(), TIMEOUT).join();
    Assert.assertEquals("Unexpected Name.", expectedInfo.getName(), actual.getName());
    Assert.assertEquals("Unexpected Length.", expectedInfo.getLength(), actual.getLength());
    Assert.assertEquals("Unexpected Sealed status.", expectedInfo.isSealed(), actual.isSealed());
    Assert.assertEquals("Unexpected Start Offset.", expectedInfo.getStartOffset(), actual.getStartOffset());
    AssertExtensions.assertMapEquals("Unexpected Attributes.", expectedAttributes, actual.getAttributes());
}
Also used : lombok.val(lombok.val) Storage(io.pravega.segmentstore.storage.Storage) StreamSegmentInformation(io.pravega.segmentstore.contracts.StreamSegmentInformation) AssertExtensions(io.pravega.test.common.AssertExtensions) lombok.val(lombok.val) Cleanup(lombok.Cleanup) Test(org.junit.Test) UUID(java.util.UUID) AttributeUpdate(io.pravega.segmentstore.contracts.AttributeUpdate) Rule(org.junit.Rule) ByteArrayInputStream(java.io.ByteArrayInputStream) ThreadPooledTestSuite(io.pravega.test.common.ThreadPooledTestSuite) InMemoryStorageFactory(io.pravega.segmentstore.storage.mocks.InMemoryStorageFactory) Duration(java.time.Duration) Timeout(org.junit.rules.Timeout) AttributeUpdateType(io.pravega.segmentstore.contracts.AttributeUpdateType) Assert(org.junit.Assert) Collections(java.util.Collections) AttributeUpdate(io.pravega.segmentstore.contracts.AttributeUpdate) ByteArrayInputStream(java.io.ByteArrayInputStream) UUID(java.util.UUID) Cleanup(lombok.Cleanup) Test(org.junit.Test)

Example 4 with Timeout

use of org.junit.rules.Timeout in project pravega by pravega.

the class SequentialAsyncProcessorTests method testRunAsyncErrors.

/**
 * Tests the runAsync() method with execution errors.
 */
@Test(timeout = TIMEOUT_MILLIS)
public void testRunAsyncErrors() throws Exception {
    final int expectedCount = 2;
    val count = new AtomicInteger();
    val finished = new CompletableFuture<Void>();
    val retry = Retry.withExpBackoff(1, 2, expectedCount).retryWhen(t -> {
        if (count.get() >= expectedCount) {
            finished.complete(null);
        }
        return Exceptions.unwrap(t) instanceof IntentionalException;
    }).throwingOn(Exception.class);
    val error = new CompletableFuture<Throwable>();
    val p = new SequentialAsyncProcessor(() -> {
        count.incrementAndGet();
        throw new IntentionalException();
    }, retry, error::complete, executorService());
    // Invoke it once.
    p.runAsync();
    finished.get(TIMEOUT_MILLIS, TimeUnit.MILLISECONDS);
    val finalException = Exceptions.unwrap(error.get(TIMEOUT_MILLIS, TimeUnit.MILLISECONDS));
    Assert.assertEquals("Unexpected number of final invocations.", expectedCount, count.get());
    Assert.assertTrue("Unexpected final error callback.", finalException instanceof RetriesExhaustedException && Exceptions.unwrap(finalException.getCause()) instanceof IntentionalException);
}
Also used : lombok.val(lombok.val) Retry(io.pravega.common.util.Retry) Semaphore(java.util.concurrent.Semaphore) Exceptions(io.pravega.common.Exceptions) IntentionalException(io.pravega.test.common.IntentionalException) lombok.val(lombok.val) CompletableFuture(java.util.concurrent.CompletableFuture) Test(org.junit.Test) AtomicReference(java.util.concurrent.atomic.AtomicReference) RetriesExhaustedException(io.pravega.common.util.RetriesExhaustedException) TimeUnit(java.util.concurrent.TimeUnit) Rule(org.junit.Rule) ThreadPooledTestSuite(io.pravega.test.common.ThreadPooledTestSuite) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) Timeout(org.junit.rules.Timeout) Assert(org.junit.Assert) CompletableFuture(java.util.concurrent.CompletableFuture) RetriesExhaustedException(io.pravega.common.util.RetriesExhaustedException) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) IntentionalException(io.pravega.test.common.IntentionalException) Test(org.junit.Test)

Example 5 with Timeout

use of org.junit.rules.Timeout in project rxrabbit by meltwater.

the class RxRabbitTests method if_not_using_publish_confirms_messages_can_be_lost.

@Test
public void if_not_using_publish_confirms_messages_can_be_lost() throws IOException {
    ChannelFactory proxyChannelFactory = getDroppingAndExceptionThrowingChannelFactory(1, 2);
    final PublisherSettings proxyPublishSettings = new PublisherSettings().withNumChannels(1).withPublisherConfirms(false).withRetryCount(5);
    DefaultPublisherFactory proxyPublishFactory = new DefaultPublisherFactory(proxyChannelFactory, proxyPublishSettings);
    RabbitPublisher publisher = proxyPublishFactory.createPublisher();
    final List<PublishedMessage> res = sendNMessagesAsync(3, 0, publisher).take(3).timeout(30, TimeUnit.SECONDS).toList().toBlocking().last();
    for (PublishedMessage re : res) {
        assertFalse(re.failed);
    }
    final List<Message> consumeRes = consumerFactory.createConsumer(inputQueue).doOnNext(m -> m.acknowledger.ack()).take(2).timeout(10, TimeUnit.SECONDS).toList().toBlocking().last();
    assertThat(consumeRes.size(), is(2));
    final List<Message> timeoutConsume = consumerFactory.createConsumer(inputQueue).doOnNext(m -> m.acknowledger.ack()).take(1).timeout(3, TimeUnit.SECONDS).onErrorResumeNext(Observable.<Message>empty()).toList().toBlocking().last();
    assertTrue(timeoutConsume.isEmpty());
    publisher.close();
}
Also used : SortedSet(java.util.SortedSet) DockerContainers(com.meltwater.rxrabbit.docker.DockerContainers) TimeoutException(java.util.concurrent.TimeoutException) Random(java.util.Random) Collections2(com.google.common.collect.Collections2) MonitoringTestThreadFactory(com.meltwater.rxrabbit.util.MonitoringTestThreadFactory) Assert.assertThat(org.junit.Assert.assertThat) RabbitTestUtils.waitForNumQueuesToBePresent(com.meltwater.rxrabbit.RabbitTestUtils.waitForNumQueuesToBePresent) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) After(org.junit.After) Map(java.util.Map) Schedulers(rx.schedulers.Schedulers) RxJavaHooks(rx.plugins.RxJavaHooks) TakeAndAckTransformer(com.meltwater.rxrabbit.util.TakeAndAckTransformer) AfterClass(org.junit.AfterClass) Collection(java.util.Collection) Set(java.util.Set) RabbitTestUtils.declareAndBindQueue(com.meltwater.rxrabbit.RabbitTestUtils.declareAndBindQueue) Scheduler(rx.Scheduler) CountDownLatch(java.util.concurrent.CountDownLatch) List(java.util.List) DefaultChannelFactory(com.meltwater.rxrabbit.impl.DefaultChannelFactory) RabbitTestUtils.realm(com.meltwater.rxrabbit.RabbitTestUtils.realm) Assert.assertFalse(org.junit.Assert.assertFalse) Matchers.equalTo(org.hamcrest.Matchers.equalTo) Matchers.is(org.hamcrest.Matchers.is) CachedThreadScheduler(rx.internal.schedulers.CachedThreadScheduler) Subscription(rx.Subscription) RabbitTestUtils.waitForAllConnectionsToClose(com.meltwater.rxrabbit.RabbitTestUtils.waitForAllConnectionsToClose) RabbitTestUtils.createQueues(com.meltwater.rxrabbit.RabbitTestUtils.createQueues) BeforeClass(org.junit.BeforeClass) ConfirmListener(com.rabbitmq.client.ConfirmListener) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) HashMap(java.util.HashMap) MINUTES(java.util.concurrent.TimeUnit.MINUTES) AtomicReference(java.util.concurrent.atomic.AtomicReference) TreeSet(java.util.TreeSet) Observable(rx.Observable) ArrayList(java.util.ArrayList) ConstantBackoffAlgorithm(com.meltwater.rxrabbit.util.ConstantBackoffAlgorithm) HashSet(java.util.HashSet) AsyncHttpClient(com.ning.http.client.AsyncHttpClient) Timeout(org.junit.rules.Timeout) Matchers.lessThan(org.hamcrest.Matchers.lessThan) Response(com.ning.http.client.Response) Before(org.junit.Before) ExampleCode(com.meltwater.rxrabbit.example.ExampleCode) Subscriber(rx.Subscriber) Semaphore(java.util.concurrent.Semaphore) Assert.assertTrue(org.junit.Assert.assertTrue) Test(org.junit.Test) IOException(java.io.IOException) Logger(com.meltwater.rxrabbit.util.Logger) TimeUnit(java.util.concurrent.TimeUnit) AtomicLong(java.util.concurrent.atomic.AtomicLong) Rule(org.junit.Rule) Collections(java.util.Collections) Assert.assertEquals(org.junit.Assert.assertEquals) AMQP(com.rabbitmq.client.AMQP) DefaultChannelFactory(com.meltwater.rxrabbit.impl.DefaultChannelFactory) Test(org.junit.Test)

Aggregations

Timeout (org.junit.rules.Timeout)92 Rule (org.junit.Rule)91 Test (org.junit.Test)91 Assert (org.junit.Assert)84 AssertExtensions (io.pravega.test.common.AssertExtensions)81 Duration (java.time.Duration)81 ArrayList (java.util.ArrayList)80 lombok.val (lombok.val)79 TimeUnit (java.util.concurrent.TimeUnit)78 ThreadPooledTestSuite (io.pravega.test.common.ThreadPooledTestSuite)77 Cleanup (lombok.Cleanup)73 Collections (java.util.Collections)72 CompletableFuture (java.util.concurrent.CompletableFuture)72 HashMap (java.util.HashMap)69 ByteArraySegment (io.pravega.common.util.ByteArraySegment)68 Collectors (java.util.stream.Collectors)68 List (java.util.List)66 AtomicReference (java.util.concurrent.atomic.AtomicReference)66 IntentionalException (io.pravega.test.common.IntentionalException)62 Map (java.util.Map)62