aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/java/com/google
diff options
context:
space:
mode:
authorGravatar shahan <shahan@google.com>2018-04-05 08:03:04 -0700
committerGravatar Copybara-Service <copybara-piper@google.com>2018-04-05 08:05:03 -0700
commite483df35c30cfb7b77fe46b9c2dee8114d4b5748 (patch)
treeee014ac7b592c28f3ae61a2672c23bd1d9843c62 /src/test/java/com/google
parent0c148f361388369249b13cf5618a27873ac46bfb (diff)
Avoids calling getPath() in Artifact.toDetailString().
Also deletes obsolete Artifact.serializeToString() method. "Semantic" change: replaces the actual exec root with <execution_root> in the toString() representation. PiperOrigin-RevId: 191742669
Diffstat (limited to 'src/test/java/com/google')
-rw-r--r--src/test/java/com/google/devtools/build/lib/actions/ArtifactTest.java37
1 files changed, 3 insertions, 34 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/actions/ArtifactTest.java b/src/test/java/com/google/devtools/build/lib/actions/ArtifactTest.java
index e7ead54483..ccec35005a 100644
--- a/src/test/java/com/google/devtools/build/lib/actions/ArtifactTest.java
+++ b/src/test/java/com/google/devtools/build/lib/actions/ArtifactTest.java
@@ -285,12 +285,12 @@ public class ArtifactTest {
@Test
public void testToDetailString() throws Exception {
- Path execRoot = scratch.getFileSystem().getPath("/a");
+ Path execRoot = scratch.getFileSystem().getPath("/execroot/workspace");
Artifact a =
new Artifact(
- ArtifactRoot.asDerivedRoot(execRoot, scratch.dir("/a/b")),
+ ArtifactRoot.asDerivedRoot(execRoot, scratch.dir("/execroot/workspace/b")),
PathFragment.create("b/c"));
- assertThat(a.toDetailString()).isEqualTo("[[/a]b]c");
+ assertThat(a.toDetailString()).isEqualTo("[[<execution_root>]b]c");
}
@Test
@@ -304,37 +304,6 @@ public class ArtifactTest {
}
@Test
- public void testSerializeToString() throws Exception {
- Path execRoot = scratch.getFileSystem().getPath("/");
- assertThat(
- new Artifact(
- scratch.file("/a/b/c"), ArtifactRoot.asDerivedRoot(execRoot, scratch.dir("/a")))
- .serializeToString())
- .isEqualTo("a/b/c /3");
- }
-
- @Test
- public void testSerializeToStringWithExecPath() throws Exception {
- Path execRoot = scratch.getFileSystem().getPath("/aaa");
- ArtifactRoot root = ArtifactRoot.asDerivedRoot(execRoot, scratch.dir("/aaa/bbb"));
- PathFragment execPath = PathFragment.create("bbb/ccc");
-
- assertThat(new Artifact(root, execPath).serializeToString()).isEqualTo("bbb/ccc /3");
- }
-
- @Test
- public void testSerializeToStringWithOwner() throws Exception {
- Path execRoot = scratch.getFileSystem().getPath("/aa");
- assertThat(
- new Artifact(
- ArtifactRoot.asDerivedRoot(execRoot, scratch.dir("/aa/b")),
- PathFragment.create("b/c"),
- new LabelArtifactOwner(Label.parseAbsoluteUnchecked("//foo:bar")))
- .serializeToString())
- .isEqualTo("b/c /1 //foo:bar");
- }
-
- @Test
public void testCodec() throws Exception {
new SerializationTester(
new Artifact(PathFragment.create("src/a"), rootDir),