use of io.aeron.archive.Archive.Context in project Aeron by real-logic.
the class ArchiveTest method dataBufferIsAllocatedOnDemand.
@Test
void dataBufferIsAllocatedOnDemand() {
final Context context = new Context();
final UnsafeBuffer buffer = context.dataBuffer();
assertNotNull(buffer);
assertEquals(context.fileIoMaxLength(), buffer.capacity());
assertSame(buffer, context.dataBuffer());
}
use of io.aeron.archive.Archive.Context in project Aeron by real-logic.
the class ArchiveTest method replayBufferReturnsDataBufferIfThreadingModeIsNotDEDICATED.
@ParameterizedTest
@EnumSource(value = ArchiveThreadingMode.class, mode = EXCLUDE, names = "DEDICATED")
void replayBufferReturnsDataBufferIfThreadingModeIsNotDEDICATED(final ArchiveThreadingMode threadingMode) {
final Archive.Context context = new Archive.Context().threadingMode(threadingMode);
final UnsafeBuffer buffer = context.replayBuffer();
assertSame(context.dataBuffer(), buffer);
}
use of io.aeron.archive.Archive.Context in project Aeron by real-logic.
the class ArchiveTest method recordChecksumBufferReturnsNullIfRecordChecksumIsNull.
@Test
void recordChecksumBufferReturnsNullIfRecordChecksumIsNull() {
final Archive.Context context = new Archive.Context();
assertNull(context.recordChecksumBuffer());
}
use of io.aeron.archive.Archive.Context in project Aeron by real-logic.
the class ArchiveTest method recordChecksumBufferReturnsValueAssignedIfThreadingModeIsDEDICATED.
@Test
void recordChecksumBufferReturnsValueAssignedIfThreadingModeIsDEDICATED() {
final UnsafeBuffer buffer = mock(UnsafeBuffer.class);
final Checksum recordChecksum = mock(Checksum.class);
final Archive.Context context = new Archive.Context().recordChecksum(recordChecksum).threadingMode(DEDICATED);
context.recordChecksumBuffer(buffer);
assertSame(buffer, context.recordChecksumBuffer());
}
use of io.aeron.archive.Archive.Context in project Aeron by real-logic.
the class ArchiveTest method replayBufferReturnsValueAssignedIfThreadingModeIsDEDICATED.
@Test
void replayBufferReturnsValueAssignedIfThreadingModeIsDEDICATED() {
final UnsafeBuffer buffer = mock(UnsafeBuffer.class);
final Archive.Context context = new Archive.Context().threadingMode(DEDICATED);
context.replayBuffer(buffer);
assertSame(buffer, context.replayBuffer());
}
Aggregations