Search in sources :

Example 6 with ProjectFilesystemDelegate

use of com.facebook.buck.io.ProjectFilesystemDelegate in project buck by facebook.

the class AutoSparseIntegrationTest method testNotExecutableFile.

@Test
public void testNotExecutableFile() {
    ProjectFilesystemDelegate delegate = createDelegate();
    Assume.assumeFalse(delegate.isExecutable(repoPath.resolve("file2")));
}
Also used : ProjectFilesystemDelegate(com.facebook.buck.io.ProjectFilesystemDelegate) Test(org.junit.Test)

Example 7 with ProjectFilesystemDelegate

use of com.facebook.buck.io.ProjectFilesystemDelegate in project buck by facebook.

the class AutoSparseIntegrationTest method testRelativePath.

@Test
public void testRelativePath() {
    ProjectFilesystemDelegate delegate = createDelegate();
    Path path = delegate.getPathForRelativePath(Paths.get("subdir/file_in_subdir"));
    Assert.assertEquals(path, repoPath.resolve("subdir/file_in_subdir"));
}
Also used : Path(java.nio.file.Path) ProjectFilesystemDelegate(com.facebook.buck.io.ProjectFilesystemDelegate) Test(org.junit.Test)

Example 8 with ProjectFilesystemDelegate

use of com.facebook.buck.io.ProjectFilesystemDelegate in project buck by facebook.

the class AutoSparseIntegrationTest method testExecutableFile.

@Test
public void testExecutableFile() {
    ProjectFilesystemDelegate delegate = createDelegate();
    Assume.assumeTrue(delegate.isExecutable(repoPath.resolve("file1")));
}
Also used : ProjectFilesystemDelegate(com.facebook.buck.io.ProjectFilesystemDelegate) Test(org.junit.Test)

Example 9 with ProjectFilesystemDelegate

use of com.facebook.buck.io.ProjectFilesystemDelegate in project buck by facebook.

the class AutoSparseIntegrationTest method testNotSymLink.

@Test
public void testNotSymLink() {
    ProjectFilesystemDelegate delegate = createDelegate();
    Assume.assumeFalse(delegate.isSymlink(repoPath.resolve("file2")));
}
Also used : ProjectFilesystemDelegate(com.facebook.buck.io.ProjectFilesystemDelegate) Test(org.junit.Test)

Example 10 with ProjectFilesystemDelegate

use of com.facebook.buck.io.ProjectFilesystemDelegate in project buck by facebook.

the class AutoSparseIntegrationTest method testExistsUntracked.

@Test
public void testExistsUntracked() throws FileNotFoundException, IOException {
    ProjectFilesystemDelegate delegate = createDelegate();
    File newFile = repoPath.resolve("newFile").toFile();
    new FileOutputStream(newFile).close();
    Assume.assumeTrue(delegate.exists(newFile.toPath()));
}
Also used : FileOutputStream(java.io.FileOutputStream) ProjectFilesystemDelegate(com.facebook.buck.io.ProjectFilesystemDelegate) File(java.io.File) Test(org.junit.Test)

Aggregations

ProjectFilesystemDelegate (com.facebook.buck.io.ProjectFilesystemDelegate)19 Test (org.junit.Test)19 Path (java.nio.file.Path)6 DefaultProjectFilesystemDelegate (com.facebook.buck.io.DefaultProjectFilesystemDelegate)5 FileSystem (java.nio.file.FileSystem)5 EdenError (com.facebook.eden.thrift.EdenError)2 FakeClock (com.facebook.buck.timing.FakeClock)1 File (java.io.File)1 FileOutputStream (java.io.FileOutputStream)1