use of org.eclipse.jkube.kit.common.AssemblyFileSet in project jkube by eclipse.
the class AssemblyFileSetUtilsTest method calculateFilePermissionsFileWithFileMode.
@Test
public void calculateFilePermissionsFileWithFileMode() throws Exception {
// Given
final AssemblyFileSet afs = AssemblyFileSet.builder().fileMode("0777").build();
final File sourceFile = temp.newFile("source-file.txt");
final File aFile = temp.newFile("just-a-file.txt");
// When
final List<AssemblyFileEntry> result = calculateFilePermissions(sourceFile, aFile, afs);
// Then
assertThat(result).hasSize(1).contains(new AssemblyFileEntry(sourceFile, aFile, "0777"));
}
use of org.eclipse.jkube.kit.common.AssemblyFileSet in project jkube by eclipse.
the class AssemblyFileSetUtilsTest method calculateFilePermissionsDirectoryAndNestedDirectoryWithDirectoryAndFileMode.
@Test
public void calculateFilePermissionsDirectoryAndNestedDirectoryWithDirectoryAndFileMode() throws Exception {
// Given
final AssemblyFileSet afs = AssemblyFileSet.builder().directoryMode("040775").fileMode("0755").build();
final File sourceDirectory = temp.newFolder("source-directory");
final File sourceSubdirectory = new File(sourceDirectory, "subdirectory");
FileUtils.forceMkdir(sourceSubdirectory);
final File aDirectory = temp.newFolder("just-a-directory");
final File aSubdirectory = new File(aDirectory, "subdirectory");
FileUtils.forceMkdir(aSubdirectory);
// When
final List<AssemblyFileEntry> result = calculateFilePermissions(sourceDirectory, aDirectory, afs);
// Then
assertThat(result).hasSize(2).containsExactlyInAnyOrder(new AssemblyFileEntry(sourceDirectory, aDirectory, "040775"), new AssemblyFileEntry(sourceSubdirectory, aSubdirectory, "040775"));
}
use of org.eclipse.jkube.kit.common.AssemblyFileSet in project jkube by eclipse.
the class AssemblyFileSetUtilsTest method calculateFilePermissionsDirectoryWithNoDirectoryMode.
@Test
public void calculateFilePermissionsDirectoryWithNoDirectoryMode() throws Exception {
// Given
final AssemblyFileSet afs = AssemblyFileSet.builder().build();
final File sourceDirectory = temp.newFile("source-directory");
final File aDirectory = temp.newFolder("just-a-directory");
// When
final List<AssemblyFileEntry> result = calculateFilePermissions(sourceDirectory, aDirectory, afs);
// Then
assertThat(result).hasSize(1).contains(new AssemblyFileEntry(sourceDirectory, aDirectory, "040755"));
}
Aggregations