use of org.junit.jupiter.api.condition.DisabledOnOs in project cucumber-jvm by cucumber.
the class ResourceScannerTest method scanForResourcesPathSymlink.
@Test
@DisabledOnOs(value = OS.WINDOWS, disabledReason = "Only works if repository is explicitly cloned activated symlinks and " + "developer mode in windows is activated")
void scanForResourcesPathSymlink() {
File file = new File("src/test/resource-symlink/test/resource.txt");
List<URI> resources = resourceScanner.scanForResourcesPath(file.toPath());
assertThat(resources, contains(file.toURI()));
}
use of org.junit.jupiter.api.condition.DisabledOnOs in project neo4j by neo4j.
the class DumpCommandIT method shouldHandleDatabaseSymlink.
@Test
@DisabledOnOs(OS.WINDOWS)
void shouldHandleDatabaseSymlink() throws Exception {
Path realDatabaseDir = testDirectory.directory("path-to-links/foo");
Path dataDir = testDirectory.directory("some-other-path");
Path databaseDir = dataDir.resolve("databases/foo");
Path txLogsDir = dataDir.resolve(DEFAULT_TX_LOGS_ROOT_DIR_NAME + "/foo");
Files.createDirectories(dataDir.resolve("databases"));
Files.createSymbolicLink(databaseDir, realDatabaseDir);
Files.write(configDir.resolve(Config.DEFAULT_CONFIG_FILE_NAME), singletonList(format("%s=%s", data_directory.name(), dataDir.toString().replace('\\', '/'))));
putStoreInDirectory(buildConfig(), realDatabaseDir);
execute("foo");
verify(dumper).dump(eq(realDatabaseDir), eq(txLogsDir), any(), any(), any());
}
use of org.junit.jupiter.api.condition.DisabledOnOs in project neo4j by neo4j.
the class DefaultFileSystemAbstractionTest method shouldFailGracefullyWhenPathCannotBeCreated.
@Test
// Windows doesn't seem to be able to set a directory read only without complex ACLs
@DisabledOnOs(OS.WINDOWS)
@DisabledForRoot
void shouldFailGracefullyWhenPathCannotBeCreated() throws Exception {
Files.createDirectories(path);
assertTrue(fsa.fileExists(path));
Files.setPosixFilePermissions(path, EnumSet.of(PosixFilePermission.OWNER_READ, PosixFilePermission.GROUP_READ, PosixFilePermission.OTHERS_READ));
path = path.resolve("some_file");
IOException exception = assertThrows(IOException.class, () -> fsa.mkdirs(path));
assertFalse(fsa.isDirectory(path));
String expectedMessage = format(UNABLE_TO_CREATE_DIRECTORY_FORMAT, path);
assertThat(exception.getMessage()).isEqualTo(expectedMessage);
Throwable cause = exception.getCause();
assertThat(cause).isInstanceOf(AccessDeniedException.class);
}
use of org.junit.jupiter.api.condition.DisabledOnOs in project neo4j by neo4j.
the class PageSwapperTest method directIOAllowedOnlyOnLinux.
@Test
@DisabledOnOs(OS.LINUX)
void directIOAllowedOnlyOnLinux() throws IOException {
PageSwapperFactory factory = createSwapperFactory(getFs());
Path file = file("file");
var e = assertThrows(IllegalArgumentException.class, () -> createSwapperAndFile(factory, file, true));
assertThat(e.getMessage()).contains("Linux");
}
use of org.junit.jupiter.api.condition.DisabledOnOs in project neo4j by neo4j.
the class VersionAwareLogEntryReaderIT method readTillTheEndOfNotPreallocatedFile.
@Test
@DisabledOnOs(OS.LINUX)
void readTillTheEndOfNotPreallocatedFile() throws IOException {
LogFiles logFiles = LogFilesBuilder.builder(databaseLayout, fs).withLogEntryReader(entryReader).withLogVersionRepository(new SimpleLogVersionRepository()).withTransactionIdStore(new SimpleTransactionIdStore()).withStoreId(StoreId.UNKNOWN).build();
try (Lifespan lifespan = new Lifespan(logFiles)) {
LogPosition logPosition = entryReader.lastPosition();
assertEquals(0L, logPosition.getLogVersion());
assertEquals(Files.size(logFiles.getLogFile().getHighestLogFile()), logPosition.getByteOffset());
}
}
Aggregations