Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 12 additions & 9 deletions src/test/java/net/openhft/chronicle/queue/ReadWriteTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -153,21 +153,24 @@ public void testProceedWhenMetadataFileInitialized() throws IOException {
}

// Can't append to a read-only chronicle
@Test(expected = IllegalStateException.class)
@Test
public void testWriteToReadOnlyChronicle() {
if (OS.isWindows()) {
System.err.println("#460 Cannot test read only mode on windows");
throw new IllegalStateException("not run");
}
assumeFalse("#460 Cannot test read only mode on Windows", OS.isWindows());

try (ChronicleQueue out = SingleChronicleQueueBuilder
.binary(chroniclePath)
.testBlockSize()
.readOnly(true)
.build();
final ExcerptAppender appender = out.createAppender()) {
assumeNotNull(appender);
// Do nothing
.build()) {
ExcerptAppender unexpectedAppender;
try {
unexpectedAppender = out.createAppender();
} catch (IllegalStateException expected) {
return;
}
try (ExcerptAppender appender = unexpectedAppender) {
fail("Read-only queue unexpectedly created an appender: " + appender);
}
}
}

Expand Down