aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/test/java/com/google/devtools/build/lib/exec/SingleBuildFileCacheTest.java3
-rw-r--r--src/test/java/com/google/devtools/build/lib/packages/GlobCacheTest.java2
-rw-r--r--src/test/java/com/google/devtools/build/lib/rules/cpp/ShowIncludesFilterTest.java2
-rw-r--r--src/test/java/com/google/devtools/build/lib/skyframe/DiffAwarenessManagerTest.java10
-rw-r--r--src/test/java/com/google/devtools/build/lib/skyframe/FileFunctionTest.java8
-rw-r--r--src/test/java/com/google/devtools/build/lib/skyframe/FileSymlinkCycleUniquenessFunctionTest.java3
-rw-r--r--src/test/java/com/google/devtools/build/lib/skyframe/FilesystemValueCheckerTest.java6
-rw-r--r--src/test/java/com/google/devtools/build/lib/skyframe/GlobFunctionTest.java6
-rw-r--r--src/test/java/com/google/devtools/build/lib/skyframe/packages/AbstractPackageLoaderTest.java2
-rw-r--r--src/test/java/com/google/devtools/build/lib/vfs/PathFragmentTest.java2
10 files changed, 20 insertions, 24 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/exec/SingleBuildFileCacheTest.java b/src/test/java/com/google/devtools/build/lib/exec/SingleBuildFileCacheTest.java
index f9d0372e0a..5e87a658ae 100644
--- a/src/test/java/com/google/devtools/build/lib/exec/SingleBuildFileCacheTest.java
+++ b/src/test/java/com/google/devtools/build/lib/exec/SingleBuildFileCacheTest.java
@@ -72,8 +72,7 @@ public class SingleBuildFileCacheTest {
}
};
underTest = new SingleBuildFileCache("/", fs);
- Path root = fs.getRootDirectory();
- Path file = root.getChild("empty");
+ Path file = fs.getPath("/empty");
file.getOutputStream().close();
}
diff --git a/src/test/java/com/google/devtools/build/lib/packages/GlobCacheTest.java b/src/test/java/com/google/devtools/build/lib/packages/GlobCacheTest.java
index 78401536cd..764bb8f2e5 100644
--- a/src/test/java/com/google/devtools/build/lib/packages/GlobCacheTest.java
+++ b/src/test/java/com/google/devtools/build/lib/packages/GlobCacheTest.java
@@ -111,7 +111,7 @@ public class GlobCacheTest {
@After
public final void deleteFiles() throws Exception {
- FileSystemUtils.deleteTreesBelow(scratch.getFileSystem().getRootDirectory());
+ FileSystemUtils.deleteTreesBelow(scratch.getFileSystem().getPath("/"));
}
@Test
diff --git a/src/test/java/com/google/devtools/build/lib/rules/cpp/ShowIncludesFilterTest.java b/src/test/java/com/google/devtools/build/lib/rules/cpp/ShowIncludesFilterTest.java
index a70a24ad29..2a55081e99 100644
--- a/src/test/java/com/google/devtools/build/lib/rules/cpp/ShowIncludesFilterTest.java
+++ b/src/test/java/com/google/devtools/build/lib/rules/cpp/ShowIncludesFilterTest.java
@@ -44,7 +44,7 @@ public class ShowIncludesFilterTest {
output = new ByteArrayOutputStream();
filterOutputStream = showIncludesFilter.getFilteredOutputStream(output);
fs = new InMemoryFileSystem();
- fs.getRootDirectory().getChild("out").createDirectory();
+ fs.getPath("/out").createDirectory();
}
private byte[] getBytes(String str) {
diff --git a/src/test/java/com/google/devtools/build/lib/skyframe/DiffAwarenessManagerTest.java b/src/test/java/com/google/devtools/build/lib/skyframe/DiffAwarenessManagerTest.java
index 1a61ecc3ad..dee4a46db6 100644
--- a/src/test/java/com/google/devtools/build/lib/skyframe/DiffAwarenessManagerTest.java
+++ b/src/test/java/com/google/devtools/build/lib/skyframe/DiffAwarenessManagerTest.java
@@ -42,13 +42,11 @@ import org.junit.runners.JUnit4;
@RunWith(JUnit4.class)
public class DiffAwarenessManagerTest {
private FileSystem fs;
- private Path root;
protected EventCollectionApparatus events;
@Before
public final void createFileSystem() throws Exception {
fs = new InMemoryFileSystem();
- root = fs.getRootDirectory();
}
@Before
@@ -59,7 +57,7 @@ public class DiffAwarenessManagerTest {
@Test
public void testEverythingModifiedIfNoDiffAwareness() throws Exception {
- Path pathEntry = root.getRelative("pathEntry");
+ Path pathEntry = fs.getPath("/pathEntry");
DiffAwarenessFactoryStub factory = new DiffAwarenessFactoryStub();
DiffAwarenessManager manager = new DiffAwarenessManager(ImmutableList.of(factory));
assertWithMessage("Expected EVERYTHING_MODIFIED since there are no factories")
@@ -73,7 +71,7 @@ public class DiffAwarenessManagerTest {
@Test
public void testResetAndSetPathEntriesCallClose() throws Exception {
- Path pathEntry = root.getRelative("pathEntry");
+ Path pathEntry = fs.getPath("/pathEntry");
ModifiedFileSet diff = ModifiedFileSet.NOTHING_MODIFIED;
DiffAwarenessStub diffAwareness1 = new DiffAwarenessStub(ImmutableList.of(diff));
DiffAwarenessStub diffAwareness2 = new DiffAwarenessStub(ImmutableList.of(diff));
@@ -98,7 +96,7 @@ public class DiffAwarenessManagerTest {
@Test
public void testHandlesUnprocessedDiffs() throws Exception {
- Path pathEntry = root.getRelative("pathEntry");
+ Path pathEntry = fs.getPath("/pathEntry");
ModifiedFileSet diff1 = ModifiedFileSet.builder().modify(PathFragment.create("file1")).build();
ModifiedFileSet diff2 = ModifiedFileSet.builder().modify(PathFragment.create("file2")).build();
ModifiedFileSet diff3 = ModifiedFileSet.builder().modify(PathFragment.create("file3")).build();
@@ -134,7 +132,7 @@ public class DiffAwarenessManagerTest {
@Test
public void testHandlesBrokenDiffs() throws Exception {
- Path pathEntry = root.getRelative("pathEntry");
+ Path pathEntry = fs.getPath("/pathEntry");
DiffAwarenessFactoryStub factory1 = new DiffAwarenessFactoryStub();
DiffAwarenessStub diffAwareness1 =
new DiffAwarenessStub(ImmutableList.<ModifiedFileSet>of(), 1);
diff --git a/src/test/java/com/google/devtools/build/lib/skyframe/FileFunctionTest.java b/src/test/java/com/google/devtools/build/lib/skyframe/FileFunctionTest.java
index e28fef3774..052b59105a 100644
--- a/src/test/java/com/google/devtools/build/lib/skyframe/FileFunctionTest.java
+++ b/src/test/java/com/google/devtools/build/lib/skyframe/FileFunctionTest.java
@@ -110,8 +110,8 @@ public class FileFunctionTest {
private void createFsAndRoot(CustomInMemoryFs fs) throws IOException {
this.fs = fs;
- pkgRoot = fs.getRootDirectory().getRelative("root");
- outputBase = fs.getRootDirectory().getRelative("output_base");
+ pkgRoot = fs.getPath("/root");
+ outputBase = fs.getPath("/output_base");
pkgLocator =
new PathPackageLocator(
outputBase,
@@ -634,7 +634,7 @@ public class FileFunctionTest {
@Test
public void testSymlinkAcrossPackageRoots() throws Exception {
- Path otherPkgRoot = fs.getRootDirectory().getRelative("other_root");
+ Path otherPkgRoot = fs.getPath("/other_root");
pkgLocator =
new PathPackageLocator(
outputBase,
@@ -835,7 +835,7 @@ public class FileFunctionTest {
return super.getDigest(path, hf);
}
};
- pkgRoot = fs.getRootDirectory().getRelative("root");
+ pkgRoot = fs.getPath("/root");
Path file = file("file");
FileSystemUtils.writeContentAsLatin1(file, Strings.repeat("a", 20));
byte[] digest = file.getDigest();
diff --git a/src/test/java/com/google/devtools/build/lib/skyframe/FileSymlinkCycleUniquenessFunctionTest.java b/src/test/java/com/google/devtools/build/lib/skyframe/FileSymlinkCycleUniquenessFunctionTest.java
index aadce0f35e..811afd134d 100644
--- a/src/test/java/com/google/devtools/build/lib/skyframe/FileSymlinkCycleUniquenessFunctionTest.java
+++ b/src/test/java/com/google/devtools/build/lib/skyframe/FileSymlinkCycleUniquenessFunctionTest.java
@@ -19,7 +19,6 @@ import com.google.devtools.build.lib.vfs.Path;
import com.google.devtools.build.lib.vfs.PathFragment;
import com.google.devtools.build.lib.vfs.RootedPath;
import com.google.devtools.build.lib.vfs.inmemoryfs.InMemoryFileSystem;
-
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
@@ -29,7 +28,7 @@ public class FileSymlinkCycleUniquenessFunctionTest {
@Test
public void testHashCodeAndEqualsContract() throws Exception {
- Path root = new InMemoryFileSystem().getRootDirectory().getRelative("root");
+ Path root = new InMemoryFileSystem().getPath("/root");
RootedPath p1 = RootedPath.toRootedPath(root, PathFragment.create("p1"));
RootedPath p2 = RootedPath.toRootedPath(root, PathFragment.create("p2"));
RootedPath p3 = RootedPath.toRootedPath(root, PathFragment.create("p3"));
diff --git a/src/test/java/com/google/devtools/build/lib/skyframe/FilesystemValueCheckerTest.java b/src/test/java/com/google/devtools/build/lib/skyframe/FilesystemValueCheckerTest.java
index 8c77934a4c..50059107eb 100644
--- a/src/test/java/com/google/devtools/build/lib/skyframe/FilesystemValueCheckerTest.java
+++ b/src/test/java/com/google/devtools/build/lib/skyframe/FilesystemValueCheckerTest.java
@@ -638,7 +638,7 @@ public class FilesystemValueCheckerTest {
for (PathFragment pathFrag : paths) {
stats.add(
FileStatusWithDigestAdapter.adapt(
- fs.getRootDirectory().getRelative(pathFrag).statIfFound(Symlinks.NOFOLLOW)));
+ fs.getPath("/").getRelative(pathFrag).statIfFound(Symlinks.NOFOLLOW)));
}
return stats;
}
@@ -656,7 +656,7 @@ public class FilesystemValueCheckerTest {
throws IOException {
List<FileStatusWithDigest> stats = new ArrayList<>();
for (PathFragment pathFrag : paths) {
- final Path path = fs.getRootDirectory().getRelative(pathFrag);
+ final Path path = fs.getPath("/").getRelative(pathFrag);
stats.add(statWithDigest(path, path.statIfFound(Symlinks.NOFOLLOW)));
}
return stats;
@@ -696,7 +696,7 @@ public class FilesystemValueCheckerTest {
for (PathFragment pathFrag : paths) {
stats.add(
FileStatusWithDigestAdapter.adapt(
- fs.getRootDirectory().getRelative(pathFrag).statIfFound(Symlinks.NOFOLLOW)));
+ fs.getPath("/").getRelative(pathFrag).statIfFound(Symlinks.NOFOLLOW)));
}
return stats;
}
diff --git a/src/test/java/com/google/devtools/build/lib/skyframe/GlobFunctionTest.java b/src/test/java/com/google/devtools/build/lib/skyframe/GlobFunctionTest.java
index 13acf704e9..51cf1cf265 100644
--- a/src/test/java/com/google/devtools/build/lib/skyframe/GlobFunctionTest.java
+++ b/src/test/java/com/google/devtools/build/lib/skyframe/GlobFunctionTest.java
@@ -105,9 +105,9 @@ public abstract class GlobFunctionTest {
@Before
public final void setUp() throws Exception {
fs = new CustomInMemoryFs(new ManualClock());
- root = fs.getRootDirectory().getRelative("root/workspace");
- writableRoot = fs.getRootDirectory().getRelative("writableRoot/workspace");
- outputBase = fs.getRootDirectory().getRelative("output_base");
+ root = fs.getPath("/root/workspace");
+ writableRoot = fs.getPath("/writableRoot/workspace");
+ outputBase = fs.getPath("/output_base");
pkgPath = root.getRelative(PKG_ID.getPackageFragment());
pkgLocator =
diff --git a/src/test/java/com/google/devtools/build/lib/skyframe/packages/AbstractPackageLoaderTest.java b/src/test/java/com/google/devtools/build/lib/skyframe/packages/AbstractPackageLoaderTest.java
index 6505d0e94b..1ac5266802 100644
--- a/src/test/java/com/google/devtools/build/lib/skyframe/packages/AbstractPackageLoaderTest.java
+++ b/src/test/java/com/google/devtools/build/lib/skyframe/packages/AbstractPackageLoaderTest.java
@@ -44,7 +44,7 @@ public abstract class AbstractPackageLoaderTest {
@Before
public final void init() throws Exception {
FileSystem fs = new InMemoryFileSystem();
- pkgRoot = fs.getRootDirectory().getChild("pkgRoot");
+ pkgRoot = fs.getPath("/").getRelative("pkgRoot");
FileSystemUtils.createDirectoryAndParents(pkgRoot);
Reporter reporter = new Reporter(new EventBus());
handler = new StoredEventHandler();
diff --git a/src/test/java/com/google/devtools/build/lib/vfs/PathFragmentTest.java b/src/test/java/com/google/devtools/build/lib/vfs/PathFragmentTest.java
index 41954851be..e2405d36cd 100644
--- a/src/test/java/com/google/devtools/build/lib/vfs/PathFragmentTest.java
+++ b/src/test/java/com/google/devtools/build/lib/vfs/PathFragmentTest.java
@@ -78,7 +78,7 @@ public class PathFragmentTest {
.addEqualityGroup(PathFragment.create("/something/else"))
.addEqualityGroup(PathFragment.create("/"), PathFragment.create("//////"))
.addEqualityGroup(PathFragment.create(""), PathFragment.EMPTY_FRAGMENT)
- .addEqualityGroup(filesystem.getRootDirectory()) // A Path object.
+ .addEqualityGroup(filesystem.getPath("/")) // A Path object.
.testEquals();
}