Skip to content

Commit c25cdd7

Browse files
committed
Add more tests
1 parent cd63699 commit c25cdd7

File tree

1 file changed

+6
-21
lines changed

1 file changed

+6
-21
lines changed

src/test/java/com/google/devtools/build/lib/remote/RemoteActionFileSystemTest.java

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1046,10 +1046,7 @@ public void createSymbolicLink_localFileArtifact() throws Exception {
10461046
// assert
10471047
assertThat(symlinkActionFs.getFileSystem()).isSameInstanceAs(actionFs);
10481048
assertThat(symlinkActionFs.readSymbolicLink()).isEqualTo(targetPath);
1049-
assertThat(getLocalFileSystem(actionFs).getPath(linkPath).readSymbolicLink())
1050-
.isEqualTo(targetPath);
1051-
assertThat(getLocalFileSystem(actionFs).getPath(linkPath).readSymbolicLink())
1052-
.isEqualTo(targetPath);
1049+
assertThat(getLocalFileSystem(actionFs).getPath(linkPath).exists(Symlinks.NOFOLLOW)).isFalse();
10531050
}
10541051

10551052
@Test
@@ -1070,11 +1067,8 @@ public void createSymbolicLink_remoteFileArtifact() throws Exception {
10701067
// assert
10711068
assertThat(symlinkActionFs.getFileSystem()).isSameInstanceAs(actionFs);
10721069
assertThat(symlinkActionFs.readSymbolicLink()).isEqualTo(targetPath);
1073-
assertThat(outputArtifact.getPath().readSymbolicLink()).isEqualTo(targetPath);
1074-
assertThat(getLocalFileSystem(actionFs).getPath(linkPath).readSymbolicLink())
1075-
.isEqualTo(targetPath);
1076-
assertThat(getLocalFileSystem(actionFs).getPath(linkPath).readSymbolicLink())
1077-
.isEqualTo(targetPath);
1070+
assertThat(outputArtifact.getPath().exists(Symlinks.NOFOLLOW)).isFalse();
1071+
assertThat(getLocalFileSystem(actionFs).getPath(linkPath).exists(Symlinks.NOFOLLOW)).isFalse();
10781072
}
10791073

10801074
@Test
@@ -1098,10 +1092,7 @@ public void createSymbolicLink_localTreeArtifact() throws Exception {
10981092
// assert
10991093
assertThat(symlinkActionFs.getFileSystem()).isSameInstanceAs(actionFs);
11001094
assertThat(symlinkActionFs.readSymbolicLink()).isEqualTo(targetPath);
1101-
assertThat(getLocalFileSystem(actionFs).getPath(linkPath).readSymbolicLink())
1102-
.isEqualTo(targetPath);
1103-
assertThat(getLocalFileSystem(actionFs).getPath(linkPath).readSymbolicLink())
1104-
.isEqualTo(targetPath);
1095+
assertThat(getLocalFileSystem(actionFs).getPath(linkPath).exists(Symlinks.NOFOLLOW)).isFalse();
11051096
}
11061097

11071098
@Test
@@ -1125,10 +1116,7 @@ public void createSymbolicLink_remoteTreeArtifact() throws Exception {
11251116
// assert
11261117
assertThat(symlinkActionFs.getFileSystem()).isSameInstanceAs(actionFs);
11271118
assertThat(symlinkActionFs.readSymbolicLink()).isEqualTo(targetPath);
1128-
assertThat(getLocalFileSystem(actionFs).getPath(linkPath).readSymbolicLink())
1129-
.isEqualTo(targetPath);
1130-
assertThat(getLocalFileSystem(actionFs).getPath(linkPath).readSymbolicLink())
1131-
.isEqualTo(targetPath);
1119+
assertThat(getLocalFileSystem(actionFs).getPath(linkPath).exists(Symlinks.NOFOLLOW)).isFalse();
11321120
}
11331121

11341122
@Test
@@ -1149,10 +1137,7 @@ public void createSymbolicLink_unresolvedSymlink() throws Exception {
11491137
// assert
11501138
assertThat(symlinkActionFs.getFileSystem()).isSameInstanceAs(actionFs);
11511139
assertThat(symlinkActionFs.readSymbolicLink()).isEqualTo(targetPath);
1152-
assertThat(getLocalFileSystem(actionFs).getPath(linkPath).readSymbolicLink())
1153-
.isEqualTo(targetPath);
1154-
assertThat(getLocalFileSystem(actionFs).getPath(linkPath).readSymbolicLink())
1155-
.isEqualTo(targetPath);
1140+
assertThat(getLocalFileSystem(actionFs).getPath(linkPath).exists(Symlinks.NOFOLLOW)).isFalse();
11561141
}
11571142

11581143
@Test

0 commit comments

Comments
 (0)