use of org.junit.jupiter.api.condition.EnabledOnOs in project cucumber-jvm by cucumber.
the class FeaturePathTest method can_parse_windows_absolute_path_form.
@Test
@EnabledOnOs(WINDOWS)
void can_parse_windows_absolute_path_form() {
URI uri = FeaturePath.parse("C:\\path\\to\\file.feature");
assertAll(() -> assertThat(uri.getScheme(), is(is("file"))), () -> assertThat(uri.getSchemeSpecificPart(), is("/C:/path/to/file.feature")));
}
use of org.junit.jupiter.api.condition.EnabledOnOs in project cucumber-jvm by cucumber.
the class GluePathTest method absolute_windows_path_form_is_not_valid.
@Test
@EnabledOnOs(OS.WINDOWS)
void absolute_windows_path_form_is_not_valid() {
Executable testMethod = () -> GluePath.parse("C:\\com\\example\\app");
IllegalArgumentException actualThrown = assertThrows(IllegalArgumentException.class, testMethod);
assertThat("Unexpected exception message", actualThrown.getMessage(), is(equalTo("The glue path must have a classpath scheme C:/com/example/app")));
}
use of org.junit.jupiter.api.condition.EnabledOnOs in project neo4j by neo4j.
the class TransactionLogFileIT method doNotScanDirectoryOnRotate.
@Test
@EnabledOnOs(OS.LINUX)
void doNotScanDirectoryOnRotate() throws IOException {
LogFiles logFiles = LogFilesBuilder.builder(databaseLayout, fileSystem).withTransactionIdStore(transactionIdStore).withLogVersionRepository(logVersionRepository).withStoreId(StoreId.UNKNOWN).build();
life.add(logFiles);
life.start();
MutableLong rotationObservedVersion = new MutableLong();
LogRotation logRotation = FileLogRotation.transactionLogRotation(logFiles, Clock.systemUTC(), new DatabaseHealth(NO_OP, NullLog.getInstance()), new LogRotationMonitorAdapter() {
@Override
public void startRotation(long currentLogVersion) {
rotationObservedVersion.setValue(currentLogVersion);
}
});
for (int i = 0; i < 6; i++) {
for (Path path : logFiles.logFiles()) {
FileUtils.deleteFile(path);
}
logRotation.rotateLogFile(LogAppendEvent.NULL);
}
assertEquals(5, rotationObservedVersion.getValue());
assertEquals(6, logFiles.getLogFile().getCurrentLogVersion());
}
use of org.junit.jupiter.api.condition.EnabledOnOs in project neo4j by neo4j.
the class RotatingLogFileWriterTest method rotationShouldCompressToGzipIfRequested.
@Test
@EnabledOnOs({ LINUX })
void rotationShouldCompressToGzipIfRequested() throws IOException {
Path targetFile = dir.homePath().resolve("test.log");
Path targetFile1 = dir.homePath().resolve("test.log.1.gz");
writer = new RotatingLogFileWriter(fs, targetFile, 10, 2, ".gz", "");
assertThat(fs.fileExists(targetFile)).isEqualTo(true);
writer.printf("test string 1");
writer.printf("test string 2");
assertThat(fs.fileExists(targetFile)).isEqualTo(true);
// The files are compressed asynchronously after the log rotation so wait for the file to exist.
assertEventually(() -> fs.fileExists(targetFile1), bool -> bool, 5, TimeUnit.SECONDS);
writer.close();
assertThat(Files.readAllLines(targetFile)).containsExactly("test string 2");
try (GZIPInputStream stream = new GZIPInputStream(Files.newInputStream(targetFile1))) {
assertThat(UTF8.decode(stream.readAllBytes())).isEqualTo("test string 1" + System.lineSeparator());
}
}
use of org.junit.jupiter.api.condition.EnabledOnOs in project neo4j by neo4j.
the class TransactionLogChannelAllocatorIT method allocateNewTransactionLogFile.
@Test
@EnabledOnOs(OS.LINUX)
void allocateNewTransactionLogFile() throws IOException {
PhysicalLogVersionedStoreChannel logChannel = fileAllocator.createLogChannel(10, () -> 1L);
assertEquals(ROTATION_THRESHOLD, logChannel.size());
}
Aggregations