else if (EnvironmentUtil.isUnixLikeOperatingSystem()) {
Files.setPosixFilePermissions(somefilePath, PosixFilePermissions.fromString("rw-rw-r-x"));
}
// Run
FileProperties fileProperties = versionComparator.captureFileProperties(somefile, null, true);
// Test
assertNotNull(fileProperties.getChecksum());
assertEquals(1382196000, fileProperties.getLastModified());
assertEquals("somefile", fileProperties.getRelativePath());
assertEquals(100*1024, fileProperties.getSize());
assertNull(fileProperties.getLinkTarget());
assertTrue(fileProperties.exists());
assertEquals(FileType.FILE, fileProperties.getType());
if (EnvironmentUtil.isWindows()) {
DosFileAttributes dosFileAttributes = FileUtil.dosAttrsFromString(fileProperties.getDosAttributes());
assertFalse(dosFileAttributes.isArchive());
assertFalse(dosFileAttributes.isHidden());
assertFalse(dosFileAttributes.isReadOnly());
assertFalse(dosFileAttributes.isSystem());
assertNull(fileProperties.getPosixPermissions());
}
else if (EnvironmentUtil.isUnixLikeOperatingSystem()) {
assertEquals("rw-rw-r-x", fileProperties.getPosixPermissions());
assertNull(fileProperties.getDosAttributes());
}
// Tear down
TestConfigUtil.deleteTestLocalConfigAndData(config);
}