aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/java/com
diff options
context:
space:
mode:
authorGravatar tomlu <tomlu@google.com>2018-01-19 09:28:06 -0800
committerGravatar Copybara-Service <copybara-piper@google.com>2018-01-19 09:30:16 -0800
commit8cc5dcf34cf5156db78ccf5f936ca3c8b893c36f (patch)
tree5d10eb07b1c4bcd43c36ac4dc02c31a18a2fe3d0 /src/test/java/com
parent8608df20d98873d1aecf2d6f08836d0b56f826fa (diff)
Rename relativePath -> rootRelativePath in Root and friends.
This makes it clearer that the path fragments in question are relative *to the root*. Confusingly, when the root is absolute, the root relative fragment is also absolute. This makes it a tiny bit clearer that the path fragment may be absolute. PiperOrigin-RevId: 182544893
Diffstat (limited to 'src/test/java/com')
-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/PrepareDepsOfTargetsUnderDirectoryFunctionTest.java6
-rw-r--r--src/test/java/com/google/devtools/build/lib/skyframe/RecursiveFilesystemTraversalFunctionTest.java9
-rw-r--r--src/test/java/com/google/devtools/build/lib/windows/PathWindowsTest.java2
4 files changed, 15 insertions, 10 deletions
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 c472b26896..268a9f3c9c 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
@@ -752,7 +752,8 @@ public class FileFunctionTest {
FileValue value = (FileValue) result.get(key);
assertThat(value).isNotNull();
assertThat(value.exists()).isTrue();
- assertThat(value.realRootedPath().getRelativePath().getPathString()).isEqualTo("insideroot");
+ assertThat(value.realRootedPath().getRootRelativePath().getPathString())
+ .isEqualTo("insideroot");
}
@SuppressWarnings({"rawtypes", "unchecked"})
@@ -1201,7 +1202,8 @@ public class FileFunctionTest {
if (absoluteSymlink) {
FileSystemUtils.ensureSymbolicLink(intermediatePath, ancestorPath);
} else {
- FileSystemUtils.ensureSymbolicLink(intermediatePath, ancestorRootedPath.getRelativePath());
+ FileSystemUtils.ensureSymbolicLink(
+ intermediatePath, ancestorRootedPath.getRootRelativePath());
}
} else {
FileSystemUtils.ensureSymbolicLink(ancestorPath, intermediatePath);
@@ -1209,7 +1211,7 @@ public class FileFunctionTest {
FileSystemUtils.ensureSymbolicLink(intermediatePath, descendantPath);
} else {
FileSystemUtils.ensureSymbolicLink(
- intermediatePath, descendantRootedPath.getRelativePath());
+ intermediatePath, descendantRootedPath.getRootRelativePath());
}
}
StoredEventHandler eventHandler = new StoredEventHandler();
diff --git a/src/test/java/com/google/devtools/build/lib/skyframe/PrepareDepsOfTargetsUnderDirectoryFunctionTest.java b/src/test/java/com/google/devtools/build/lib/skyframe/PrepareDepsOfTargetsUnderDirectoryFunctionTest.java
index 49d502b900..68be10e4cc 100644
--- a/src/test/java/com/google/devtools/build/lib/skyframe/PrepareDepsOfTargetsUnderDirectoryFunctionTest.java
+++ b/src/test/java/com/google/devtools/build/lib/skyframe/PrepareDepsOfTargetsUnderDirectoryFunctionTest.java
@@ -180,7 +180,7 @@ public class PrepareDepsOfTargetsUnderDirectoryFunctionTest extends BuildViewTes
RootedPath onlySubdir =
Iterables.getOnlyElement(
value.getSubdirectoryTransitivelyContainsPackagesOrErrors().keySet());
- assertThat(onlySubdir.getRelativePath()).isEqualTo(PathFragment.create("a/c"));
+ assertThat(onlySubdir.getRootRelativePath()).isEqualTo(PathFragment.create("a/c"));
// And the "a/c" subdirectory reports a package under it.
assertThat(value.getSubdirectoryTransitivelyContainsPackagesOrErrors().get(onlySubdir))
@@ -234,7 +234,7 @@ public class PrepareDepsOfTargetsUnderDirectoryFunctionTest extends BuildViewTes
RootedPath onlySubdir =
Iterables.getOnlyElement(
value.getSubdirectoryTransitivelyContainsPackagesOrErrors().keySet());
- assertThat(onlySubdir.getRelativePath()).isEqualTo(PathFragment.create("a/b"));
+ assertThat(onlySubdir.getRootRelativePath()).isEqualTo(PathFragment.create("a/b"));
// And the "a/b" subdirectory does not report a package under it (because it got excluded).
assertThat(value.getSubdirectoryTransitivelyContainsPackagesOrErrors().get(onlySubdir))
@@ -256,7 +256,7 @@ public class PrepareDepsOfTargetsUnderDirectoryFunctionTest extends BuildViewTes
RootedPath abd =
Iterables.getOnlyElement(
abValue.getSubdirectoryTransitivelyContainsPackagesOrErrors().keySet());
- assertThat(abd.getRelativePath()).isEqualTo(PathFragment.create("a/b/d"));
+ assertThat(abd.getRootRelativePath()).isEqualTo(PathFragment.create("a/b/d"));
// And no package is under "a/b/d".
assertThat(abValue.getSubdirectoryTransitivelyContainsPackagesOrErrors().get(abd)).isFalse();
diff --git a/src/test/java/com/google/devtools/build/lib/skyframe/RecursiveFilesystemTraversalFunctionTest.java b/src/test/java/com/google/devtools/build/lib/skyframe/RecursiveFilesystemTraversalFunctionTest.java
index 96fa7e48ed..1368b54ebb 100644
--- a/src/test/java/com/google/devtools/build/lib/skyframe/RecursiveFilesystemTraversalFunctionTest.java
+++ b/src/test/java/com/google/devtools/build/lib/skyframe/RecursiveFilesystemTraversalFunctionTest.java
@@ -187,16 +187,19 @@ public final class RecursiveFilesystemTraversalFunctionTest extends FoundationTe
}
private static RootedPath childOf(RootedPath path, String relative) {
- return RootedPath.toRootedPath(path.getRoot(), path.getRelativePath().getRelative(relative));
+ return RootedPath.toRootedPath(
+ path.getRoot(), path.getRootRelativePath().getRelative(relative));
}
private static RootedPath parentOf(RootedPath path) {
- PathFragment parent = Preconditions.checkNotNull(path.getRelativePath().getParentDirectory());
+ PathFragment parent =
+ Preconditions.checkNotNull(path.getRootRelativePath().getParentDirectory());
return RootedPath.toRootedPath(path.getRoot(), parent);
}
private static RootedPath siblingOf(RootedPath path, String relative) {
- PathFragment parent = Preconditions.checkNotNull(path.getRelativePath().getParentDirectory());
+ PathFragment parent =
+ Preconditions.checkNotNull(path.getRootRelativePath().getParentDirectory());
return RootedPath.toRootedPath(path.getRoot(), parent.getRelative(relative));
}
diff --git a/src/test/java/com/google/devtools/build/lib/windows/PathWindowsTest.java b/src/test/java/com/google/devtools/build/lib/windows/PathWindowsTest.java
index 47cb2ed470..e77de52d83 100644
--- a/src/test/java/com/google/devtools/build/lib/windows/PathWindowsTest.java
+++ b/src/test/java/com/google/devtools/build/lib/windows/PathWindowsTest.java
@@ -285,7 +285,7 @@ public class PathWindowsTest {
assertThat(child.relativeTo(ancestor)).isEqualTo(PathFragment.create("baz"));
RootedPath actual = RootedPath.toRootedPath(Root.fromPath(ancestor), child);
assertThat(actual.getRoot()).isEqualTo(Root.fromPath(ancestor));
- assertThat(actual.getRelativePath()).isEqualTo(PathFragment.create("baz"));
+ assertThat(actual.getRootRelativePath()).isEqualTo(PathFragment.create("baz"));
}
@Test