Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix one test to work with the other unit tests #3454

Merged
merged 1 commit into from
Jul 13, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ public void testInputStreamReads() throws IOException, InterruptedException {
// reading past the end
int eof = is.read(buf, 0, 1);
assertWithMessage("EOF should return -1").that(eof).isEqualTo(-1);
} finally {
// clean up
Files.delete(p);
}
}
}
Expand Down Expand Up @@ -121,6 +124,9 @@ public void testChannelReads() throws IOException, InterruptedException {
buf.clear();
int eof = chan.read(buf);
assertWithMessage("EOF should return -1").that(eof).isEqualTo(-1);
} finally {
// clean up
Files.delete(p);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,10 @@ public void testListFiles() throws IOException {
got.add(path);
}
assertThat(got).containsExactlyElementsIn(goodPaths);
// clean up
for (Path path : paths) {
Files.delete(path);
}
}
}

Expand All @@ -552,10 +556,12 @@ public void testDeleteRecursive() throws IOException {

@Test
public void testListFilesInRootDirectory() throws IOException {
// We must explicitly set the storageOptions, because the unit tests
// set the fake storage as default but we want to access the real storage.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

CloudStorageFileSystem fs = CloudStorageFileSystem.forBucket(
BUCKET, CloudStorageConfiguration.builder().permitEmptyPathComponents(true)
.build());
.build(), storageOptions);

// test absolute path
Path rootPath = fs.getPath("");
List<String> objectNames = new ArrayList<String>();
Expand Down